|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectmx4j.remote.AbstractRemoteNotificationClientHandler
Base implementation of the RemoteNotificationClientHandler interface.
| Constructor Summary | |
protected |
AbstractRemoteNotificationClientHandler(ConnectionNotificationEmitter emitter,
HeartBeat heartbeat,
java.util.Map environment)
Creates a new remote notification client-side handler. |
| Method Summary | |
void |
addNotificationListener(java.lang.Integer id,
NotificationTuple tuple)
Adds the given tuple with the given listener ID to this handler |
boolean |
contains(NotificationTuple tuple)
Returns whether the tuple is already present in this handler |
protected abstract javax.management.remote.NotificationResult |
fetchNotifications(long sequence,
int maxNumber,
long timeout)
Calls the server side to fetch notifications. |
protected Logger |
getLogger()
|
protected int |
getMaxRetries()
Returns the maximum number of attempts that should be made before declaring a connection failed. |
java.lang.Integer |
getNotificationListener(NotificationTuple tuple)
Returns the ID of the listener for the given tuple |
java.lang.Integer[] |
getNotificationListeners(NotificationTuple tuple)
Returns the IDs of the listeners for the given tuple |
protected int |
getNotificationsCount()
|
protected long |
getRetryPeriod()
Returns the period between two retries if the connection with the server side fails. |
boolean |
isActive()
Returns whether this client handler is fetching notifications or not. |
void |
removeNotificationListeners(java.lang.Integer[] ids)
Removes the listeners with the given IDs from this handler |
protected void |
sendConnectionNotificationLost(long number)
Sends the JMXConnectionNotification.NOTIFS_LOST notification
using the emitter passed to AbstractRemoteNotificationClientHandler |
void |
start()
Starts notification fetching |
void |
stop()
Stops notification fetching |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
protected AbstractRemoteNotificationClientHandler(ConnectionNotificationEmitter emitter,
HeartBeat heartbeat,
java.util.Map environment)
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 handlerMX4JRemoteConstants.FETCH_NOTIFICATIONS_MAX_NUMBER,
MX4JRemoteConstants.FETCH_NOTIFICATIONS_SLEEP,
MX4JRemoteConstants.FETCH_NOTIFICATIONS_TIMEOUT,
sendConnectionNotificationLost(long),
getMaxRetries(),
getRetryPeriod()| Method Detail |
public boolean isActive()
start(),
stop()public void start()
RemoteNotificationClientHandler
start in interface RemoteNotificationClientHandlerRemoteNotificationClientHandler.stop()public void stop()
RemoteNotificationClientHandler
stop in interface RemoteNotificationClientHandlerRemoteNotificationClientHandler.start()public boolean contains(NotificationTuple tuple)
RemoteNotificationClientHandler
contains in interface RemoteNotificationClientHandler
public void addNotificationListener(java.lang.Integer id,
NotificationTuple tuple)
RemoteNotificationClientHandler
addNotificationListener in interface RemoteNotificationClientHandlerMBeanServerConnection.addNotificationListener(javax.management.ObjectName, javax.management.NotificationListener, javax.management.NotificationFilter, java.lang.Object),
RemoteNotificationClientHandler.removeNotificationListeners(java.lang.Integer[])public java.lang.Integer[] getNotificationListeners(NotificationTuple tuple)
RemoteNotificationClientHandler
getNotificationListeners in interface RemoteNotificationClientHandlerMBeanServerConnection.removeNotificationListener(javax.management.ObjectName, javax.management.NotificationListener),
RemoteNotificationClientHandler.getNotificationListener(mx4j.remote.NotificationTuple)public java.lang.Integer getNotificationListener(NotificationTuple tuple)
RemoteNotificationClientHandler
getNotificationListener in interface RemoteNotificationClientHandlerMBeanServerConnection.removeNotificationListener(javax.management.ObjectName, javax.management.NotificationListener, javax.management.NotificationFilter, java.lang.Object),
RemoteNotificationClientHandler.getNotificationListeners(mx4j.remote.NotificationTuple)public void removeNotificationListeners(java.lang.Integer[] ids)
RemoteNotificationClientHandler
removeNotificationListeners in interface RemoteNotificationClientHandlerRemoteNotificationClientHandler.addNotificationListener(java.lang.Integer, mx4j.remote.NotificationTuple)
protected abstract javax.management.remote.NotificationResult fetchNotifications(long sequence,
int maxNumber,
long timeout)
throws java.io.IOException
java.io.IOExceptionprotected long getRetryPeriod()
getMaxRetries(),
AbstractRemoteNotificationClientHandler(mx4j.remote.ConnectionNotificationEmitter, mx4j.remote.HeartBeat, java.util.Map)protected int getMaxRetries()
getRetryPeriod(),
AbstractRemoteNotificationClientHandler(mx4j.remote.ConnectionNotificationEmitter, mx4j.remote.HeartBeat, java.util.Map)protected void sendConnectionNotificationLost(long number)
JMXConnectionNotification.NOTIFS_LOST notification
using the emitter passed to AbstractRemoteNotificationClientHandler
protected int getNotificationsCount()
protected Logger getLogger()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||