FileDocCategorySizeDatePackage
Switch.javaAPI DocGlassfish v2 API8342Fri May 04 22:33:16 BST 2007com.sun.enterprise

Switch

public class Switch extends Object
The Switch class holds references to all the components in an EJB server including Containers, TM, Protocol Manager, etc.

Fields Summary
private static final String
EJB_CONFIG_FILE
public static final int
APPCLIENT_CONTAINER
public static final int
EJBWEB_CONTAINER
private static final Switch
theSwitch
private Hashtable
containerDescriptorTable
private ProtocolManager
protocolManager
private J2EETransactionManager
tm
private ContainerFactory
containerFactory
private InvocationManager
invocationManager
private NamingManager
namingManager
private InjectionManager
injectionManager
private PoolManager
poolManager
private com.sun.enterprise.resource.ResourceInstaller
resourceInstaller
private Timer
timer
private javax.ejb.spi.HandleDelegate
handleDelegate
private int
containerType
private volatile com.sun.enterprise.ManagementObjectManager
managementObjectManager
private com.sun.enterprise.admin.monitor.callflow.Agent
callFlowAgent
private com.sun.enterprise.naming.ProviderManager
providerManager
private final Object
getManagementObjectManagerLock
private final Object
getTimerLock
private final Object
getHandleDelegateLock
Constructors Summary
Methods Summary
public com.sun.enterprise.admin.monitor.callflow.AgentgetCallFlowAgent()

    	return this.callFlowAgent;
    
public ContainerFactorygetContainerFactory()

	    return containerFactory;
    
public intgetContainerType()

	return containerType;
    
public java.lang.ObjectgetDescriptorFor(java.lang.Object containerContext)
Returns the deployment descriptor for the EJB container or Servlet context provided. This is used by the Transaction/Naming Security Managers.

	    return containerDescriptorTable.get(containerContext);
    
public javax.ejb.spi.HandleDelegategetHandleDelegate()

    
       
        synchronized(getHandleDelegateLock) {
            if (handleDelegate == null) {
                handleDelegate =
                    com.sun.enterprise.iiop.IIOPHandleDelegate.getHandleDelegate();
            }
        }
        return handleDelegate;
    
public InjectionManagergetInjectionManager()

        return injectionManager;
    
public InvocationManagergetInvocationManager()

        return invocationManager;
    
public com.sun.enterprise.ManagementObjectManagergetManagementObjectManager()

    
       
        synchronized( getManagementObjectManagerLock ) {
            if ( managementObjectManager == null ) {
                   try {
                    managementObjectManager = (ManagementObjectManager)
                        Class.forName("com.sun.enterprise.management.util.J2EEManagementObjectManager").newInstance();
                } catch(Exception e) {
                    System.err.println(e);
                }
            }
        }
        return managementObjectManager;
    
public NamingManagergetNamingManager()

	return namingManager;
    
public PoolManagergetPoolManager()

        return poolManager;
    
public ProtocolManagergetProtocolManager()

	return protocolManager;
    
public com.sun.enterprise.naming.ProviderManagergetProviderManager()

	return providerManager;
    
public com.sun.enterprise.resource.ResourceInstallergetResourceInstaller()

        return resourceInstaller;
    
public static com.sun.enterprise.SwitchgetSwitch()

    
	//IASRI 4717059 BEGIN
	/*
    private ROBNotifier robNotifier;
    
    public ROBNotifier getROBNotifier() {
	    return robNotifier;
    }

    public void setROBNotifier(ROBNotifier robNotifier) {
    	this.robNotifier = robNotifier;
    } 
	*/
	//IASRI 4717059 END

        
        return theSwitch;
    
public java.util.TimergetTimer()

       
        synchronized( getTimerLock ) {
            if( timer == null ) {
                // Create a scheduler as a daemon so it
                // won't prevent process from exiting.
                timer = new Timer(true);
            }
        }
        return timer;
    
public J2EETransactionManagergetTransactionManager()

	return tm;
    
public voidremoveDescriptorFor(java.lang.Object containerContext)
Remove the descriptor from the hashtable

	    containerDescriptorTable.remove(containerContext);
    
public synchronized voidsetCallFlowAgent(com.sun.enterprise.admin.monitor.callflow.Agent callFlowAgent)

    	this.callFlowAgent = callFlowAgent;
        
        FeatureAvailability.getInstance().registerFeature(
            FeatureAvailability.CALL_FLOW_FEATURE, callFlowAgent );
    
public voidsetContainerFactory(ContainerFactory containerFactory)

    	this.containerFactory = containerFactory;
    
public voidsetContainerType(int type)

	containerType = type;
    
public java.lang.ObjectsetDescriptorFor(java.lang.Object containerContext, java.lang.Object desc)
Sets the deployment descriptor for the EJB container or Servlet context provided.

	    return containerDescriptorTable.put(containerContext, desc);
    
public voidsetInjectionManager(InjectionManager im)

        injectionManager = im;
    
public voidsetInvocationManager(InvocationManager invocationManager)

        this.invocationManager = invocationManager;
    
public voidsetNamingManager(NamingManager nm)

	namingManager = nm;
    
public voidsetPoolManager(PoolManager poolManager)

        this.poolManager = poolManager;
    
public voidsetProtocolManager(ProtocolManager pm)

	protocolManager = pm;
    
public voidsetProviderManager(com.sun.enterprise.naming.ProviderManager pf)

	providerManager = pf;
    
public voidsetResourceInstaller(com.sun.enterprise.resource.ResourceInstaller resourceInstaller)

        this.resourceInstaller = resourceInstaller;
    
public voidsetTransactionManager(J2EETransactionManager tm)

	this.tm = tm;