IBM Branch Transformation Toolkit Javadoc

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

java.lang.Object
  extended bycom.ibm.btt.cs.invoker.base.BeanInvokerFactory

public class BeanInvokerFactory
extends java.lang.Object

Bean Invoker Factory is responsible for the Bean Invoker creation. Only one instance of Bean Invoker Factory should be available in a JVM. Since Bean Invokers can be reused by other request, local attribute should not be defined within a Bean Invoker. Otherwise, such data may mix up with other transaction. The EJB Proxy being stored is required to be removed once the Bean Invoker is released. Within Bean Invoker Factory, there should be three main components: Bean Invoker Pool, Bean Proxy Cache and Bean Invoker Registry


Field Summary
static java.lang.String BEAN_INVOKER_CACHE_SWITCH
          Bean Invoker Cache switch (true/false.
static java.lang.String BEAN_INVOKER_PROXY_CACHE_SWITCH
          Bean Invoker Proxy (EJBObject) Cache switch (true/false.
 
Constructor Summary
BeanInvokerFactory()
           
 
Method Summary
static BeanInvoker getBeanInvoker(java.lang.String requestID, BTTSystemData systemData)
          Create BeanInvoker Instance according to the RequestID.
static BeanInvokerRegistry getBeanInvokerRegistry()
          Get BeanInvokerRegistry instance.
static boolean isRegistedInvoker(java.lang.String requestID)
          Estimate the Invoker is existed or not according to the requestID.
static void releaseInvoker(BeanInvoker beanInvoker)
          When Request Handler is completed with a Bean Invoker, it should release it and notify the Bean Invoker Factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BEAN_INVOKER_CACHE_SWITCH

public static java.lang.String BEAN_INVOKER_CACHE_SWITCH
Bean Invoker Cache switch (true/false. The default is true)


BEAN_INVOKER_PROXY_CACHE_SWITCH

public static java.lang.String BEAN_INVOKER_PROXY_CACHE_SWITCH
Bean Invoker Proxy (EJBObject) Cache switch (true/false. The default is true)

Constructor Detail

BeanInvokerFactory

public BeanInvokerFactory()
Method Detail

getBeanInvoker

public static BeanInvoker getBeanInvoker(java.lang.String requestID,
                                         BTTSystemData systemData)
                                  throws DSEObjectNotFoundException,
                                         java.lang.ClassNotFoundException,
                                         DSEInvalidRequestException
Create BeanInvoker Instance according to the RequestID. Here, BeanInvokerFactory will try to get the BeanInvoker instance from BeanInvoker Pool. If not found, then create new one; Otherwise, it will return the one in cache, and remove it in cache.

Parameters:
requestID - requestID associated with ResourceBundle file.
systemData - .
Returns:
BeanInvoker
Throws:
DSEObjectNotFoundException - No resourcce bundle file found
java.lang.ClassNotFoundException - No customer defined implemenetation file found
DSEInvalidRequestException - Create Bean Proxy exception

releaseInvoker

public static void releaseInvoker(BeanInvoker beanInvoker)
When Request Handler is completed with a Bean Invoker, it should release it and notify the Bean Invoker Factory. If released, all data contained in BeanInvoker will be cleared, and then be put into Bean Invoker Cache.

Parameters:
beanInvoker - Bean Invoker instance

getBeanInvokerRegistry

public static BeanInvokerRegistry getBeanInvokerRegistry()
Get BeanInvokerRegistry instance. Only one instance existed in JVM

Returns:
BeanInvokerRegistry Bean Invoker Registry instance

isRegistedInvoker

public static boolean isRegistedInvoker(java.lang.String requestID)
Estimate the Invoker is existed or not according to the requestID.

Parameters:
requestID - Invoker Key
Returns:
boolean true means this Invoker is registed in mapper file; false means NOT

IBM Branch Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2005