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
This commit is contained in:
Jamie Doornbos
2008-09-30 23:21:04 +00:00
parent 7e49edd3eb
commit f4111247d7
3 changed files with 14 additions and 6 deletions
@@ -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
{
@@ -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()));
}
/**
@@ -74,6 +74,7 @@ public class TestServer extends PresentsServer
{
super.init(injector);
_bureauReg.init();
_bureauReg.setDefaultClientFactory();
}
public void setClientTarget (String target)