BureauClientFactory class to make client resolution more intuitive, plus a registry method to install the factory

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5221 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Jamie Doornbos
2008-07-03 20:31:37 +00:00
parent ab9ca71450
commit 8f9c7e7117
2 changed files with 80 additions and 0 deletions
@@ -39,6 +39,7 @@ import com.threerings.presents.data.ClientObject;
import com.threerings.presents.dobj.ObjectDeathListener;
import com.threerings.presents.dobj.ObjectDestroyedEvent;
import com.threerings.presents.dobj.RootDObjectManager;
import com.threerings.presents.server.ClientManager;
import com.threerings.presents.server.InvocationManager;
import com.threerings.bureau.data.AgentObject;
@@ -117,6 +118,16 @@ public class BureauRegistry
{
}
/**
* Install the bureau client factory in the manager, delegating to the current factory
* for non-bureau connections.
*/
public void addClientFactory (ClientManager clmgr)
{
clmgr.setClientFactory(
new BureauClientFactory(clmgr.getClientFactory()));
}
/**
* Check the credentials to make sure this is one of our bureaus.
* @return null if all's well, otherwise a string describing the authentication failure