org.mockejb
Class SessionBeanDescriptor

java.lang.Object
  extended byorg.mockejb.BasicEjbDescriptor
      extended byorg.mockejb.SessionBeanDescriptor
All Implemented Interfaces:
java.io.Serializable

public class SessionBeanDescriptor
extends BasicEjbDescriptor

Provides Session bean-specific information required by MockContainer to deploy session EJB. The only piece if session-bean specific data is isStateful flag.

Author:
Alexander Ananiev
See Also:
Serialized Form

Constructor Summary
SessionBeanDescriptor(java.lang.String jndiName, java.lang.Class homeClass, java.lang.Class ifaceClass, java.lang.Class beanClass)
          Creates a new instance of the descriptor.
SessionBeanDescriptor(java.lang.String jndiName, java.lang.Class homeClass, java.lang.Class ifaceClass, java.lang.Object bean)
          Creates a new instance of the descriptor.
 
Method Summary
 boolean isStateful()
          Returns true if this bean is the stateful bean.
 void setStateful(boolean isStateful)
           
 
Methods inherited from class org.mockejb.BasicEjbDescriptor
getBean, getBeanClass, getHomeClass, getIfaceClass, getJndiName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionBeanDescriptor

public SessionBeanDescriptor(java.lang.String jndiName,
                             java.lang.Class homeClass,
                             java.lang.Class ifaceClass,
                             java.lang.Class beanClass)
Creates a new instance of the descriptor.

Parameters:
jndiName - jndiName to bind Home to. Note that MockEjb does not support bean-scoped context, so this name must be unique.
homeClass - class of the home interface
ifaceClass - class of the business interface, remote or local
beanClass - class of the implementation class

SessionBeanDescriptor

public SessionBeanDescriptor(java.lang.String jndiName,
                             java.lang.Class homeClass,
                             java.lang.Class ifaceClass,
                             java.lang.Object bean)
Creates a new instance of the descriptor.

Parameters:
jndiName - jndiName to bind Home to. Note that MockEjb does not support bean-scoped context, so this name must be unique.
homeClass - class of the home interface
ifaceClass - class of the business interface, remote or local
bean - instance of a bean implementation class.
Method Detail

setStateful

public void setStateful(boolean isStateful)

isStateful

public boolean isStateful()
Returns true if this bean is the stateful bean. Note that MockEJB treats stateless and stateful session beans exactly the same way since there is no pooling involved. This setting is only used by EJBMetaData in case if the client calls isStateless method.

Returns:
true if the bean is the stateful bean.