com.sun.ejb.containers
Class BaseContainer

java.lang.Object
  extended by com.sun.ejb.containers.BaseContainer
All Implemented Interfaces:
Container, JavaEEContainer, EjbContainerFacade
Direct Known Subclasses:
AbstractSingletonContainer, EntityContainer, MessageBeanContainer, StatefulSessionContainer, StatelessSessionContainer

public abstract class BaseContainer
extends java.lang.Object
implements Container, EjbContainerFacade, JavaEEContainer

This class implements part of the com.sun.ejb.Container interface. It implements the container's side of the EJB-to-Container contract definweed by the EJB 2.0 spec. It contains code shared by SessionBeans, EntityBeans and MessageDrivenBeans. Its subclasses provide the remaining implementation of the container functionality.


Nested Class Summary
static class BaseContainer.ContainerType
           
 
Field Summary
protected static java.util.logging.Logger _logger
           
protected  EjbCacheStatsProvider cacheProbeListener
           
protected  EjbCacheProbeProvider cacheProbeNotifier
           
protected  CallFlowInfo callFlowInfo
           
protected  int cmtTimeoutInSeconds
           
protected  java.lang.String componentId
           
protected static int CONTAINER_INITIALIZING
           
protected static int CONTAINER_ON_HOLD
           
protected static int CONTAINER_STARTED
           
protected static int CONTAINER_STOPPED
           
protected static int CONTAINER_UNDEPLOYED
           
protected  com.sun.ejb.containers.ContainerInfo containerInfo
           
protected  int containerState
           
protected  BaseContainer.ContainerType containerType
           
protected  boolean debugMonitorFlag
           
protected  java.lang.reflect.Method ejbActivateMethod
           
protected  java.lang.Class ejbClass
           
protected  EjbContainerUtil ejbContainerUtilImpl
           
protected  EjbDescriptor ejbDescriptor
           
protected  java.lang.Class ejbGeneratedOptionalLocalBusinessIntfClass
           
protected  EJBHome ejbHome
           
protected  EJBHomeImpl ejbHomeImpl
           
protected  EJBHome ejbHomeStub
           
protected  InvocationInfo[] ejbIntfMethodInfo
           
protected  java.lang.reflect.Method[] ejbIntfMethods
           
protected  GenericEJBLocalHome ejbLocalBusinessHome
           
protected  EJBLocalHomeImpl ejbLocalBusinessHomeImpl
           
protected  EJBLocalHome ejbLocalHome
           
protected  EJBLocalHomeImpl ejbLocalHomeImpl
           
protected  EJBMethodStatsManager ejbMethodStatsManager
           
protected  GenericEJBLocalHome ejbOptionalLocalBusinessHome
           
protected  EJBLocalHomeImpl ejbOptionalLocalBusinessHomeImpl
           
protected  java.lang.Class ejbOptionalLocalBusinessHomeIntf
           
protected  java.lang.reflect.Method ejbPassivateMethod
           
protected  EjbMonitoringStatsProvider ejbProbeListener
           
protected  EjbMonitoringProbeProvider ejbProbeNotifier
           
protected  EJBHome ejbRemoteBusinessHome
           
protected  EJBHomeImpl ejbRemoteBusinessHomeImpl
           
protected  EJBHome ejbRemoteBusinessHomeStub
           
protected  java.lang.reflect.Method ejbRemoveMethod
           
protected  java.lang.reflect.Method ejbTimeoutMethod
           
protected  java.util.Properties envProps
           
protected  boolean hasLocalBusinessView
           
protected  boolean hasLocalHomeView
           
protected  boolean hasOptionalLocalBusinessView
           
protected  boolean hasRemoteBusinessView
           
protected  boolean hasRemoteHomeView
           
protected  java.lang.Class homeIntf
           
protected  InjectionManager injectionManager
           
protected  InterceptorManager interceptorManager
           
protected  java.util.Map invocationInfoMap
           
protected  InvocationManager invocationManager
           
protected  boolean isEntity
           
protected  boolean isLocal
          Data members for Local views *
protected  boolean isMessageDriven
           
protected  boolean isRemote
          Data members for Remote views *
protected  boolean isSession
           
protected  boolean isSingleton
           
protected  boolean isStatefulSession
           
protected  boolean isStatelessSession
           
protected  boolean isWebServiceEndpoint
           
protected static java.lang.Class[] lifecycleCallbackAnnotationClasses
           
protected  java.lang.ClassLoader loader
           
protected  java.lang.Class localBusinessHomeIntf
           
protected  java.util.Set<java.lang.Class> localBusinessIntfs
           
protected  java.lang.Class localHomeIntf
           
protected  java.lang.Object[] logParams
           
protected  EJBMetaData metadata
           
protected  java.util.HashMap methodMonitorMap
           
protected  boolean monitorOn
           
protected  GlassfishNamingManager namingManager
           
protected static java.lang.Class[] NO_PARAMS
           
protected  EjbOptionalIntfGenerator optIntfClassLoader
           
protected  EjbPoolStatsProvider poolProbeListener
           
protected  MonitoringRegistryMediator registryMediator
           
protected  java.lang.Class remoteBusinessHomeIntf
           
protected  java.util.Map<java.lang.String,com.sun.ejb.containers.RemoteBusinessIntfInfo> remoteBusinessIntfInfo
           
protected  RemoteReferenceFactory remoteHomeRefFactory
           
protected  java.lang.Class remoteIntf
           
