com.ibm.websphere.samples.workarea.companycontextejb
Class BackendBeanImpl

java.lang.Object
  extended by com.ibm.websphere.samples.workarea.companycontextejb.BackendBeanImpl
All Implemented Interfaces:
java.io.Serializable, javax.ejb.EnterpriseBean, javax.ejb.SessionBean

public class BackendBeanImpl
extends java.lang.Object
implements javax.ejb.SessionBean

The Backend represents in the sample business function known to the Bean but not necessarily to the originating client. In this case, because the Bean is the client to the BackendBean, the SampleBean began a new nested WorkArea and overrode the client's priority. This is the intended use of WorkArea nesting. This bean makes nominal use of the WorkArea service; it reads the two keys directly (priority from the nested WorkArea, company from the original WorkArea begun from the client) without being aware of the composition of the work areas, then reads all keys to illustrate another method from the WorkArea api.

See Also:
Serialized Form

Constructor Summary
BackendBeanImpl()
           
 
Method Summary
 void ejbActivate()
          Framework methods.
 void ejbCreate()
          Framework methods.
 void ejbPassivate()
          Framework methods.
 void ejbRemove()
          Framework methods.
 javax.ejb.SessionContext getSessionContext()
          Framework methods.
 void setSessionContext(javax.ejb.SessionContext ctx)
          Framework methods.
 java.lang.String[] test()
          BackendBean's only remote method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BackendBeanImpl

public BackendBeanImpl()
Method Detail

ejbActivate

public void ejbActivate()
                 throws javax.ejb.EJBException
Framework methods. Do not use the WorkArea service in ejb framework methods!

Specified by:
ejbActivate in interface javax.ejb.SessionBean
Throws:
javax.ejb.EJBException

ejbCreate

public void ejbCreate()
               throws javax.ejb.CreateException,
                      javax.ejb.EJBException
Framework methods. Do not use the WorkArea service in ejb framework methods!

Throws:
javax.ejb.CreateException
javax.ejb.EJBException

ejbPassivate

public void ejbPassivate()
                  throws javax.ejb.EJBException
Framework methods. Do not use the WorkArea service in ejb framework methods!

Specified by:
ejbPassivate in interface javax.ejb.SessionBean
Throws:
javax.ejb.EJBException

ejbRemove

public void ejbRemove()
               throws javax.ejb.EJBException
Framework methods. Do not use the WorkArea service in ejb framework methods!

Specified by:
ejbRemove in interface javax.ejb.SessionBean
Throws:
javax.ejb.EJBException

getSessionContext

public javax.ejb.SessionContext getSessionContext()
Framework methods. Do not use the WorkArea service in ejb framework methods!

Returns:
javax.ejb.SessionContext

setSessionContext

public void setSessionContext(javax.ejb.SessionContext ctx)
                       throws javax.ejb.EJBException
Framework methods. Do not use the WorkArea service in ejb framework methods!

Specified by:
setSessionContext in interface javax.ejb.SessionBean
Parameters:
ctx - javax.ejb.SessionContext
Throws:
javax.ejb.EJBException

test

public java.lang.String[] test()
BackendBean's only remote method. Note that the method takes no parameters in order to clearly demonstrate the WorkArea service's function. The method will merely retrieve context from the WorkArea. Note that of the two parameters retrieved from the WorkArea, one is defined in the outer scope and one in the inner; end users of the WorkArea (this bean) do not have to worry about WorkArea context is composed, and the lookup is quite lightweight with no declared exceptions. The retrieveAllKeys method is used just to demonstrate one more method from the WorkArea api; note that the method does recurse the stack of imported WorkAreas.

Returns:
java.lang.String [] Messages, essentially trace, are collected from each bean and returned as an array of strings to be displayed by the client.