com.ibm.retail.AEF.factory
Class AEFSessionPool

java.lang.Object
  |
  +--java.util.Dictionary
        |
        +--java.util.Hashtable
              |
              +--com.ibm.retail.AEF.factory.AEFSessionPool
All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, java.io.Serializable

public class AEFSessionPool
extends java.util.Hashtable

A AEFSessionPool serves as a resource pool for AEFSession objects.

See Also:
Serialized Form

Field Summary
protected  java.util.Hashtable pool
           
 
Constructor Summary
AEFSessionPool()
          Construct AEFSessionPool
 
Method Summary
 void addSession(com.ibm.retail.AEF.session.AEFSession session)
          Add a session to the pool
 boolean containsSession(java.lang.String terminalNumber)
          Does this pool contain a session.
(package private) static java.lang.String copyright()
           
 void destroySession(java.lang.String terminalNumber)
          Destroy an AEFSession and remove from the session pool.
 java.util.Collection getActiveTerminalNumbers()
          Get an enumeration of terminal numbers of active AEFSessions in this factory.
 com.ibm.retail.AEF.session.AEFSession getAvailableSession()
          Get any available session from the pool
 int getCurrentPoolSize()
          Get the total number of sessions that are pooled.
 com.ibm.retail.AEF.session.AEFSession getSession(java.lang.String terminalNumber)
          Get a session from the pool
 int getTotalAvailableSessions()
          Get the total number of sessions that are available
 void releaseSession(com.ibm.retail.AEF.session.AEFSession session)
          Release a session.
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

pool

protected java.util.Hashtable pool
Constructor Detail

AEFSessionPool

public AEFSessionPool()
Construct AEFSessionPool

Method Detail

copyright

static java.lang.String copyright()

addSession

public void addSession(com.ibm.retail.AEF.session.AEFSession session)
Add a session to the pool

Parameters:
session - AEFSession to be added

getSession

public com.ibm.retail.AEF.session.AEFSession getSession(java.lang.String terminalNumber)
Get a session from the pool

Parameters:
terminalNumber - terminal number of session
Returns:
AEFSession or null if no session in pool

getAvailableSession

public com.ibm.retail.AEF.session.AEFSession getAvailableSession()
Get any available session from the pool

Returns:
AEFSession or null if no session in pool

releaseSession

public void releaseSession(com.ibm.retail.AEF.session.AEFSession session)
Release a session.

Parameters:
session - the session to be released

destroySession

public void destroySession(java.lang.String terminalNumber)
                    throws java.rmi.RemoteException,
                           AEFException
Destroy an AEFSession and remove from the session pool. This method applies only to virtual (CSS) sessions. It terminates the POS sales application and removes the AEFSession from the SessionPool.

Parameters:
terminalNumber - terminal number to destroy
Throws:
java.rmi.RemoteException
AEFException - Among the possible AEFException error codes are:
AEFConst.SESSION_NOT_ACTIVE
AEFConst.API_VALID_FOR_TSS_ONLY

getTotalAvailableSessions

public int getTotalAvailableSessions()
Get the total number of sessions that are available

Returns:
total available sessions

getCurrentPoolSize

public int getCurrentPoolSize()
Get the total number of sessions that are pooled. This number includes all sessions.

Returns:
total sessions in pool

getActiveTerminalNumbers

public java.util.Collection getActiveTerminalNumbers()
                                              throws java.rmi.RemoteException
Get an enumeration of terminal numbers of active AEFSessions in this factory.

Returns:
Collection of active terminal numbers sorted in ascending order (strings)
Throws:
java.rmi.RemoteException - if an instance of an object cannot be created

containsSession

public boolean containsSession(java.lang.String terminalNumber)
Does this pool contain a session.

Parameters:
terminalNumber - identifies the session
Returns:
Return true if the session pool contains a session with specified terminal number


Copyright © 2004 IBM. All Rights Reserved.
Generated: July 19 2004