public class DefaultRemoteNotificationServerHandler extends java.lang.Object implements RemoteNotificationServerHandler
Constructor and Description |
---|
DefaultRemoteNotificationServerHandler(java.util.Map environment)
Creates a new remote notification server handler.
|
Modifier and Type | Method and Description |
---|---|
void |
addNotificationListener(java.lang.Integer id,
NotificationTuple tuple)
Adds the given tuple with the given listener ID to this handler
|
NotificationTuple[] |
close()
Closes this handler, that will not accept anymore add or removal of listeners
|
javax.management.remote.NotificationResult |
fetchNotifications(long sequenceNumber,
int maxNotifications,
long timeout)
Fetches notifications from the notification buffer in order to send them
to the client side
|
protected javax.management.remote.TargetedNotification[] |
filterNotifications(javax.management.remote.TargetedNotification[] notifications)
This method filters the given notification array and returns a possibly smaller array containing
only notifications that passed successfully the filtering.
|
java.lang.Integer |
generateListenerID(javax.management.ObjectName name,
javax.management.NotificationFilter filter)
Returns a unique ID for a client-side NotificationListener
|
protected Logger |
getLogger() |
javax.management.NotificationListener |
getServerNotificationListener()
Returns the unique server side listener that will represent client-side listeners
on MBeans.
|
NotificationTuple |
removeNotificationListener(java.lang.Integer id)
Removes the listener with the given ID from this handler
|
protected boolean |
waitForNotifications(java.lang.Object lock,
long timeout)
Called when there are no notifications to send to the client.
|
public DefaultRemoteNotificationServerHandler(java.util.Map environment)
environment
- Contains environment variables used to configure this handlerMX4JRemoteConstants.NOTIFICATION_BUFFER_CAPACITY
,
MX4JRemoteConstants.NOTIFICATION_PURGE_DISTANCE
public java.lang.Integer generateListenerID(javax.management.ObjectName name, javax.management.NotificationFilter filter)
RemoteNotificationServerHandler
generateListenerID
in interface RemoteNotificationServerHandler
RemoteNotificationServerHandler.addNotificationListener(java.lang.Integer, mx4j.remote.NotificationTuple)
public javax.management.NotificationListener getServerNotificationListener()
RemoteNotificationServerHandler
getServerNotificationListener
in interface RemoteNotificationServerHandler
public void addNotificationListener(java.lang.Integer id, NotificationTuple tuple)
RemoteNotificationServerHandler
addNotificationListener
in interface RemoteNotificationServerHandler
RemoteNotificationServerHandler.removeNotificationListener(java.lang.Integer)
public NotificationTuple removeNotificationListener(java.lang.Integer id)
RemoteNotificationServerHandler
public javax.management.remote.NotificationResult fetchNotifications(long sequenceNumber, int maxNotifications, long timeout) throws java.io.IOException
RemoteNotificationServerHandler
fetchNotifications
in interface RemoteNotificationServerHandler
java.io.IOException
- If this handler has already been closedpublic NotificationTuple[] close()
RemoteNotificationServerHandler
close
in interface RemoteNotificationServerHandler
RemoteNotificationServerHandler.fetchNotifications(long, int, long)
protected boolean waitForNotifications(java.lang.Object lock, long timeout)
lock
- The object on which Object.wait(long)
should be calledtimeout
- The amount of time to wait (guaranteed to be strictly greater than 0)protected javax.management.remote.TargetedNotification[] filterNotifications(javax.management.remote.TargetedNotification[] notifications)
protected Logger getLogger()