protected  java.util.Map<TimerPrimaryKey,java.lang.reflect.Method> scheduleIds
           
protected  SecurityManager securityManager
           
protected  java.lang.Class sfsbSerializedClass
           
protected static java.lang.String SINGLETON_BEAN_POOL_PROP
           
protected  EjbTimedObjectStatsProvider timerProbeListener
           
protected  EjbTimedObjectProbeProvider timerProbeNotifier
           
protected  JavaEETransactionManager transactionManager
           
protected  java.lang.Class webServiceEndpointIntf
           
protected  java.util.Map webServiceInvocationInfoMap
           
 
Fields inherited from interface com.sun.ejb.Container
SEC_CHECKED, SEC_EXCLUDED, SEC_NOT_INITIALIZED, SEC_UNCHECKED, secAttrStrings, TX_BEAN_MANAGED, TX_MANDATORY, TX_NEVER, TX_NOT_INITIALIZED, TX_NOT_SUPPORTED, TX_REQUIRED, TX_REQUIRES_NEW, TX_SUPPORTS, txAttrStrings
 
Constructor Summary
protected BaseContainer(BaseContainer.ContainerType type, EjbDescriptor ejbDesc, java.lang.ClassLoader loader)
          This constructor is called from ContainerFactoryImpl when an EJB Jar is deployed.
 
Method Summary
protected  EJBContextImpl _constructEJBContextImpl(java.lang.Object instance)
           
protected  java.lang.Object _constructEJBInstance()
           
protected abstract  ComponentContext _getContext(EjbInvocation inv)
           
protected  void addSchedule(TimerPrimaryKey timerId, TimerSchedule ts)
          Call back from the timer migration process to add automatic timers to the map of scheduleIds
 void assertValidLocalObject(java.lang.Object o)
          Verify that a given object is an EJBLocalObject of an ejb from this ejb container.
 void assertValidRemoteObject(java.lang.Object o)
          Asserts validity of RemoteHome objects.
 boolean authorize(EjbInvocation inv)
          Common code to handle EJB security manager authorization call.
protected  java.lang.Throwable checkExceptionClientTx(EJBContextImpl context, java.lang.Throwable exception)
           
protected  void checkUnfinishedTx(Transaction prevTx, EjbInvocation inv)
           
 void checkUserTransactionLookup(ComponentInvocation inv)
           
protected  void cleanupInstance(EJBContextImpl context)
           
protected static java.lang.String containerStateToString(int state)
           
protected  void createCallFlowAgent(ComponentType compType)
           
protected  EJBContextImpl createEjbInstanceAndContext()
           
protected  void createMonitoringRegistryMediator()
           
 java.rmi.Remote createRemoteReferenceWithId(byte[] instanceKey, java.lang.String generatedRemoteBusinessIntf)
          Create an EJBObject reference from the instanceKey Called from EJBObjectOutputStream.SerializableRemoteRef during deserialization of a remote-ref
 void doAfterBegin(ComponentInvocation ci)
          Called from the TM when an EJB with Bean-Managed transactions starts a tx
protected abstract  void doConcreteContainerShutdown(boolean appBeingUndeployed)
           
protected  void doEJBHomeRemove(java.lang.Object pk, java.lang.reflect.Method m, boolean isLocal)
           
protected  void doFlush(EjbInvocation inv)
           
protected  void enlistExtendedEntityManagers(ComponentContext ctx)
           
 void externalPostInvoke()
          Performs post external invocation cleanup such as restoring the original class loader.
 void externalPreInvoke()
          Performs pre external invocation setup such as setting application context class loader.
protected  boolean findFlushEnabledAttr(MethodDescriptor md)
           
protected  int findTxAttr(MethodDescriptor md)
           
 java.lang.ClassLoader getClassLoader()
           
 java.lang.String getComponentId()
          Called from NamingManagerImpl during java:comp/env lookup.
 java.lang.ClassLoader getContainerClassLoader()
           
 BaseContainer.ContainerType getContainerType()
           
protected  ComponentContext getContext(EjbInvocation inv)
           
 boolean getDebugMonitorFlag()
           
 Descriptor getDescriptor()
          Method defined on JavaEEContainer
 java.lang.Class getEJBClass()
           
 EjbDescriptor getEjbDescriptor()
           
 EJBHome getEJBHome()
           
 EJBHome getEJBHomeStub()
           
 GenericEJBLocalHome getEJBLocalBusinessHome(java.lang.String clientViewClassName)
          Return an object that implements ejb's local business home interface.
 EJBLocalHome getEJBLocalHome()
          Return an object that implements ejb's local home interface.
 EJBLocalObject getEJBLocalObjectForPrimaryKey(java.lang.Object pkey)
           
 EJBLocalObject getEJBLocalObjectForPrimaryKey(java.lang.Object pkey, EJBContext ctx)
          Obtain an Entity EJBLocalObject corresponding to the primary key.
 EJBMetaData getEJBMetaData()
           
 EJBObject getEJBObjectForPrimaryKey(java.lang.Object pkey)
          Obtain an Entity EJBObject corresponding to the primary key.
 java.lang.Object getJaccEjb(EjbInvocation inv)
          Called-back from security implementation through EjbInvocation when a jacc policy provider wants an enterprise bean instance.
protected  java.lang.String getJavaGlobalJndiNamePrefix()
           
protected  java.lang.reflect.Method[] getMonitoringMethodsArray()
           
protected  java.lang.reflect.Method[] getMonitoringMethodsArray(boolean hasGeneratedClasses)
           
