01: package org.mockejb;
02:
03: /**
04: * Provides Session bean-specific information required by MockContainer
05: * to deploy session EJB.
06: * The only piece if session-bean specific data is <code>isStateful</code> flag.
07: *
08: * @author Alexander Ananiev
09: */
10: public class SessionBeanDescriptor extends BasicEjbDescriptor {
11:
12: private boolean isStateful = false;
13:
14: /**
15: * Creates a new instance of the descriptor.
16: * @param jndiName jndiName to bind Home to. Note that MockEjb does not support
17: * bean-scoped context, so this name must be unique.
18: * @param homeClass class of the home interface
19: * @param ifaceClass class of the business interface, remote or local
20: * @param beanClass class of the implementation class
21: */
22: // TODO: Deprecate?
23: public SessionBeanDescriptor(String jndiName, Class homeClass,
24: Class ifaceClass, Class beanClass) {
25:
26: super (jndiName, homeClass, ifaceClass, beanClass);
27: }
28:
29: /**
30: * Creates a new instance of the descriptor.
31: * @param jndiName jndiName to bind Home to. Note that MockEjb does not support
32: * bean-scoped context, so this name must be unique.
33: * @param homeClass class of the home interface
34: * @param ifaceClass class of the business interface, remote or local
35: * @param bean instance of a bean implementation class.
36: */
37: public SessionBeanDescriptor(String jndiName, Class homeClass,
38: Class ifaceClass, Object bean) {
39: super (jndiName, homeClass, ifaceClass, bean);
40: }
41:
42: public void setStateful(boolean isStateful) {
43: this .isStateful = isStateful;
44: }
45:
46: /**
47: * Returns true if this bean is the stateful bean. Note that MockEJB treats
48: * stateless and stateful session beans exactly the same way since there is no
49: * pooling involved.
50: * This setting is only used by EJBMetaData in case if the client calls
51: * isStateless method.
52: * @return true if the bean is the stateful bean.
53: */
54: public boolean isStateful() {
55: return isStateful;
56: }
57:
58: }
|