ClientFactory -> SessionFactory, etc.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5509 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2008-11-06 18:24:44 +00:00
parent c69630b7e0
commit b81ccde75b
9 changed files with 35 additions and 35 deletions
@@ -149,15 +149,15 @@ public class ClientManager
* Configures the client manager with a factory for creating {@link PresentsSession} and {@link
* ClientResolver} classes for authenticated client connections.
*/
public void setClientFactory (ClientFactory factory)
public void setSessionFactory (SessionFactory factory)
{
_factory = factory;
}
/**
* Returns the {@link ClientFactory} currently in use.
* Returns the {@link SessionFactory} currently in use.
*/
public ClientFactory getClientFactory ()
public SessionFactory getSessionFactory ()
{
return _factory;
}
@@ -384,7 +384,7 @@ public class ClientManager
} else {
log.info("Session initiated [username=" + username + ", conn=" + conn + "].");
// create a new client and stick'em in the table
client = _injector.getInstance(_factory.getClientClass(req));
client = _injector.getInstance(_factory.getSessionClass(req));
client.startSession(req, conn, rsp.authdata);
// map their client instance
@@ -565,7 +565,7 @@ public class ClientManager
protected Map<Name, ClientResolver> _penders = Maps.newHashMap();
/** Lets us know what sort of client classes to use. */
protected ClientFactory _factory = ClientFactory.DEFAULT;
protected SessionFactory _factory = SessionFactory.DEFAULT;
/** Tracks registered {@link ClientObserver}s. */
protected ObserverList<ClientObserver> _clobservers = ObserverList.newSafeInOrder();
@@ -29,11 +29,11 @@ import com.threerings.presents.net.AuthRequest;
* Used to determine what type of {@link PresentsSession} to use to manage an authenticated client
* as well the type of {@link ClientResolver} to use when resolving clients' runtime data.
*/
public interface ClientFactory
public interface SessionFactory
{
/** The default client factory. */
public static ClientFactory DEFAULT = new ClientFactory() {
public Class<? extends PresentsSession> getClientClass (AuthRequest areq) {
public static SessionFactory DEFAULT = new SessionFactory() {
public Class<? extends PresentsSession> getSessionClass (AuthRequest areq) {
return PresentsSession.class;
}
public Class<? extends ClientResolver> getClientResolverClass (Name username) {
@@ -45,7 +45,7 @@ public interface ClientFactory
* Returns the {@link PresentsSession} derived class to use for the session that authenticated
* with the supplied request.
*/
Class<? extends PresentsSession> getClientClass (AuthRequest areq);
Class<? extends PresentsSession> getSessionClass (AuthRequest areq);
/**
* Returns the {@link ClientResolver} derived class to use to resolve a client with the