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:
@@ -32,7 +32,9 @@ import com.threerings.bureau.data.BureauCredentials;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles resolution of bureaus and passes non-bureau resolution requests through to a normal
|
* 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
|
public class BureauClientFactory implements ClientFactory
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -117,6 +117,7 @@ public class BureauRegistry
|
|||||||
* Provides the Bureau registry with necessary runtime configuration. Inserts the bureau
|
* Provides the Bureau registry with necessary runtime configuration. Inserts the bureau
|
||||||
* client factory into the client manager and registers observers to track the progress
|
* client factory into the client manager and registers observers to track the progress
|
||||||
* of launched bureaus.
|
* of launched bureaus.
|
||||||
|
* @see BureauClientFactory
|
||||||
*/
|
*/
|
||||||
public void init ()
|
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
|
// add the client factory, but later, after all the other modules have been initialized
|
||||||
_omgr.postRunnable(new Runnable() {
|
_clmgr.setClientFactory(new BureauClientFactory(_clmgr.getClientFactory()));
|
||||||
public void run () {
|
|
||||||
_clmgr.setClientFactory(new BureauClientFactory(_clmgr.getClientFactory()));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ public class TestServer extends PresentsServer
|
|||||||
{
|
{
|
||||||
super.init(injector);
|
super.init(injector);
|
||||||
_bureauReg.init();
|
_bureauReg.init();
|
||||||
|
_bureauReg.setDefaultClientFactory();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setClientTarget (String target)
|
public void setClientTarget (String target)
|
||||||
|
|||||||
Reference in New Issue
Block a user