com.sun.jdmk.comm
Interface HeartBeatClientHandler

All Known Implementing Classes:
GenericHttpConnectorClient, HttpConnectorClient, HttpsConnectorClient, RmiConnectorClient

public interface HeartBeatClientHandler

Interface to be implemented by all the connector clients that want to support the heartbeat mechanism.

This interface provides methods for configuring the heartbeat functionality from a manager.


Method Summary
 void addHeartBeatNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)
          Adds the specified heartbeat listener to receive heartbeat notifications from this connector client.
 int getHeartBeatPeriod()
          Gets the heartbeat period in milliseconds.
 int getHeartBeatRetries()
          Gets the number of retries.
 void removeHeartBeatNotificationListener(NotificationListener listener)
          Removes the specified heartbeat listener so that it no longer receives heartbeat notifications from this connector client.
 void setHeartBeatPeriod(int period)
          Specifies the heartbeat period in milliseconds.
 void setHeartBeatRetries(int nretries)
          Sets the number of retries.
 

Method Detail

getHeartBeatPeriod

int getHeartBeatPeriod()
Gets the heartbeat period in milliseconds.


setHeartBeatPeriod

void setHeartBeatPeriod(int period)
Specifies the heartbeat period in milliseconds.

If set to zero no check will be carried out for the associated connector server being alive. As the heartbeat is driven by the manager this would also prevent the connector server from being aware of the aliveness of this connector client.

Parameters:
period - The heartbeat period in milliseconds.

getHeartBeatRetries

int getHeartBeatRetries()
Gets the number of retries. This number specifies how many times a connector client must retry the connection to the connector server before sending the heartbeat notification indicating that the connector server has died. If number of retries equals zero then no retries are carried out.


setHeartBeatRetries

void setHeartBeatRetries(int nretries)
Sets the number of retries. This number specifies how many times a connector client must retry the connection to the connector server before sending the heartbeat notification indicating that the connector server has died. If number of retries equals zero then no retries are carried out.

Parameters:
nretries - The number of retries.

addHeartBeatNotificationListener

void addHeartBeatNotificationListener(NotificationListener listener,
                                      NotificationFilter filter,
                                      Object handback)
Adds the specified heartbeat listener to receive heartbeat notifications from this connector client. Heartbeat notifications occur when the connector client connects to or disconnects from the connector server or when the connector server associated to this connector client dies or is temporarily unreachable.

Parameters:
listener - The heartbeat listener which will handle the notifications emitted by the connector client.
filter - The filter object. If filter is null, no filtering will be performed before handling notifications.
handback - The context to be sent to the listener when a notification is emitted.

removeHeartBeatNotificationListener

void removeHeartBeatNotificationListener(NotificationListener listener)
Removes the specified heartbeat listener so that it no longer receives heartbeat notifications from this connector client. Heartbeat notifications occur when the connector client connects to or disconnects from the connector server or when the connector server associated to this connector client dies or is temporarily unreachable.

Parameters:
listener - The heartbeat listener which will handle the notifications emitted by the connector client.

Open Source build 02
opendmk-1.0-b02 2007.10.01_19:17:46_MEST

Copyright 1998-2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.