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:
@@ -21,6 +21,8 @@
|
|||||||
|
|
||||||
package com.threerings.presents.server;
|
package com.threerings.presents.server;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
import com.samskivert.util.HashIntMap;
|
import com.samskivert.util.HashIntMap;
|
||||||
import com.samskivert.util.LRUHashMap;
|
import com.samskivert.util.LRUHashMap;
|
||||||
import com.samskivert.util.StringUtil;
|
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.ObjectAccessException;
|
||||||
import com.threerings.presents.dobj.RootDObjectManager;
|
import com.threerings.presents.dobj.RootDObjectManager;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The invocation services provide client to server invocations (service requests) and server to
|
* 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
|
* client invocations (responses and notifications). Via this mechanism, the client can make
|
||||||
@@ -62,11 +62,6 @@ import java.util.HashMap;
|
|||||||
public class InvocationManager
|
public class InvocationManager
|
||||||
implements EventListener
|
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
|
* 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
|
* 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 it's a bootstrap service, slap it in the list
|
||||||
if (group != null) {
|
if (group != null) {
|
||||||
StreamableArrayList<InvocationMarshaller> list = bootlists.get(group);
|
StreamableArrayList<InvocationMarshaller> list = _bootlists.get(group);
|
||||||
if (list == null) {
|
if (list == null) {
|
||||||
bootlists.put(group, list = new StreamableArrayList<InvocationMarshaller>());
|
_bootlists.put(group, list = new StreamableArrayList<InvocationMarshaller>());
|
||||||
}
|
}
|
||||||
list.add(marsh);
|
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
|
* Get the class that is being used to dispatch the specified
|
||||||
* invocation code, for informational purposes.
|
* invocation code, for informational purposes.
|
||||||
@@ -295,6 +306,11 @@ public class InvocationManager
|
|||||||
protected HashIntMap<InvocationDispatcher> _dispatchers =
|
protected HashIntMap<InvocationDispatcher> _dispatchers =
|
||||||
new HashIntMap<InvocationDispatcher>();
|
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
|
/** The text that is appended to the procedure name when automatically generating a failure
|
||||||
* response. */
|
* response. */
|
||||||
protected static final String FAILED_SUFFIX = "Failed";
|
protected static final String FAILED_SUFFIX = "Failed";
|
||||||
|
|||||||
@@ -650,14 +650,7 @@ public class PresentsClient
|
|||||||
data.clientOid = _clobj.getOid();
|
data.clientOid = _clobj.getOid();
|
||||||
|
|
||||||
// fill in the list of bootstrap services
|
// fill in the list of bootstrap services
|
||||||
data.services = new StreamableArrayList<InvocationMarshaller>();
|
data.services = PresentsServer.invmgr.getBootstrapServices(_areq.getBootGroups());
|
||||||
for (String group : _areq.getBootGroups()) {
|
|
||||||
StreamableArrayList<InvocationMarshaller> list =
|
|
||||||
PresentsServer.invmgr.bootlists.get(group);
|
|
||||||
if (list != null) {
|
|
||||||
data.services.addAll(list);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user