protected abstract  EjbMonitoringStatsProvider getMonitoringStatsProvider(java.lang.String appName, java.lang.String modName, java.lang.String ejbName)
           
protected  java.lang.String[] getPre30LifecycleMethodNames()
           
protected  ProtocolManager getProtocolManager()
           
 SecurityManager getSecurityManager()
           
 java.rmi.Remote getTargetObject(byte[] instanceKey, java.lang.String generatedRemoteBusinessIntf)
          Return the EJBObject/EJBHome Proxy for the given ejbId and instanceKey.
protected  int getTxAttr(EjbInvocation inv)
           
protected  int getTxAttr(java.lang.reflect.Method method, java.lang.String methodIntf)
           
protected  void incrementCreatedTimedObject()
           
protected  void incrementDeliveredTimedObject()
           
protected  void incrementRemovedTimedObject()
           
protected  void injectEjbInstance(EJBContextImpl context)
           
protected  EJBLocalObjectImpl instantiateEJBLocalBusinessObjectImpl()
           
protected  EJBLocalObjectImpl instantiateEJBLocalObjectImpl()
           
protected  EJBObjectImpl instantiateEJBObjectImpl()
           
protected  EJBLocalObjectImpl instantiateOptionalEJBLocalBusinessObjectImpl()
           
protected  EJBObjectImpl instantiateRemoteBusinessObjectImpl()
           
 java.lang.Object invokeBeanMethod(EjbInvocation inv)
          Called from Interceptor Chain to invoke the actual bean method.
protected  boolean isAppExceptionRequiringRollback(java.lang.Throwable exception)
          Returns true if this exception is an Application Exception and it requires rollback of the transaction in which it was thrown.
protected  boolean isApplicationException(java.lang.Throwable exception)
           
 boolean isHAEnabled()
           
protected  boolean isLocalInterfaceSupported()
           
protected  boolean isRemoteInterfaceSupported()
           
 boolean isStopped()
           
protected  boolean isSystemUncheckedException(java.lang.Throwable exception)
           
 boolean isTimedObject()
          Returns true if this Container uses EJB Timer Service.
 boolean isUndeployed()
           
 javax.persistence.EntityManager lookupExtendedEntityManager(javax.persistence.EntityManagerFactory emf)
          Containers that allow extended EntityManager will override this method.
 void onReady()
          Called when server instance is Ready
 void onShutdown()
          Container shutdown event.
 void onTermination()
          Called when server instance is terminating.
protected  void populateMethodMonitorMap()
           
protected  void populateMethodMonitorMap(java.lang.reflect.Method[] methods)
           
protected  void populateMethodMonitorMap(java.lang.reflect.Method[] methods, boolean prefixClassName)
           
 void postCreate(EjbInvocation inv, java.lang.Object primaryKey)
          Called by the EJB(Local)Home after invoking ejbCreate on an EntityBean.
 java.lang.Object postFind(EjbInvocation inv, java.lang.Object primaryKeys, java.lang.Object[] findParams)
          Called by the EJB(Local)Home after invoking ejbFind* on an EntityBean.
 void postInvoke(EjbInvocation inv)
          Called from EJBObject/EJBHome after invoking on bean.
protected  void postInvoke(EjbInvocation inv, boolean doTxProcessing)
           
 void postInvokeTx(EjbInvocation inv)
          postInvokeTx is called after every invocation on the EJB instance, including ejbCreate/ejbFind---/ejbRemove.
protected  InvocationInfo postProcessInvocationInfo(InvocationInfo invInfo)
           
protected  void preInitialize(EjbDescriptor ejbDesc, java.lang.ClassLoader loader)
           
 void preInvoke(EjbInvocation inv)
          Called from EJBObject/EJBHome before invoking on EJB.
protected  void preInvokeTx(EjbInvocation inv)
          This is called from preInvoke before every method invocation on the EJB instance, including ejbCreate, ejbFind*, ejbRemove.
 void preSelect()
          Notification from persistence manager than an ejbSelect query is about to be invoked on a bean of the ejb type for this container.
protected  void registerMonitorableComponents()
           
protected  void registerTimerMonitorableComponent()
           
protected  void registerTxAttrForMethod(java.lang.reflect.Method method, java.lang.String methodIntf)
           
protected abstract  void releaseContext(EjbInvocation inv)
           
 void releaseTargetObject(java.rmi.Remote remoteObj)
          Release the EJBObject/EJBHome object.
 void removeBeanUnchecked(EJBLocalObject bean)
          Remove a bean.
 void removeBeanUnchecked(java.lang.Object pkey)
          Remove a bean given primary key.
 void setDebugMonitorFlag(boolean flag)
           
 void setMonitorOn(boolean flag)
           
 void setSecurityManager(SecurityManager sm)
           
 void setStartedState()
          Start servicing invocations for EJB instances in this Container.
 void setStoppedState()
          Stop servicing invocations for EJB instances in this Container.
 void setUndeployedState()
          Stop servicing invocations for EJB instances in this Container as the container is being undeployed.
 void startApplication(boolean deploy)
          Called after all the components in the container's application have deployed successfully.
 java.lang.String toString()
           
 void undeploy()
          Undeploy event.
protected  void useClientTx(Transaction prevTx, EjbInvocation inv)
           
 boolean userTransactionMethodsAllowed(ComponentInvocation inv)
          EJB spec makes a distinction between access to the UserTransaction object itself and access to its methods.
 void webServicePostInvoke(EjbInvocation inv)
          Called by webservice code to do ejb invocation post processing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_logger

