areAllServicesOffline()
Methods inherited from class com.ibm.btt.base.Service |
externalizer, getExternalizer, getTagName, readExternal, readExternal, readObject, removeExternal, setExternalizer, toStrings, toTags, writeExternal, writeExternal |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
COMPID
public static final java.lang.String COMPID
- See Also:
- Constant Field Values
indexOfLastSession
int indexOfLastSession
- Index of the last service assigned
size
int size
- Current pool size
nameIndex
long nameIndex
- nameIndex
initialSize
int initialSize
- Initial pool size
identicalElements
boolean identicalElements
- Indicates if the elements on the pool are identical
pool
java.util.Vector pool
- The communications pool
poolSem
java.lang.Object poolSem
- Object used for synchronization purposes
maxPoolSize
int maxPoolSize
- Maximum pool size
timeBetweenRetries
long timeBetweenRetries
- Time to wait for a retry when no free service is available
cleanupTime
int cleanupTime
- Time between resizing processes
requestsCount
int requestsCount
- Counter of concurrent request
maxConcurrents
int maxConcurrents
- Maximum number of concurrent request from the last resizing process
spare
int spare
- Additional percentage of the pool size to be added during the resizing process
sem
Semaphore sem
- Internal semaphore used to notify that a service has been released
CommunicationsPool
public CommunicationsPool()
- This constructor creates a CommunicationsPool object.
CommunicationsPool
public CommunicationsPool(java.lang.String aName)
throws java.io.IOException
- This constructor creates a CommunicationsPool object.
- Parameters:
aName - java.lang.String - Communications pool service name.
- Throws:
java.io.IOException.
java.io.IOException
areAllServicesOffline
public boolean areAllServicesOffline()
- Checks if at least one service in the pool is in session.
Returns:
- true - If no service of the pool is in session
- false - If at least one pool service is in session
- Specified by:
areAllServicesOffline in interface CommunicationsPoolService
- Returns:
- boolean
closeAll
public void closeAll()
- Closes all pool instances.
Executes ccClose() on each pool element.
- Specified by:
closeAll in interface CommunicationsPoolService
freeAll
protected void freeAll()
- Marks every pool element as not used.
getPoolService
public CommonCommunicationsService getPoolService()
- Returns the first free service in the pool or null if no free
services are available.
See getPoolService(boolean)
- Specified by:
getPoolService in interface CommunicationsPoolService
- Returns:
- com.ibm.btt.services.comms.CommonCommunicationsService
getSessionWithName
protected CommonCommunicationsService getSessionWithName(java.lang.String name)
- Returns a communications service from the pool.
- Parameters:
name - String - The name of the service to be returned
- Returns:
- com.ibm.btt.services.comms.CommonCommunicationsService
initializeFrom
public java.lang.Object initializeFrom(Tag aTag)
throws java.io.IOException,
DSEInvalidArgumentException,
DSEException
- Initializes a CommunicationsPool with the Tag attributes.
- Overrides:
initializeFrom in class Service
- Parameters:
aTag - Tag, the Tag
- Returns:
- CommunicationsPool - the initialized CommunicationsPool
- Throws:
java.io.IOException
DSEInvalidArgumentException
DSEException
initInstance
public void initInstance()
throws DSEException
- Initializes the thread responsible for resizing the pool.
- Throws:
DSEException
insertService
public void insertService(CommonCommunicationsService aService)
- Inserts a new communications service in the pool.
- Specified by:
insertService in interface CommunicationsPoolService
- Parameters:
aService - com.ibm.btt.services.comms.CommonCommunicationsService - The service to be added to the pool
isThreadIsAlive
public boolean isThreadIsAlive()
- Returns the status of the thread responsible for resizing the pool.
- Returns:
- boolean
openAll
public void openAll()
- Opens all the communications services in the pool by sending
ccOpen() to all the services in the pool.
- Specified by:
openAll in interface CommunicationsPoolService
releasePoolService
public void releasePoolService(CommonCommunicationsService aService)
- Releases a communications service. This method returns
the released communications service to the pool and signals that it
is available.
- Specified by:
releasePoolService in interface CommunicationsPoolService
- Parameters:
aService - com.ibm.btt.services.comms.CommonCommunicationsService - The service to be released
removeAll
protected void removeAll()
- Removes all the communications services from the pool.
releaseAndRemovePoolService
public void releaseAndRemovePoolService(CommonCommunicationsService aService)
- Release a communication service and then remove it from communication pool.
This method should only be used for the service that is corrupt.
- Parameters:
aService -
removeService
public void removeService(CommonCommunicationsService aService)
- Removes a communications service from the pool. If the communications service does not exist, no action is taken.
- Specified by:
removeService in interface CommunicationsPoolService
- Parameters:
aService - com.ibm.btt.services.comms.CommonCommunicationsService - The service to be removed
run
public void run()
- Runs the pool thread.
- Specified by:
run in interface java.lang.Runnable
terminate
public void terminate()
- Frees and closes all the services from the pool.
- Specified by:
terminate in interface ProcessorNotifier - Specified by:
terminate in interface CommunicationsPoolService - Overrides:
terminate in class Service
toString
public java.lang.String toString()
- Converts this CommonCommunicationsService to a String.
- Overrides:
toString in class Service
- Returns:
- java.lang.String
getCleanupTime
public int getCleanupTime()
- Returns the cleanupTime attribute.
- Specified by:
getCleanupTime in interface CommunicationsPoolService
getIdenticalElements
public boolean getIdenticalElements()
- Returns the identicalElements attribute.
- Specified by:
getIdenticalElements in interface CommunicationsPoolService
getMaxPoolSize
public int getMaxPoolSize()
- Returns the maxPoolSize attribute.
- Specified by:
getMaxPoolSize in interface CommunicationsPoolService
getSize
public int getSize()
- Returns the size attribute.
- Specified by:
getSize in interface CommunicationsPoolService
getSpare
public int getSpare()
- Returns the spare attribute.
- Specified by:
getSpare in interface CommunicationsPoolService
getTag
public Tag getTag()
- Returns the tag attribute.
- Specified by:
getTag in interface CommunicationsPoolService
getTimeBetweenRetries
public long getTimeBetweenRetries()
- Returns the timeBetweenRetries attribute.
- Specified by:
getTimeBetweenRetries in interface CommunicationsPoolService
setCleanupTime
public void setCleanupTime(int aTime)
- Sets cleanupTime attribute value.
- Specified by:
setCleanupTime in interface CommunicationsPoolService
setIdenticalElements
public void setIdenticalElements(boolean aBoolean)
- Sets identicalElements attribute value.
- Specified by:
setIdenticalElements in interface CommunicationsPoolService
setMaxPoolSize
public void setMaxPoolSize(int aMaxPoolSize)
- Sets maxPoolSize attribute value.
- Specified by:
setMaxPoolSize in interface CommunicationsPoolService
setSize
public void setSize(int aSize)
- Sets size attribute value.
- Specified by:
setSize in interface CommunicationsPoolService
setSpare
public void setSpare(int aSpare)
- Sets spare attribute value.
- Specified by:
setSpare in interface CommunicationsPoolService
setTag
public void setTag(Tag aTag)
- Sets tag attribute value.
- Specified by:
setTag in interface CommunicationsPoolService
setTimeBetweenRetries
public void setTimeBetweenRetries(int aTime)
- Sets timeBetweenRetries attribute value.
- Specified by:
setTimeBetweenRetries in interface CommunicationsPoolService
getRequestsCount
public int getRequestsCount()
- returns a count of the number of pool elements that are in use.
Added for APAR JR18668
(c) Copyright IBM Corporation 1998, 2009
|