com.ibm.redback.redbeansejb
Class RedBeansEJB

java.lang.Object
  |
  +--com.ibm.redback.redbeansejb.RedBeansEJB
Direct Known Subclasses:
RBEntityEJB, RedBeansSFEJB

public class RedBeansEJB
extends java.lang.Object

Class that provides main behaviour for stateless and stateful session beans. Note that stateful classes should extend RedBeansSFEJB


Field Summary
 javax.ejb.SessionContext sc
           
 
Constructor Summary
RedBeansEJB()
           
 
Method Summary
 RBState callMethod(RBState ourState, java.lang.String methodName)
          Calls an RBO method on the RBO Server.
 RBState createObj(java.lang.String objName, java.lang.String URL)
          Called when the client wants to create the RBO instance.
 RBState createObj(java.lang.String objName, java.lang.String URL, java.lang.String sessionId)
           
 void ejbActivate()
          Required but not used with Session Beans
 void ejbPassivate()
          Required but not used with Session Beans
 void ejbRemove()
          Standard EJB method, invoked when the EJB Container removes the Session Bean
 java.lang.String getProperty(RBState ourState, java.lang.String name)
          This method returns the current value for the property name passed.
 RecordSet getRecordSet(RBState ourState)
          This method returns the record set from current state.
 javax.ejb.SessionContext getSessionContext()
           
 RBState setProperty(RBState ourState, java.lang.String name, java.lang.String value)
          Sets a property with a given value for the passed client state.
 RBState setRecordSet(RBState ourState, RecordSet rs)
          This method returns the record set from the current rbo state.
 void setSessionContext(javax.ejb.SessionContext sc)
          Standard EJB method, invoked when the EJB Container instantiates the Session Bean
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sc

public javax.ejb.SessionContext sc
Constructor Detail

RedBeansEJB

public RedBeansEJB()
Method Detail

callMethod

public RBState callMethod(RBState ourState,
                          java.lang.String methodName)
                   throws RbException
Calls an RBO method on the RBO Server. All current client state will be passed to the RBO Server and state on the RBO Server will be updated.
Parameters:
ourRbSession - current client state
methodName - the RBO method to call
Throws:
RbException - thrown if the RedObject returns an exception or if the client state is not valid

createObj

public RBState createObj(java.lang.String objName,
                         java.lang.String URL)
                  throws RbException
Called when the client wants to create the RBO instance. Will create the RedObject and do all initialisation required
Parameters:
objName - the name of the RBO, module:objectname
URL - the URL for the RedBack account, either the full URL or RedBack account name if using JRGW
Throws:
RbException - thrown if open fails

createObj

public RBState createObj(java.lang.String objName,
                         java.lang.String URL,
                         java.lang.String sessionId)
                  throws RbException

ejbActivate

public void ejbActivate()
Required but not used with Session Beans

ejbPassivate

public void ejbPassivate()
Required but not used with Session Beans

ejbRemove

public void ejbRemove()
Standard EJB method, invoked when the EJB Container removes the Session Bean

setRecordSet

public RBState setRecordSet(RBState ourState,
                            RecordSet rs)
This method returns the record set from the current rbo state.
Parameters:
ourState - the current state
rs - the current recordSet

getRecordSet

public RecordSet getRecordSet(RBState ourState)
This method returns the record set from current state.
Parameters:
current - state is passed to the method.

getProperty

public java.lang.String getProperty(RBState ourState,
                                    java.lang.String name)
                             throws RbException
This method returns the current value for the property name passed.
Parameters:
ourState - the current RBO state for this instance
name - the property name
Throws:
RbException - thrown if the property name cannot be found

getSessionContext

public javax.ejb.SessionContext getSessionContext()

setProperty

public RBState setProperty(RBState ourState,
                           java.lang.String name,
                           java.lang.String value)
                    throws RbException
Sets a property with a given value for the passed client state. The value is set in the client state and will not update the RBO Server state until a CallMethod is invoked
Parameters:
ourState - current client state
name - the property name
value - the value to set
Throws:
RbException - thrown if the property name cannot be found

setSessionContext

public void setSessionContext(javax.ejb.SessionContext sc)
Standard EJB method, invoked when the EJB Container instantiates the Session Bean