com.ibm.retail.AEF.server
Interface LoadBalancer


public interface LoadBalancer

LoadBalancer provides an API to enable load balancing logic to be used by the AEF SessionServer.

Classes implementing the LoadBalancer interface may be used as the load balancing implementation by overriding the default LoadBalancer class name specified in the classes.properties file.


Method Summary
 void factoryAdded(com.ibm.retail.AEF.factory.AEFSessionFactoryInfo factoryInfo)
          Called by the session server when a factory has been added.
 void factoryRemoved(com.ibm.retail.AEF.factory.AEFSessionFactoryInfo factoryInfo)
          Called by the session server when a factory has been removed.
 void factoryUpdated(com.ibm.retail.AEF.factory.AEFSessionFactoryInfo factoryInfo)
          Called by the session server when factory info has been updated.
 com.ibm.retail.AEF.session.AEFSession getAvailableSession(com.ibm.retail.AEF.session.SessionParameters parms)
          Get an available session using a factory selected by the LoadBalancer.
 com.ibm.retail.AEF.server.SessionServer getSessionServer()
          Gets the SessionServer which owns this load balancer.
 void setSessionServer(com.ibm.retail.AEF.server.SessionServer server)
          Sets the SessionServer which owns this load balancer.
 

Method Detail

factoryAdded

public void factoryAdded(com.ibm.retail.AEF.factory.AEFSessionFactoryInfo factoryInfo)
Called by the session server when a factory has been added. This method should update any internal data structure required to keep track of the factory. The AEFSessionFactoryInfo.getKey() will return a key that can be used to tell the session server which factory to utilize for a session request.

Parameters:
factoryInfo - AEFSessionFactoryInfo

factoryRemoved

public void factoryRemoved(com.ibm.retail.AEF.factory.AEFSessionFactoryInfo factoryInfo)
Called by the session server when a factory has been removed. This method should update any internal data structure required to keep track of the factory. The AEFSessionFactoryInfo.getKey() will return a key that can be used to tell the session server which factory to utilize for a session request.

Parameters:
factoryInfo - AEFSessionFactoryInfo

factoryUpdated

public void factoryUpdated(com.ibm.retail.AEF.factory.AEFSessionFactoryInfo factoryInfo)
Called by the session server when factory info has been updated. This method should update any internal data structure required to keep track of the factory. The AEFSessionFactoryInfo.getKey() will return a key that can be used to tell the session server which factory to utilize for a session request.

Parameters:
factoryInfo - AEFSessionFactoryInfo

getSessionServer

public com.ibm.retail.AEF.server.SessionServer getSessionServer()
                                                         throws java.rmi.RemoteException
Gets the SessionServer which owns this load balancer.

Returns:
SessionServer
Throws:
java.rmi.RemoteException - if remote access fails

setSessionServer

public void setSessionServer(com.ibm.retail.AEF.server.SessionServer server)
                      throws java.rmi.RemoteException
Sets the SessionServer which owns this load balancer.

Throws:
java.rmi.RemoteException - if remote access fails

getAvailableSession

public com.ibm.retail.AEF.session.AEFSession getAvailableSession(com.ibm.retail.AEF.session.SessionParameters parms)
                                                          throws AEFException
Get an available session using a factory selected by the LoadBalancer.

Pluggable LoadBalancer implementations may implement a variety of load balancing algorithms to distribute requests.

The SessionServer invokes this method whenever a client request for a an available AEFSession is received. The SessionServer defers all factory selection to the LoadBalancer.

If no factory can satisfy the request, an exception is thrown.

Parameters:
parms - SessionParameters object contains all parms for the session as name-value pairs.
Returns:
an avaiable AEFSession or null if none exists
Throws:
AEFException - if a session can not be accessed Among the possible AEFException error codes are:
AEFConst.NO_SESSION_FACTORIES_FOUND, AEFConst.NONE
AEFConst.SERVER_NO_SESSION_AVAILABLE, AEFConst.NONE


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