Marshaller and dispatcher class templates.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1635 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2002-08-09 03:36:09 +00:00
parent 86a0e96b83
commit 872c12a626
2 changed files with 124 additions and 0 deletions
+49
View File
@@ -0,0 +1,49 @@
//
// $Id: dispatcher.tmpl,v 1.1 2002/08/09 03:36:09 mdb Exp $
package [% package %];
[% FOREACH import = imports -%]
import [% import %];
[% END -%]
/**
* Dispatches requests to the {@link [% name %]Provider}.
*/
public class [% name %]Dispatcher extends InvocationDispatcher
{
/**
* Creates a dispatcher that may be registered to dispatch invocation
* service requests for the specified provider.
*/
public [% name %]Dispatcher ([% name %]Provider provider)
{
this.provider = provider;
}
// documentation inherited
public InvocationMarshaller createMarshaller ()
{
return new [% name %]Marshaller();
}
// documentation inherited
public void dispatchRequest (
ClientObject source, int methodId, Object[] args)
throws InvocationException
{
switch (methodId) {
[% FOREACH method = methods -%]
case [% name %]Marshaller.[% method.mcode %]:
(([% name %]Provider)provider).[% method.mname %](
source,
[% method.unwrapped_args %]
);
return;
[% END -%]
default:
super.dispatchRequest(source, methodId, args);
}
}
}