|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
org.exoplatform.services.jcr.rmi.api.observation.ClientEventPoll
public class ClientEventPoll
The ClientEventPoll class is the registry for client-side event listeners on behalf
of the ClientObservationManager class. In
addition this class extends the java.lang.Thread class able to be run in a separate
thread to constantly poll the server-side observation manager for new events.
Notes:
RemoteObservationManager class.
EventListeners registered with this class must properly implement the
Object.hashCode() and Object.equals() contracts for them to be handled
correctly by this class.
run()| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
| Field Summary |
|---|
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
ClientEventPoll(RemoteObservationManager remote,
javax.jcr.Session session)
Creates an instance of this class talking to the given RemoteObservationManager. |
|
| Method Summary | |
|---|---|
long |
addListener(javax.jcr.observation.EventListener listener)
Registers the given local listener with this instance and returns the unique identifier assigned to it. |
javax.jcr.observation.EventListener[] |
getListeners()
Returns an array of the registered event listeners. |
long |
removeListener(javax.jcr.observation.EventListener listener)
Unregisters the given local listener from this instance and returns the unique identifier assigned to it. |
void |
run()
Checks for remote events and dispatches them to the locally registered event listeners. |
void |
terminate()
Indicates to the run() method, that asking for events should be terminated. |
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ClientEventPoll(RemoteObservationManager remote,
javax.jcr.Session session)
throws java.lang.NullPointerException
RemoteObservationManager.
remote - The remote observation manager which is asked for new events. This must not be
null.session - The Session which is asked whether it is alive by the run()
method. This must not be null.
java.lang.NullPointerException - if remote or session is null.| Method Detail |
|---|
public long addListener(javax.jcr.observation.EventListener listener)
listener - The EventListener to register.
public long removeListener(javax.jcr.observation.EventListener listener)
listener - The EventListener to unregister.
-1 if
the listener was not registered.public javax.jcr.observation.EventListener[] getListeners()
public void terminate()
run() method, that asking for events should be terminated.
run()public void run()
terminate() has not been called yet and the session is
still alive.
RemoteObservationManager.getNextEvent(long) method waiting for a specified
time (5 seconds).
EventIterator and call the
EventListener.onEvent() method.
run in interface java.lang.Runnablerun in class java.lang.Thread
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||