mx4j.remote
Class DefaultRemoteNotificationServerHandler
java.lang.Object
mx4j.remote.DefaultRemoteNotificationServerHandler
- RemoteNotificationServerHandler
public class DefaultRemoteNotificationServerHandler
extends java.lang.Object
Base implementation of the RemoteNotificationServerHandler interface.
void | addNotificationListener(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.
|
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(Integer id) - Removes the listener with the given ID from this handler
|
protected boolean | waitForNotifications(Object lock, long timeout) - Called when there are no notifications to send to the client.
|
DefaultRemoteNotificationServerHandler
public DefaultRemoteNotificationServerHandler(Map environment)
Creates a new remote notification server handler.
environment
- Contains environment variables used to configure this handler
fetchNotifications
public javax.management.remote.NotificationResult fetchNotifications(long sequenceNumber,
int maxNotifications,
long timeout)
throws IOException
Fetches notifications from the notification buffer in order to send them
to the client side
- fetchNotifications in interface RemoteNotificationServerHandler
filterNotifications
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.
Default behavior is no filtering, but subclasses may choose to change this bahavior.
For example, for RMI, one can assure that all notifications are truly serializable, and log those
that are not.
generateListenerID
public Integer generateListenerID(javax.management.ObjectName name,
javax.management.NotificationFilter filter)
Returns a unique ID for a client-side NotificationListener
- generateListenerID in interface RemoteNotificationServerHandler
getLogger
protected Logger getLogger()
waitForNotifications
protected boolean waitForNotifications(Object lock,
long timeout)
Called when there are no notifications to send to the client.
It is guaranteed that no notification can be added before this method waits on the given lock.
It should wait on the given lock for the specified timeout, and return true
to send notifications (if no notifications arrived, an empty notification array
will be returned to the client), or false if no notifications should be sent to
the client.
lock
- The object on which DefaultRemoteNotificationServerHandler
should be calledtimeout
- The amount of time to wait (guaranteed to be strictly greater than 0)
Copyright © 2001-2005 The MX4J Contributors. All Rights Reserved.