The great invocation services rethink of 2002! Rearchitected the remote
method invocation services and converted everything to the new style. Could this be my biggest checkin ever? git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1642 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,21 +0,0 @@
|
||||
//
|
||||
// $Id: AdminCodes.java,v 1.1 2002/06/07 06:22:24 mdb Exp $
|
||||
|
||||
package com.threerings.admin.data;
|
||||
|
||||
import com.threerings.presents.data.InvocationCodes;
|
||||
|
||||
/**
|
||||
* Contains codes used by the admin invocation services.
|
||||
*/
|
||||
public interface AdminCodes extends InvocationCodes
|
||||
{
|
||||
/** The module name for the admin services. */
|
||||
public static final String MODULE_NAME = "admin";
|
||||
|
||||
/** The message identifier for a getConfigInfo request. */
|
||||
public static final String GET_CONFIG_INFO_REQUEST = "GetConfigInfo";
|
||||
|
||||
/** The response identifier for a successful getConfigInfo request. */
|
||||
public static final String CONFIG_INFO_RESPONSE = "ConfigInfo";
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
//
|
||||
// $Id: AdminMarshaller.java,v 1.1 2002/08/14 19:07:48 mdb Exp $
|
||||
|
||||
package com.threerings.admin.data;
|
||||
|
||||
import com.threerings.admin.client.AdminService;
|
||||
import com.threerings.admin.client.AdminService.ConfigInfoListener;
|
||||
import com.threerings.presents.client.Client;
|
||||
import com.threerings.presents.data.InvocationMarshaller;
|
||||
import com.threerings.presents.dobj.InvocationResponseEvent;
|
||||
|
||||
/**
|
||||
* Provides the implementation of the {@link AdminService} interface
|
||||
* that marshalls the arguments and delivers the request to the provider
|
||||
* on the server. Also provides an implementation of the response listener
|
||||
* interfaces that marshall the response arguments and deliver them back
|
||||
* to the requesting client.
|
||||
*/
|
||||
public class AdminMarshaller extends InvocationMarshaller
|
||||
implements AdminService
|
||||
{
|
||||
// documentation inherited
|
||||
public static class ConfigInfoMarshaller extends ListenerMarshaller
|
||||
implements ConfigInfoListener
|
||||
{
|
||||
/** The method id used to dispatch {@link #gotConfigInfo}
|
||||
* responses. */
|
||||
public static final int GOT_CONFIG_INFO = 0;
|
||||
|
||||
// documentation inherited from interface
|
||||
public void gotConfigInfo (String[] arg1, int[] arg2)
|
||||
{
|
||||
omgr.postEvent(new InvocationResponseEvent(
|
||||
callerOid, requestId, GOT_CONFIG_INFO,
|
||||
new Object[] { arg1, arg2 }));
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
public void dispatchResponse (int methodId, Object[] args)
|
||||
{
|
||||
switch (methodId) {
|
||||
case GOT_CONFIG_INFO:
|
||||
((ConfigInfoListener)listener).gotConfigInfo(
|
||||
(String[])args[0], (int[])args[1]);
|
||||
return;
|
||||
|
||||
default:
|
||||
super.dispatchResponse(methodId, args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** The method id used to dispatch {@link #getConfigInfo} requests. */
|
||||
public static final int GET_CONFIG_INFO = 1;
|
||||
|
||||
// documentation inherited from interface
|
||||
public void getConfigInfo (Client arg1, ConfigInfoListener arg2)
|
||||
{
|
||||
ConfigInfoMarshaller listener2 = new ConfigInfoMarshaller();
|
||||
listener2.listener = arg2;
|
||||
sendRequest(arg1, GET_CONFIG_INFO, new Object[] {
|
||||
listener2
|
||||
});
|
||||
}
|
||||
|
||||
// Class file generated on 00:25:58 08/11/02.
|
||||
}
|
||||
Reference in New Issue
Block a user