IBM Branch Transformation Toolkit Javadoc

com.ibm.btt.services
Class BTTServiceRequester

java.lang.Object
  extended bycom.ibm.btt.base.Service
      extended bycom.ibm.btt.services.BTTServiceRequester
All Implemented Interfaces:
Externalizable, java.io.Externalizable, java.io.Serializable
Direct Known Subclasses:
PooledServiceRequester, ServiceInvocation

public abstract class BTTServiceRequester
extends Service

The BTTServiceRequester class is the super class of all requester. It extends Service to provide backward compatibibty. Furthermore, it wraps the basic processes, like default attributes setting(e.g. ServiceID, CachingEnabled, ServiceInvocation), and re-directing the processRequester to the proper invocation class.

See Also:
Serialized Form

Field Summary
static java.lang.String COMPID
           
 
Fields inherited from class com.ibm.btt.base.Service
externalizer, name
 
Constructor Summary
BTTServiceRequester()
           
 
Method Summary
 boolean getCachingEnabled()
          Method getCachingEnabled.
 long getInactiveTimeout()
           
 long getLastAccess()
          Get the last access time of the requester instance
 java.lang.String getServiceID()
          Returns the service ID
 ServiceInvocation getServiceInvocation()
          Method getServiceInvocation.
 java.lang.String getServiceType()
          Returns the serviceType.
 void grantServiceID()
          Send a request to the service holder to grant a service id
 java.util.Hashtable HashMapToHashtable(java.util.HashMap aHashMap)
          Convert HashMap to Hashtable
 void initializeFrom(java.util.ResourceBundle config)
          Method initializeFrom.
 java.lang.Object initializeFrom(Tag aTag)
          Initializes the Service reading its attributes values from aTag.
 BTTServiceRequester newInstance()
          Method newInstance.
protected  java.lang.Object processRequest(java.lang.String opName, java.util.Hashtable parts)
          Commend intereface which will be invoked by the operation method of the requester.
 void releaseServiceRequester()
          Release the service requester and the service object
 void setCachingEnabled(boolean cached)
          Method setCachingEnabled.
 void setInactiveTimeout(long time)
           
 void setLastAccess(long time)
          Set the last access time of the requester instance
 void setServiceID(java.lang.String serviceID)
          Set the service ID in the service requester
 void setServiceInvocation(ServiceInvocation ServiceInvocation)
          Sets the service invocation object for the requester.
 void setServiceType(java.lang.String serviceType)
          Sets the serviceType.
 
Methods inherited from class com.ibm.btt.base.Service
externalizer, getExternalizer, getName, getTagName, readExternal, readExternal, readObject, removeExternal, setExternalizer, setName, terminate, toString, toStrings, toTags, writeExternal, writeExternal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COMPID

public static final java.lang.String COMPID
See Also:
Constant Field Values
Constructor Detail

BTTServiceRequester

public BTTServiceRequester()
Method Detail

processRequest

protected java.lang.Object processRequest(java.lang.String opName,
                                          java.util.Hashtable parts)
                                   throws java.lang.Exception
Commend intereface which will be invoked by the operation method of the requester. This method will re-direct the request to the proper service invocation class. The invocation ways have 3 types: LOCAL -> for local Java invocation, WSIF -> for WSIF(Java, EJB or SOAP binding) invocation, EJB -> for remote EJB invocation,

Parameters:
opName - Operation name
parts - Operation parameters
Returns:
Object Execution result
Throws:
java.lang.Exception

initializeFrom

public java.lang.Object initializeFrom(Tag aTag)
                                throws java.io.IOException,
                                       DSEException
Description copied from class: Service
Initializes the Service reading its attributes values from aTag.

Specified by:
initializeFrom in interface Externalizable
Overrides:
initializeFrom in class Service
Parameters:
aTag - com.ibm.dse.base.Tag
Returns:
java.lang.Object
Throws:
java.io.IOException
DSEException
See Also:
Handles the basic definition, e.g. Service ID, Caching or not, Service invocation way.

initializeFrom

public void initializeFrom(java.util.ResourceBundle config)
                    throws java.lang.Exception
Method initializeFrom. It is similar to initializeFrom(Tag) . The only difference is the information is from Resource Bundle file.

Parameters:
config - A resource bundle class.
Throws:
java.lang.Exception

grantServiceID

public void grantServiceID()
                    throws java.lang.Exception
Send a request to the service holder to grant a service id

Throws:
java.lang.Exception

releaseServiceRequester

public void releaseServiceRequester()
                             throws java.lang.Exception
Release the service requester and the service object

Throws:
java.lang.Exception

setServiceInvocation

public void setServiceInvocation(ServiceInvocation ServiceInvocation)
Sets the service invocation object for the requester.

Parameters:
ServiceInvocation -

getServiceInvocation

public ServiceInvocation getServiceInvocation()
Method getServiceInvocation. Returns the service invocation object

Returns:
ServiceInvocation

setServiceID

public void setServiceID(java.lang.String serviceID)
Set the service ID in the service requester

Parameters:
serviceID -

getServiceID

public java.lang.String getServiceID()
                              throws java.lang.Exception
Returns the service ID

Returns:
String
Throws:
java.lang.Exception

setCachingEnabled

public void setCachingEnabled(boolean cached)
Method setCachingEnabled. Set the attribute "CachingEnabled".

Parameters:
cached - true - caching in the requester factory.

getCachingEnabled

public boolean getCachingEnabled()
Method getCachingEnabled. Returns whether the attributes "CachingEnabled" is true or not.

Returns:
boolean

newInstance

public BTTServiceRequester newInstance()
                                throws java.lang.Exception
Method newInstance. Creates and return a new copy of the requester

Returns:
BTTServiceRequester
Throws:
java.lang.Exception

getServiceType

public java.lang.String getServiceType()
Returns the serviceType.

Returns:
String

setServiceType

public void setServiceType(java.lang.String serviceType)
Sets the serviceType.

Parameters:
serviceType - The serviceType to set

HashMapToHashtable

public java.util.Hashtable HashMapToHashtable(java.util.HashMap aHashMap)
Convert HashMap to Hashtable

Parameters:
aHashMap - a HashMap object
Returns:
Hashtable

getLastAccess

public long getLastAccess()
Get the last access time of the requester instance

Returns:
long

setLastAccess

public void setLastAccess(long time)
Set the last access time of the requester instance

Parameters:
time - Last access time

getInactiveTimeout

public long getInactiveTimeout()
Returns:
long

setInactiveTimeout

public void setInactiveTimeout(long time)
Parameters:
time -

IBM Branch Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2005