protected static final java.util.logging.Logger _logger

NO_PARAMS

protected static final java.lang.Class[] NO_PARAMS

logParams

protected java.lang.Object[] logParams

containerType

protected BaseContainer.ContainerType containerType

SINGLETON_BEAN_POOL_PROP

protected static final java.lang.String SINGLETON_BEAN_POOL_PROP
See Also:
Constant Field Values

loader

protected java.lang.ClassLoader loader

ejbClass

protected java.lang.Class ejbClass

sfsbSerializedClass

protected java.lang.Class sfsbSerializedClass

ejbPassivateMethod

protected java.lang.reflect.Method ejbPassivateMethod

ejbActivateMethod

protected java.lang.reflect.Method ejbActivateMethod

ejbRemoveMethod

protected java.lang.reflect.Method ejbRemoveMethod

ejbTimeoutMethod

protected java.lang.reflect.Method ejbTimeoutMethod

webServiceEndpointIntf

protected java.lang.Class webServiceEndpointIntf

isWebServiceEndpoint

protected boolean isWebServiceEndpoint

isLocal

protected boolean isLocal
Data members for Local views *


hasLocalHomeView

protected boolean hasLocalHomeView

hasLocalBusinessView

protected boolean hasLocalBusinessView

hasOptionalLocalBusinessView

protected boolean hasOptionalLocalBusinessView

ejbGeneratedOptionalLocalBusinessIntfClass

protected java.lang.Class ejbGeneratedOptionalLocalBusinessIntfClass

localHomeIntf

protected java.lang.Class localHomeIntf

ejbLocalHome

protected EJBLocalHome ejbLocalHome

ejbLocalHomeImpl

protected EJBLocalHomeImpl ejbLocalHomeImpl

localBusinessHomeIntf

protected java.lang.Class localBusinessHomeIntf

ejbOptionalLocalBusinessHomeIntf

protected java.lang.Class ejbOptionalLocalBusinessHomeIntf

localBusinessIntfs

protected java.util.Set<java.lang.Class> localBusinessIntfs

ejbLocalBusinessHome

protected GenericEJBLocalHome ejbLocalBusinessHome

ejbOptionalLocalBusinessHome

protected GenericEJBLocalHome ejbOptionalLocalBusinessHome

ejbLocalBusinessHomeImpl

protected EJBLocalHomeImpl ejbLocalBusinessHomeImpl

ejbOptionalLocalBusinessHomeImpl

protected EJBLocalHomeImpl ejbOptionalLocalBusinessHomeImpl

isRemote

protected boolean isRemote
Data members for Remote views *


hasRemoteHomeView

protected boolean hasRemoteHomeView

hasRemoteBusinessView

protected boolean hasRemoteBusinessView

homeIntf

protected java.lang.Class homeIntf

remoteIntf

protected java.lang.Class remoteIntf

ejbHomeImpl

protected EJBHomeImpl ejbHomeImpl

ejbHome

protected EJBHome ejbHome

ejbHomeStub

protected EJBHome ejbHomeStub

remoteHomeRefFactory

protected RemoteReferenceFactory remoteHomeRefFactory

remoteBusinessHomeIntf

protected java.lang.Class remoteBusinessHomeIntf

ejbRemoteBusinessHomeImpl

protected EJBHomeImpl ejbRemoteBusinessHomeImpl

ejbRemoteBusinessHome

protected EJBHome ejbRemoteBusinessHome

ejbRemoteBusinessHomeStub

protected EJBHome ejbRemoteBusinessHomeStub

remoteBusinessIntfInfo

protected java.util.Map<java.lang.String,com.sun.ejb.containers.RemoteBusinessIntfInfo> remoteBusinessIntfInfo

metadata

protected EJBMetaData metadata

securityManager

protected SecurityManager securityManager

isSession

protected boolean isSession

isStatelessSession

protected boolean isStatelessSession

isStatefulSession

protected boolean isStatefulSession

isMessageDriven

protected boolean isMessageDriven

isEntity

protected boolean isEntity

isSingleton

protected boolean isSingleton

ejbDescriptor

protected EjbDescriptor ejbDescriptor

componentId

protected java.lang.String componentId

invocationInfoMap

protected java.util.Map invocationInfoMap

scheduleIds

protected java.util.Map<TimerPrimaryKey,java.lang.reflect.Method> scheduleIds

webServiceInvocationInfoMap

protected java.util.Map webServiceInvocationInfoMap

ejbIntfMethods

protected java.lang.reflect.Method[] ejbIntfMethods

ejbIntfMethodInfo

protected InvocationInfo[] ejbIntfMethodInfo

envProps

protected java.util.Properties envProps

debugMonitorFlag

protected boolean debugMonitorFlag

CONTAINER_INITIALIZING

protected static final int CONTAINER_INITIALIZING
See Also:
Constant Field Values

CONTAINER_STARTED

protected static final int CONTAINER_STARTED
See Also:
Constant Field Values

CONTAINER_STOPPED

protected static final int CONTAINER_STOPPED
See Also:
Constant Field Values

CONTAINER_UNDEPLOYED

protected static final int CONTAINER_UNDEPLOYED
See Also:
Constant Field Values

CONTAINER_ON_HOLD

protected static final int CONTAINER_ON_HOLD
See Also:
Constant Field Values

containerState

protected int containerState

cmtTimeoutInSeconds

protected int cmtTimeoutInSeconds

methodMonitorMap

