code: public synchronized void generatePluginConfig(String root, String serverName,boolean utilityRequest, File writeDirectory) {
              
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
              Tr.entry(tc, "generatePluginConfig", "server is stopping = " + serverIsStopping);
          }
      	try {
      		// Method is synchronized so only one generate can be in progress at a time.
      	    generateInProgress = true;
          	if (!serverIsStopping) {
      		
                  PluginGenerator generator = pluginGenerator;
                  if ( generator == null ) {
                      // Process the updated configuration
                      generator = pluginGenerator = new PluginGenerator(this.config, locMgr, bundleContext);
                  }
                  generator.generateXML(root, serverName, (WebContainer) webContainer, smgr, dynVhostMgr, locMgr,utilityRequest, writeDirectory); 
          	}   
           } catch (Throwable t) {
              FFDCFilter.processException(t, getClass().getName(), "generatePluginConfig");
              if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
                  Tr.event(tc, "Error generate plugin xml: " + t.getMessage());
              }
          } finally {
         	     generateInProgress = false;
          }
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
              Tr.exit(tc, "generatePluginConfig", "server is stopping = " + serverIsStopping);
          }
  
      }
docs: Subcommand for creating the plugin-cfg.xml file at runtime using the
  user provided Plugin install root and Plugin server name.
  
  @param root Plugin install root directory
  @param name The server name
  @param utilityRequest True if plugin config creation is being done automatically or via the pluginUtility, False if it is being done because of a call to the mbean
  @param writeDirectory The directory to write the plugin-cfg.xml file to