Let's put that code in the InvocationManager because we're going to need it

elsewhere when we go fix the standalone servers.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4553 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2007-02-11 01:21:20 +00:00
parent ebc99935d5
commit 73bcb0faaf
2 changed files with 26 additions and 17 deletions
@@ -21,6 +21,8 @@
package com.threerings.presents.server;
import java.util.HashMap;
import com.samskivert.util.HashIntMap;
import com.samskivert.util.LRUHashMap;
import com.samskivert.util.StringUtil;
@@ -40,8 +42,6 @@ import com.threerings.presents.dobj.InvocationRequestEvent;
import com.threerings.presents.dobj.ObjectAccessException;
import com.threerings.presents.dobj.RootDObjectManager;
import java.util.HashMap;
/**
* The invocation services provide client to server invocations (service requests) and server to
* client invocations (responses and notifications). Via this mechanism, the client can make
@@ -62,11 +62,6 @@ import java.util.HashMap;
public class InvocationManager
implements EventListener
{
/** A mapping from bootstrap group to lists of services that are to be provided to clients at
* boot time. Don't mess with these lists! */
public HashMap<String,StreamableArrayList<InvocationMarshaller>> bootlists =
new HashMap<String,StreamableArrayList<InvocationMarshaller>>();
/**
* Constructs an invocation manager which will use the supplied distributed object manager to
* operate its invocation services. Generally only one invocation manager should be operational
@@ -127,9 +122,9 @@ public class InvocationManager
// if it's a bootstrap service, slap it in the list
if (group != null) {
StreamableArrayList<InvocationMarshaller> list = bootlists.get(group);
StreamableArrayList<InvocationMarshaller> list = _bootlists.get(group);
if (list == null) {
bootlists.put(group, list = new StreamableArrayList<InvocationMarshaller>());
_bootlists.put(group, list = new StreamableArrayList<InvocationMarshaller>());
}
list.add(marsh);
}
@@ -160,6 +155,22 @@ public class InvocationManager
}
}
/**
* Constructs a list of all bootstrap services registered in any of the supplied groups.
*/
public StreamableArrayList<InvocationMarshaller> getBootstrapServices (String[] bootGroups)
{
StreamableArrayList<InvocationMarshaller> services =
new StreamableArrayList<InvocationMarshaller>();
for (String group : bootGroups) {
StreamableArrayList<InvocationMarshaller> list = _bootlists.get(group);
if (list != null) {
services.addAll(list);
}
}
return services;
}
/**
* Get the class that is being used to dispatch the specified
* invocation code, for informational purposes.
@@ -295,6 +306,11 @@ public class InvocationManager
protected HashIntMap<InvocationDispatcher> _dispatchers =
new HashIntMap<InvocationDispatcher>();
/** A mapping from bootstrap group to lists of services that are to be provided to clients at
* boot time. */
protected HashMap<String,StreamableArrayList<InvocationMarshaller>> _bootlists =
new HashMap<String,StreamableArrayList<InvocationMarshaller>>();
/** The text that is appended to the procedure name when automatically generating a failure
* response. */
protected static final String FAILED_SUFFIX = "Failed";