com.threerings.presents.tools.marshaller_as.tmpl Maven / Gradle / Ivy
package {{package}} {
{{#importGroups}}
{{#this}}
import {{this}};
{{/this}}
{{/importGroups}}
/**
* Provides the implementation of the {{name}}Service
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 {{name}}Marshaller extends InvocationMarshaller
implements {{name}}Service
{
{{#methods}}
{{^-first}}
{{/-first}}
/** The method id used to dispatch {{method.name}}
requests. */
public static const {{code}} :int = {{-index}};
// from interface {{name}}Service
public function {{method.name}} ({{getASArgList}}) :void
{
{{#listenerArgs}}
var listener{{index}} :{{actionScriptMarshaller}} = new {{actionScriptMarshaller}}();
listener{{index}}.listener = arg{{index}};
{{/listenerArgs}}
sendRequest({{code}}, [
{{#hasArgs}}
{{getASWrappedArgList}}
{{/hasArgs}}
]);
}
{{/methods}}
}
}