protected java.util.HashMap methodMonitorMap

monitorOn

protected boolean monitorOn

registryMediator

protected MonitoringRegistryMediator registryMediator

ejbMethodStatsManager

protected EJBMethodStatsManager ejbMethodStatsManager

ejbProbeListener

protected EjbMonitoringStatsProvider ejbProbeListener

ejbProbeNotifier

protected EjbMonitoringProbeProvider ejbProbeNotifier

timerProbeListener

protected EjbTimedObjectStatsProvider timerProbeListener

timerProbeNotifier

protected EjbTimedObjectProbeProvider timerProbeNotifier

poolProbeListener

protected EjbPoolStatsProvider poolProbeListener

cacheProbeNotifier

protected EjbCacheProbeProvider cacheProbeNotifier

cacheProbeListener

protected EjbCacheStatsProvider cacheProbeListener

containerInfo

protected com.sun.ejb.containers.ContainerInfo containerInfo

callFlowInfo

protected CallFlowInfo callFlowInfo

interceptorManager

protected InterceptorManager interceptorManager

lifecycleCallbackAnnotationClasses

protected static final java.lang.Class[] lifecycleCallbackAnnotationClasses

invocationManager

protected InvocationManager invocationManager

injectionManager

protected InjectionManager injectionManager

namingManager

protected GlassfishNamingManager namingManager

transactionManager

protected JavaEETransactionManager transactionManager

ejbContainerUtilImpl

protected EjbContainerUtil ejbContainerUtilImpl

optIntfClassLoader

protected EjbOptionalIntfGenerator optIntfClassLoader
Constructor Detail

BaseContainer

protected BaseContainer(BaseContainer.ContainerType type,
                        EjbDescriptor ejbDesc,
                        java.lang.ClassLoader loader)
                 throws java.lang.Exception
This constructor is called from ContainerFactoryImpl when an EJB Jar is deployed.

Throws:
java.lang.Exception
Method Detail

getProtocolManager

protected ProtocolManager getProtocolManager()

getContainerType

public BaseContainer.ContainerType getContainerType()

doEJBHomeRemove

protected void doEJBHomeRemove(java.lang.Object pk,
                               java.lang.reflect.Method m,
                               boolean isLocal)
                        throws java.rmi.RemoteException,
                               RemoveException
Throws:
java.rmi.RemoteException
RemoveException

preInitialize

protected void preInitialize(EjbDescriptor ejbDesc,
                             java.lang.ClassLoader loader)

checkUserTransactionLookup

public void checkUserTransactionLookup(ComponentInvocation inv)
                                throws javax.naming.NameNotFoundException
Throws:
javax.naming.NameNotFoundException

createCallFlowAgent

protected final void createCallFlowAgent(ComponentType compType)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

setStartedState

public final void setStartedState()
Description copied from interface: Container
Start servicing invocations for EJB instances in this Container.

Specified by:
setStartedState in interface Container

setStoppedState

public final void setStoppedState()
Description copied from interface: Container
Stop servicing invocations for EJB instances in this Container. Subsequent EJB invocations will receive exceptions. Invocations already in progress will be allowed to complete eventually.

Specified by:
setStoppedState in interface Container

isStopped

public final boolean isStopped()

setUndeployedState

public final void setUndeployedState()
Description copied from interface: Container
Stop servicing invocations for EJB instances in this Container as the container is being undeployed. No new EJB invocations will be accepted from now on. Invocations already in progress will be allowed to complete eventually.

Specified by:
setUndeployedState in interface Container

isUndeployed

public final boolean isUndeployed()

isTimedObject

public final boolean isTimedObject()
Description copied from interface: Container
Returns true if this Container uses EJB Timer Service.

Specified by:
isTimedObject in interface Container

getContainerClassLoader

public final java.lang.ClassLoader getContainerClassLoader()
Specified by:
getContainerClassLoader in interface JavaEEContainer

getClassLoader

public final java.lang.ClassLoader getClassLoader()
Specified by:
getClassLoader in interface Container
Specified by:
getClassLoader in interface EjbContainerFacade
Returns:
the classloader of this container instance.

getEjbDescriptor

public final EjbDescriptor getEjbDescriptor()
Specified by:
getEjbDescriptor in interface Container
Specified by:
getEjbDescriptor in interface EjbContainerFacade
Returns:
the EjbDescriptor containing deployment information for the EJB type corresponding to this Container instance.

getDescriptor

public final Descriptor getDescriptor()
Method defined on JavaEEContainer

Specified by:
getDescriptor in interface JavaEEContainer

getEJBMetaData

public final EJBMetaData getEJBMetaData()
Specified by:
getEJBMetaData in interface Container
Returns:
the MetaData for this EJB type.

isHAEnabled

public boolean isHAEnabled()

userTransactionMethodsAllowed

public boolean userTransactionMethodsAllowed(ComponentInvocation inv)
EJB spec makes a distinction between access to the UserTransaction object itself and access to its methods. getUserTransaction covers the first check and this method covers the second. It is called by the UserTransaction implementation to verify access.

Specified by:
userTransactionMethodsAllowed in interface Container

getEJBHomeStub

public final EJBHome getEJBHomeStub()

getEJBHome

public final EJBHome getEJBHome()
Specified by:
getEJBHome in interface Container
Returns:
the EJBHome object reference for this container instance.

getEJBLocalHome

public final EJBLocalHome getEJBLocalHome()
Return an object that implements ejb's local home interface. If dynamic proxies are being used, this is the proxy itself, it can't be directly cast to an EJBLocalHomeImpl.


