IBM Branch Transformation Toolkit Javadoc

com.ibm.btt.cs.invoker.base
Class BeanInvokerImpl

java.lang.Object
  extended bycom.ibm.btt.cs.invoker.base.BeanInvokerImpl
All Implemented Interfaces:
BeanInvoker
Direct Known Subclasses:
EventManagerServerInvoker

public abstract class BeanInvokerImpl
extends java.lang.Object
implements BeanInvoker

The basic Invoker class is the abstract class which encapsulates some basic functions about EJB accessing and session propagation, for example, generate SystemData, WorkArea lifecycle management (if configured) etc. And the generic method named invoker() will be launched by Request Handler; This invoker method will follow the execution sequence rules to accomplish the EJB invocation.

When a request arrived with a serverOperation ID, the framework judges that at first this request is Processor or not. If it¡¯s not processor, it goes to the Bean Invoker Factory to locate a corresponding Bean Invoker. When the Bean Invoker Factory release a Bean Invoker, the invoker should contains the corresponding Bean Proxy.

And this basic invoker also provides all format/un-format functions, for example, StringFormatter, XMLFormatter, FloatFormatter etc. These each API is corresponded with Formatter/un-Formatter definition in client side. And all the predefined validations APIs are available too, for example, StringValidator, FloatValidator etc.


Field Summary
protected  java.util.Hashtable ejbParameters
          Used to store the EJB parameters
 
Constructor Summary
BeanInvokerImpl()
          Constructor for BeanInvokerImpl.
 
Method Summary
 void clear()
          Since BeanInvoker is request independence, it should be cleared before put into cache.
abstract  java.lang.Object createBeanInvokerProxy()
          Create a bean proxy.
abstract  java.lang.Object executeEJB()
          It's the blank method should be overrode by end-user in extended class; In this method, end-user should create the Bean Invoker Proxy (EJBObject) from Proxy Pool or EJB Home Interface; and then hard code the method execution manually.
 java.lang.Object getBeanInvokerProxy()
          Returns the beanInvokerProxy.
 Context getContext()
          Returns the context.
 Tokenizer getDelimitedTokenizer(java.lang.String requestData)
          Returns the DelimitedTokenizer.
 java.lang.Object getEjbParameter(java.lang.String key)
          Returns the ejb Parameters.
 java.util.Hashtable getEjbParameters()
          Returns the ejbParameters.
 Tokenizer getFixLengthTokenizer(java.lang.String requestData)
          Returns the Fix Length Tokenizer.
 BeanInvokerFormatter getFormatter()
          Returns the formatter.
protected  java.lang.Object getHomeObject()
          Get EJB Home Object.
 java.lang.String getRequestID()
          Returns the requestID.
 java.util.ResourceBundle getResource()
          Returns the resource.
 BTTSystemData getSystemData()
          Returns the systemData.
 BeanInvokerValidation getValidation()
          Returns the validation.
protected  BTTXMLFormatter getXMLFormatter()
          Returns a XML formater
protected  XMLTokenizer getXMLTokenizer(java.lang.String aXMLDoc)
          Returns a XML tokenizer
protected  BTTXMLUnFormatter getXMLUnFormatter()
          Returns a default XML unformatter
protected  BTTXMLUnFormatter getXMLUnFormatter(java.lang.String aResultObjectControllerType)
          Returns a XML unformatter with a given Result Object Controller type
 java.lang.Object invoke()
          It's the generic entry point launched by Request Handler.
abstract  java.lang.Object processRespondData(java.lang.Object ejbResult)
          Handler the EJB result, and transfer to client side.
 void setBeanInvokerProxy(java.lang.Object beanInvokerProxy)
          Sets the beanInvokerProxy.
 void setContext(Context context)
          Sets the context.
 void setEjbParameters(java.util.Hashtable ejbParameters)
          Sets the ejbParameters.
 void setRequestID(java.lang.String requestID)
          Sets the requestID.
 void setResource(java.util.ResourceBundle resource)
          Sets the resource.
 void setSystemData(BTTSystemData systemData)
          Sets the systemData.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ejbParameters

protected java.util.Hashtable ejbParameters
Used to store the EJB parameters

Constructor Detail

BeanInvokerImpl

public BeanInvokerImpl()
Constructor for BeanInvokerImpl.

Method Detail

invoke

public java.lang.Object invoke()
                        throws DSEInvalidRequestException
It's the generic entry point launched by Request Handler. This invoker method will follow the execution sequence rules to accomplish the EJB invocation.

Specified by:
invoke in interface BeanInvoker
Returns:
Object EJB Invocation result
Throws:
DSEInvalidRequestException

executeEJB

public abstract java.lang.Object executeEJB()
                                     throws java.lang.Exception
It's the blank method should be overrode by end-user in extended class; In this method, end-user should create the Bean Invoker Proxy (EJBObject) from Proxy Pool or EJB Home Interface; and then hard code the method execution manually.

Returns:
Object EJB invocation result
Throws:
java.lang.Exception

getHomeObject

protected java.lang.Object getHomeObject()
Get EJB Home Object. HomeObject can be cached within the Bean Invoker. If for any reason the HomeObject is not available, it can leverage on the feature provided in super class to create new one. Note that here the LocalHome will be determinated to use narrow or not.

Returns:
Object EJBHome object

getEjbParameter

public java.lang.Object getEjbParameter(java.lang.String key)
Returns the ejb Parameters. If the parameters is not existed in Hashtable, then try to get it from Context.

Parameters:
key - Key in ejb parameters
Returns:
Hashtable

