From f4111247d7894f631834788a7059c051bd67e0fa Mon Sep 17 00:00:00 2001 From: Jamie Doornbos Date: Tue, 30 Sep 2008 23:21:04 +0000 Subject: [PATCH] Make the bureau registry's client factory optional, must now be explicitly invoked using a new method git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5406 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../bureau/server/BureauClientFactory.java | 4 +++- .../threerings/bureau/server/BureauRegistry.java | 15 ++++++++++----- .../com/threerings/bureau/server/TestServer.java | 1 + 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/java/com/threerings/bureau/server/BureauClientFactory.java b/src/java/com/threerings/bureau/server/BureauClientFactory.java index 3d60811bf..552b8af1f 100644 --- a/src/java/com/threerings/bureau/server/BureauClientFactory.java +++ b/src/java/com/threerings/bureau/server/BureauClientFactory.java @@ -32,7 +32,9 @@ import com.threerings.bureau.data.BureauCredentials; /** * Handles resolution of bureaus and passes non-bureau resolution requests through to a normal - * factory. + * factory. For bureaus, creates base class instances {@link PresentsClient} and + * {@link ClientObject}. + * @see BureauRegistry#setDefaultClientFactory() */ public class BureauClientFactory implements ClientFactory { diff --git a/src/java/com/threerings/bureau/server/BureauRegistry.java b/src/java/com/threerings/bureau/server/BureauRegistry.java index ea4a61db9..31f49cb72 100644 --- a/src/java/com/threerings/bureau/server/BureauRegistry.java +++ b/src/java/com/threerings/bureau/server/BureauRegistry.java @@ -117,6 +117,7 @@ public class BureauRegistry * Provides the Bureau registry with necessary runtime configuration. Inserts the bureau * client factory into the client manager and registers observers to track the progress * of launched bureaus. + * @see BureauClientFactory */ public void init () { @@ -134,13 +135,17 @@ public class BureauRegistry } } }); + } + /** + * Adds the delegating client factory. Note this should be called after all application + * client factories are in place. The installed factory will simply create presents clients and + * client objects for bureaus. + */ + public void setDefaultClientFactory () + { // add the client factory, but later, after all the other modules have been initialized - _omgr.postRunnable(new Runnable() { - public void run () { - _clmgr.setClientFactory(new BureauClientFactory(_clmgr.getClientFactory())); - } - }); + _clmgr.setClientFactory(new BureauClientFactory(_clmgr.getClientFactory())); } /** diff --git a/tests/src/java/com/threerings/bureau/server/TestServer.java b/tests/src/java/com/threerings/bureau/server/TestServer.java index c0c61704d..b9a4e2328 100644 --- a/tests/src/java/com/threerings/bureau/server/TestServer.java +++ b/tests/src/java/com/threerings/bureau/server/TestServer.java @@ -74,6 +74,7 @@ public class TestServer extends PresentsServer { super.init(injector); _bureauReg.init(); + _bureauReg.setDefaultClientFactory(); } public void setClientTarget (String target)