Broker 10.5 | webMethods Broker Documentation | webMethods Broker Client Java API Programmer's Guide | Using Broker Clients | Connection Notification | Registering the Callback Object
Registering the Callback Object
You use the BrokerClient.registerConnectionCallback method to register a method you want to be called in the event your Broker client is disconnected or reconnected to its Broker. This method accepts two parameters. The first parameter is the BrokerConnectionCallback-derived object that implements your callback method. The second parameter is a client_data object, which is used to pass any needed data to the callback method.
Any callback objects previously registered for a Broker client will be replaced by the one currently being registered.
When the BrokerConnectionCallback object's the callback method is invoked, that method's connect_state parameter will be set to one of the BrokerClient-defined values shown in the following table.
Connect state values
The client has been disconnected.
The Client connection has been re-established, because automatic reconnect was enabled.
The Client was disconnected, but the connection was re-established immediately. This only happens if the automatic reconnect feature is enabled and the connection is re-established before a disconnected state can be reported.