getEJBLocalBusinessHome

public final GenericEJBLocalHome getEJBLocalBusinessHome(java.lang.String clientViewClassName)
Return an object that implements ejb's local business home interface.


getEJBClass

public final java.lang.Class getEJBClass()

getSecurityManager

public final SecurityManager getSecurityManager()
Specified by:
getSecurityManager in interface Container
Returns:
A SecurityManager object for this container.

setSecurityManager

public final void setSecurityManager(SecurityManager sm)
                              throws java.lang.Exception
Throws:
java.lang.Exception

createRemoteReferenceWithId

public java.rmi.Remote createRemoteReferenceWithId(byte[] instanceKey,
                                                   java.lang.String generatedRemoteBusinessIntf)
Create an EJBObject reference from the instanceKey Called from EJBObjectOutputStream.SerializableRemoteRef during deserialization of a remote-ref

Parameters:
instanceKey - instanceKey of the ejbobject
generatedRemoteBusinessIntf - non-null, this is a remote business view and the param is the name of the generated remote business interface. Otherwise, this is for the RemoteHome view

getJavaGlobalJndiNamePrefix

protected java.lang.String getJavaGlobalJndiNamePrefix()

createEjbInstanceAndContext

protected EJBContextImpl createEjbInstanceAndContext()
                                              throws java.lang.Exception
Throws:
java.lang.Exception

_constructEJBContextImpl

protected EJBContextImpl _constructEJBContextImpl(java.lang.Object instance)

_constructEJBInstance

protected java.lang.Object _constructEJBInstance()
                                          throws java.lang.Exception
Throws:
java.lang.Exception

injectEjbInstance

protected void injectEjbInstance(EJBContextImpl context)
                          throws java.lang.Exception
Throws:
java.lang.Exception

cleanupInstance

protected void cleanupInstance(EJBContextImpl context)

getTargetObject

public java.rmi.Remote getTargetObject(byte[] instanceKey,
                                       java.lang.String generatedRemoteBusinessIntf)
Return the EJBObject/EJBHome Proxy for the given ejbId and instanceKey. Called from the ProtocolManager when a remote invocation arrives.

Specified by:
getTargetObject in interface Container
Specified by:
getTargetObject in interface EjbContainerFacade
generatedRemoteBusinessIntf - True if this invocation is for the RemoteHome view of the bean. False if for the RemoteBusiness view. Called from the ProtocolManager when a remote invocation arrives.
Throws:
NoSuchObjectLocalException - if the target object does not exist

releaseTargetObject

public void releaseTargetObject(java.rmi.Remote remoteObj)
Release the EJBObject/EJBHome object. Called from the ProtocolManager after a remote invocation completes.

Specified by:
releaseTargetObject in interface Container
Specified by:
releaseTargetObject in interface EjbContainerFacade

externalPreInvoke

public void externalPreInvoke()
Description copied from interface: Container
Performs pre external invocation setup such as setting application context class loader. Called by getTargetObject() and web service inv

Specified by:
externalPreInvoke in interface Container

externalPostInvoke

public void externalPostInvoke()
Description copied from interface: Container
Performs post external invocation cleanup such as restoring the original class loader. Called by releaseTargetObject() and web service inv

Specified by:
externalPostInvoke in interface Container

preInvoke

public void preInvoke(EjbInvocation inv)
Called from EJBObject/EJBHome before invoking on EJB. Set the EJB instance in the EjbInvocation. It must be ensured that the following general pattern is followed by various parts of the EJBContainer code: try { container.preInvoke(inv); returnValue = container.intercept(inv); } catch (Exception1 e1) { ... } catch (Exception2 e2) { ... } finally { container.postInvoke(); }

Specified by:
preInvoke in interface Container

enlistExtendedEntityManagers

protected void enlistExtendedEntityManagers(ComponentContext ctx)

lookupExtendedEntityManager

public javax.persistence.EntityManager lookupExtendedEntityManager(javax.persistence.EntityManagerFactory emf)
Containers that allow extended EntityManager will override this method.

Specified by:
lookupExtendedEntityManager in interface JavaEEContainer

webServicePostInvoke

public void webServicePostInvoke(EjbInvocation inv)
Description copied from interface: Container
Called by webservice code to do ejb invocation post processing.

Specified by:
webServicePostInvoke in interface Container

postInvoke

public void postInvoke(EjbInvocation inv)
Called from EJBObject/EJBHome after invoking on bean.

Specified by:
postInvoke in interface Container

postInvoke

protected void postInvoke(EjbInvocation inv,
                          boolean doTxProcessing)

addSchedule

protected void addSchedule(TimerPrimaryKey timerId,
                           TimerSchedule ts)
Call back from the timer migration process to add automatic timers to the map of scheduleIds


authorize

public boolean authorize(EjbInvocation inv)
Common code to handle EJB security manager authorization call.

Specified by:
authorize in interface Container

getContext

protected final ComponentContext getContext(EjbInvocation inv)
                                     throws EJBException
Throws:
EJBException

_getContext

protected abstract ComponentContext _getContext(EjbInvocation inv)
                                         throws EJBException
Throws:
EJBException

releaseContext

protected abstract void releaseContext(EjbInvocation inv)
                                throws EJBException
Throws:
EJBException

removeBeanUnchecked

public void removeBeanUnchecked(java.lang.Object pkey)
Description copied from interface: Container
Remove a bean given primary key. Used by the PersistenceManager.

