From f546167ca763fc49c15fb0bb0d436667f2319189 Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Mon, 7 Dec 2009 21:26:44 +0000 Subject: [PATCH] RootDObjectManager (PresentsDObjectMgr) implements Executor. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6000 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../threerings/presents/dobj/RootDObjectManager.java | 4 +++- .../threerings/presents/server/PresentsDObjectMgr.java | 10 +++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/java/com/threerings/presents/dobj/RootDObjectManager.java b/src/java/com/threerings/presents/dobj/RootDObjectManager.java index 187cf5c2c..9f758608f 100644 --- a/src/java/com/threerings/presents/dobj/RootDObjectManager.java +++ b/src/java/com/threerings/presents/dobj/RootDObjectManager.java @@ -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 diff --git a/src/java/com/threerings/presents/server/PresentsDObjectMgr.java b/src/java/com/threerings/presents/server/PresentsDObjectMgr.java index 502b0cd7f..abac4bd89 100644 --- a/src/java/com/threerings/presents/server/PresentsDObjectMgr.java +++ b/src/java/com/threerings/presents/server/PresentsDObjectMgr.java @@ -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