RootDObjectManager (PresentsDObjectMgr) implements Executor.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6000 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2009-12-07 21:26:44 +00:00
parent 72ce4370af
commit f546167ca7
2 changed files with 12 additions and 2 deletions
@@ -21,6 +21,8 @@
package com.threerings.presents.dobj;
import java.util.concurrent.Executor;
import com.samskivert.util.Interval;
import com.samskivert.util.RunQueue;
@@ -30,7 +32,7 @@ import com.samskivert.util.RunQueue;
* distributed objects in question. VMs that operate proxies of objects can only implement the
* basic distributed object manager interface.
*/
public interface RootDObjectManager extends DObjectManager, RunQueue
public interface RootDObjectManager extends DObjectManager, RunQueue, Executor
{
/**
* Looks up and returns the requested distributed object in the dobj table, returning null if
@@ -27,6 +27,8 @@ import java.lang.reflect.Modifier;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Executor;
import com.google.common.collect.Maps;
import com.google.inject.Inject;
import com.google.inject.Singleton;
@@ -69,7 +71,7 @@ import static com.threerings.presents.Log.log;
*/
@Singleton
public class PresentsDObjectMgr
implements RootDObjectManager, RunQueue
implements RootDObjectManager, RunQueue, Executor
{
/** Returned by {@link #getStats}. */
public static class Stats
@@ -333,6 +335,12 @@ public class PresentsDObjectMgr
return _recent;
}
// from Executor
public void execute (Runnable command)
{
postRunnable(command);
}
/**
* Posts a self-contained unit of code that should be run on the distributed object manager
* thread at the next available opportunity. The code will be queued up with the rest of the