Class StatefulSessionComponent
- java.lang.Object
-
- org.jboss.as.ee.component.BasicComponent
-
- org.jboss.as.ejb3.component.EJBComponent
-
- org.jboss.as.ejb3.component.session.SessionBeanComponent
-
- org.jboss.as.ejb3.component.stateful.StatefulSessionComponent
-
- All Implemented Interfaces:
Component,StatefulObjectFactory<StatefulSessionComponentInstance>,org.jboss.as.server.suspend.ServerActivityCallback,PassivationListener<StatefulSessionComponentInstance>
public class StatefulSessionComponent extends SessionBeanComponent implements StatefulObjectFactory<StatefulSessionComponentInstance>, PassivationListener<StatefulSessionComponentInstance>
Stateful Session Bean- Author:
- Carlo de Wolf
-
-
Field Summary
-
Fields inherited from class org.jboss.as.ejb3.component.session.SessionBeanComponent
beanLevelAccessTimeout
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedStatefulSessionComponent(StatefulSessionComponentCreateService ejbComponentCreateService)Construct a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StatefulSessionComponentInstanceconstructComponentInstance(org.jboss.as.naming.ManagedReference instance, boolean invokePostConstruct)protected StatefulSessionComponentInstanceconstructComponentInstance(org.jboss.as.naming.ManagedReference instance, boolean invokePostConstruct, Map<Object,Object> context)StatefulSessionComponentInstancecreateInstance()Create a new instance of this component.StatefulSessionComponentInstancecreateInstance(Object instance)protected voidcreateInterceptors(org.jboss.invocation.InterceptorFactoryContext context)org.jboss.ejb.client.SessionIDcreateSession()org.jboss.ejb.client.SessionIDcreateSessionRemote()creates a session using the global request controller.voiddestroyInstance(StatefulSessionComponentInstance instance)Destroy an instance of the component.voiddone()AccessTimeoutDetailsgetAccessTimeout(Method method)Returns theAccessTimeoutapplicable to given methodorg.jboss.invocation.InterceptorgetAfterBegin()MethodgetAfterBeginMethod()org.jboss.invocation.InterceptorgetAfterCompletion()MethodgetAfterCompletionMethod()AllowedMethodsInformationgetAllowedMethodsInformation()org.jboss.invocation.InterceptorgetBeforeCompletion()MethodgetBeforeCompletionMethod()<T> TgetBusinessObject(Class<T> businessInterface, org.jboss.invocation.InterceptorContext context)Cache<org.jboss.ejb.client.SessionID,StatefulSessionComponentInstance>getCache()org.jboss.invocation.InterceptorgetEjb2XRemoveMethod()javax.ejb.EJBLocalObjectgetEJBLocalObject(org.jboss.invocation.InterceptorContext ctx)javax.ejb.EJBObjectgetEJBObject(org.jboss.invocation.InterceptorContext ctx)org.jboss.invocation.InterceptorgetPostActivate()org.jboss.invocation.InterceptorgetPrePassivate()Set<Object>getSerialiableInterceptorContextKeys()protected org.jboss.ejb.client.SessionIDgetSessionIdOf(org.jboss.invocation.InterceptorContext ctx)javax.ejb.TimerServicegetTimerService()voidinit()protected BasicComponentInstanceinstantiateComponentInstance(org.jboss.invocation.Interceptor preDestroyInterceptor, Map<Method,org.jboss.invocation.Interceptor> methodInterceptors, Map<Object,Object> context)booleanisRemotable(Throwable throwable)voidpostActivate(StatefulSessionComponentInstance instance)voidprePassivate(StatefulSessionComponentInstance instance)voidremoveSession(org.jboss.ejb.client.SessionID sessionId)Removes the session associated with thesessionId.booleanshouldDiscard(Exception ex, Method method)-
Methods inherited from class org.jboss.as.ejb3.component.session.SessionBeanComponent
getAsynchronousExecutor, getRollbackOnly, setRollbackOnly
-
Methods inherited from class org.jboss.as.ejb3.component.EJBComponent
createViewInstanceProxy, createViewInstanceProxy, getApplicationException, getApplicationName, getCallerPrincipal, getComponentDescription, getControlPoint, getCurrentTransactionAttribute, getDistinctName, getEarApplicationName, getEJBHome, getEJBLocalHome, getEjbLocalObjectType, getEjbLocalObjectViewServiceName, getEjbObjectType, getEjbObjectViewServiceName, getEjbSuspendHandlerService, getIdentityOutflowFunction, getIncomingRunAsIdentity, getInvocationMetrics, getModuleName, getSecurityDomain, getSecurityMetaData, getShutDownInterceptorFactory, getTimeoutInterceptors, getTimeoutMethod, getTransactionAttributeType, getTransactionAttributeType, getTransactionAttributeType, getTransactionManager, getTransactionSynchronizationRegistry, getTransactionTimeout, getTransactionTimeout, getUserTransaction, isBeanManagedTransaction, isCallerInRole, isExceptionLoggingEnabled, isSecurityDomainKnown, isStatisticsEnabled, isTransactionAttributeTypeExplicit, lookup, setIncomingRunAsIdentity, stop
-
Methods inherited from class org.jboss.as.ee.component.BasicComponent
componentInstanceCreated, getComponentClass, getComponentName, getCreateServiceName, getInstance, getNamespaceContextSelector, serviceNameOf, start, toString, waitForComponentStart
-
-
-
-
Constructor Detail
-
StatefulSessionComponent
protected StatefulSessionComponent(StatefulSessionComponentCreateService ejbComponentCreateService)
Construct a new instance.- Parameters:
ejbComponentCreateService- the component configuration
-
-
Method Detail
-
createInstance
public StatefulSessionComponentInstance createInstance()
Description copied from interface:StatefulObjectFactoryCreate a new instance of this component. This may be invoked by a component interceptor, a client interceptor, or in the course of creating a new client, or in the case of an "eager" singleton, at component start. This method will block until the component is available. If the component fails to start then a runtime exception will be thrown. The instance has been injected and post-construct has been called.- Specified by:
createInstancein interfaceComponent- Specified by:
createInstancein interfaceStatefulObjectFactory<StatefulSessionComponentInstance>- Overrides:
createInstancein classBasicComponent- Returns:
- the component instance
-
createInstance
public StatefulSessionComponentInstance createInstance(Object instance)
- Specified by:
createInstancein interfaceComponent- Overrides:
createInstancein classBasicComponent
-
constructComponentInstance
protected StatefulSessionComponentInstance constructComponentInstance(org.jboss.as.naming.ManagedReference instance, boolean invokePostConstruct)
- Overrides:
constructComponentInstancein classBasicComponent
-
constructComponentInstance
protected StatefulSessionComponentInstance constructComponentInstance(org.jboss.as.naming.ManagedReference instance, boolean invokePostConstruct, Map<Object,Object> context)
- Overrides:
constructComponentInstancein classBasicComponent
-
destroyInstance
public void destroyInstance(StatefulSessionComponentInstance instance)
Description copied from interface:StatefulObjectFactoryDestroy an instance of the component. This method causes all uninjection and pre-destroy lifecycle invocations to occur.- Specified by:
destroyInstancein interfaceStatefulObjectFactory<StatefulSessionComponentInstance>- Parameters:
instance- the instance to destroy
-
postActivate
public void postActivate(StatefulSessionComponentInstance instance)
- Specified by:
postActivatein interfacePassivationListener<StatefulSessionComponentInstance>
-
prePassivate
public void prePassivate(StatefulSessionComponentInstance instance)
- Specified by:
prePassivatein interfacePassivationListener<StatefulSessionComponentInstance>
-
getSessionIdOf
protected org.jboss.ejb.client.SessionID getSessionIdOf(org.jboss.invocation.InterceptorContext ctx)
-
getBusinessObject
public <T> T getBusinessObject(Class<T> businessInterface, org.jboss.invocation.InterceptorContext context) throws IllegalStateException
- Overrides:
getBusinessObjectin classSessionBeanComponent- Throws:
IllegalStateException
-
getEJBLocalObject
public javax.ejb.EJBLocalObject getEJBLocalObject(org.jboss.invocation.InterceptorContext ctx) throws IllegalStateException- Overrides:
getEJBLocalObjectin classSessionBeanComponent- Throws:
IllegalStateException
-
getEJBObject
public javax.ejb.EJBObject getEJBObject(org.jboss.invocation.InterceptorContext ctx) throws IllegalStateException- Overrides:
getEJBObjectin classSessionBeanComponent- Throws:
IllegalStateException
-
getTimerService
public javax.ejb.TimerService getTimerService() throws IllegalStateException- Overrides:
getTimerServicein classEJBComponent- Throws:
IllegalStateException
-
getAccessTimeout
public AccessTimeoutDetails getAccessTimeout(Method method)
Returns theAccessTimeoutapplicable to given method
-
createSession
public org.jboss.ejb.client.SessionID createSession()
-
createSessionRemote
public org.jboss.ejb.client.SessionID createSessionRemote()
creates a session using the global request controller. This should only be used by callers that service remote requests (i.e. places that represent a remote entry point into the container)- Returns:
- The session id
-
getCache
public Cache<org.jboss.ejb.client.SessionID,StatefulSessionComponentInstance> getCache()
-
instantiateComponentInstance
protected BasicComponentInstance instantiateComponentInstance(org.jboss.invocation.Interceptor preDestroyInterceptor, Map<Method,org.jboss.invocation.Interceptor> methodInterceptors, Map<Object,Object> context)
- Overrides:
instantiateComponentInstancein classBasicComponent
-
removeSession
public void removeSession(org.jboss.ejb.client.SessionID sessionId)
Removes the session associated with thesessionId.- Parameters:
sessionId- The session id
-
getAfterBegin
public org.jboss.invocation.Interceptor getAfterBegin()
-
getAfterCompletion
public org.jboss.invocation.Interceptor getAfterCompletion()
-
getBeforeCompletion
public org.jboss.invocation.Interceptor getBeforeCompletion()
-
getAfterBeginMethod
public Method getAfterBeginMethod()
-
getAfterCompletionMethod
public Method getAfterCompletionMethod()
-
getBeforeCompletionMethod
public Method getBeforeCompletionMethod()
-
getPrePassivate
public org.jboss.invocation.Interceptor getPrePassivate()
-
getPostActivate
public org.jboss.invocation.Interceptor getPostActivate()
-
getEjb2XRemoveMethod
public org.jboss.invocation.Interceptor getEjb2XRemoveMethod()
-
init
public void init()
- Overrides:
initin classEJBComponent
-
createInterceptors
protected void createInterceptors(org.jboss.invocation.InterceptorFactoryContext context)
- Overrides:
createInterceptorsin classBasicComponent
-
done
public void done()
- Specified by:
donein interfaceorg.jboss.as.server.suspend.ServerActivityCallback- Overrides:
donein classEJBComponent
-
getAllowedMethodsInformation
public AllowedMethodsInformation getAllowedMethodsInformation()
- Overrides:
getAllowedMethodsInformationin classEJBComponent
-
isRemotable
public boolean isRemotable(Throwable throwable)
- Specified by:
isRemotablein interfaceComponent
-
-