Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
mx4j.remote.AbstractRemoteNotificationClientHandler
public abstract class AbstractRemoteNotificationClientHandler
extends java.lang.Object
implements RemoteNotificationClientHandler
Constructor Summary | |
|
Method Summary | |
void |
|
boolean |
|
protected javax.management.remote.NotificationResult |
|
protected Logger | |
protected int |
|
Integer | |
Integer[] | |
protected int | |
protected long |
|
boolean |
|
void |
|
protected void |
|
void |
|
void |
|
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
- Parameters:
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
public void addNotificationListener(Integer id, NotificationTuple tuple)
- Specified by:
- addNotificationListener in interface RemoteNotificationClientHandler
public boolean contains(NotificationTuple tuple)
- Specified by:
- contains in interface RemoteNotificationClientHandler
protected javax.management.remote.NotificationResult fetchNotifications(long sequence, int maxNumber, long timeout) throws IOException
Calls the server side to fetch notifications.
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.
- See Also:
getRetryPeriod()
,AbstractRemoteNotificationClientHandler
public Integer getNotificationListener(NotificationTuple tuple)
- Specified by:
- getNotificationListener in interface RemoteNotificationClientHandler
public Integer[] getNotificationListeners(NotificationTuple tuple)
- Specified by:
- getNotificationListeners in interface RemoteNotificationClientHandler
protected int getNotificationsCount()
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.
- See Also:
getMaxRetries()
,AbstractRemoteNotificationClientHandler
public boolean isActive()
Returns whether this client handler is fetching notifications or not.
public void removeNotificationListeners(Integer[] ids)
- Specified by:
- removeNotificationListeners in interface RemoteNotificationClientHandler
protected void sendConnectionNotificationLost(long number)
Sends thejavax.management.remote.JMXConnectionNotification.NOTIFS_LOST
notification using the emitter passed toAbstractRemoteNotificationClientHandler