org.apache.openejb
Class BeanContext
java.lang.Object
org.apache.openejb.DeploymentContext
org.apache.openejb.BeanContext
public class BeanContext
- extends DeploymentContext
|
Constructor Summary |
BeanContext(String id,
Context jndiContext,
ModuleContext moduleContext,
Class beanClass,
Class homeInterface,
Class remoteInterface,
Class localHomeInterface,
Class localInterface,
Class proxy,
Class serviceEndpointInterface,
List<Class> businessLocals,
List<Class> businessRemotes,
Class pkClass,
BeanType componentType,
boolean localBean)
|
BeanContext(String id,
Context jndiContext,
ModuleContext moduleContext,
Class beanClass,
Class mdbInterface,
Map<String,String> activationProperties)
|
|
Method Summary |
void |
addApplicationException(Class exception,
boolean rollback,
boolean inherited)
|
void |
addCdiMethodInterceptor(Method method,
InterceptorData interceptor)
|
void |
addFirstSystemInterceptor(Object interceptor)
|
void |
addSystemInterceptor(Object interceptor)
|
void |
addUserInterceptor(Object interceptor)
|
void |
createAsynchronousMethodSet()
|
void |
createMethodMap()
|
String |
getAbstractSchemaName()
|
Duration |
getAccessTimeout()
|
Duration |
getAccessTimeout(Method beanMethod)
|
Map<String,String> |
getActivationProperties()
|
Set<Class<?>> |
getAsynchronousClasses()
|
Set<String> |
getAsynchronousMethodSignatures()
|
protected
|
getBean(Class<X> clazz,
javax.enterprise.inject.spi.Bean<?> bean)
|
Class |
getBeanClass()
|
BeanContext.BusinessLocalBeanHome |
getBusinessLocalBeanHome()
|
Class |
getBusinessLocalBeanInterface()
|
BeanContext.BusinessLocalHome |
getBusinessLocalHome()
|
BeanContext.BusinessLocalHome |
getBusinessLocalHome(Class mainInterface)
|
BeanContext.BusinessLocalHome |
getBusinessLocalHome(List<Class> interfaces,
Class mainInterface)
|
Class |
getBusinessLocalInterface()
|
List<Class> |
getBusinessLocalInterfaces()
|
BeanContext.BusinessRemoteHome |
getBusinessRemoteHome()
|
BeanContext.BusinessRemoteHome |
getBusinessRemoteHome(Class mainInterface)
|
BeanContext.BusinessRemoteHome |
getBusinessRemoteHome(List<Class> interfaces,
Class mainInterface)
|
Class |
getBusinessRemoteInterface()
|
List<Class> |
getBusinessRemoteInterfaces()
|
List<InterceptorData> |
getCallbackInterceptors()
|
List<InterceptorData> |
getCdiInterceptors()
|
ClassLoader |
getClassLoader()
|
Class |
getCmpImplClass()
|
BeanType |
getComponentType()
|
javax.ejb.LockType |
getConcurrencyAttribute(Method beanMethod)
|
Container |
getContainer()
|
Object |
getContainerData()
|
Method |
getCreateMethod()
|
Set<String> |
getDependsOn()
|
Object |
getDeploymentID()
|
String |
getDestinationId()
|
javax.ejb.EJBHome |
getEJBHome()
|
javax.ejb.EJBLocalHome |
getEJBLocalHome()
|
String |
getEjbName()
|
Method |
getEjbTimeout()
|
EjbTimerService |
getEjbTimerService()
|
ExceptionType |
getExceptionType(Throwable e)
|
Index<javax.persistence.EntityManagerFactory,Map> |
getExtendedEntityManagerFactories()
|
Class |
getHomeInterface()
|
List<Injection> |
getInjections()
|
Set<InterceptorData> |
getInstanceScopedInterceptors()
When an instance of an EJB is instantiated, everything in this list
is also instatiated and tied to the bean instance. |
List<InterceptorData> |
getInterceptorData()
|
Class |
getInterface(InterfaceType interfaceType)
|
List<Class> |
getInterfaces(InterfaceType interfaceType)
|
InterfaceType |
getInterfaceType(Class clazz)
|
Context |
getJndiContext()
|
Context |
getJndiEnc()
|
KeyGenerator |
getKeyGenerator()
|
Class |
getLocalHomeInterface()
|
Class |
getLocalInterface()
|
javax.ejb.LockType |
getLockType()
|
Class<Object> |
getManagedClass()
|
Method |
getMatchingBeanMethod(Method interfaceMethod)
|
Method |
getMatchingPostCreateMethod(Method createMethod)
|
Class |
getMdbInterface()
|
MethodContext |
getMethodContext(Method method)
|
List<InterceptorData> |
getMethodInterceptors(Method method)
|
ModuleContext |
getModuleContext()
|
String |
getModuleID()
|
String |
getModuleName()
|
List<Class> |
getObjectInterface(Class homeInterface)
|
Class |
getPrimaryKeyClass()
|
String |
getPrimaryKeyField()
|
Class<?> |
getProxyClass()
|
Class |
getRemoteInterface()
|
List<Method> |
getRemoveMethods()
|
String |
getRunAs()
|
Class |
getServiceEndpointInterface()
|
Duration |
getStatefulTimeout()
|
TransactionPolicyFactory |
getTransactionPolicyFactory()
|
TransactionType |
getTransactionType()
|
TransactionType |
getTransactionType(Method method)
|
TransactionType |
getTransactionType(Method method,
InterfaceType interfaceType)
|
List<InterceptorInstance> |
getUserAndSystemInterceptors()
|
void |
initIsPassivationScope()
|
|
inject(T instance,
javax.enterprise.context.spi.CreationalContext<T> ctx)
|
boolean |
isAsynchronous(Method method)
|
boolean |
isBeanManagedConcurrency()
|
boolean |
isBeanManagedTransaction()
|
boolean |
isCmp2()
|
boolean |
isDestroyed()
|
boolean |
isDynamicallyImplemented()
|
boolean |
isHidden()
|
boolean |
isLoadOnStartup()
|
boolean |
isLocalbean()
|
boolean |
isPassivatingScope()
|
boolean |
isReentrant()
|
boolean |
isRemoteQueryResults(String methodSignature)
|
boolean |
isSessionSynchronized()
|
Iterator<Map.Entry<Method,MethodContext>> |
iteratorMethodContext()
|
void |
mapMethods(Method interfaceMethod,
Method beanMethod)
|
InstanceContext |
newInstance()
|
boolean |
retainIfExeption(Method removeMethod)
TODO: Move to MethodContext |
void |
setAbstractSchemaName(String abstractSchemaName)
|
void |
setAccessTimeout(Duration accessTimeout)
|
void |
setBeanManagedConcurrency(boolean beanManagedConcurrency)
|
void |
setBeanManagedTransaction(boolean value)
|
void |
setCallbackInterceptors(List<InterceptorData> callbackInterceptors)
|
void |
setCdiInterceptors(List<InterceptorData> cdiInterceptors)
|
void |
setCmp2(boolean cmp2)
|
void |
setCmpImplClass(Class cmpImplClass)
|
void |
setContainer(Container container)
|
void |
setContainerData(Object containerData)
|
void |
setDestinationId(String destinationId)
|
void |
setDestroyed(boolean destroyed)
|
void |
setEjbName(String ejbName)
|
void |
setEjbTimeout(Method ejbTimeout)
|
void |
setEjbTimerService(EjbTimerService ejbTimerService)
|
void |
setExtendedEntityManagerFactories(Index<javax.persistence.EntityManagerFactory,Map> extendedEntityManagerFactories)
|
void |
setHidden(boolean hidden)
|
void |
setIsReentrant(boolean reentrant)
|
void |
setKeyGenerator(KeyGenerator keyGenerator)
|
void |
setLoadOnStartup(boolean loadOnStartup)
|
void |
setMethodConcurrencyAttribute(Method method,
javax.ejb.LockType concurrencyAttribute)
|
void |
setMethodInterceptors(Method method,
List<InterceptorData> interceptors)
|
void |
setMethodTransactionAttribute(Method method,
TransactionType transactionType)
TODO: Move to MethodContext |
void |
setMethodTransactionAttribute(Method method,
TransactionType transactionType,
String view)
TODO: Move to MethodContext |
void |
setPrimaryKeyField(String primaryKeyField)
|
void |
setRemoteQueryResults(String methodSignature)
|
void |
setRetainIfExeption(Method removeMethod,
boolean retain)
TODO: Move to MethodContext |
void |
setRunAs(String runAs)
|
void |
setStatefulTimeout(Duration statefulTimeout)
|
void |
setTransactionPolicyFactory(TransactionPolicyFactory transactionPolicyFactory)
|
void |
stop()
|
String |
toString()
|
USER_INTERCEPTOR_KEY
public static final String USER_INTERCEPTOR_KEY
- See Also:
- Constant Field Values
USER_INTERCEPTOR_SEPARATOR
public static final String USER_INTERCEPTOR_SEPARATOR
- See Also:
- Constant Field Values
BeanContext
public BeanContext(String id,
Context jndiContext,
ModuleContext moduleContext,
Class beanClass,
Class homeInterface,
Class remoteInterface,
Class localHomeInterface,
Class localInterface,
Class proxy,
Class serviceEndpointInterface,
List<Class> businessLocals,
List<Class> businessRemotes,
Class pkClass,
BeanType componentType,
boolean localBean)
throws SystemException
- Throws:
SystemException
BeanContext
public BeanContext(String id,
Context jndiContext,
ModuleContext moduleContext,
Class beanClass,
Class mdbInterface,
Map<String,String> activationProperties)
throws SystemException
- Throws:
SystemException
isDynamicallyImplemented
public boolean isDynamicallyImplemented()
getInterface
public Class getInterface(InterfaceType interfaceType)
getInterfaces
public List<Class> getInterfaces(InterfaceType interfaceType)
getInterfaceType
public InterfaceType getInterfaceType(Class clazz)
addApplicationException
public void addApplicationException(Class exception,
boolean rollback,
boolean inherited)
getExceptionType
public ExceptionType getExceptionType(Throwable e)
getContainerData
public Object getContainerData()
setContainerData
public void setContainerData(Object containerData)
getClassLoader
public ClassLoader getClassLoader()
getJndiContext
public Context getJndiContext()
getModuleContext
public ModuleContext getModuleContext()
isDestroyed
public boolean isDestroyed()
setDestroyed
public void setDestroyed(boolean destroyed)
getInjections
public List<Injection> getInjections()
getExtendedEntityManagerFactories
public Index<javax.persistence.EntityManagerFactory,Map> getExtendedEntityManagerFactories()
setExtendedEntityManagerFactories
public void setExtendedEntityManagerFactories(Index<javax.persistence.EntityManagerFactory,Map> extendedEntityManagerFactories)
setContainer
public void setContainer(Container container)
getComponentType
public BeanType getComponentType()
getConcurrencyAttribute
public javax.ejb.LockType getConcurrencyAttribute(Method beanMethod)
getLockType
public javax.ejb.LockType getLockType()
getTransactionType
public TransactionType getTransactionType(Method method)
getTransactionType
public TransactionType getTransactionType(Method method,
InterfaceType interfaceType)
getTransactionType
public TransactionType getTransactionType()
getTransactionPolicyFactory
public TransactionPolicyFactory getTransactionPolicyFactory()
setTransactionPolicyFactory
public void setTransactionPolicyFactory(TransactionPolicyFactory transactionPolicyFactory)
getContainer
public Container getContainer()
getDeploymentID
public Object getDeploymentID()
isBeanManagedTransaction
public boolean isBeanManagedTransaction()
isBeanManagedConcurrency
public boolean isBeanManagedConcurrency()
getHomeInterface
public Class getHomeInterface()
getRemoteInterface
public Class getRemoteInterface()
getLocalHomeInterface
public Class getLocalHomeInterface()
getLocalInterface
public Class getLocalInterface()
getBeanClass
public Class getBeanClass()
getBusinessLocalInterface
public Class getBusinessLocalInterface()
getBusinessRemoteInterface
public Class getBusinessRemoteInterface()
getBusinessLocalInterfaces
public List<Class> getBusinessLocalInterfaces()
getBusinessRemoteInterfaces
public List<Class> getBusinessRemoteInterfaces()
getMdbInterface
public Class getMdbInterface()
getServiceEndpointInterface
public Class getServiceEndpointInterface()
getActivationProperties
public Map<String,String> getActivationProperties()
getPrimaryKeyClass
public Class getPrimaryKeyClass()
getEJBHome
public javax.ejb.EJBHome getEJBHome()
getEJBLocalHome
public javax.ejb.EJBLocalHome getEJBLocalHome()
getBusinessLocalHome
public BeanContext.BusinessLocalHome getBusinessLocalHome()
getBusinessLocalBeanHome
public BeanContext.BusinessLocalBeanHome getBusinessLocalBeanHome()
getBusinessLocalHome
public BeanContext.BusinessLocalHome getBusinessLocalHome(Class mainInterface)
getBusinessLocalHome
public BeanContext.BusinessLocalHome getBusinessLocalHome(List<Class> interfaces,
Class mainInterface)
getBusinessRemoteHome
public BeanContext.BusinessRemoteHome getBusinessRemoteHome()
getBusinessRemoteHome
public BeanContext.BusinessRemoteHome getBusinessRemoteHome(Class mainInterface)
getBusinessRemoteHome
public BeanContext.BusinessRemoteHome getBusinessRemoteHome(List<Class> interfaces,
Class mainInterface)
getDestinationId
public String getDestinationId()
setDestinationId
public void setDestinationId(String destinationId)
setBeanManagedTransaction
public void setBeanManagedTransaction(boolean value)
setBeanManagedConcurrency
public void setBeanManagedConcurrency(boolean beanManagedConcurrency)
getJndiEnc
public Context getJndiEnc()
isReentrant
public boolean isReentrant()
setIsReentrant
public void setIsReentrant(boolean reentrant)
getMatchingBeanMethod
public Method getMatchingBeanMethod(Method interfaceMethod)
getMethodContext
public MethodContext getMethodContext(Method method)
iteratorMethodContext
public Iterator<Map.Entry<Method,MethodContext>> iteratorMethodContext()
setMethodConcurrencyAttribute
public void setMethodConcurrencyAttribute(Method method,
javax.ejb.LockType concurrencyAttribute)
setMethodTransactionAttribute
public void setMethodTransactionAttribute(Method method,
TransactionType transactionType)
throws OpenEJBException
- TODO: Move to MethodContext
- Throws:
OpenEJBException
setMethodTransactionAttribute
public void setMethodTransactionAttribute(Method method,
TransactionType transactionType,
String view)
throws OpenEJBException
- TODO: Move to MethodContext
- Throws:
OpenEJBException
getRemoveMethods
public List<Method> getRemoveMethods()
setRetainIfExeption
public void setRetainIfExeption(Method removeMethod,
boolean retain)
- TODO: Move to MethodContext
retainIfExeption
public boolean retainIfExeption(Method removeMethod)
- TODO: Move to MethodContext
getInstanceScopedInterceptors
public Set<InterceptorData> getInstanceScopedInterceptors()
- When an instance of an EJB is instantiated, everything in this list
is also instatiated and tied to the bean instance. Per spec, interceptors
are supposed to have the same lifecycle as the bean they wrap.
OpenEJB has the concept of interceptors which do not share the same lifecycle
as the bean instance -- they may be instantiated elsewhere and simply applied
to the bean. The impact is that these interceptors must be multithreaded.
It also means we do not add these interceptors to this list and expose them
via different means.
- Returns:
- standard interceptors sharing the bean lifecycle
addSystemInterceptor
public void addSystemInterceptor(Object interceptor)
addFirstSystemInterceptor
public void addFirstSystemInterceptor(Object interceptor)
addUserInterceptor
public void addUserInterceptor(Object interceptor)
getUserAndSystemInterceptors
public List<InterceptorInstance> getUserAndSystemInterceptors()
getCallbackInterceptors
public List<InterceptorData> getCallbackInterceptors()
setCallbackInterceptors
public void setCallbackInterceptors(List<InterceptorData> callbackInterceptors)
getCdiInterceptors
public List<InterceptorData> getCdiInterceptors()
setCdiInterceptors
public void setCdiInterceptors(List<InterceptorData> cdiInterceptors)
getMethodInterceptors
public List<InterceptorData> getMethodInterceptors(Method method)
getInterceptorData
public List<InterceptorData> getInterceptorData()
addCdiMethodInterceptor
public void addCdiMethodInterceptor(Method method,
InterceptorData interceptor)
setMethodInterceptors
public void setMethodInterceptors(Method method,
List<InterceptorData> interceptors)
createMethodMap
public void createMethodMap()
throws SystemException
- Throws:
SystemException
mapMethods
public void mapMethods(Method interfaceMethod,
Method beanMethod)
getObjectInterface
public List<Class> getObjectInterface(Class homeInterface)
getCreateMethod
public Method getCreateMethod()
getMatchingPostCreateMethod
public Method getMatchingPostCreateMethod(Method createMethod)
isAsynchronous
public boolean isAsynchronous(Method method)
isCmp2
public boolean isCmp2()
setCmp2
public void setCmp2(boolean cmp2)
getPrimaryKeyField
public String getPrimaryKeyField()
setPrimaryKeyField
public void setPrimaryKeyField(String primaryKeyField)
getKeyGenerator
public KeyGenerator getKeyGenerator()
setKeyGenerator
public void setKeyGenerator(KeyGenerator keyGenerator)
setRemoteQueryResults
public void setRemoteQueryResults(String methodSignature)
isRemoteQueryResults
public boolean isRemoteQueryResults(String methodSignature)
getCmpImplClass
public Class getCmpImplClass()
setCmpImplClass
public void setCmpImplClass(Class cmpImplClass)
getAbstractSchemaName
public String getAbstractSchemaName()
setAbstractSchemaName
public void setAbstractSchemaName(String abstractSchemaName)
getEjbTimeout
public Method getEjbTimeout()
setEjbTimeout
public void setEjbTimeout(Method ejbTimeout)
getEjbTimerService
public EjbTimerService getEjbTimerService()
setEjbTimerService
public void setEjbTimerService(EjbTimerService ejbTimerService)
getEjbName
public String getEjbName()
getModuleID
public String getModuleID()
getModuleName
public String getModuleName()
getRunAs
public String getRunAs()
setEjbName
public void setEjbName(String ejbName)
setRunAs
public void setRunAs(String runAs)
toString
public String toString()
- Overrides:
toString in class Object
isLoadOnStartup
public boolean isLoadOnStartup()
setLoadOnStartup
public void setLoadOnStartup(boolean loadOnStartup)
getDependsOn
public Set<String> getDependsOn()
isSessionSynchronized
public boolean isSessionSynchronized()
isLocalbean
public boolean isLocalbean()
getBusinessLocalBeanInterface
public Class getBusinessLocalBeanInterface()
getAccessTimeout
public Duration getAccessTimeout(Method beanMethod)
getAccessTimeout
public Duration getAccessTimeout()
setAccessTimeout
public void setAccessTimeout(Duration accessTimeout)
getStatefulTimeout
public Duration getStatefulTimeout()
setStatefulTimeout
public void setStatefulTimeout(Duration statefulTimeout)
getManagedClass
public Class<Object> getManagedClass()
newInstance
public InstanceContext newInstance()
throws Exception
- Throws:
Exception
getBean
protected <X> X getBean(Class<X> clazz,
javax.enterprise.inject.spi.Bean<?> bean)
inject
public <T> void inject(T instance,
javax.enterprise.context.spi.CreationalContext<T> ctx)
getAsynchronousClasses
public Set<Class<?>> getAsynchronousClasses()
getAsynchronousMethodSignatures
public Set<String> getAsynchronousMethodSignatures()
createAsynchronousMethodSet
public void createAsynchronousMethodSet()
getProxyClass
public Class<?> getProxyClass()
isHidden
public boolean isHidden()
setHidden
public void setHidden(boolean hidden)
initIsPassivationScope
public void initIsPassivationScope()
isPassivatingScope
public boolean isPassivatingScope()
stop
public void stop()
Copyright © 1999-2012 The Apache Software Foundation. All Rights Reserved.