com.ibm.dse.services.comms
Class CommunicationsPool

java.lang.Object
  |
  +--com.ibm.dse.base.DSENotifier
        |
        +--com.ibm.dse.base.Service
              |
              +--com.ibm.dse.services.comms.CommunicationsPool

public class CommunicationsPool
extends Service
implements CommunicationsPoolService

The CommunicationsPool is a pool that manages communications services that implement CommonCommunicationsService interface.

See Also:
Serialized Form

Field Summary
static java.lang.String COMPID
           
 
Fields inherited from class com.ibm.dse.base.Service
externalizer
 
Fields inherited from class com.ibm.dse.base.DSENotifier
handlersList, name
 
Constructor Summary
CommunicationsPool()
          This constructor creates a CommunicationsPool object.
CommunicationsPool(java.lang.String aName)
          This constructor creates a CommunicationsPool object.
 
Method Summary
 boolean areAllServicesOffline()
          This method returns : true - If no service of the pool is in session false - If at least one service of the pool is in session
 void closeAll()
          Executes ccClose method of every pool element.
protected  void freeAll()
          Marks every pool element as not used.
 CommonCommunicationsService getPoolService()
          This method returns the first free service of the pool, and in SEND state.
protected  CommonCommunicationsService getSessionWithName(java.lang.String name)
          Returns a service pool with name
 java.lang.Object initializeFrom(Tag aTag)
          Initializes a CommunicationsPool with the Tag attributes.
 void insertService(CommonCommunicationsService aService)
          Inserts aService in the pool of services.
 void openAll()
          Executes ccOpen method of every pool element.
 void releasePoolService(CommonCommunicationsService aService)
          Frees aSession to be reused.
protected  void removeAll()
          Removes all services from the pool
 void removeService(CommonCommunicationsService aService)
          Removes aService from the pool.
 void terminate()
          Frees and closes all the services from the pool.
 java.lang.String toString()
          Converts this CommonCommunicationsService to string.
 
Methods inherited from class com.ibm.dse.base.Service
externalizer, getExternalizer, getTagName, readExternal, readExternal, readObject, removeExternal, setExternalizer, toStrings, toTags, writeExternal, writeExternal
 
Methods inherited from class com.ibm.dse.base.DSENotifier
addHandler, getHandlersList, getName, removeHandler, setName, signalEvent, signalEvent, signalEvent
 
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
Constructor Detail

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
Throws:
java.io.IOException. -  
Method Detail

areAllServicesOffline

public boolean areAllServicesOffline()
This method returns :
Specified by:
areAllServicesOffline in interface CommunicationsPoolService

closeAll

public void closeAll()
Executes ccClose method of every pool element.
Specified by:
closeAll in interface CommunicationsPoolService

freeAll

protected void freeAll()
Marks every pool element as not used.

getPoolService

public CommonCommunicationsService getPoolService()
This method returns the first free service of the pool, and in SEND state. It marks this session 'inUse', to prevent be used by another client. If no free services and the elements are identical, a new instance of the communications service is created.
Specified by:
getPoolService in interface CommunicationsPoolService
Returns:
com.ibm.dse.services.comms.CommonCommunicationsService

getSessionWithName

protected CommonCommunicationsService getSessionWithName(java.lang.String name)
Returns a service pool with name

initializeFrom

public java.lang.Object initializeFrom(Tag aTag)
                                throws java.io.IOException,
                                       DSEInvalidArgumentException
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 -  

insertService

public void insertService(CommonCommunicationsService aService)
Inserts aService in the pool of services.
Specified by:
insertService in interface CommunicationsPoolService
Tags copied from interface: CommunicationsPoolService
Parameters:
aSession - com.ibm.dse.services.comms.CommonCommunicationsService.

openAll

public void openAll()
Executes ccOpen method of every pool element.
Specified by:
openAll in interface CommunicationsPoolService

releasePoolService

public void releasePoolService(CommonCommunicationsService aService)
Frees aSession to be reused.
Specified by:
releasePoolService in interface CommunicationsPoolService
Parameters:
aSession - com.ibm.dse.services.comms.CommonCommunicationsService.

removeAll

protected void removeAll()
Removes all services from the pool

removeService

public void removeService(CommonCommunicationsService aService)
Removes aService from the pool.
Specified by:
removeService in interface CommunicationsPoolService
Parameters:
aSession - com.ibm.dse.services.comms.CommonCommunicationsService

terminate

public void terminate()
Frees and closes all the services from the pool.
Specified by:
terminate in interface CommunicationsPoolService
Overrides:
terminate in class Service

toString

public java.lang.String toString()
Converts this CommonCommunicationsService to string.
Overrides:
toString in class Service
Tags copied from class: Service
Returns:
java.lang.String