IBM Branch Transformation Toolkit Javadoc

com.ibm.btt.services
Class PooledServiceRequester

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

public class PooledServiceRequester
extends BTTServiceRequester

PooledServiceRequester is the basic class for the service requester which want to provide the pool feature. It wraps the pool handling process for the sub-class. The sub-class will just need to override the method if there is extra pool handling.

See Also:
Serialized Form

Field Summary
protected  boolean poolable
           
protected  java.lang.String poolId
           
 
Fields inherited from class com.ibm.btt.services.BTTServiceRequester
COMPID
 
Fields inherited from class com.ibm.btt.base.Service
externalizer, name
 
Constructor Summary
PooledServiceRequester()
           
 
Method Summary
 java.lang.String getGrantTime()
           
 void getPoolable()
          Method getPoolable is to get a available pool from the generic pool of the service holder.
 void getPoolable(int pid)
          Method getPoolable is to acquire the pool by a given pool id.
 java.lang.String getPoolId()
          Method getPoolId.
 java.lang.String getServiceID()
          Returns the service ID
 void grantServiceID()
          Send a request to the service holder to grant a service id
 void initializeFrom(java.util.ResourceBundle config)
          Method initializeFrom.
 java.lang.Object initializeFrom(Tag aTag)
          Initializes the Service reading its attributes values from aTag.
protected  java.lang.Object processRequest(java.lang.String opName, java.util.Hashtable parts)
          Commend intereface that the request and execute the corresponding method, it is being implemented by the developers
 void releaseOrphan()
          Release the orphan instance.
 void releaseOrphan(int orphanTime)
          Release the orphan instance.
 void releasePoolable()
          Request a command to the generic pool to releases the held pool object.
 void releaseServiceRequester()
          Release the service requester and the service object
 void setGrantTime(java.lang.String string)
           
 void setPoolId(java.lang.String pid)
           
 
Methods inherited from class com.ibm.btt.services.BTTServiceRequester
getCachingEnabled, getInactiveTimeout, getLastAccess, getServiceInvocation, getServiceType, HashMapToHashtable, newInstance, setCachingEnabled, setInactiveTimeout, setLastAccess, setServiceID, setServiceInvocation, setServiceType
 
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

poolId

protected java.lang.String poolId

poolable

protected boolean poolable
Constructor Detail

PooledServiceRequester

public PooledServiceRequester()
Method Detail

getPoolId

public java.lang.String getPoolId()
Method getPoolId.

Returns:
String

setPoolId

public void setPoolId(java.lang.String pid)

getPoolable

public void getPoolable()
                 throws java.lang.Exception
Method getPoolable is to get a available pool from the generic pool of the service holder.

Throws:
java.lang.Exception

getPoolable

public void getPoolable(int pid)
                 throws java.lang.Exception
Method getPoolable is to acquire the pool by a given pool id.

Parameters:
pid -
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 BTTServiceRequester
Throws:
java.io.IOException
DSEException
See Also:
The method will get an available pool from the service holder.

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.

Overrides:
initializeFrom in class BTTServiceRequester
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

Overrides:
grantServiceID in class BTTServiceRequester
Throws:
java.lang.Exception

processRequest

protected java.lang.Object processRequest(java.lang.String opName,
                                          java.util.Hashtable parts)
                                   throws java.lang.Exception
Commend intereface that the request and execute the corresponding method, it is being implemented by the developers

Overrides:
processRequest in class BTTServiceRequester
Parameters:
opName - Operation name
parts - Operation parameters
Returns:
Object Execution result
Throws:
java.lang.Exception

releaseServiceRequester

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

Overrides:
releaseServiceRequester in class BTTServiceRequester
Throws:
java.lang.Exception

releasePoolable

public void releasePoolable()
                     throws java.lang.Exception
Request a command to the generic pool to releases the held pool object. The released object is returned to the pool and signaled as available (not in use).

Throws:
java.lang.Exception

releaseOrphan

public void releaseOrphan()
                   throws java.lang.Exception
Release the orphan instance. The instance will be release if the instance's last access is exceeded the orphan timeout value. The orphan timeout value is according to the value from the definition file. If there is no the orphan timeout value specify, it will do nothing.

Throws:
java.lang.Exception

releaseOrphan

public void releaseOrphan(int orphanTime)
                   throws java.lang.Exception
Release the orphan instance. The instance will be release if the instance's last access is exceeded the orphan timeout value(based on the input parameter).

Parameters:
orphanTime - - The orphan timeout value in second
Throws:
java.lang.Exception

getServiceID

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

Overrides:
getServiceID in class BTTServiceRequester
Returns:
String
Throws:
java.lang.Exception

getGrantTime

public java.lang.String getGrantTime()
Returns:
String

setGrantTime

public void setGrantTime(java.lang.String string)
Parameters:
string -

IBM Branch Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2005