mx4j.remote
Class AbstractRemoteNotificationClientHandler
java.lang.Object
mx4j.remote.AbstractRemoteNotificationClientHandler
- RemoteNotificationClientHandler
public abstract class AbstractRemoteNotificationClientHandler
extends java.lang.Object
Base implementation of the RemoteNotificationClientHandler interface.
AbstractRemoteNotificationClientHandler
protected AbstractRemoteNotificationClientHandler(ConnectionNotificationEmitter emitter,
HeartBeat heartbeat,
Map environment)
Creates a new remote notification client-side handler.
It uses an emitter, an heartbeat and an environment to perform the job.
All 3 can be null, but the corrispondent methods must be overridden
emitter
- The NotificationEmitter that emits connection failures notificationsheartbeat
- The heart beat is used to get the retry parameters in case of connection failureenvironment
- Contains environment variables used to configure this handler
fetchNotifications
protected abstract javax.management.remote.NotificationResult fetchNotifications(long sequence,
int maxNumber,
long timeout)
throws IOException
Calls the server side to fetch notifications.
getLogger
protected Logger getLogger()
getMaxRetries
protected int getMaxRetries()
Returns the maximum number of attempts that should be made before declaring a connection
failed.
This implementation returns the heartbeat max retries, but can be overridden.
getNotificationsCount
protected int getNotificationsCount()
getRetryPeriod
protected long getRetryPeriod()
Returns the period between two retries if the connection with the server side fails.
This implementation returns the heartbeat pulse period, but can be overridden.
isActive
public boolean isActive()
Returns whether this client handler is fetching notifications or not.
sendConnectionNotificationLost
protected void sendConnectionNotificationLost(long number)
Copyright © 2001-2005 The MX4J Contributors. All Rights Reserved.