Package com.sun.ejb.containers
Class BaseContainer
java.lang.Object
com.sun.ejb.containers.BaseContainer
- All Implemented Interfaces:
Container,com.sun.enterprise.container.common.spi.JavaEEContainer,org.glassfish.enterprise.iiop.spi.EjbContainerFacade
- Direct Known Subclasses:
AbstractSingletonContainer,StatefulSessionContainer,StatelessSessionContainer
public abstract class BaseContainer
extends Object
implements Container, org.glassfish.enterprise.iiop.spi.EjbContainerFacade, com.sun.enterprise.container.common.spi.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
Nested ClassesModifier and TypeClassDescriptionstatic final classInformations about this container.static enumstatic final classPreInvokeException is used to wrap exceptions thrown from BaseContainer.preInvoke, so it indicates that the bean's method will not be called. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Loggerprotected EjbCacheStatsProviderprotected EjbCacheProbeProviderprotected com.sun.enterprise.admin.monitor.callflow.CallFlowInfoprotected Stringprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected final BaseContainer.ContainerInfoprotected intprotected EJBContainerStateManagerprotected EJBContainerTransactionManagerprotected booleanprotected Methodprotected Class<?> protected EjbContainerUtilprotected EjbDescriptorprotected Class<?> protected jakarta.ejb.EJBHomeprotected EJBHomeImplprotected jakarta.ejb.EJBHomeprotected InvocationInfo[]protected Method[]protected GenericEJBLocalHomeprotected EJBLocalHomeImplprotected jakarta.ejb.EJBLocalHomeprotected EJBLocalHomeImplprotected static final intprotected static final intprotected GenericEJBLocalHomeprotected EJBLocalHomeImplprotected Classprotected Methodprotected EjbMonitoringStatsProviderprotected EjbMonitoringProbeProviderprotected jakarta.ejb.EJBHomeprotected EJBHomeImplprotected jakarta.ejb.EJBHomeprotected Methodprotected Propertiesprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected Classprotected com.sun.enterprise.container.common.spi.util.InjectionManagerprotected InterceptorManagerprotected Map<Method, InvocationInfo> protected org.glassfish.api.invocation.InvocationManagerprotected booleanprotected booleanData members for Local views *protected booleanprotected booleanData members for Remote views *protected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected final ClassLoaderprotected Classprotected Class<?> protected jakarta.ejb.EJBMetaDataprotected HashMapprotected booleanprotected org.glassfish.api.naming.GlassfishNamingManagerprotected static final Class[]protected EjbOptionalIntfGeneratorprotected EjbPoolStatsProviderprotected Classprotected org.glassfish.enterprise.iiop.api.RemoteReferenceFactoryprotected Classprotected Map<TimerPrimaryKey, Method> protected final com.sun.enterprise.security.SecurityManagerprotected Class<?> protected static final Stringprotected EjbTimedObjectStatsProviderprotected EjbTimedObjectProbeProviderprotected com.sun.enterprise.transaction.api.JavaEETransactionManagerprotected Class<?> protected Map<Method, InvocationInfo> 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
ConstructorsModifierConstructorDescriptionprotectedBaseContainer(BaseContainer.ContainerType type, EjbDescriptor ejbDesc, ClassLoader loader, com.sun.enterprise.security.SecurityManager sm) This constructor is called from ContainerFactoryImpl when an EJB Jar is deployed. -
Method Summary
Modifier and TypeMethodDescriptionprotected EJBContextImpl_constructEJBContextImpl(Object instance) protected Objectprotected abstract ComponentContext_getContext(EjbInvocation inv) protected InvocationInfoaddInvocationInfo(Method method, String methodIntf, Class originalIntf) protected voidprotected voidaddProxyInterfacesSetClass(Set proxyInterfacesSet, boolean local) protected voidadjustHomeTargetMethodInfo(InvocationInfo invInfo, String methodName, Class[] paramTypes) protected voidadjustInvocationInfo(InvocationInfo invInfo, Method method, int txAttr, boolean flushEnabled, String methodIntf, Class originalIntf) protected abstract voidafterBegin(EJBContextImpl context) protected abstract voidafterCompletion(EJBContextImpl context, int status) voidVerify that a given object is an EJBLocalObject of an ejb from this ejb container.voidAsserts validity of RemoteHome objects.booleanauthorize(EjbInvocation invocation) Common code to handle EJB security manager authorization call.protected voidprotected voidauthorizeLocalMethod(int method) Check if caller is authorized to invoke the method.protected voidprotected voidauthorizeRemoteMethod(int method) Check if caller is authorized to invoke the method.protected abstract voidbeforeCompletion(EJBContextImpl context) protected booleancallEJBTimeout(RuntimeTimerState timerState, EJBTimerService timerService) protected voidcancelTimers(Object key) protected ThrowablecheckExceptionClientTx(EJBContextImpl context, Throwable exception) protected voidcheckExists(EJBLocalRemoteObject ejbObj) Check if the given EJBObject/LocalObject has been removed.protected voidcheckUnfinishedTx(jakarta.transaction.Transaction prevTx, EjbInvocation inv) voidcheckUserTransactionLookup(org.glassfish.api.invocation.ComponentInvocation inv) protected voidcleanupInstance(EJBContextImpl context) protected static final StringcontainerStateToString(int state) protected final voidcreateCallFlowAgent(com.sun.enterprise.admin.monitor.callflow.ComponentType compType) protected EJBContextImplvoidcreateEjbInstanceForInterceptors(Object[] params, EJBContextImpl ctx) protected EjbInvocationprotected EjbInvocationcreateEjbInvocation(Object ejb, ComponentContext context) protected EJBLocalObjectImplprotected abstract EJBObjectImplprotected voidcreateRemoteReferenceWithId(byte[] instanceKey, String generatedRemoteBusinessIntf) Create an EJBObject reference from the instanceKey Called from EJBObjectOutputStream.SerializableRemoteRef during deserialization of a remote-refprotected voidfinal voiddoAfterBegin(org.glassfish.api.invocation.ComponentInvocation ci) Called from the TM when an EJB with Bean-Managed transactions starts a txprotected abstract voiddoConcreteContainerShutdown(boolean appBeingUndeployed) protected voiddoEJBHomeRemove(Object pk, Method m, boolean isLocal) protected voiddoFlush(EjbInvocation inv) protected voiddoTimerInvocationInit(EjbInvocation inv, Object primaryKey) This is implemented by concrete containers that support TimedObjects.protected voidvoidPerforms post external invocation cleanup such as restoring the original class loader.voidPerforms pre external invocation setup such as setting application context class loader.protected booleanfindFlushEnabledAttr(com.sun.enterprise.deployment.MethodDescriptor md) protected abstract voidfinal longfinal ClassLoaderCalled from NamingManagerImpl during java:comp/env lookup.final ClassLoaderprotected final longprotected final ComponentContextgetContext(EjbInvocation inv) booleanfinal org.glassfish.deployment.common.DescriptorMethod defined on JavaEEContainerfinal Classfinal EjbDescriptorfinal jakarta.ejb.EJBHomeprotected EJBHomeInvocationHandlergetEJBHomeInvocationHandler(Class homeIntfClass) final jakarta.ejb.EJBHomefinal GenericEJBLocalHomegetEJBLocalBusinessHome(String clientViewClassName) Return an object that implements ejb's local business home interface.final jakarta.ejb.EJBLocalHomeReturn an object that implements ejb's local home interface.protected EJBLocalHomeInvocationHandlergetEJBLocalHomeInvocationHandler(Class homeIntfClass) jakarta.ejb.EJBLocalObjectjakarta.ejb.EJBLocalObjectgetEJBLocalObjectForPrimaryKey(Object pkey, jakarta.ejb.EJBContext ctx) Obtain an Entity EJBLocalObject corresponding to the primary key.protected EJBLocalObjectImplfinal jakarta.ejb.EJBMetaDatajakarta.ejb.EJBObjectObtain an Entity EJBObject corresponding to the primary key.protected abstract EJBObjectImplgetEJBObjectImpl(byte[] streamKey) Called when a remote invocation arrives for an EJB.protected final ObjectgetJaccEjb(EjbInvocation ejbInvocation) Called-back from security implementation through EjbInvocation when a jacc policy provider wants an enterprise bean instance.protected org.glassfish.api.naming.SimpleJndiNameprotected String[]protected String[]getMonitoringMethodsArray(boolean hasGeneratedClasses) protected abstract EjbMonitoringStatsProvidergetMonitoringStatsProvider(String appName, String modName, String ejbName) final booleanprotected String[]protected org.glassfish.enterprise.iiop.api.ProtocolManagerfinal com.sun.enterprise.security.SecurityManagergetTargetObject(byte[] instanceKey, String generatedRemoteBusinessIntf) Return the EJBObject/EJBHome Proxy for the given ejbId and instanceKey.protected MethodgetTimeoutMethod(RuntimeTimerState timerState) protected final intgetTxAttr(EjbInvocation inv) protected final intprotected intgetTxAttrForLifecycleCallback(Set<com.sun.enterprise.deployment.LifecycleCallbackDescriptor> lifecycleCallbackDescriptors, int defaultTxAttr, int... validateTxAttr) final jakarta.transaction.UserTransactionfinal Stringprotected voidprotected voidprotected voidprotected voidCalled from the ContainerFactory during initialization.protected voidprotected voidinjectEjbInstance(EJBContextImpl context) protected EJBLocalObjectImplprotected EJBLocalObjectImplprotected EJBLocalObjectImplprotected EJBObjectImplprotected EJBObjectImplinstantiateEJBObjectImpl(jakarta.ejb.EJBObject ejbStub, Object key) protected EJBLocalObjectImplprotected EJBObjectImplprotected Objectintercept(EjbInvocation inv) Called from various places within the container that are responsible for dispatching invocations to business methods.booleanintercept(com.sun.enterprise.deployment.LifecycleCallbackDescriptor.CallbackType eventType, EJBContextImpl ctx) invokeBeanMethod(EjbInvocation invocation) Called from Interceptor Chain to invoke the actual bean method.protected ObjectinvokeFindByPrimaryKey(Method method, EjbInvocation inv, Object[] args) protected ObjectinvokeTargetBeanMethod(Method beanClassMethod, EjbInvocation inv, Object target, Object[] params, com.sun.enterprise.security.SecurityManager mgr) protected booleanisApplicationException(Throwable exception) protected booleanisCreateHomeFinder(Method method) protected booleanbooleanprotected booleanisIdentical(EJBObjectImpl ejbo, jakarta.ejb.EJBObject other) protected final booleanfinal booleanReturns true if the bean associated with this Container has a LocalHome/Local view OR a Local business view OR both.protected final booleanfinal booleanReturns true if the bean associated with this Container has a RemoteHome/Remote view OR a Remote business view OR both.final booleanprotected booleanisSystemUncheckedException(Throwable exception) final booleanReturns true if this Container uses EJB Timer Service.final booleanjakarta.persistence.EntityManagerlookupExtendedEntityManager(jakarta.persistence.EntityManagerFactory emf) Containers that allow extended EntityManager will override this method.final voidCalled when the request started it's processing in the containerfinal voidCalled when the request finished it's processing in the containervoidonReady()Called when server instance is Readyfinal voidContainer shutdown event.voidCalled when server instance is terminating.protected abstract booleanpassivateEJB(ComponentContext context) voidpostCreate(EjbInvocation inv, Object primaryKey) Called by the EJB(Local)Home after invoking ejbCreate on an EntityBean.protected booleanpostEjbTimeout(RuntimeTimerState timerState, EJBTimerService timerService) postFind(EjbInvocation inv, Object primaryKeys, Object[] findParams) Called by the EJB(Local)Home after invoking ejbFind* on an EntityBean.voidpostInvoke(EjbInvocation inv) Called from EJBObject/EJBHome after invoking on bean.protected voidpostInvoke(EjbInvocation inv, boolean doTxProcessing) protected voidprotected voidpostInvokeTx is called after every invocation on the EJB instance, including ejbCreate/ejbFind---/ejbRemove.protected InvocationInfopostProcessInvocationInfo(InvocationInfo invInfo) protected voidpreInitialize(EjbDescriptor ejbDesc, ClassLoader loader) voidpreInvoke(EjbInvocation inv) Called from EJBObject/EJBHome before invoking on EJB.protected voidprotected final voidpreInvokeTx(EjbInvocation inv) This is called from preInvoke before every method invocation on the EJB instance, including ejbCreate, ejbFind*, ejbRemove.protected voidprepareEjbTimeoutParams(EjbInvocation inv, RuntimeTimerState timerState, EJBTimerService timerService) voidNotification from persistence manager than an ejbSelect query is about to be invoked on a bean of the ejb type for this container.protected voidvoidregisterSystemInterceptor(Object interceptor) Can be called after original interceptor initialization.protected voidprotected abstract voidvoidreleaseTargetObject(Remote remoteObj) Release the EJBObject/EJBHome object.protected abstract voidremoveBean(EJBLocalRemoteObject ejbo, Method removeMethod, boolean local) voidremoveBeanUnchecked(jakarta.ejb.EJBLocalObject bean) Remove a bean.voidremoveBeanUnchecked(Object pkey) Remove a bean given primary key.protected booleanbooleanvoidsetDebugMonitorFlag(boolean flag) protected voidfinal voidStart servicing invocations for EJB instances in this Container.final voidStop servicing invocations for EJB instances in this Container.final voidStop servicing invocations for EJB instances in this Container as the container is being undeployed.voidstartApplication(boolean deploy) Called after all the components in the container's application have deployed successfully.protected booleantoString()final voidundeploy()Undeploy event.protected voiduseClientTx(jakarta.transaction.Transaction prevTx, EjbInvocation inv) booleanuserTransactionMethodsAllowed(org.glassfish.api.invocation.ComponentInvocation inv) EJB spec makes a distinction between access to the UserTransaction object itself and access to its methods.protected voidvalidateEMForClientTx(EjbInvocation inv, com.sun.enterprise.transaction.api.JavaEETransaction t) protected voidvalidateTxAttr(com.sun.enterprise.deployment.MethodDescriptor md, int txAttr) Validate transaction attribute value.voidCalled by webservice code to do ejb invocation post processing.
-
Field Details
-
_logger
-
NO_PARAMS
-
containerInfo
-
EJBObject_getPrimaryKey
protected static final int EJBObject_getPrimaryKey- See Also:
-
EJBLocalObject_getPrimaryKey
protected static final int EJBLocalObject_getPrimaryKey- See Also:
-
SINGLETON_BEAN_POOL_PROP
- See Also:
-
loader
-
ejbClass
-
sfsbSerializedClass
-
ejbPassivateMethod
-
ejbActivateMethod
-
ejbRemoveMethod
-
webServiceEndpointIntf
-
isWebServiceEndpoint
protected boolean isWebServiceEndpoint -
isLocal
protected boolean isLocalData members for Local views * -
hasLocalHomeView
protected boolean hasLocalHomeView -
hasLocalBusinessView
protected boolean hasLocalBusinessView -
hasOptionalLocalBusinessView
protected boolean hasOptionalLocalBusinessView -
ejbGeneratedOptionalLocalBusinessIntfClass
-
localHomeIntf
-
ejbLocalHome
protected jakarta.ejb.EJBLocalHome ejbLocalHome -
ejbLocalHomeImpl
-
localBusinessHomeIntf
-
ejbOptionalLocalBusinessHomeIntf
-
localBusinessIntfs
-
ejbLocalBusinessHome
-
ejbOptionalLocalBusinessHome
-
ejbLocalBusinessHomeImpl
-
ejbOptionalLocalBusinessHomeImpl
-
isRemote
protected boolean isRemoteData members for Remote views * -
hasRemoteHomeView
protected boolean hasRemoteHomeView -
hasRemoteBusinessView
protected boolean hasRemoteBusinessView -
homeIntf
-
remoteIntf
-
ejbHomeImpl
-
ejbHome
protected jakarta.ejb.EJBHome ejbHome -
ejbHomeStub
protected jakarta.ejb.EJBHome ejbHomeStub -
remoteHomeRefFactory
protected org.glassfish.enterprise.iiop.api.RemoteReferenceFactory remoteHomeRefFactory -
remoteBusinessHomeIntf
-
ejbRemoteBusinessHomeImpl
-
ejbRemoteBusinessHome
protected jakarta.ejb.EJBHome ejbRemoteBusinessHome -
ejbRemoteBusinessHomeStub
protected jakarta.ejb.EJBHome ejbRemoteBusinessHomeStub -
remoteBusinessIntfInfo
-
metadata
protected jakarta.ejb.EJBMetaData metadata -
securityManager
protected final com.sun.enterprise.security.SecurityManager securityManager -
isSession
protected boolean isSession -
isStatelessSession
protected boolean isStatelessSession -
isStatefulSession
protected boolean isStatefulSession -
isMessageDriven
protected boolean isMessageDriven -
isSingleton
protected boolean isSingleton -
ejbDescriptor
-
componentId
-
invocationInfoMap
-
scheduleIds
-
webServiceInvocationInfoMap
-
ejbIntfMethods
-
ejbIntfMethodInfo
-
envProps
-
isBeanManagedTran
protected boolean isBeanManagedTran -
debugMonitorFlag
protected boolean debugMonitorFlag -
CONTAINER_INITIALIZING
protected static final int CONTAINER_INITIALIZING- See Also:
-
CONTAINER_STARTED
protected static final int CONTAINER_STARTED- See Also:
-
CONTAINER_STOPPED
protected static final int CONTAINER_STOPPED- See Also:
-
CONTAINER_UNDEPLOYED
protected static final int CONTAINER_UNDEPLOYED- See Also:
-
CONTAINER_ON_HOLD
protected static final int CONTAINER_ON_HOLD- See Also:
-
containerState
protected int containerState -
methodMonitorMap
-
monitorOn
protected boolean monitorOn -
ejbProbeListener
-
ejbProbeNotifier
-
timerProbeListener
-
timerProbeNotifier
-
poolProbeListener
-
cacheProbeNotifier
-
cacheProbeListener
-
callFlowInfo
protected com.sun.enterprise.admin.monitor.callflow.CallFlowInfo callFlowInfo -
interceptorManager
-
invocationManager
protected org.glassfish.api.invocation.InvocationManager invocationManager -
injectionManager
protected com.sun.enterprise.container.common.spi.util.InjectionManager injectionManager -
namingManager
protected org.glassfish.api.naming.GlassfishNamingManager namingManager -
transactionManager
protected com.sun.enterprise.transaction.api.JavaEETransactionManager transactionManager -
ejbContainerUtilImpl
-
optIntfClassLoader
-
containerStateManager
-
containerTransactionManager
-
-
Constructor Details
-
BaseContainer
protected BaseContainer(BaseContainer.ContainerType type, EjbDescriptor ejbDesc, ClassLoader loader, com.sun.enterprise.security.SecurityManager sm) throws Exception This constructor is called from ContainerFactoryImpl when an EJB Jar is deployed.- Throws:
Exception
-
-
Method Details
-
getProtocolManager
protected org.glassfish.enterprise.iiop.api.ProtocolManager getProtocolManager() -
getContainerInfo
-
doEJBHomeRemove
protected void doEJBHomeRemove(Object pk, Method m, boolean isLocal) throws RemoteException, jakarta.ejb.RemoveException - Throws:
RemoteExceptionjakarta.ejb.RemoveException
-
initializeProtocolManager
protected void initializeProtocolManager() -
preInitialize
-
checkUserTransactionLookup
public void checkUserTransactionLookup(org.glassfish.api.invocation.ComponentInvocation inv) throws NameNotFoundException - Throws:
NameNotFoundException
-
createCallFlowAgent
protected final void createCallFlowAgent(com.sun.enterprise.admin.monitor.callflow.ComponentType compType) -
toString
-
setStartedState
public final void setStartedState()Description copied from interface:ContainerStart servicing invocations for EJB instances in this Container.- Specified by:
setStartedStatein interfaceContainer
-
setStoppedState
public final void setStoppedState()Description copied from interface:ContainerStop 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:
setStoppedStatein interfaceContainer
-
isStopped
public final boolean isStopped() -
setUndeployedState
public final void setUndeployedState()Description copied from interface:ContainerStop 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:
setUndeployedStatein interfaceContainer
-
isUndeployed
public final boolean isUndeployed() -
isTimedObject
public final boolean isTimedObject()Description copied from interface:ContainerReturns true if this Container uses EJB Timer Service.- Specified by:
isTimedObjectin interfaceContainer
-
isLocalObject
public final boolean isLocalObject()Description copied from interface:ContainerReturns true if the bean associated with this Container has a LocalHome/Local view OR a Local business view OR both.- Specified by:
isLocalObjectin interfaceContainer
-
isRemoteObject
public final boolean isRemoteObject()Description copied from interface:ContainerReturns true if the bean associated with this Container has a RemoteHome/Remote view OR a Remote business view OR both.- Specified by:
isRemoteObjectin interfaceContainer
-
getContainerClassLoader
- Specified by:
getContainerClassLoaderin interfacecom.sun.enterprise.container.common.spi.JavaEEContainer
-
getClassLoader
- Specified by:
getClassLoaderin interfaceContainer- Specified by:
getClassLoaderin interfaceorg.glassfish.enterprise.iiop.spi.EjbContainerFacade- Returns:
- the classloader of this container instance.
-
getUseThreadPoolId
- Specified by:
getUseThreadPoolIdin interfaceorg.glassfish.enterprise.iiop.spi.EjbContainerFacade
-
getPassByReference
public final boolean getPassByReference()- Specified by:
getPassByReferencein interfaceorg.glassfish.enterprise.iiop.spi.EjbContainerFacade
-
getContainerId
protected final long getContainerId() -
getApplicationId
public final long getApplicationId() -
getEjbDescriptor
- Specified by:
getEjbDescriptorin interfaceContainer- Specified by:
getEjbDescriptorin interfaceorg.glassfish.enterprise.iiop.spi.EjbContainerFacade- Returns:
- the EjbDescriptor containing deployment information for the EJB type corresponding to this Container instance.
-
getDescriptor
public final org.glassfish.deployment.common.Descriptor getDescriptor()Method defined on JavaEEContainer- Specified by:
getDescriptorin interfacecom.sun.enterprise.container.common.spi.JavaEEContainer
-
getEJBMetaData
public final jakarta.ejb.EJBMetaData getEJBMetaData()- Specified by:
getEJBMetaDatain interfaceContainer- Returns:
- the MetaData for this EJB type.
-
getUserTransaction
public final jakarta.transaction.UserTransaction getUserTransaction() -
isHAEnabled
public boolean isHAEnabled() -
userTransactionMethodsAllowed
public boolean userTransactionMethodsAllowed(org.glassfish.api.invocation.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:
userTransactionMethodsAllowedin interfaceContainer
-
getEJBHomeStub
public final jakarta.ejb.EJBHome getEJBHomeStub() -
getEJBHome
public final jakarta.ejb.EJBHome getEJBHome()- Specified by:
getEJBHomein interfaceContainer- Returns:
- the EJBHome object reference for this container instance.
-
getEJBLocalHome
public final jakarta.ejb.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
Return an object that implements ejb's local business home interface. -
getEJBClass
-
getSecurityManager
public final com.sun.enterprise.security.SecurityManager getSecurityManager()- Specified by:
getSecurityManagerin interfaceContainer- Returns:
- A SecurityManager object for this container.
-
createRemoteReferenceWithId
Create an EJBObject reference from the instanceKey Called from EJBObjectOutputStream.SerializableRemoteRef during deserialization of a remote-ref- Parameters:
instanceKey- instanceKey of the ejbobjectgeneratedRemoteBusinessIntf- 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
-
initializeHome
Called from the ContainerFactory during initialization.- Throws:
Exception
-
setEJBMetaData
- Throws:
Exception
-
getJavaGlobalJndiNamePrefix
protected org.glassfish.api.naming.SimpleJndiName getJavaGlobalJndiNamePrefix() -
createEjbInstanceForInterceptors
- Throws:
Exception
-
createEjbInstanceAndContext
- Throws:
Exception
-
_constructEJBContextImpl
-
_constructEJBInstance
- Throws:
Exception
-
injectEjbInstance
- Throws:
Exception
-
cleanupInstance
-
getTargetObject
Return the EJBObject/EJBHome Proxy for the given ejbId and instanceKey. Called from the ProtocolManager when a remote invocation arrives.- Specified by:
getTargetObjectin interfaceContainer- Specified by:
getTargetObjectin interfaceorg.glassfish.enterprise.iiop.spi.EjbContainerFacade- Parameters:
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:
jakarta.ejb.NoSuchObjectLocalException- if the target object does not exist
-
releaseTargetObject
Release the EJBObject/EJBHome object. Called from the ProtocolManager after a remote invocation completes.- Specified by:
releaseTargetObjectin interfaceContainer- Specified by:
releaseTargetObjectin interfaceorg.glassfish.enterprise.iiop.spi.EjbContainerFacade
-
externalPreInvoke
public void externalPreInvoke()Description copied from interface:ContainerPerforms pre external invocation setup such as setting application context class loader. Called by getTargetObject() and web service inv- Specified by:
externalPreInvokein interfaceContainer
-
externalPostInvoke
public void externalPostInvoke()Description copied from interface:ContainerPerforms post external invocation cleanup such as restoring the original class loader. Called by releaseTargetObject() and web service inv- Specified by:
externalPostInvokein interfaceContainer
-
preInvoke
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(); } -
intercept
public boolean intercept(com.sun.enterprise.deployment.LifecycleCallbackDescriptor.CallbackType eventType, EJBContextImpl ctx) throws Throwable - Throws:
Throwable
-
enlistExtendedEntityManagers
-
delistExtendedEntityManagers
-
lookupExtendedEntityManager
public jakarta.persistence.EntityManager lookupExtendedEntityManager(jakarta.persistence.EntityManagerFactory emf) Containers that allow extended EntityManager will override this method.- Specified by:
lookupExtendedEntityManagerin interfacecom.sun.enterprise.container.common.spi.JavaEEContainer
-
webServicePostInvoke
Description copied from interface:ContainerCalled by webservice code to do ejb invocation post processing.- Specified by:
webServicePostInvokein interfaceContainer
-
postInvoke
Called from EJBObject/EJBHome after invoking on bean.- Specified by:
postInvokein interfaceContainer
-
postInvoke
-
authorizeLocalMethod
protected void authorizeLocalMethod(int method) Check if caller is authorized to invoke the method. Only called for EJBLocalObject and EJBLocalHome methods, from EJBLocalHome|ObjectImpl classes.- Parameters:
method- an integer identifying the method to be checked, must be one of the EJBLocal{Home|Object}_* constants.
-
authorizeRemoteMethod
Check if caller is authorized to invoke the method. Only called for EJBObject and EJBHome methods, from EJBHome|ObjectImpl classes.- Parameters:
method- an integer identifying the method to be checked, must be one of the EJB{Home|Object}_* constants.- Throws:
RemoteException
-
authorize
Common code to handle EJB security manager authorization call. -
cancelTimers
-
isEjbTimeoutMethod
-
createEJBObjectImpl
protected abstract EJBObjectImpl createEJBObjectImpl() throws jakarta.ejb.CreateException, RemoteException- Throws:
jakarta.ejb.CreateExceptionRemoteException
-
createEJBLocalObjectImpl
- Throws:
jakarta.ejb.CreateException
-
getEJBObjectImpl
Called when a remote invocation arrives for an EJB. Implemented in subclasses. -
getEJBLocalObjectImpl
-
checkExists
Check if the given EJBObject/LocalObject has been removed.- Throws:
jakarta.ejb.NoSuchObjectLocalException- if the object has been removed.
-
getContext
- Throws:
jakarta.ejb.EJBException
-
getInvocationKey
-
_getContext
- Throws:
jakarta.ejb.EJBException
-
releaseContext
- Throws:
jakarta.ejb.EJBException
-
passivateEJB
-
forceDestroyBean
- Throws:
jakarta.ejb.EJBException
-
removeBean
protected abstract void removeBean(EJBLocalRemoteObject ejbo, Method removeMethod, boolean local) throws jakarta.ejb.RemoveException, jakarta.ejb.EJBException, RemoteException - Throws:
jakarta.ejb.RemoveExceptionjakarta.ejb.EJBExceptionRemoteException
-
authorizeLocalGetPrimaryKey
protected void authorizeLocalGetPrimaryKey(EJBLocalRemoteObject ejbObj) throws jakarta.ejb.EJBException - Throws:
jakarta.ejb.EJBException
-
authorizeRemoteGetPrimaryKey
- Throws:
RemoteException
-
invokeFindByPrimaryKey
protected Object invokeFindByPrimaryKey(Method method, EjbInvocation inv, Object[] args) throws Throwable - Throws:
Throwable
-
removeBeanUnchecked
Description copied from interface:ContainerRemove a bean given primary key. Used by the PersistenceManager.- Specified by:
removeBeanUncheckedin interfaceContainer
-
removeBeanUnchecked
public void removeBeanUnchecked(jakarta.ejb.EJBLocalObject bean) Description copied from interface:ContainerRemove a bean. Used by the PersistenceManager.- Specified by:
removeBeanUncheckedin interfaceContainer
-
preSelect
public void preSelect()Description copied from interface:ContainerNotification 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) -
getEJBLocalObjectForPrimaryKey
public jakarta.ejb.EJBLocalObject getEJBLocalObjectForPrimaryKey(Object pkey, jakarta.ejb.EJBContext ctx) Description copied from interface:ContainerObtain an Entity EJBLocalObject corresponding to the primary key. Used by the PersistenceManager.- Specified by:
getEJBLocalObjectForPrimaryKeyin interfaceContainer
-
getEJBLocalObjectForPrimaryKey
- Specified by:
getEJBLocalObjectForPrimaryKeyin interfaceContainer
-
getEJBObjectForPrimaryKey
Description copied from interface:ContainerObtain an Entity EJBObject corresponding to the primary key. Used by the PersistenceManager.- Specified by:
getEJBObjectForPrimaryKeyin interfaceContainer
-
isIdentical
protected boolean isIdentical(EJBObjectImpl ejbo, jakarta.ejb.EJBObject other) throws RemoteException - Throws:
RemoteException
-
getJaccEjb
Called-back from security implementation through EjbInvocation when a jacc policy provider wants an enterprise bean instance.- Specified by:
getJaccEjbin interfaceContainer- Returns:
- EnterpriseBean instance or null if not applicable for this invocation.
-
assertValidLocalObject
Description copied from interface:ContainerVerify 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:
assertValidLocalObjectin interfaceContainer- Throws:
jakarta.ejb.EJBException- Thrown when the assertion fails.
-
assertValidRemoteObject
Asserts validity of RemoteHome objects. This was defined for the J2EE 1.4 implementation and is exposed through Container SPI.- Specified by:
assertValidRemoteObjectin interfaceContainer- Throws:
jakarta.ejb.EJBException- Thrown when the assertion fails.
-
getTxAttr
- Throws:
jakarta.ejb.EJBException
-
getTxAttr
- Throws:
jakarta.ejb.EJBException
-
isCreateHomeFinder
-
addInvocationInfo
protected InvocationInfo addInvocationInfo(Method method, String methodIntf, Class originalIntf) throws jakarta.ejb.EJBException - Throws:
jakarta.ejb.EJBException
-
adjustInvocationInfo
protected void adjustInvocationInfo(InvocationInfo invInfo, Method method, int txAttr, boolean flushEnabled, String methodIntf, Class originalIntf) throws jakarta.ejb.EJBException - Throws:
jakarta.ejb.EJBException
-
postProcessInvocationInfo
-
adjustHomeTargetMethodInfo
protected void adjustHomeTargetMethodInfo(InvocationInfo invInfo, String methodName, Class[] paramTypes) throws NoSuchMethodException - Throws:
NoSuchMethodException
-
getPre30LifecycleMethodNames
-
registerSystemInterceptor
Can be called after original interceptor initialization. Install the given interceptor class instance before any application level interceptors.- Parameters:
interceptor- optionally specified delegate to be set on SystemInterceptorProxy
-
addLocalRemoteInvocationInfo
- Throws:
Exception
-
validateTxAttr
protected void validateTxAttr(com.sun.enterprise.deployment.MethodDescriptor md, int txAttr) throws jakarta.ejb.EJBException Validate transaction attribute value. Allow subclasses to add their own validation.- Throws:
jakarta.ejb.EJBException
-
findFlushEnabledAttr
protected boolean findFlushEnabledAttr(com.sun.enterprise.deployment.MethodDescriptor md) -
addProxyInterfacesSetClass
-
getEJBHomeInvocationHandler
protected EJBHomeInvocationHandler getEJBHomeInvocationHandler(Class homeIntfClass) throws Exception - Throws:
Exception
-
createEjbInvocation
-
createEjbInvocation
-
getEJBLocalHomeInvocationHandler
protected EJBLocalHomeInvocationHandler getEJBLocalHomeInvocationHandler(Class homeIntfClass) throws Exception - Throws:
Exception
-
instantiateEJBLocalObjectImpl
- Throws:
Exception
-
instantiateEJBLocalObjectImpl
- Throws:
Exception
-
instantiateEJBLocalBusinessObjectImpl
- Throws:
Exception
-
instantiateOptionalEJBLocalBusinessObjectImpl
- Throws:
Exception
-
instantiateEJBObjectImpl
- Throws:
Exception
-
instantiateEJBObjectImpl
protected EJBObjectImpl instantiateEJBObjectImpl(jakarta.ejb.EJBObject ejbStub, Object key) throws Exception - Throws:
Exception
-
instantiateRemoteBusinessObjectImpl
- Throws:
Exception
-
scanForEjbCreateMethod
public boolean scanForEjbCreateMethod() -
postCreate
Description copied from interface:ContainerCalled 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:
postCreatein interfaceContainer- Parameters:
primaryKey- the value returned from ejbCreate.- Throws:
jakarta.ejb.CreateException
-
postFind
public Object postFind(EjbInvocation inv, Object primaryKeys, Object[] findParams) throws jakarta.ejb.FinderException Description copied from interface:ContainerCalled by the EJB(Local)Home after invoking ejbFind* on an EntityBean.- Specified by:
postFindin interfaceContainer- Parameters:
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:
jakarta.ejb.FinderException
-
getComponentId
Called from NamingManagerImpl during java:comp/env lookup.- Specified by:
getComponentIdin interfaceContainer- Specified by:
getComponentIdin interfacecom.sun.enterprise.container.common.spi.JavaEEContainer
-
startApplication
public void startApplication(boolean deploy) Called after all the components in the container's application have deployed successfully.- Specified by:
startApplicationin interfaceContainer- Parameters:
deploy- true if this method is called during application deploy
-
callEJBTimeout
protected boolean callEJBTimeout(RuntimeTimerState timerState, EJBTimerService timerService) throws Exception - Throws:
Exception
-
getTimeoutMethod
-
postEjbTimeout
-
prepareEjbTimeoutParams
protected void prepareEjbTimeoutParams(EjbInvocation inv, RuntimeTimerState timerState, EJBTimerService timerService) -
onEnteringContainer
public final void onEnteringContainer()Description copied from interface:ContainerCalled when the request started it's processing in the container- Specified by:
onEnteringContainerin interfaceContainer
-
onLeavingContainer
public final void onLeavingContainer()Description copied from interface:ContainerCalled when the request finished it's processing in the container- Specified by:
onLeavingContainerin interfaceContainer
-
invokeTargetBeanMethod
protected Object invokeTargetBeanMethod(Method beanClassMethod, EjbInvocation inv, Object target, Object[] params, com.sun.enterprise.security.SecurityManager mgr) throws Throwable - Throws:
Throwable
-
doTimerInvocationInit
This is implemented by concrete containers that support TimedObjects.- Throws:
Exception
-
undeploy
public final void undeploy()Undeploy event. Code must be able to gracefully handle redundant undeploy/shutdown calls for the same container instance. -
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:
onShutdownin interfaceContainer
-
doConcreteContainerShutdown
protected abstract void doConcreteContainerShutdown(boolean appBeingUndeployed) -
onReady
public void onReady()Called when server instance is Ready -
onTermination
public void onTermination()Called when server instance is terminating. This method is the last one called during server shutdown.- Specified by:
onTerminationin interfaceContainer
-
preInvokeTx
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:
Exception
-
checkUnfinishedTx
-
suspendTransaction
- Throws:
Exception
-
resumeTransaction
- Throws:
Exception
-
useClientTx
-
validateEMForClientTx
protected void validateEMForClientTx(EjbInvocation inv, com.sun.enterprise.transaction.api.JavaEETransaction t) -
postInvokeTx
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:
Exception
-
checkExceptionClientTx
protected Throwable checkExceptionClientTx(EJBContextImpl context, Throwable exception) throws Exception - Throws:
Exception
-
doAfterBegin
public final void doAfterBegin(org.glassfish.api.invocation.ComponentInvocation ci) Description copied from interface:ContainerCalled from the TM when an EJB with Bean-Managed transactions starts a tx- Specified by:
doAfterBeginin interfaceContainer
-
afterBegin
-
beforeCompletion
-
afterCompletion
-
preInvokeNoTx
-
postInvokeNoTx
-
isApplicationException
-
isSystemUncheckedException
-
getDebugMonitorFlag
public boolean getDebugMonitorFlag() -
setDebugMonitorFlag
public void setDebugMonitorFlag(boolean flag) -
containerStateToString
-
isRemoteInterfaceSupported
protected final boolean isRemoteInterfaceSupported() -
isLocalInterfaceSupported
protected final boolean isLocalInterfaceSupported() -
getTxAttrForLifecycleCallback
protected int getTxAttrForLifecycleCallback(Set<com.sun.enterprise.deployment.LifecycleCallbackDescriptor> lifecycleCallbackDescriptors, int defaultTxAttr, int... validateTxAttr) throws Exception - Throws:
Exception
-
intercept
Called from various places within the container that are responsible for dispatching invocations to business methods. This method has the exception semantics of Method.invoke(). Any exception that originated from the business method or application code within an interceptor will be propagated as the cause within an InvocationTargetException.- Throws:
Throwable
-
invokeBeanMethod
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:
Throwable
-
getMonitoringStatsProvider
protected abstract EjbMonitoringStatsProvider getMonitoringStatsProvider(String appName, String modName, String ejbName) -
createMonitoringRegistry
protected void createMonitoringRegistry() -
getMonitoringMethodsArray
-
getMonitoringMethodsArray
-
doFlush
-
registerMonitorableComponents
protected void registerMonitorableComponents() -
registerTimerMonitorableComponent
protected void registerTimerMonitorableComponent() -
incrementCreatedTimedObject
protected void incrementCreatedTimedObject() -
incrementRemovedTimedObject
protected void incrementRemovedTimedObject() -
incrementDeliveredTimedObject
protected void incrementDeliveredTimedObject()
-