Added InvocationMarshaller implementations for our prefab
InvocationListener extensions. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2297 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: InvocationMarshaller.java,v 1.4 2002/12/20 23:41:26 mdb Exp $
|
||||
// $Id: InvocationMarshaller.java,v 1.5 2003/03/04 01:35:33 mdb Exp $
|
||||
|
||||
package com.threerings.presents.data;
|
||||
|
||||
@@ -85,6 +85,71 @@ public class InvocationMarshaller
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines a marshaller for the standard {@link ConfirmListener}.
|
||||
*/
|
||||
public static class ConfirmMarshaller extends ListenerMarshaller
|
||||
implements ConfirmListener
|
||||
{
|
||||
/** The method id used to dispatch {@link #requestProcessed}
|
||||
* responses. */
|
||||
public static final int REQUEST_PROCESSED = 1;
|
||||
|
||||
// documentation inherited from interface
|
||||
public void requestProcessed ()
|
||||
{
|
||||
omgr.postEvent(new InvocationResponseEvent(
|
||||
callerOid, requestId, REQUEST_PROCESSED,
|
||||
null));
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
public void dispatchResponse (int methodId, Object[] args)
|
||||
{
|
||||
switch (methodId) {
|
||||
case REQUEST_PROCESSED:
|
||||
((ConfirmListener)listener).requestProcessed();
|
||||
return;
|
||||
|
||||
default:
|
||||
super.dispatchResponse(methodId, args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines a marshaller for the standard {@link ResultListener}.
|
||||
*/
|
||||
public static class ResultMarshaller extends ListenerMarshaller
|
||||
implements ResultListener
|
||||
{
|
||||
/** The method id used to dispatch {@link #requestProcessed}
|
||||
* responses. */
|
||||
public static final int REQUEST_PROCESSED = 1;
|
||||
|
||||
// documentation inherited from interface
|
||||
public void requestProcessed (Object result)
|
||||
{
|
||||
omgr.postEvent(new InvocationResponseEvent(
|
||||
callerOid, requestId, REQUEST_PROCESSED,
|
||||
new Object[] { result }));
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
public void dispatchResponse (int methodId, Object[] args)
|
||||
{
|
||||
switch (methodId) {
|
||||
case REQUEST_PROCESSED:
|
||||
((ResultListener)listener).requestProcessed(
|
||||
args[0]);
|
||||
return;
|
||||
|
||||
default:
|
||||
super.dispatchResponse(methodId, args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes this invocation marshaller instance with the requisite
|
||||
* information to allow it to operate in the wide world. This is
|
||||
|
||||
Reference in New Issue
Block a user