com.threerings.presents.dobj
Interface RootDObjectManager

All Superinterfaces:
DObjectManager, Executor, Interval.Factory, RunQueue
All Known Implementing Classes:
LocalDObjectMgr, PresentsDObjectMgr

public interface RootDObjectManager
extends DObjectManager, RunQueue, Executor, Interval.Factory

The root distributed object manager extends the basic distributed object manager interface with methods that can only be guaranteed to work in the virtual machine that is hosting the distributed objects in question. VMs that operate proxies of objects can only implement the basic distributed object manager interface.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.samskivert.util.RunQueue
RunQueue.AsExecutor
 
Field Summary
 
Fields inherited from interface com.samskivert.util.RunQueue
AWT
 
Method Summary
 void destroyObject(int oid)
          Requests that the specified object be destroyed.
 DObject getObject(int oid)
          Looks up and returns the requested distributed object in the dobj table, returning null if no object exists with that oid.
 Interval newInterval(Runnable action)
          Creates an Interval that runs the supplied runnable.
<T extends DObject>
T
registerObject(T object)
          Registers a distributed object instance of the supplied class with the system and assigns it an oid.
 
Methods inherited from interface com.threerings.presents.dobj.DObjectManager
isManager, postEvent, removedLastSubscriber, subscribeToObject, unsubscribeFromObject
 
Methods inherited from interface com.samskivert.util.RunQueue
isDispatchThread, isRunning, postRunnable
 
Methods inherited from interface java.util.concurrent.Executor
execute
 

Method Detail

getObject

DObject getObject(int oid)
Looks up and returns the requested distributed object in the dobj table, returning null if no object exists with that oid.


registerObject

<T extends DObject> T registerObject(T object)
Registers a distributed object instance of the supplied class with the system and assigns it an oid. When the call returns the object will be registered with the system and its oid will have been assigned.

Returns:
the registered object for the caller's convenience.

destroyObject

void destroyObject(int oid)
Requests that the specified object be destroyed. Once destroyed an object is removed from the runtime system and may no longer have events dispatched on it.

Parameters:
oid - The object id of the distributed object to be destroyed.

newInterval

Interval newInterval(Runnable action)
Creates an Interval that runs the supplied runnable. If the root omgr is shutdown before the interval expires (or if the interval is scheduled to repeat), it will be automatically cancelled. This makes it easy to schedule fire-and-forget intervals:
 _omgr.newInterval(someRunnable).schedule(500); // one shot
 Interval ival = _omgr.newInterval(someRunnable).schedule(500, true); // repeater
 

Specified by:
newInterval in interface Interval.Factory