org.apache.openejb.jee
Class SessionBean
java.lang.Object
org.apache.openejb.jee.SessionBean
- All Implemented Interfaces:
- EnterpriseBean, JndiConsumer, Lifecycle, RemoteBean, Session, TimerConsumer
- Direct Known Subclasses:
- ManagedBean, SingletonBean, StatefulBean, StatelessBean
public class SessionBean
- extends java.lang.Object
- implements RemoteBean, Session, TimerConsumer
The session-beanType declares an session bean. The
declaration consists of:
- an optional description
- an optional display name
- an optional icon element that contains a small and a large
icon file name
- a name assigned to the enterprise bean
in the deployment description
- an optional mapped-name element that can be used to provide
vendor-specific deployment information such as the physical
jndi-name of the session bean's remote home/business interface.
This element is not required to be supported by all
implementations. Any use of this element is non-portable.
- the names of all the remote or local business interfaces,
if any
- the names of the session bean's remote home and
remote interfaces, if any
- the names of the session bean's local home and
local interfaces, if any
- the name of the session bean's web service endpoint
interface, if any
- the session bean's implementation class
- the session bean's state management type
- an optional declaration of the session bean's timeout method.
- the optional session bean's transaction management type.
If it is not present, it is defaulted to Container.
- an optional list of the session bean class and/or
superclass around-invoke methods.
- an optional declaration of the bean's
environment entries
- an optional declaration of the bean's EJB references
- an optional declaration of the bean's local
EJB references
- an optional declaration of the bean's web
service references
- an optional declaration of the security role
references
- an optional declaration of the security identity
to be used for the execution of the bean's methods
- an optional declaration of the bean's resource
manager connection factory references
- an optional declaration of the bean's resource
environment references.
- an optional declaration of the bean's message
destination references
The elements that are optional are "optional" in the sense
that they are omitted when if lists represented by them are
empty.
Either both the local-home and the local elements or both
the home and the remote elements must be specified for the
session bean.
The service-endpoint element may only be specified if the
bean is a stateless session bean.
Method Summary |
void |
addAroundInvoke(java.lang.String method)
|
void |
addBusinessLocal(java.lang.Class businessLocal)
|
void |
addBusinessLocal(java.lang.String businessLocal)
|
void |
addBusinessRemote(java.lang.Class businessRemote)
|
void |
addBusinessRemote(java.lang.String businessRemote)
|
void |
addPostActivate(java.lang.String method)
|
void |
addPostConstruct(java.lang.String method)
|
void |
addPreDestroy(java.lang.String method)
|
void |
addPrePassivate(java.lang.String method)
|
java.util.List<AroundInvoke> |
getAroundInvoke()
|
java.util.Collection<java.lang.String> |
getBusinessLocal()
|
java.util.Collection<java.lang.String> |
getBusinessRemote()
|
ConcurrencyType |
getConcurrencyType()
|
java.util.List<java.lang.String> |
getDependsOn()
|
java.lang.String |
getDescription()
|
Text[] |
getDescriptions()
|
java.lang.String |
getDisplayName()
|
Text[] |
getDisplayNames()
|
java.lang.String |
getEjbClass()
|
java.util.Collection<EjbLocalRef> |
getEjbLocalRef()
|
java.util.Map<java.lang.String,EjbLocalRef> |
getEjbLocalRefMap()
|
java.lang.String |
getEjbName()
|
java.util.Collection<EjbRef> |
getEjbRef()
|
java.util.Map<java.lang.String,EjbRef> |
getEjbRefMap()
|
java.util.Collection<EnvEntry> |
getEnvEntry()
|
java.util.Map<java.lang.String,EnvEntry> |
getEnvEntryMap()
|
java.lang.String |
getHome()
|
Icon |
getIcon()
|
java.util.Map<java.lang.String,Icon> |
getIconMap()
|
java.util.Collection<Icon> |
getIcons()
|
java.lang.String |
getId()
|
java.util.List<InitMethod> |
getInitMethod()
|
java.lang.String |
getJndiConsumerName()
|
boolean |
getLoadOnStartup()
|
java.lang.String |
getLocal()
|
EmptyType |
getLocalBean()
|
java.lang.String |
getLocalHome()
|
java.lang.String |
getMappedName()
|
java.util.Collection<MessageDestinationRef> |
getMessageDestinationRef()
|
java.util.Map<java.lang.String,MessageDestinationRef> |
getMessageDestinationRefMap()
|
java.util.Collection<PersistenceContextRef> |
getPersistenceContextRef()
|
java.util.Map<java.lang.String,PersistenceContextRef> |
getPersistenceContextRefMap()
|
java.util.Collection<PersistenceUnitRef> |
getPersistenceUnitRef()
|
java.util.Map<java.lang.String,PersistenceUnitRef> |
getPersistenceUnitRefMap()
|
java.util.List<LifecycleCallback> |
getPostActivate()
|
java.util.List<LifecycleCallback> |
getPostConstruct()
|
java.util.List<LifecycleCallback> |
getPreDestroy()
|
java.util.List<LifecycleCallback> |
getPrePassivate()
|
java.lang.String |
getRemote()
|
java.util.List<RemoveMethod> |
getRemoveMethod()
|
java.util.Collection<ResourceEnvRef> |
getResourceEnvRef()
|
java.util.Map<java.lang.String,ResourceEnvRef> |
getResourceEnvRefMap()
|
java.util.Collection<ResourceRef> |
getResourceRef()
|
java.util.Map<java.lang.String,ResourceRef> |
getResourceRefMap()
|
SecurityIdentity |
getSecurityIdentity()
|
java.util.List<SecurityRoleRef> |
getSecurityRoleRef()
|
java.lang.String |
getServiceEndpoint()
|
java.util.Collection<ServiceRef> |
getServiceRef()
|
java.util.Map<java.lang.String,ServiceRef> |
getServiceRefMap()
|
SessionType |
getSessionType()
|
NamedMethod |
getTimeoutMethod()
|
TransactionType |
getTransactionType()
|
boolean |
hasLoadOnStartup()
|
void |
setConcurrencyType(ConcurrencyType value)
|
void |
setDependsOn(java.util.List<java.lang.String> ejbNames)
|
void |
setDependsOn(java.lang.String... ejbNames)
|
void |
setDescriptions(Text[] text)
|
void |
setDisplayNames(Text[] text)
|
void |
setEjbClass(java.lang.Class value)
|
void |
setEjbClass(java.lang.String value)
|
void |
setEjbName(java.lang.String value)
The ejb-nameType specifies an enterprise bean's name. |
void |
setHome(java.lang.String value)
|
void |
setHomeAndLocal(java.lang.Class<?> localHome,
java.lang.Class<?> local)
|
void |
setHomeAndLocal(java.lang.String localHome,
java.lang.String local)
|
void |
setHomeAndRemote(java.lang.Class<?> home,
java.lang.Class<?> remote)
|
void |
setHomeAndRemote(java.lang.String home,
java.lang.String remote)
|
void |
setId(java.lang.String value)
|
void |
setLoadOnStartup(boolean loadOnStartup)
|
void |
setLocal(java.lang.String value)
|
void |
setLocalBean(EmptyType localBean)
|
void |
setLocalHome(java.lang.String value)
|
void |
setMappedName(java.lang.String value)
|
void |
setRemote(java.lang.String value)
|
void |
setSecurityIdentity(SecurityIdentity value)
|
void |
setServiceEndpoint(java.lang.String value)
|
void |
setSessionType(SessionType value)
|
void |
setTimeoutMethod(NamedMethod value)
|
void |
setTransactionType(TransactionType value)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
description
protected TextMap description
displayName
protected TextMap displayName
icon
protected LocalCollection<Icon> icon
ejbName
protected java.lang.String ejbName
mappedName
protected java.lang.String mappedName
home
protected java.lang.String home
remote
protected java.lang.String remote
localHome
protected java.lang.String localHome
local
protected java.lang.String local
businessLocal
protected java.util.LinkedHashSet<java.lang.String> businessLocal
businessRemote
protected java.util.LinkedHashSet<java.lang.String> businessRemote
localBean
protected EmptyType localBean
serviceEndpoint
protected java.lang.String serviceEndpoint
ejbClass
protected java.lang.String ejbClass
sessionType
protected SessionType sessionType
timeoutMethod
protected NamedMethod timeoutMethod
initMethod
protected java.util.List<InitMethod> initMethod
removeMethod
protected java.util.List<RemoveMethod> removeMethod
transactionType
protected TransactionType transactionType
concurrencyType
protected ConcurrencyType concurrencyType
aroundInvoke
protected java.util.List<AroundInvoke> aroundInvoke
envEntry
protected KeyedCollection<java.lang.String,EnvEntry> envEntry
ejbRef
protected KeyedCollection<java.lang.String,EjbRef> ejbRef
ejbLocalRef
protected KeyedCollection<java.lang.String,EjbLocalRef> ejbLocalRef
serviceRef
protected KeyedCollection<java.lang.String,ServiceRef> serviceRef
resourceRef
protected KeyedCollection<java.lang.String,ResourceRef> resourceRef
resourceEnvRef
protected KeyedCollection<java.lang.String,ResourceEnvRef> resourceEnvRef
messageDestinationRef
protected KeyedCollection<java.lang.String,MessageDestinationRef> messageDestinationRef
persistenceContextRef
protected KeyedCollection<java.lang.String,PersistenceContextRef> persistenceContextRef
persistenceUnitRef
protected KeyedCollection<java.lang.String,PersistenceUnitRef> persistenceUnitRef
postConstruct
protected java.util.List<LifecycleCallback> postConstruct
preDestroy
protected java.util.List<LifecycleCallback> preDestroy
postActivate
protected java.util.List<LifecycleCallback> postActivate
prePassivate
protected java.util.List<LifecycleCallback> prePassivate
securityRoleRef
protected java.util.List<SecurityRoleRef> securityRoleRef
securityIdentity
protected SecurityIdentity securityIdentity
loadOnStartup
protected java.lang.Boolean loadOnStartup
dependsOn
protected java.util.List<java.lang.String> dependsOn
id
protected java.lang.String id
SessionBean
public SessionBean()
SessionBean
public SessionBean(java.lang.String ejbName,
java.lang.String ejbClass,
SessionType sessionType)
getJndiConsumerName
public java.lang.String getJndiConsumerName()
- Specified by:
getJndiConsumerName
in interface JndiConsumer
getDescriptions
public Text[] getDescriptions()
setDescriptions
public void setDescriptions(Text[] text)
getDescription
public java.lang.String getDescription()
getDisplayNames
public Text[] getDisplayNames()
setDisplayNames
public void setDisplayNames(Text[] text)
getDisplayName
public java.lang.String getDisplayName()
getIcons
public java.util.Collection<Icon> getIcons()
getIconMap
public java.util.Map<java.lang.String,Icon> getIconMap()
getIcon
public Icon getIcon()
getEjbName
public java.lang.String getEjbName()
- Specified by:
getEjbName
in interface EnterpriseBean
setEjbName
public void setEjbName(java.lang.String value)
- The ejb-nameType specifies an enterprise bean's name. It is
used by ejb-name elements. This name is assigned by the
ejb-jar file producer to name the enterprise bean in the
ejb-jar file's deployment descriptor. The name must be
unique among the names of the enterprise beans in the same
ejb-jar file.
There is no architected relationship between the used
ejb-name in the deployment descriptor and the JNDI name that
the Deployer will assign to the enterprise bean's home.
The name for an entity bean must conform to the lexical
rules for an NMTOKEN.
Example:
EmployeeService
- Specified by:
setEjbName
in interface EnterpriseBean
getMappedName
public java.lang.String getMappedName()
- Specified by:
getMappedName
in interface EnterpriseBean
setMappedName
public void setMappedName(java.lang.String value)
- Specified by:
setMappedName
in interface EnterpriseBean
getHome
public java.lang.String getHome()
- Specified by:
getHome
in interface RemoteBean
setHome
public void setHome(java.lang.String value)
- Specified by:
setHome
in interface RemoteBean
getRemote
public java.lang.String getRemote()
- Specified by:
getRemote
in interface RemoteBean
setRemote
public void setRemote(java.lang.String value)
- Specified by:
setRemote
in interface RemoteBean
setHomeAndRemote
public void setHomeAndRemote(java.lang.String home,
java.lang.String remote)
setHomeAndRemote
public void setHomeAndRemote(java.lang.Class<?> home,
java.lang.Class<?> remote)
setHomeAndLocal
public void setHomeAndLocal(java.lang.String localHome,
java.lang.String local)
setHomeAndLocal
public void setHomeAndLocal(java.lang.Class<?> localHome,
java.lang.Class<?> local)
getLocalHome
public java.lang.String getLocalHome()
- Specified by:
getLocalHome
in interface RemoteBean
setLocalHome
public void setLocalHome(java.lang.String value)
- Specified by:
setLocalHome
in interface RemoteBean
getLocal
public java.lang.String getLocal()
- Specified by:
getLocal
in interface RemoteBean
setLocal
public void setLocal(java.lang.String value)
- Specified by:
setLocal
in interface RemoteBean
getBusinessLocal
public java.util.Collection<java.lang.String> getBusinessLocal()
- Specified by:
getBusinessLocal
in interface RemoteBean
addBusinessLocal
public void addBusinessLocal(java.lang.String businessLocal)
addBusinessLocal
public void addBusinessLocal(java.lang.Class businessLocal)
getBusinessRemote
public java.util.Collection<java.lang.String> getBusinessRemote()
- Specified by:
getBusinessRemote
in interface RemoteBean
addBusinessRemote
public void addBusinessRemote(java.lang.String businessRemote)
addBusinessRemote
public void addBusinessRemote(java.lang.Class businessRemote)
getLocalBean
public EmptyType getLocalBean()
setLocalBean
public void setLocalBean(EmptyType localBean)
getServiceEndpoint
public java.lang.String getServiceEndpoint()
setServiceEndpoint
public void setServiceEndpoint(java.lang.String value)
getEjbClass
public java.lang.String getEjbClass()
- Specified by:
getEjbClass
in interface EnterpriseBean
setEjbClass
public void setEjbClass(java.lang.String value)
- Specified by:
setEjbClass
in interface EnterpriseBean
setEjbClass
public void setEjbClass(java.lang.Class value)
- Specified by:
setEjbClass
in interface EnterpriseBean
getSessionType
public SessionType getSessionType()
setSessionType
public void setSessionType(SessionType value)
getTimeoutMethod
public NamedMethod getTimeoutMethod()
- Specified by:
getTimeoutMethod
in interface TimerConsumer
setTimeoutMethod
public void setTimeoutMethod(NamedMethod value)
- Specified by:
setTimeoutMethod
in interface TimerConsumer
getInitMethod
public java.util.List<InitMethod> getInitMethod()
- Specified by:
getInitMethod
in interface Session
getRemoveMethod
public java.util.List<RemoveMethod> getRemoveMethod()
- Specified by:
getRemoveMethod
in interface Session
getTransactionType
public TransactionType getTransactionType()
- Specified by:
getTransactionType
in interface EnterpriseBean
getConcurrencyType
public ConcurrencyType getConcurrencyType()
setTransactionType
public void setTransactionType(TransactionType value)
- Specified by:
setTransactionType
in interface EnterpriseBean
setConcurrencyType
public void setConcurrencyType(ConcurrencyType value)
getAroundInvoke
public java.util.List<AroundInvoke> getAroundInvoke()
- Specified by:
getAroundInvoke
in interface Lifecycle
addAroundInvoke
public void addAroundInvoke(java.lang.String method)
- Specified by:
addAroundInvoke
in interface Lifecycle
getEnvEntry
public java.util.Collection<EnvEntry> getEnvEntry()
- Specified by:
getEnvEntry
in interface JndiConsumer
getEnvEntryMap
public java.util.Map<java.lang.String,EnvEntry> getEnvEntryMap()
- Specified by:
getEnvEntryMap
in interface JndiConsumer
getEjbRef
public java.util.Collection<EjbRef> getEjbRef()
- Specified by:
getEjbRef
in interface JndiConsumer
getEjbRefMap
public java.util.Map<java.lang.String,EjbRef> getEjbRefMap()
- Specified by:
getEjbRefMap
in interface JndiConsumer
getEjbLocalRef
public java.util.Collection<EjbLocalRef> getEjbLocalRef()
- Specified by:
getEjbLocalRef
in interface JndiConsumer
getEjbLocalRefMap
public java.util.Map<java.lang.String,EjbLocalRef> getEjbLocalRefMap()
- Specified by:
getEjbLocalRefMap
in interface JndiConsumer
getServiceRef
public java.util.Collection<ServiceRef> getServiceRef()
- Specified by:
getServiceRef
in interface JndiConsumer
getServiceRefMap
public java.util.Map<java.lang.String,ServiceRef> getServiceRefMap()
- Specified by:
getServiceRefMap
in interface JndiConsumer
getResourceRef
public java.util.Collection<ResourceRef> getResourceRef()
- Specified by:
getResourceRef
in interface JndiConsumer
getResourceRefMap
public java.util.Map<java.lang.String,ResourceRef> getResourceRefMap()
- Specified by:
getResourceRefMap
in interface JndiConsumer
getResourceEnvRef
public java.util.Collection<ResourceEnvRef> getResourceEnvRef()
- Specified by:
getResourceEnvRef
in interface JndiConsumer
getResourceEnvRefMap
public java.util.Map<java.lang.String,ResourceEnvRef> getResourceEnvRefMap()
- Specified by:
getResourceEnvRefMap
in interface JndiConsumer
getMessageDestinationRef
public java.util.Collection<MessageDestinationRef> getMessageDestinationRef()
- Specified by:
getMessageDestinationRef
in interface JndiConsumer
getMessageDestinationRefMap
public java.util.Map<java.lang.String,MessageDestinationRef> getMessageDestinationRefMap()
- Specified by:
getMessageDestinationRefMap
in interface JndiConsumer
getPersistenceContextRef
public java.util.Collection<PersistenceContextRef> getPersistenceContextRef()
- Specified by:
getPersistenceContextRef
in interface JndiConsumer
getPersistenceContextRefMap
public java.util.Map<java.lang.String,PersistenceContextRef> getPersistenceContextRefMap()
- Specified by:
getPersistenceContextRefMap
in interface JndiConsumer
getPersistenceUnitRef
public java.util.Collection<PersistenceUnitRef> getPersistenceUnitRef()
- Specified by:
getPersistenceUnitRef
in interface JndiConsumer
getPersistenceUnitRefMap
public java.util.Map<java.lang.String,PersistenceUnitRef> getPersistenceUnitRefMap()
- Specified by:
getPersistenceUnitRefMap
in interface JndiConsumer
getPostConstruct
public java.util.List<LifecycleCallback> getPostConstruct()
- Specified by:
getPostConstruct
in interface Lifecycle
addPostConstruct
public void addPostConstruct(java.lang.String method)
- Specified by:
addPostConstruct
in interface Lifecycle
getPreDestroy
public java.util.List<LifecycleCallback> getPreDestroy()
- Specified by:
getPreDestroy
in interface Lifecycle
addPreDestroy
public void addPreDestroy(java.lang.String method)
- Specified by:
addPreDestroy
in interface Lifecycle
getPostActivate
public java.util.List<LifecycleCallback> getPostActivate()
- Specified by:
getPostActivate
in interface Session
addPostActivate
public void addPostActivate(java.lang.String method)
- Specified by:
addPostActivate
in interface Session
getPrePassivate
public java.util.List<LifecycleCallback> getPrePassivate()
- Specified by:
getPrePassivate
in interface Session
addPrePassivate
public void addPrePassivate(java.lang.String method)
- Specified by:
addPrePassivate
in interface Session
getSecurityRoleRef
public java.util.List<SecurityRoleRef> getSecurityRoleRef()
- Specified by:
getSecurityRoleRef
in interface EnterpriseBean
getSecurityIdentity
public SecurityIdentity getSecurityIdentity()
- Specified by:
getSecurityIdentity
in interface EnterpriseBean
setSecurityIdentity
public void setSecurityIdentity(SecurityIdentity value)
- Specified by:
setSecurityIdentity
in interface EnterpriseBean
getDependsOn
public java.util.List<java.lang.String> getDependsOn()
setDependsOn
public void setDependsOn(java.lang.String... ejbNames)
setDependsOn
public void setDependsOn(java.util.List<java.lang.String> ejbNames)
hasLoadOnStartup
public boolean hasLoadOnStartup()
getLoadOnStartup
public boolean getLoadOnStartup()
setLoadOnStartup
public void setLoadOnStartup(boolean loadOnStartup)
getId
public java.lang.String getId()
- Specified by:
getId
in interface EnterpriseBean
setId
public void setId(java.lang.String value)
- Specified by:
setId
in interface EnterpriseBean
Copyright © 1999-2011 The Apache OpenEJB development community. All Rights Reserved.