org.lsst.ccs.utilities.dispatch
Class ParallelObservable<P>
java.lang.Object
org.lsst.ccs.utilities.dispatch.ParallelObservable<P>
public class ParallelObservable<P>
- extends Object
An Observable that notifies Observers
through an ExecutorService (that is through different threads).
- Author:
- bernard AMADE
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
list
protected CopyOnWriteArrayList<ASyncObserver<P>> list
loop
protected ExecutorService loop
- ExecutorService that deals with the Threads handling the commands.
ParallelObservable
public ParallelObservable()
- Here the threads handling the updates are daemons.
You may change that by using a different constructor with another ExecutorService
ParallelObservable
public ParallelObservable(ExecutorService execService)
addObserver
public void addObserver(ASyncObserver<P> observer)
removeObserver
public void removeObserver(ASyncObserver<P> observer)
notifyObservers
public void notifyObservers(P data)
- do not need a call to setChanged: observers
are immediately notified through different threads
- Parameters:
data -
Copyright © 2013 LSST. All Rights Reserved.