org.exoplatform.services.jcr.rmi.impl.server
Class ServerObservationManager
java.lang.Object
java.rmi.server.RemoteObject
java.rmi.server.RemoteServer
java.rmi.server.UnicastRemoteObject
org.exoplatform.services.jcr.rmi.impl.server.ServerObject
org.exoplatform.services.jcr.rmi.impl.server.ServerObservationManager
- All Implemented Interfaces:
- java.io.Serializable, java.rmi.Remote, RemoteObservationManager
public class ServerObservationManager
- extends ServerObject
- implements RemoteObservationManager
Remote adapter for the JCR ObservationManager
interface. This class makes a local item available as an RMI service using the
RemoteObservationManager interface.
This class works in conjunction with the
ClientObservationManager class to implement
the distributed the event listener registration described in RemoteObservationManager,
Serialized Form
| Fields inherited from class java.rmi.server.RemoteObject |
ref |
|
Method Summary |
void |
addEventListener(long listenerId,
int eventTypes,
java.lang.String absPath,
boolean isDeep,
java.lang.String[] uuid,
java.lang.String[] nodeTypeName,
boolean noLocal)
Remote version of the
ObservationManager.addEventListener() method. |
RemoteEventCollection |
getNextEvent(long timeout)
Returns the next event to be dispatched to registered event listeners. |
void |
removeEventListener(long listenerId)
Remote version of the
ObservationManager.removeEventListener() method. |
| Methods inherited from class java.rmi.server.UnicastRemoteObject |
clone, exportObject, exportObject, exportObject, unexportObject |
| Methods inherited from class java.rmi.server.RemoteServer |
getClientHost, getLog, setLog |
| Methods inherited from class java.rmi.server.RemoteObject |
equals, getRef, hashCode, toString, toStub |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
ServerObservationManager
public ServerObservationManager(javax.jcr.observation.ObservationManager observationManager,
RemoteAdapterFactory factory)
throws java.rmi.RemoteException
- Creates a remote adapter for the given local workspace.
- Parameters:
observationManager - local observation managerfactory - remote adapter factory
- Throws:
java.rmi.RemoteException - on RMI errors
addEventListener
public void addEventListener(long listenerId,
int eventTypes,
java.lang.String absPath,
boolean isDeep,
java.lang.String[] uuid,
java.lang.String[] nodeTypeName,
boolean noLocal)
throws javax.jcr.RepositoryException,
java.rmi.RemoteException
- Remote version of the
ObservationManager.addEventListener() method. See class comment for an explanation on how the
listenerId is used.
- Specified by:
addEventListener in interface RemoteObservationManager
- Parameters:
listenerId - The identification of the listener on the client side to which events will be
directed.eventTypes - The mask of event types to be sent to this listener.absPath - The root item defining a subtree for which events are to be delivered.isDeep - true if the events from the complete subtree rooted at
absPath are to be sent or only for the item at the given path.uuid - An optional list of node UUIDs for which events are to be sent. If null
this parameter is ignored.nodeTypeName - An optional list of node type names for which events are to be sent. If
null this parameter is ignored.noLocal - true if only events are to be sent which do not originate from the
session to which this instance belongs.
- Throws:
javax.jcr.RepositoryException - on repository errors
java.rmi.RemoteException - on RMI errors
removeEventListener
public void removeEventListener(long listenerId)
throws javax.jcr.RepositoryException,
java.rmi.RemoteException
- Remote version of the
ObservationManager.removeEventListener() method. See class comment for an explanation on how
the listenerId is used.
- Specified by:
removeEventListener in interface RemoteObservationManager
- Parameters:
listenerId - The identification of the listener on the client side to which events will be
directed.
- Throws:
javax.jcr.RepositoryException - on repository errors
java.rmi.RemoteException - on RMI errors
getNextEvent
public RemoteEventCollection getNextEvent(long timeout)
throws java.rmi.RemoteException
- Returns the next event to be dispatched to registered event listeners. If no event is
available, this method blocks until one is available or until the given timeout expires.
- Specified by:
getNextEvent in interface RemoteObservationManager
- Parameters:
timeout - The time in milliseconds to wait for the next event available to be dispatched. If
negative or zero, this method waits for ever.
- Returns:
- The
RemoteEventCollection to be dispatched. null is returned if
the method timed out waiting for an event to be dispatched.
- Throws:
java.rmi.RemoteException - on RMI errors
Copyright © 2011 eXo Platform SAS. All Rights Reserved.