setEjbParameters

public void setEjbParameters(java.util.Hashtable ejbParameters)
Sets the ejbParameters.

Parameters:
ejbParameters - The ejbParameters to set

getEjbParameters

public java.util.Hashtable getEjbParameters()
Returns the ejbParameters.

Returns:
Hashtable

getContext

public Context getContext()
Returns the context.

Returns:
Context

setContext

public void setContext(Context context)
Sets the context.

Parameters:
context - The context to set

processRespondData

public abstract java.lang.Object processRespondData(java.lang.Object ejbResult)
                                             throws DSEInvalidRequestException
Handler the EJB result, and transfer to client side. different result object for different Connectors:
  • Html Connector - Dummy Conetxt: End-user should map the EJB result to dummy context manually in this method
  • non-Html Connector - String: Code Generatation Tool will override this method. And generate formatting APIs according to the formatting definition.
  • Automaton - Conetxt: End-user should map the EJB result to Context manually in this method.
  • Specified by:
    processRespondData in interface BeanInvoker
    Parameters:
    ejbResult - EJB execute result
    Returns:
    Object reponse data formatted
    Throws:
    DSEInvalidRequestException

    clear

    public void clear()
    Since BeanInvoker is request independence, it should be cleared before put into cache.

    Specified by:
    clear in interface BeanInvoker
    See Also:
    BeanInvoker.clear()

    getBeanInvokerProxy

    public java.lang.Object getBeanInvokerProxy()
    Returns the beanInvokerProxy.

    Specified by:
    getBeanInvokerProxy in interface BeanInvoker
    Returns:
    Object

    setBeanInvokerProxy

    public void setBeanInvokerProxy(java.lang.Object beanInvokerProxy)
    Sets the beanInvokerProxy.

    Specified by:
    setBeanInvokerProxy in interface BeanInvoker
    Parameters:
    beanInvokerProxy - The beanInvokerProxy to set

    createBeanInvokerProxy

    public abstract java.lang.Object createBeanInvokerProxy()
                                                     throws DSEInvalidRequestException
    Create a bean proxy. The implementation is provided in the subclass This method is called when the BeanInvokerFactory cannot find a bean proxy from the pool

    Specified by:
    createBeanInvokerProxy in interface BeanInvoker
    Returns:
    Object EJBObject instance
    Throws:
    DSEInvalidRequestException
    See Also:
    BeanInvoker.createBeanInvokerProxy()

    getSystemData

    public BTTSystemData getSystemData()
    Returns the systemData.

    Specified by:
    getSystemData in interface BeanInvoker
    Returns:
    BTTSystemData

    setSystemData

    public void setSystemData(BTTSystemData systemData)
    Sets the systemData.

    Specified by:
    setSystemData in interface BeanInvoker
    Parameters:
    systemData - The systemData to set

    getDelimitedTokenizer

    public Tokenizer getDelimitedTokenizer(java.lang.String requestData)
    Returns the DelimitedTokenizer. This tokernizer object includes all formatting/unformatting APIs to parse delimited String.

    Parameters:
    requestData - requestData transferred by request handler
    Returns:
    Tokenizer DelimitedTokenizer Implementation

    getFixLengthTokenizer

    public Tokenizer getFixLengthTokenizer(java.lang.String requestData)
    Returns the Fix Length Tokenizer. This tokernizer object includes all formatting/unformatting APIs to parse fix length String.

    Parameters:
    requestData - requestData transferred by request handler
    Returns:
    Tokenizer FixLengthTokenizer Implementation

    getResource

    public java.util.ResourceBundle getResource()
    Returns the resource.

    Specified by:
    getResource in interface BeanInvoker
    Returns:
    BeanInvokerRegister

    setResource

    public void setResource(java.util.ResourceBundle resource)
    Sets the resource.

    Specified by:
    setResource in interface BeanInvoker
    Parameters:
    resource - The resource to set

    getValidation

    public BeanInvokerValidation getValidation()
    Returns the validation. Validation provides typed data validation APIs.

    Returns:
    BeanInvokerValidation

    getFormatter

    public BeanInvokerFormatter getFormatter()
    Returns the formatter. BeanInvokerFormatter provides all format/unformat and decoration APIs.

    Returns:
    BeanInvokerFormatter

    getXMLTokenizer

    protected XMLTokenizer getXMLTokenizer(java.lang.String aXMLDoc)
    Returns a XML tokenizer


    getXMLFormatter

    protected BTTXMLFormatter getXMLFormatter()
    Returns a XML formater


    getXMLUnFormatter

    protected BTTXMLUnFormatter getXMLUnFormatter()
    Returns a default XML unformatter


    getXMLUnFormatter

    protected BTTXMLUnFormatter getXMLUnFormatter(java.lang.String aResultObjectControllerType)
                                           throws java.lang.InstantiationException,
                                                  java.lang.IllegalAccessException,
                                                  java.lang.ClassNotFoundException
    Returns a XML unformatter with a given Result Object Controller type

    Throws:
    java.lang.InstantiationException
    java.lang.IllegalAccessException
    java.lang.ClassNotFoundException

    getRequestID

    public java.lang.String getRequestID()
    Returns the requestID.

    Specified by:
    getRequestID in interface BeanInvoker
    Returns:
    String

    setRequestID

    public void setRequestID(java.lang.String requestID)
    Sets the requestID.

    Specified by:
    setRequestID in interface BeanInvoker
    Parameters:
    requestID - The requestID to set

    IBM Branch Transformation Toolkit Javadoc

    (c) Copyright IBM Corporation 1998, 2005