Added a way to package up an action and data and send it to all appropriate

servers for execution. The class in question must exist on the remote server
but all of our servers are all always running the same code, so this follows.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4882 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2007-11-28 00:25:23 +00:00
parent 195f78376b
commit 9e835ff6e9
5 changed files with 137 additions and 7 deletions
@@ -44,18 +44,26 @@ public class PeerDispatcher extends InvocationDispatcher
this.provider = provider;
}
// from InvocationDispatcher
@Override // documentation inherited
public InvocationMarshaller createMarshaller ()
{
return new PeerMarshaller();
}
@SuppressWarnings("unchecked") // from InvocationDispatcher
@SuppressWarnings("unchecked")
@Override // documentation inherited
public void dispatchRequest (
ClientObject source, int methodId, Object[] args)
throws InvocationException
{
switch (methodId) {
case PeerMarshaller.INVOKE_ACTION:
((PeerProvider)provider).invokeAction(
source,
(byte[])args[0]
);
return;
case PeerMarshaller.RATIFY_LOCK_ACTION:
((PeerProvider)provider).ratifyLockAction(
source,