We've always been at war with Eurasia. Changed InvocationManager to

InvocationDirector (please god let the renaming be done). Removed IntMap
and modified code to use samskivert's HashIntMap.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@375 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2001-10-02 02:08:16 +00:00
parent 1f663669c9
commit 6620936a04
13 changed files with 73 additions and 295 deletions
@@ -1,5 +1,5 @@
//
// $Id: Client.java,v 1.13 2001/08/21 19:33:06 mdb Exp $
// $Id: Client.java,v 1.14 2001/10/02 02:05:50 mdb Exp $
package com.threerings.cocktail.cher.client;
@@ -178,12 +178,12 @@ public class Client
}
/**
* Returns the invocation manager associated with this session. This
* Returns the invocation director associated with this session. This
* reference is only valid for the duration of the session.
*/
public InvocationManager getInvocationManager ()
public InvocationDirector getInvocationDirector ()
{
return _invmgr;
return _invdir;
}
/**
@@ -277,16 +277,16 @@ public class Client
// extract bootstrap information
_cloid = data.clientOid;
// create our invocation manager
_invmgr = new InvocationManager(this, data.invOid);
// create our invocation director
_invdir = new InvocationDirector(this, data.invOid);
// we can't quite call initialization completed at this point
// because we need for the invocation manager to fully initialize
// because we need for the invocation director to fully initialize
// (which requires a round trip to the server) before turning the
// client loose to do things like request invocation services
}
void invocationManagerReady (ClientObject clobj)
void invocationDirectorReady (ClientObject clobj)
{
// keep this around
_clobj = clobj;
@@ -309,7 +309,7 @@ public class Client
protected Communicator _comm;
protected int _cloid;
protected InvocationManager _invmgr;
protected InvocationDirector _invdir;
// client observer codes
static final int CLIENT_DID_LOGON = 0;
@@ -1,18 +1,18 @@
//
// $Id: InvocationDirector.java,v 1.9 2001/08/21 19:33:06 mdb Exp $
// $Id: InvocationDirector.java,v 1.10 2001/10/02 02:05:50 mdb Exp $
package com.threerings.cocktail.cher.client;
import java.lang.reflect.Method;
import java.util.HashMap;
import com.samskivert.util.HashIntMap;
import com.samskivert.util.StringUtil;
import com.threerings.cocktail.cher.Log;
import com.threerings.cocktail.cher.data.*;
import com.threerings.cocktail.cher.dobj.*;
import com.threerings.cocktail.cher.util.ClassUtil;
import com.threerings.cocktail.cher.util.IntMap;
/**
* The invocation services provide client to server invocations (service
@@ -28,23 +28,23 @@ import com.threerings.cocktail.cher.util.IntMap;
* non-local objects (it is assumed that the distributed object facility
* will already be in use for any objects that should be shared).
*
* <p> The client invocation manager delivers invocation requests to the
* <p> The client invocation director delivers invocation requests to the
* server invocation manager and maps the responses back to the proper
* response target objects when they arrive. It also maintains the mapping
* of invocation receivers that can receive asynchronous invocation
* notifications at any time from the server.
*/
public class InvocationManager
public class InvocationDirector
implements Subscriber
{
/**
* Constructs a new invocation manager with the specified invocation
* Constructs a new invocation director with the specified invocation
* manager oid. It will obtain its distributed object manager and
* client object references from the supplied client instance. The
* invocation manager oid is the oid of the object on the server to
* which to deliver invocation requests.
*/
public InvocationManager (Client client, int imoid)
public InvocationDirector (Client client, int imoid)
{
_client = client;
_omgr = client.getDObjectManager();
@@ -120,14 +120,14 @@ public class InvocationManager
{
// let the client know that we're ready to go now that we've got
// our subscription to the client object
_client.invocationManagerReady((ClientObject)object);
_client.invocationDirectorReady((ClientObject)object);
}
public void requestFailed (int oid, ObjectAccessException cause)
{
// aiya! we were unable to subscribe to the client object. we're
// hosed, hosed, hosed
Log.warning("Invocation manager unable to subscribe to client " +
Log.warning("Invocation director unable to subscribe to client " +
"object. All is wrong in the universe.");
}
@@ -266,6 +266,6 @@ public class InvocationManager
protected int _imoid;
protected int _invocationId;
protected IntMap _targets = new IntMap();
protected HashIntMap _targets = new HashIntMap();
protected HashMap _receivers = new HashMap();
}
@@ -1,12 +1,12 @@
//
// $Id: InvocationReceiver.java,v 1.2 2001/08/04 02:31:20 mdb Exp $
// $Id: InvocationReceiver.java,v 1.3 2001/10/02 02:05:50 mdb Exp $
package com.threerings.cocktail.cher.client;
/**
* Classes registered to process invocation notifications should implement
* the invocation receiver interface and register themselves with the
* invocation manager. Because the invocation notification procedures are
* invocation director. Because the invocation notification procedures are
* looked up using reflection, there are no methods to implement in the
* receiver interface, but it serves as a useful point for documentation
* and as a useful indicator that the class in question is serving as an
@@ -15,7 +15,7 @@ package com.threerings.cocktail.cher.client;
* <p> Invocation notifications are identified by a module name and a
* procedure name. The module name identifies which invocation receiver
* instance will receive the notification. Receivers are registered with
* the invocation manager as handling all notification procedures for a
* the invocation director as handling all notification procedures for a
* particular module. The notification procedure name is used to construct
* a method name which is then reflected and invoked.
*
@@ -29,7 +29,7 @@ package com.threerings.cocktail.cher.client;
* the standard reflection argument type conversion process taken into
* account).
*
* @see InvocationManager#registerReceiver
* @see InvocationDirector#registerReceiver
*/
public interface InvocationReceiver
{