com.threerings.presents.server
Class PresentsInvoker.EmptyingUnit

java.lang.Object
  extended by com.samskivert.util.Invoker.Unit
      extended by com.threerings.presents.server.PresentsInvoker.EmptyingUnit
All Implemented Interfaces:
Runnable
Enclosing class:
PresentsInvoker

protected class PresentsInvoker.EmptyingUnit
extends Invoker.Unit

This gets posted to this invoker over and over again until it, any interdependent invokers and the DObjectManager are all empty.


Field Summary
protected  int _loopCount
          How many times we've looped on the thread we're currently on.
protected  Runnable _onEmpty
          The runnable to execute when all associated queues are empty or we've given up.
protected  int _passCount
          The number of times we've been passed to the object manager.
protected static long CHECK_TIMEOUT
           
protected static int MAX_LOOPS
          The maximum number of loops we allow before just ending things.
protected static int MAX_PASSES
          The maximum number of passes we allow before just ending things.
 
Fields inherited from class com.samskivert.util.Invoker.Unit
_name, queueStamp
 
Constructor Summary
PresentsInvoker.EmptyingUnit(Runnable onEmpty)
           
 
Method Summary
 long getLongThreshold()
           
 boolean invoke()
           
protected  void releaseCheckers(List<PresentsInvoker.BlockingUnit> checkers)
           
 
Methods inherited from class com.samskivert.util.Invoker.Unit
getDetail, handleResult, run, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_onEmpty

protected Runnable _onEmpty
The runnable to execute when all associated queues are empty or we've given up.


_passCount

protected int _passCount
The number of times we've been passed to the object manager.


_loopCount

protected int _loopCount
How many times we've looped on the thread we're currently on.


MAX_PASSES

protected static final int MAX_PASSES
The maximum number of passes we allow before just ending things.

See Also:
Constant Field Values

MAX_LOOPS

protected static final int MAX_LOOPS
The maximum number of loops we allow before just ending things.

See Also:
Constant Field Values

CHECK_TIMEOUT

protected static final long CHECK_TIMEOUT
See Also:
Constant Field Values
Constructor Detail

PresentsInvoker.EmptyingUnit

public PresentsInvoker.EmptyingUnit(Runnable onEmpty)
Method Detail

invoke

public boolean invoke()
Specified by:
invoke in class Invoker.Unit

getLongThreshold

public long getLongThreshold()
Overrides:
getLongThreshold in class Invoker.Unit

releaseCheckers

protected void releaseCheckers(List<PresentsInvoker.BlockingUnit> checkers)