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

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

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

The Bean demonstrates simple usage of the WorkArea service. The Bean will do the following on its single remote method : - attempt to set a value into the imported WorkArea This will fail. Remote processes cannot write directly into imported WorkAreas. They must begin another one and delta on top of the imported WorkArea. - begin a new WorkArea - attempt to override the Company set by the client This will fail. Values that were set as read_only cannot be overridden. - successfuly override the Priority set by the client (will set to Tin) - invoke the BackendBean in the context of the Bean - complete the Company created in the Bean - look up the imported Company and Priority and compose a return message

See Also:
Serialized Form

Constructor Summary
BeanImpl()
           
 
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()
          Bean's only remote method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanImpl

public BeanImpl()
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
javax.ejb.CreateException

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()
Bean's only remote method. Note that the method takes no parameters in order to clearly demonstrate the WorkArea service's function. The method will invoke a number of methods on the WorkArea context, demonstrating both how and how NOT to use the WorkArea service.

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.