FileDocCategorySizeDatePackage
ManagerFactory.javaAPI DocGlassfish v2 API8612Fri May 04 22:35:42 BST 2007com.sun.enterprise.server

ManagerFactory

public final class ManagerFactory extends Object
author
Sandhya E

Fields Summary
private static ApplicationManager
applicationManager
J2EE Application Manager
private static StandAloneConnectorModulesManager
saConnectorManager
Stand alone Connector module manager
private static DummyWebModuleManager
saWebManager
Stand alone Web module manager
private static StandAloneEJBModulesManager
saEJBManager
Stand alone Ejb module manager
private static StandAloneAppClientModulesManager
saACManager
Stand alone Application Client module manager
private static com.sun.enterprise.instance.InstanceEnvironment
iEnv
Instance environment of current server context
private static ClassLoader
sharedCL
shared class loader of current server context
private static final Logger
_logger
logger to log core messages
Constructors Summary
private ManagerFactory()

 /* preclude instantiation */ 
Methods Summary
public static synchronized ApplicationManagergetApplicationManager()
This method gets the Application Manager for this server context

return
ApplicationManager

    
                     
          
        if(applicationManager == null) {    
            AppsManager appsManager =
            InstanceFactory.createAppsManager(getInstanceEnvironment(), false);
            try {
                if (appsManager.isByteCodePreprocessingEnabled()){
                    // Initialize the preprocessor.  If for some reason there's a
                    // problem, the preprocessor will be disabled before we attempt
                    // to use it.
                    PreprocessorUtil.init
                    (appsManager.getBytecodeProcessorClassNames());
                }
            } catch (ConfigException confEx) {
                _logger.log(Level.WARNING,
                            "bytecodepreprocessor.config_ex",
                            confEx);
                _logger.log(Level.WARNING,
                            "bytecodepreprocessor.disabled");
            }
            
            // manager for the j2ee applications
            applicationManager = new ApplicationManager(appsManager,getSharedClassLoader());
        }
        return applicationManager;    
    
private static synchronized com.sun.enterprise.instance.InstanceEnvironmentgetInstanceEnvironment()
Returns the instance environment of this server's runtime

return
InstanceEnvironment

        if(iEnv == null) {
            ServerContext sc = ApplicationServer.getServerContext();
            iEnv = sc.getInstanceEnvironment();
        }
        return iEnv;
    
public static synchronized StandAloneAppClientModulesManagergetSAACModulesManager()
This method returns the stand alone application client module manager

return
StandAloneAppClientModulesManager


        if(saACManager == null) {

            // config manager for stand alone application client modules
	    AppclientModulesManager acModuleManager =
		InstanceFactory.createAppclientModulesManager(getInstanceEnvironment());
            
            // manager for stand alone application client modules
            saACManager = new StandAloneAppClientModulesManager(
					acModuleManager, getSharedClassLoader());
        }
        return saACManager;
    
public static synchronized StandAloneConnectorModulesManagergetSAConnectorModulesManager()
This method returns the stand alone connector module manager

return
StandAloneConnectorModulesManager

        if(saConnectorManager == null) {
            // config manager for stand alone connector modules
            ConnectorModulesManager connModuleManager =
            InstanceFactory.createConnectorModuleManager(getInstanceEnvironment(), false);
            
            // manager for stand alone connector modules
            saConnectorManager = new StandAloneConnectorModulesManager(
                                               connModuleManager, getSharedClassLoader());
        }
        return saConnectorManager;
    
public static synchronized StandAloneEJBModulesManagergetSAEJBModulesManager()
This method returns the stand alone web modules manager

return
StandAloneEjbModulesManager

        if(saEJBManager == null) {
            // config manager for stand alone ejb modules
            EjbModulesManager ejbModuleManager =
            InstanceFactory.createEjbModuleManager(getInstanceEnvironment(), false);
            
            // manager for stand alone ejb modules
            saEJBManager = new StandAloneEJBModulesManager(ejbModuleManager, getSharedClassLoader());
        }
        return saEJBManager;
    
public static synchronized DummyWebModuleManagergetSAWebModulesManager()
This method returns the *dummy* stand alone web modules manager. The returned manager does not anything but sending an event to ondemand initialization framework.

return
StandAloneWebModulesManager

        if(saWebManager == null) {
            // config manager for stand alone web modules
            WebModulesManager webModuleManager = new WebModulesManager(getInstanceEnvironment());
            saWebManager = new WebModuleDeployEventListener(webModuleManager, getSharedClassLoader());           
        }

        return saWebManager;
    
private static synchronized java.lang.ClassLoadergetSharedClassLoader()
Returns the shared class loader

return
ClassLoader

        if(sharedCL == null) {
            ServerContext sc = ApplicationServer.getServerContext();
            sharedCL = sc.getSharedClassLoader();            
        }
        return sharedCL;