org.apache.felix.mosgi.jmx.rmiconnector.mx4j.remote
Class DefaultRemoteNotificationServerHandler
java.lang.Object
org.apache.felix.mosgi.jmx.rmiconnector.mx4j.remote.DefaultRemoteNotificationServerHandler
- All Implemented Interfaces:
- RemoteNotificationServerHandler
public class DefaultRemoteNotificationServerHandler
- extends Object
- implements RemoteNotificationServerHandler
- Version:
- $Revision: 1.1.1.1 $
- Author:
- Simone Bordet
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultRemoteNotificationServerHandler
public DefaultRemoteNotificationServerHandler(Map environment)
generateListenerID
public Integer generateListenerID(javax.management.ObjectName name,
javax.management.NotificationFilter filter)
- Specified by:
generateListenerID
in interface RemoteNotificationServerHandler
getServerNotificationListener
public javax.management.NotificationListener getServerNotificationListener()
- Specified by:
getServerNotificationListener
in interface RemoteNotificationServerHandler
addNotificationListener
public void addNotificationListener(Integer id,
NotificationTuple tuple)
- Specified by:
addNotificationListener
in interface RemoteNotificationServerHandler
removeNotificationListener
public void removeNotificationListener(Integer id)
- Specified by:
removeNotificationListener
in interface RemoteNotificationServerHandler
getNotificationListener
public NotificationTuple getNotificationListener(Integer id)
- Specified by:
getNotificationListener
in interface RemoteNotificationServerHandler
fetchNotifications
public javax.management.remote.NotificationResult fetchNotifications(long sequenceNumber,
int maxNotifications,
long timeout)
- Specified by:
fetchNotifications
in interface RemoteNotificationServerHandler
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.
- Parameters:
lock
- The object on which Object.wait()
should be calledtimeout
- The amount of time to wait (guaranteed to be strictly greater than 0)
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.
Copyright © 2013 The Apache Software Foundation. All Rights Reserved.