Specified by:
removeBeanUnchecked in interface Container

removeBeanUnchecked

public void removeBeanUnchecked(EJBLocalObject bean)
Description copied from interface: Container
Remove a bean. Used by the PersistenceManager.

Specified by:
removeBeanUnchecked in interface Container

preSelect

public void preSelect()
Description copied from interface: Container
Notification from persistence manager than an ejbSelect query is about to be invoked on a bean of the ejb type for this container. This allows the ejb container to perform the same set of actions as take place before a finder method, such as calling ejbStore on bean instances. (See EJB 2.1, Section 10.5.3 ejbFind,ejbStore)

Specified by:
preSelect in interface Container

getEJBLocalObjectForPrimaryKey

public EJBLocalObject getEJBLocalObjectForPrimaryKey(java.lang.Object pkey,
                                                     EJBContext ctx)
Description copied from interface: Container
Obtain an Entity EJBLocalObject corresponding to the primary key. Used by the PersistenceManager.

Specified by:
getEJBLocalObjectForPrimaryKey in interface Container

getEJBLocalObjectForPrimaryKey

public EJBLocalObject getEJBLocalObjectForPrimaryKey(java.lang.Object pkey)
Specified by:
getEJBLocalObjectForPrimaryKey in interface Container

getEJBObjectForPrimaryKey

public EJBObject getEJBObjectForPrimaryKey(java.lang.Object pkey)
Description copied from interface: Container
Obtain an Entity EJBObject corresponding to the primary key. Used by the PersistenceManager.

Specified by:
getEJBObjectForPrimaryKey in interface Container

getJaccEjb

public java.lang.Object getJaccEjb(EjbInvocation inv)
Called-back from security implementation through EjbInvocation when a jacc policy provider wants an enterprise bean instance.

Specified by:
getJaccEjb in interface Container
Returns:
EnterpriseBean instance or null if not applicable for this invocation.

assertValidLocalObject

public void assertValidLocalObject(java.lang.Object o)
                            throws EJBException
Description copied from interface: Container
Verify that a given object is an EJBLocalObject of an ejb from this ejb container. The given object must be an EJBLocalObject and have the same ejb type ( meaning same ejb-jar and same ejb-name ) as this container. Note that for entity beans this equality check is independent of primary key.

Specified by:
assertValidLocalObject in interface Container
Throws:
EJBException - Thrown when the assertion fails.

assertValidRemoteObject

public void assertValidRemoteObject(java.lang.Object o)
                             throws EJBException
Asserts validity of RemoteHome objects. This was defined for the J2EE 1.4 implementation and is exposed through Container SPI.

Specified by:
assertValidRemoteObject in interface Container
Throws:
EJBException - Thrown when the assertion fails.

getTxAttr

protected final int getTxAttr(java.lang.reflect.Method method,
                              java.lang.String methodIntf)
                       throws EJBException
Throws:
EJBException

getTxAttr

protected final int getTxAttr(EjbInvocation inv)
                       throws EJBException
Throws:
EJBException

postProcessInvocationInfo

protected InvocationInfo postProcessInvocationInfo(InvocationInfo invInfo)

getPre30LifecycleMethodNames

protected java.lang.String[] getPre30LifecycleMethodNames()

registerTxAttrForMethod

protected void registerTxAttrForMethod(java.lang.reflect.Method method,
                                       java.lang.String methodIntf)

findTxAttr

protected int findTxAttr(MethodDescriptor md)

findFlushEnabledAttr

protected boolean findFlushEnabledAttr(MethodDescriptor md)

instantiateEJBLocalObjectImpl

protected EJBLocalObjectImpl instantiateEJBLocalObjectImpl()
                                                    throws java.lang.Exception
Throws:
java.lang.Exception

instantiateEJBLocalBusinessObjectImpl

protected EJBLocalObjectImpl instantiateEJBLocalBusinessObjectImpl()
                                                            throws java.lang.Exception
Throws:
java.lang.Exception

instantiateOptionalEJBLocalBusinessObjectImpl

protected EJBLocalObjectImpl instantiateOptionalEJBLocalBusinessObjectImpl()
                                                                    throws java.lang.Exception
Throws:
java.lang.Exception

instantiateEJBObjectImpl

protected EJBObjectImpl instantiateEJBObjectImpl()
                                          throws java.lang.Exception
Throws:
java.lang.Exception

instantiateRemoteBusinessObjectImpl

protected EJBObjectImpl instantiateRemoteBusinessObjectImpl()
                                                     throws java.lang.Exception
Throws:
java.lang.Exception

postCreate

public void postCreate(EjbInvocation inv,
                       java.lang.Object primaryKey)
                throws CreateException
Description copied from interface: Container
Called by the EJB(Local)Home after invoking ejbCreate on an EntityBean. After this postCreate the EJB(Local)Home can call ejbPostCreate on the EntityBean.

Specified by:
postCreate in interface Container
primaryKey - the value returned from ejbCreate.
Throws:
CreateException

postFind

public java.lang.Object postFind(EjbInvocation inv,
                                 java.lang.Object primaryKeys,
                                 java.lang.Object[] findParams)
                          throws FinderException
Description copied from interface: Container
Called by the EJB(Local)Home after invoking ejbFind* on an EntityBean.

Specified by:
postFind in interface Container
primaryKeys - the primaryKey or collection of primaryKeys (Collection/Enumeration) returned from ejbFind.
findParams - the parameters to the ejbFind method.
Returns:
an EJBObject reference or Collection/Enumeration of EJBObjects.
Throws:
FinderException

