Files
narya/lib/dispatcher.tmpl
T
Michael Bayne f84e832581 Can't have $Id$ in the template because it will be replaced when the
generated file is checked into CVS by the Id info for the generated file,
thus thwarting our efforts to track which version of the template from
which the generated file was generated.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1665 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-09-06 01:18:25 +00:00

52 lines
1.2 KiB
Cheetah

//
// [% idstr %]
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[% IF method.unwrapped_args %],[% END %]
[% method.unwrapped_args %]
);
return;
[% END -%]
default:
super.dispatchRequest(source, methodId, args);
}
}
// Generated on [% genstamp %].
}