com.threerings.presents.server
Class PresentsInvoker
java.lang.Object
java.lang.Thread
com.samskivert.util.LoopingThread
com.samskivert.util.Invoker
com.threerings.presents.server.ReportingInvoker
com.threerings.presents.server.PresentsInvoker
- All Implemented Interfaces:
- Lifecycle.BaseComponent, Lifecycle.ShutdownComponent, RunQueue, Runnable, Executor
public class PresentsInvoker
- extends ReportingInvoker
- implements Lifecycle.ShutdownComponent
Extends the generic Invoker and integrates it a bit more into the Presents system.
|
Nested Class Summary |
protected class |
PresentsInvoker.BlockingUnit
Runs in an Invoker or the DObjectManager and blocks it until released by EmptyingUnit. |
protected class |
PresentsInvoker.EmptyingUnit
This gets posted to this invoker over and over again until it, any interdependent invokers
and the DObjectManager are all empty. |
| Fields inherited from interface com.samskivert.util.RunQueue |
AWT |
|
Method Summary |
void |
addInterdependentInvoker(Invoker invoker)
Adds an invoker that may post to the PresentsInvoker and the DObjectManager and may be
posted to by the PresentsInvoker and DObjectManager. |
protected void |
didShutdown()
|
void |
postRunnableWhenEmpty(Runnable onEmpty)
Posts the given runnable to this invoker when it, the DObjectManager and any interdependent
invokers are all empty. |
void |
shutdown()
|
| 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 |
_checkMonitor
protected Object _checkMonitor
- Synchronizes between EmptyingUnit and its BlockingUnits when checking that all
interdependent invokers are blocked.
_interdependentInvokers
protected List<Invoker> _interdependentInvokers
- Invokers that may post to Presents and may be posted to by Presents.
_omgr
protected PresentsDObjectMgr _omgr
- The distributed object manager with which we interoperate.
_server
@Inject
protected PresentsServer _server
- The server we're working for.
PresentsInvoker
@Inject
public PresentsInvoker(PresentsDObjectMgr omgr,
Lifecycle cycle,
ReportManager repmgr)
addInterdependentInvoker
public void addInterdependentInvoker(Invoker invoker)
- Adds an invoker that may post to the PresentsInvoker and the DObjectManager and may be
posted to by the PresentsInvoker and DObjectManager. This invoker will be taken into
consideration by
postRunnableWhenEmpty(Runnable) and in waiting for invokers to
empty out on shutdown.
postRunnableWhenEmpty
public void postRunnableWhenEmpty(Runnable onEmpty)
- Posts the given runnable to this invoker when it, the DObjectManager and any interdependent
invokers are all empty.
shutdown
public void shutdown()
- Specified by:
shutdown in interface Lifecycle.ShutdownComponent- Overrides:
shutdown in class Invoker
didShutdown
protected void didShutdown()
- Overrides:
didShutdown in class LoopingThread