getComponentId

public java.lang.String getComponentId()
Called from NamingManagerImpl during java:comp/env lookup.

Specified by:
getComponentId in interface Container
Specified by:
getComponentId in interface JavaEEContainer

startApplication

public void startApplication(boolean deploy)
Called after all the components in the container's application have deployed successfully.

Specified by:
startApplication in interface Container
Parameters:
deploy - true if this method is called during application deploy

undeploy

public final void undeploy()
Undeploy event. Code must be able to gracefully handle redundant undeploy/shutdown calls for the same container instance.

Specified by:
undeploy in interface Container

onShutdown

public final void onShutdown()
Container shutdown event. This happens for every kind of shutdown other than undeploy. It could mean the server is shutting down or that the app has been disabled while the server is still running. The two cases are handled the same. We must be able to gracefully handle redundant shutdown calls for the same container instance.

Specified by:
onShutdown in interface Container

doConcreteContainerShutdown

protected abstract void doConcreteContainerShutdown(boolean appBeingUndeployed)

onReady

public void onReady()
Called when server instance is Ready

Specified by:
onReady in interface Container

onTermination

public void onTermination()
Called when server instance is terminating. This method is the last one called during server shutdown.

Specified by:
onTermination in interface Container

preInvokeTx

protected final void preInvokeTx(EjbInvocation inv)
                          throws java.lang.Exception
This is called from preInvoke before every method invocation on the EJB instance, including ejbCreate, ejbFind*, ejbRemove. Also called from MessageBeanContainer, WebServiceInvocationHandler, etc, so we can't assume that BaseContainer.preInvoke(EjbInvocation) has run. Therefore, handle inv.invocationInfo defensively since it might not have been initialized.

Throws:
java.lang.Exception

checkUnfinishedTx

protected void checkUnfinishedTx(Transaction prevTx,
                                 EjbInvocation inv)

useClientTx

protected void useClientTx(Transaction prevTx,
                           EjbInvocation inv)

postInvokeTx

public void postInvokeTx(EjbInvocation inv)
                  throws java.lang.Exception
postInvokeTx is called after every invocation on the EJB instance, including ejbCreate/ejbFind---/ejbRemove. NOTE: postInvokeTx is called even if the EJB was not invoked because of an exception thrown from preInvokeTx.

Throws:
java.lang.Exception

checkExceptionClientTx

protected java.lang.Throwable checkExceptionClientTx(EJBContextImpl context,
                                                     java.lang.Throwable exception)
                                              throws java.lang.Exception
Throws:
java.lang.Exception

doAfterBegin

public final void doAfterBegin(ComponentInvocation ci)
Description copied from interface: Container
Called from the TM when an EJB with Bean-Managed transactions starts a tx

Specified by:
doAfterBegin in interface Container

isApplicationException

protected boolean isApplicationException(java.lang.Throwable exception)

isSystemUncheckedException

protected boolean isSystemUncheckedException(java.lang.Throwable exception)

isAppExceptionRequiringRollback

protected boolean isAppExceptionRequiringRollback(java.lang.Throwable exception)
Returns true if this exception is an Application Exception and it requires rollback of the transaction in which it was thrown.


setMonitorOn

public void setMonitorOn(boolean flag)

getDebugMonitorFlag

public boolean getDebugMonitorFlag()

setDebugMonitorFlag

public void setDebugMonitorFlag(boolean flag)

containerStateToString

protected static final java.lang.String containerStateToString(int state)

isRemoteInterfaceSupported

protected final boolean isRemoteInterfaceSupported()

isLocalInterfaceSupported

protected final boolean isLocalInterfaceSupported()

invokeBeanMethod

public java.lang.Object invokeBeanMethod(EjbInvocation inv)
                                  throws java.lang.Throwable
Called from Interceptor Chain to invoke the actual bean method. This method must throw any exception from the bean method *as is*, without being wrapped in an InvocationTargetException. The exception thrown from this method will be propagated through the application's interceptor code, so it must not be changed in order for any exception handling logic in that code to function properly.

Throws:
java.lang.Throwable

getMonitoringStatsProvider

protected abstract EjbMonitoringStatsProvider getMonitoringStatsProvider(java.lang.String appName,
                                                                         java.lang.String modName,
                                                                         java.lang.String ejbName)

createMonitoringRegistryMediator

protected void createMonitoringRegistryMediator()

populateMethodMonitorMap

protected void populateMethodMonitorMap()

getMonitoringMethodsArray

protected java.lang.reflect.Method[] getMonitoringMethodsArray()

getMonitoringMethodsArray

protected java.lang.reflect.Method[] getMonitoringMethodsArray(boolean hasGeneratedClasses)

populateMethodMonitorMap

protected void populateMethodMonitorMap(java.lang.reflect.Method[] methods)

populateMethodMonitorMap

protected void populateMethodMonitorMap(java.lang.reflect.Method[] methods,
                                        boolean prefixClassName)

doFlush

protected void doFlush(EjbInvocation inv)

registerMonitorableComponents

protected void registerMonitorableComponents()

registerTimerMonitorableComponent

protected void registerTimerMonitorableComponent()

incrementCreatedTimedObject

protected void incrementCreatedTimedObject()

incrementRemovedTimedObject

protected void incrementRemovedTimedObject()

incrementDeliveredTimedObject

protected void incrementDeliveredTimedObject()


Copyright © 2012 GlassFish Community. All Rights Reserved.