com.ibm.retail.AEF.factory
Interface AEFSessionFactory

All Superinterfaces:
java.rmi.Remote

public interface AEFSessionFactory
extends java.rmi.Remote

An AEFSessionFactory provides access to AEFSession objects through an implementation of the Factory design pattern. The factory represents a collection of virtual terminals which can be accessed through the factory's getSession() methods.

The AEFSessionFactory implementation provides resource pooling to facilitate efficient use of the AEFSession instances. The factory is configured in config.properties, where values for the range of valid terminal numbers and the capacity of the factory are specified.

The AEFSessionFactory registers as a provider to one or more SessionServers which in turn provide client access to sessions while distributing the load among the factory instances.


Field Summary
static java.lang.String NAME
          Name used for RMI naming
 
Method Summary
 void destroySession(java.lang.String terminalNumber)
          Destroys an AEFSession.
 java.util.Collection getActiveTerminalNumbers()
          Get an enumeration of the terminal numbers of active AEFSessions in this factory.
 com.ibm.retail.AEF.session.AEFSession getAvailableSession(com.ibm.retail.AEF.session.SessionParameters parms)
          Get an AEFSession object with a status of "available".
 com.ibm.retail.AEF.factory.AEFSessionFactoryInfo getFactoryInfo()
          Get information about this factory.
 com.ibm.retail.AEF.factory.AEFSessionFactory getSelfReference()
          Returns a self reference.
 com.ibm.retail.AEF.session.AEFSession getSession(java.lang.String terminalNumber, com.ibm.retail.AEF.session.SessionParameters parms)
          Get an AEFSession object by terminal number.
 boolean sessionExists(java.lang.String terminalNumber)
          Returns true if a session for this terminal number has been created.
 

Field Detail

NAME

public static final java.lang.String NAME
Name used for RMI naming

See Also:
Constant Field Values
Method Detail

getAvailableSession

public com.ibm.retail.AEF.session.AEFSession getAvailableSession(com.ibm.retail.AEF.session.SessionParameters parms)
                                                          throws java.rmi.RemoteException,
                                                                 AEFException
Get an AEFSession object with a status of "available". An AEFSession is in the available state if no other clients have references to it.

This method establishes a client reference to the session and removes it from the pool of available sessions.

Parameters:
parms - SessionParameters object contains all parameters for the session as name-value pairs
Returns:
an instance of an AEFSession object
Throws:
java.rmi.RemoteException - if remote access fails
AEFException - if a session can not be created

getSession

public com.ibm.retail.AEF.session.AEFSession getSession(java.lang.String terminalNumber,
                                                        com.ibm.retail.AEF.session.SessionParameters parms)
                                                 throws java.rmi.RemoteException,
                                                        AEFException
Get an AEFSession object by terminal number. If this is a valid terminal number for the factory, the session is returned regardless of the state. This allows a session to be shared among multiple clients.

This method does not remove the session from the pool of available sessions. Clients can remove the session from the available session pool by invoking the reference() method of the particular AEFSession.

Parameters:
terminalNumber - number of the terminal session requested
parms - SessionParameters object contains all parameters for the session as name-value pairs
Returns:
an instance of an AEFSession object
Throws:
java.rmi.RemoteException - if remote access fails
AEFException - if a session can not be created

destroySession

public void destroySession(java.lang.String terminalNumber)
                    throws java.rmi.RemoteException,
                           AEFException
Destroys an AEFSession.

This method applies only to virtual (CSS) sessions. Invoking this method terminates the POS application and removes the AEFSession from the SessionPool.

Parameters:
terminalNumber - identifies the session to be destroyed
Throws:
java.rmi.RemoteException - if server is not available
AEFException - if an error occurs destroying the session AEFException error codes are:
AEFConst.API_VALID_FOR_TSS_ONLY
AEFConst.SESSION_NOT_ACTIVE

getFactoryInfo

public com.ibm.retail.AEF.factory.AEFSessionFactoryInfo getFactoryInfo()
                                                                throws java.rmi.RemoteException
Get information about this factory.

Information can be used to determine factory load (utilization) for load balancing across multiple factories.

Returns:
an instance of an AEFFactorySessionInfo object
Throws:
java.rmi.RemoteException - if an instance of an object can not be created

sessionExists

public boolean sessionExists(java.lang.String terminalNumber)
                      throws java.rmi.RemoteException
Returns true if a session for this terminal number has been created.

Parameters:
terminalNumber - identifies the session
Returns:
true if the session for this terminal number exists
Throws:
java.rmi.RemoteException - if error occurs in remote access

getActiveTerminalNumbers

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

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

getSelfReference

public com.ibm.retail.AEF.factory.AEFSessionFactory getSelfReference()
                                                              throws java.rmi.RemoteException
Returns a self reference. This method is used to retrieve the actual factory reference if given a proxy reference of the type AEFSessionFactoryRef.

Returns:
AEFSessionFactory
Throws:
java.rmi.RemoteException


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