|
AdventNet Web NMS 4 API Specification | ||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | ||||||||
See:
Description
| Interface Summary | |
| FailOverListener | This interface can be used to get the notification of FailOver Event. |
| Class Summary | |
| FailOverEvent | |
This package contains java documentation for the API classes that provide useful information about the status of the client when it detects connection loss with the front end server. FailOver mechanism is supported only for Application clients and not for the Applet clients(due to Applet restrictions) .i.e the clients which are connected through the Browser.
Actually, the client frame work maintains the number of front-end servers
which are connected to a common back-end server. Whenever the
client framework detects connection loss with the front-end server,
it intimates the failover listener via the preFailOverNotification( ) method.
The FailOverEvent which is passed as an argument to the preFailOverNotification(
) contains information regarding the presently connected front-end server
name, port and so on.
FailOver Registeration Process :
Suppose an application wants to do some operation when the client is trying to do a failOver operation. Here the application must implement the FailOverListener interface and register with the PureClientUtils through the addFailOverListener() method. If an application is an instance of SocketListener then it will automatically get registered with the PureClientUtils on invoking the registerForResponse() method.
For registering as a FailOver Listener, the application needs to specify a constant called SOCKET_TYPE. The client framework sends a failover notification based on the socket type which is specified by the application.
There are three types of constants as given below.
The following code snippet will help you to achieve the same.
//Registering as FailOver Listener
| PureClientUtils.addFailOverListener(this, PureClientUtils.MAIN_SOCKET); |
FailOver deRegisteration Process :
This mechanism is for disabling the notification mechanism for an application at run time. If this mechanism is used, the client is deregistered for receiving notifications during failover..
The following code snippet shows how you can use the de-registering process.
//Removes a FailOver Listener from the Client Framework.
| PureClientUtils.removeFailOverListener(FailOverListener listener,PureClientUtils.MAIN_SOCKET) ; |
While invoking the removeFailOverListener( ) method, make sure that the specified socket type is same as the socket type which was specified while doing the registeration. If an application is an instance of the SocketListener then this deregisteration process will automatically be carried out while shutting down the client.
The client modules which desire to receive PreFailOverNotification and PostFailOverNotification must register themselves as FailOverListeners. For registering as listeners, the modules must implement the FailOverListener interface.
The client framework tries to reestablish the connection with the front
end servers which are available for connect. Once the above mentioned operation
is over, the client framework intimates the failover listeners about the
result of the failover operation through the postFailOverNotification(
) method. The FailOverEvent which is passed as an argument to the preFailOverNotification(
) contains information regarding the presently connected front-end server
name, port and so on.
|
AdventNet Web NMS 4 API Specification | ||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | ||||||||