com.ibm.dse.appl.forwarding.base
Class SystemAvailabilityManager

java.lang.Object
  |
  +--com.ibm.dse.base.DSENotifier
        |
        +--com.ibm.dse.appl.forwarding.base.SystemAvailabilityManager

public class SystemAvailabilityManager
extends DSENotifier
implements Handler


Field Summary
static int NOT_KNOWN
           
static int OFF_LINE
           
static int ON_LINE
           
 
Fields inherited from class com.ibm.dse.base.DSENotifier
handlersList, name
 
Constructor Summary
protected SystemAvailabilityManager()
          The constructor is used only by instance() method.
 
Method Summary
 Handler dispatchEvent(DSEEventObject anEvent)
          This method is called when a notifier generates the event anEvent.
 int getBranchStatus()
           
 int getHostStatus()
           
 int getTellerStatus()
           
 void handleEvent(java.lang.String anEventName, java.lang.String aNotifierName, Context aContext)
          This method calls the EventManager class that will care of registering the handler to the local notifier if it is defined or to add it to its own list of handlers if the notifier is remote.
 void handleEvent(java.lang.String anEventName, java.lang.String aNotifierName, Context aContext, java.lang.String aTID)
          This method calls the EventManager class that will care of registering the handler to the local notifier if it is defined or to add it to its own list of handlers if the notifier is remote.
static SystemAvailabilityManager instance()
          Returns the only instance of the class.
static void releaseInstance()
          Releases the only instance of this class.
 void setBranchStatus(int value)
           
 void setHostStatus(int status)
           
 void setTellerStatus(int value)
           
 void stopHandlingEvent(java.lang.String anEventName, java.lang.String aNotifierName, Context aContext)
          This method allows the Handler to stop receiving a specific event it was registered for previously.
 void stopHandlingEvent(java.lang.String anEventName, java.lang.String aNotifierName, Context aContext, java.lang.String aTID)
          This method allows the Handler to stop receiving a specific event it was registered for previously.
 int verifyOperationMode()
          Checks host (including time-out values), branch, teller and session availability indicators to do this.
 
Methods inherited from class com.ibm.dse.base.DSENotifier
addHandler, getHandlersList, getName, removeHandler, setName, signalEvent, signalEvent, signalEvent, terminate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ON_LINE

public static int ON_LINE

OFF_LINE

public static int OFF_LINE

NOT_KNOWN

public static int NOT_KNOWN
Constructor Detail

SystemAvailabilityManager

protected SystemAvailabilityManager()
The constructor is used only by instance() method.
Method Detail

dispatchEvent

public Handler dispatchEvent(DSEEventObject anEvent)
This method is called when a notifier generates the event anEvent.

anEvent will contain relevant data to be used by the event handler held in a Hashtable, the source of the event and the event name. Any handler is responsible for implementing this method, to check if it is interested in the event and/or pass it to the next interested handler in the chain.

If the method returns this, the notifier will pass the event to the following handler in the chain waiting for it. If the method returns null, the event is not propagated.

The default event processing is to pass the event to the following handler.

Specified by:
dispatchEvent in interface Handler

getBranchStatus

public int getBranchStatus()

getHostStatus

public int getHostStatus()

getTellerStatus

public int getTellerStatus()

handleEvent

public void handleEvent(java.lang.String anEventName,
                        java.lang.String aNotifierName,
                        Context aContext)
                 throws DSEInvalidArgumentException
This method calls the EventManager class that will care of registering the handler to the local notifier if it is defined or to add it to its own list of handlers if the notifier is remote.

This method throws a DSEInvalidArgumentException generated by the EventManager addHandler method.

Specified by:
handleEvent in interface Handler

handleEvent

public void handleEvent(java.lang.String anEventName,
                        java.lang.String aNotifierName,
                        Context aContext,
                        java.lang.String aTID)
                 throws DSEInvalidArgumentException
This method calls the EventManager class that will care of registering the handler to the local notifier if it is defined or to add it to its own list of handlers if the notifier is remote.

aServerName is used when the application has session with different remote workstations; it can be a TID

This method throws a DSEInvalidArgumentException generated by the EventManager addHandler method.

Specified by:
handleEvent in interface Handler

instance

public static SystemAvailabilityManager instance()
Returns the only instance of the class.
Returns:
COM.footprint.sf.server.SystemAvailabilityManager

releaseInstance

public static void releaseInstance()
Releases the only instance of this class.

setBranchStatus

public void setBranchStatus(int value)
Parameters:
value - int

setHostStatus

public void setHostStatus(int status)
Parameters:
status - java.lang.Integer

setTellerStatus

public void setTellerStatus(int value)
Parameters:
value - int

stopHandlingEvent

public void stopHandlingEvent(java.lang.String anEventName,
                              java.lang.String aNotifierName,
                              Context aContext)
                       throws DSEInvalidArgumentException,
                              DSEHandlerNotFoundException
This method allows the Handler to stop receiving a specific event it was registered for previously.

The notifier will remove the handler from its handlers list for that specific event. If the event name is "allEvents" any reference to the handler in the list of handlers for that notifier will be deleted.

The method invoke an EventManeger method that will check whether the notifier is local or remote. In the first case, it will call the notifier to remove the handler from its list of handlers for that specific event; in the second case, the EventManager will itself remove the handler from its list of handlers.

This method throws a DSEInvalidArgumentException and a DSEHandlerNotFoundException generated by the EventManager removeHandler method.

Specified by:
stopHandlingEvent in interface Handler

stopHandlingEvent

public void stopHandlingEvent(java.lang.String anEventName,
                              java.lang.String aNotifierName,
                              Context aContext,
                              java.lang.String aTID)
                       throws DSEInvalidArgumentException,
                              DSEHandlerNotFoundException
This method allows the Handler to stop receiving a specific event it was registered for previously.

The notifier will remove the handler from its handlers list for that specific event. If the event name is "allEvents" any reference to the handler in the list of handlers for that notifier will be deleted.

The method invoke an EventManager method that will check whether the notifier is local or remote. In the first case, it will call the notifier to remove the handler from its list of handlers for that specific event; in the second case, the EventManager will itself remove the handler from its list of handlers and will call the remote EventManager to deregister interest in a remote event if no more handlers in that workstation are waiting for the event. From aContext and aTID, the EventManager knows the C/S mechanism instance to use to communicate with the server workstation.

This method throws a DSEInvalidArgumentException and a DSEHandlerNotFoundException generated by the EventManager removeHandler method.

Specified by:
stopHandlingEvent in interface Handler

verifyOperationMode

public int verifyOperationMode()
Checks host (including time-out values), branch, teller and session availability indicators to do this. If all the indicators show on-line, the system responds that the teller is on-line. If one of the indicators shows off-line, the system responds with an off-line indicator and indicates which level is not available