Keep our resources in src/main/resources per the standard project layout.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6251 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +0,0 @@
|
||||
gendobj=com.threerings.presents.tools.GenDObjectTask
|
||||
genservice=com.threerings.presents.tools.GenServiceTask
|
||||
genreceiver=com.threerings.presents.tools.GenReceiverTask
|
||||
instream=com.threerings.presents.tools.InstrumentStreamableTask
|
||||
genascript=com.threerings.presents.tools.GenActionScriptTask
|
||||
@@ -1,53 +0,0 @@
|
||||
package {{package}};
|
||||
|
||||
{{#imports}}
|
||||
import {{this}};
|
||||
{{/imports}}
|
||||
|
||||
/**
|
||||
* Dispatches calls to a {@link {{name}}Receiver} instance.
|
||||
*/
|
||||
public class {{name}}Decoder extends InvocationDecoder
|
||||
{
|
||||
/** The generated hash code used to identify this receiver class. */
|
||||
public static final String RECEIVER_CODE = "{{receiver_code}}";
|
||||
|
||||
{{#methods}}
|
||||
/** The method id used to dispatch {@link {{name}}Receiver#{{method.name}}}
|
||||
* notifications. */
|
||||
public static final int {{code}} = {{-index}};
|
||||
|
||||
{{/methods}}
|
||||
/**
|
||||
* Creates a decoder that may be registered to dispatch invocation
|
||||
* service notifications to the specified receiver.
|
||||
*/
|
||||
public {{name}}Decoder ({{name}}Receiver receiver)
|
||||
{
|
||||
this.receiver = receiver;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getReceiverCode ()
|
||||
{
|
||||
return RECEIVER_CODE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispatchNotification (int methodId, Object[] args)
|
||||
{
|
||||
switch (methodId) {
|
||||
{{#methods}}
|
||||
case {{code}}:
|
||||
(({{name}}Receiver)receiver).{{method.name}}(
|
||||
{{getUnwrappedArgListAsListeners}}
|
||||
);
|
||||
return;
|
||||
|
||||
{{/methods}}
|
||||
default:
|
||||
super.dispatchNotification(methodId, args);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
package {{package}};
|
||||
|
||||
import javax.annotation.Generated;
|
||||
|
||||
{{#imports}}
|
||||
import {{this}};
|
||||
{{/imports}}
|
||||
|
||||
/**
|
||||
* Dispatches requests to the {@link {{name}}Provider}.
|
||||
*/
|
||||
{{generated}}
|
||||
public class {{name}}Dispatcher extends InvocationDispatcher<{{name}}Marshaller>
|
||||
{
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public {{name}}Marshaller createMarshaller ()
|
||||
{
|
||||
return new {{name}}Marshaller();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispatchRequest (
|
||||
ClientObject source, int methodId, Object[] args)
|
||||
throws InvocationException
|
||||
{
|
||||
switch (methodId) {
|
||||
{{#methods}}
|
||||
case {{name}}Marshaller.{{code}}:
|
||||
(({{name}}Provider)provider).{{method.name}}(
|
||||
source{{#hasArgsSkipFirst}}, {{/hasArgsSkipFirst}}{{getUnwrappedArgList}}
|
||||
);
|
||||
return;
|
||||
|
||||
{{/methods}}
|
||||
default:
|
||||
super.dispatchRequest(source, methodId, args);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
/**
|
||||
* Requests that the <code>{{field}}</code> field be set to the
|
||||
* specified value. The local value will be updated immediately and an
|
||||
* event will be propagated through the system to notify all listeners
|
||||
* that the attribute did change. Proxied copies of this object (on
|
||||
* clients) will apply the value change when they received the
|
||||
* attribute changed notification.
|
||||
*/
|
||||
{{generated}}
|
||||
public void set{{upfield}} ({{type}} value)
|
||||
{
|
||||
{{type}} ovalue = this.{{field}};
|
||||
requestAttributeChange(
|
||||
{{capfield}}, {{wrapfield}}, {{wrapofield}}{{transport}});
|
||||
this.{{field}} = {{clonefield}};
|
||||
}
|
||||
{{#have_elem}}
|
||||
|
||||
/**
|
||||
* Requests that the <code>index</code>th element of
|
||||
* <code>{{field}}</code> field be set to the specified value.
|
||||
* The local value will be updated immediately and an event will be
|
||||
* propagated through the system to notify all listeners that the
|
||||
* attribute did change. Proxied copies of this object (on clients)
|
||||
* will apply the value change when they received the attribute
|
||||
* changed notification.
|
||||
*/
|
||||
{{generated}}
|
||||
public void set{{upfield}}At ({{elemtype}} value, int index)
|
||||
{
|
||||
{{elemtype}} ovalue = this.{{field}}[index];
|
||||
requestElementUpdate(
|
||||
{{capfield}}, index, {{wrapelem}}, {{wrapoelem}}{{transport}});
|
||||
this.{{field}}[index] = value;
|
||||
}
|
||||
{{/have_elem}}
|
||||
@@ -1,3 +0,0 @@
|
||||
/** The field name of the <code>{{field}}</code> field. */
|
||||
{{generated}}
|
||||
public static final String {{capfield}} = "{{field}}";
|
||||
@@ -1,21 +0,0 @@
|
||||
/**
|
||||
* Requests that <code>oid</code> be added to the <code>{{field}}</code>
|
||||
* oid list. The list will not change until the event is actually
|
||||
* propagated through the system.
|
||||
*/
|
||||
{{generated}}
|
||||
public void addTo{{upfield}} (int oid)
|
||||
{
|
||||
requestOidAdd({{capfield}}, oid);
|
||||
}
|
||||
|
||||
/**
|
||||
* Requests that <code>oid</code> be removed from the
|
||||
* <code>{{field}}</code> oid list. The list will not change until the
|
||||
* event is actually propagated through the system.
|
||||
*/
|
||||
{{generated}}
|
||||
public void removeFrom{{upfield}} (int oid)
|
||||
{
|
||||
requestOidRemove({{capfield}}, oid);
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
/**
|
||||
* Requests that the specified entry be added to the
|
||||
* <code>{{field}}</code> set. The set will not change until the event is
|
||||
* actually propagated through the system.
|
||||
*/
|
||||
{{generated}}
|
||||
public void addTo{{upfield}} ({{etype}} elem)
|
||||
{
|
||||
requestEntryAdd({{capfield}}, {{field}}, elem);
|
||||
}
|
||||
|
||||
/**
|
||||
* Requests that the entry matching the supplied key be removed from
|
||||
* the <code>{{field}}</code> set. The set will not change until the
|
||||
* event is actually propagated through the system.
|
||||
*/
|
||||
{{generated}}
|
||||
public void removeFrom{{upfield}} (Comparable<?> key)
|
||||
{
|
||||
requestEntryRemove({{capfield}}, {{field}}, key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Requests that the specified entry be updated in the
|
||||
* <code>{{field}}</code> set. The set will not change until the event is
|
||||
* actually propagated through the system.
|
||||
*/
|
||||
{{generated}}
|
||||
public void update{{upfield}} ({{etype}} elem)
|
||||
{
|
||||
requestEntryUpdate({{capfield}}, {{field}}, elem{{transport}});
|
||||
}
|
||||
|
||||
/**
|
||||
* Requests that the <code>{{field}}</code> field be set to the
|
||||
* specified value. Generally one only adds, updates and removes
|
||||
* entries of a distributed set, but certain situations call for a
|
||||
* complete replacement of the set value. The local value will be
|
||||
* updated immediately and an event will be propagated through the
|
||||
* system to notify all listeners that the attribute did
|
||||
* change. Proxied copies of this object (on clients) will apply the
|
||||
* value change when they received the attribute changed notification.
|
||||
*/
|
||||
{{generated}}
|
||||
public void set{{upfield}} ({{type}} value)
|
||||
{
|
||||
requestAttributeChange({{capfield}}, value, this.{{field}});
|
||||
{{type}} clone = {{clonefield}};
|
||||
this.{{field}} = clone;
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
package {{package}};
|
||||
|
||||
import javax.annotation.Generated;
|
||||
|
||||
{{#imports}}
|
||||
import {{this}};
|
||||
{{/imports}}
|
||||
|
||||
/**
|
||||
* Provides the implementation of the {@link {{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.
|
||||
*/
|
||||
{{generated}}
|
||||
public class {{name}}Marshaller extends InvocationMarshaller
|
||||
implements {{name}}Service
|
||||
{
|
||||
{{#listeners}}
|
||||
/**
|
||||
* Marshalls results to implementations of {@link {{name}}Service.{{listenerName}}Listener}.
|
||||
*/
|
||||
public static class {{listenerName}}Marshaller extends ListenerMarshaller
|
||||
implements {{listenerName}}Listener
|
||||
{
|
||||
{{#methods}}
|
||||
/** The method id used to dispatch {@link #{{method.name}}}
|
||||
* responses. */
|
||||
public static final int {{code}} = {{-index}};
|
||||
|
||||
// from interface {{listenerName}}Marshaller
|
||||
public void {{method.name}} ({{getArgList}})
|
||||
{
|
||||
_invId = null;
|
||||
omgr.postEvent(new InvocationResponseEvent(
|
||||
callerOid, requestId, {{code}},
|
||||
new Object[] { {{getWrappedArgList}} }, transport));
|
||||
}
|
||||
|
||||
{{/methods}}
|
||||
@Override // from InvocationMarshaller
|
||||
{{#hasParameterizedMethodArgs}}
|
||||
@SuppressWarnings("unchecked")
|
||||
{{/hasParameterizedMethodArgs}}
|
||||
public void dispatchResponse (int methodId, Object[] args)
|
||||
{
|
||||
switch (methodId) {
|
||||
{{#methods}}
|
||||
case {{code}}:
|
||||
(({{listenerName}}Listener)listener).{{method.name}}(
|
||||
{{getUnwrappedArgListAsListeners}});
|
||||
return;
|
||||
|
||||
{{/methods}}
|
||||
default:
|
||||
super.dispatchResponse(methodId, args);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{{/listeners}}
|
||||
{{#methods}}
|
||||
{{^-first}}
|
||||
|
||||
{{/-first}}
|
||||
/** The method id used to dispatch {@link #{{method.name}}} requests. */
|
||||
public static final int {{code}} = {{-index}};
|
||||
|
||||
// from interface {{name}}Service
|
||||
public void {{method.name}} ({{getArgList}})
|
||||
{
|
||||
{{#listenerArgs}}
|
||||
{{marshaller}} listener{{index}} = new {{marshaller}}();
|
||||
listener{{index}}.listener = arg{{index}};
|
||||
{{/listenerArgs}}
|
||||
sendRequest(arg1, {{code}}, new Object[] {
|
||||
{{#hasArgsSkipFirst}}
|
||||
{{getWrappedArgListSkipFirst}}
|
||||
{{/hasArgsSkipFirst}}
|
||||
}{{transport}});
|
||||
}
|
||||
{{/methods}}
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
package {{package}} {
|
||||
|
||||
{{#imports}}
|
||||
import {{this}};
|
||||
{{/imports}}
|
||||
|
||||
/**
|
||||
* Provides the implementation of the <code>{{name}}Service</code> 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 <code>{{method.name}}</code> requests. */
|
||||
public static const {{code}} :int = {{-index}};
|
||||
|
||||
// from interface {{name}}Service
|
||||
public function {{method.name}} ({{getASArgListSkipFirst}}) :void
|
||||
{
|
||||
{{#listenerArgs}}
|
||||
var listener{{indexSkipFirst}} :{{actionScriptMarshaller}} = new {{actionScriptMarshaller}}();
|
||||
listener{{indexSkipFirst}}.listener = arg{{indexSkipFirst}};
|
||||
{{/listenerArgs}}
|
||||
sendRequest({{code}}, [
|
||||
{{getASWrappedArgListSkipFirst}}
|
||||
]);
|
||||
}
|
||||
{{/methods}}
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
package {{package}} {
|
||||
|
||||
{{#imports}}
|
||||
import {{this}};
|
||||
{{/imports}}
|
||||
|
||||
/**
|
||||
* Marshalls instances of the {{name}}Service_{{listener.listenerName}}Marshaller interface.
|
||||
*/
|
||||
public class {{name}}Marshaller_{{listener.listenerName}}Marshaller
|
||||
extends InvocationMarshaller_ListenerMarshaller
|
||||
{
|
||||
{{#listener.methods}}
|
||||
/** The method id used to dispatch <code>{{method.name}}</code> responses. */
|
||||
public static const {{code}} :int = {{-index}};
|
||||
|
||||
{{/listener.methods}}
|
||||
// from InvocationMarshaller_ListenerMarshaller
|
||||
override public function dispatchResponse (methodId :int, args :Array) :void
|
||||
{
|
||||
switch (methodId) {
|
||||
{{#listener.methods}}
|
||||
case {{code}}:
|
||||
(listener as {{name}}Service_{{listener.listenerName}}Listener).{{method.name}}(
|
||||
{{getASUnwrappedArgListAsListeners}});
|
||||
return;
|
||||
|
||||
{{/listener.methods}}
|
||||
default:
|
||||
super.dispatchResponse(methodId, args);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
package {{package}};
|
||||
|
||||
import javax.annotation.Generated;
|
||||
|
||||
{{#imports}}
|
||||
import {{this}};
|
||||
{{/imports}}
|
||||
|
||||
/**
|
||||
* Defines the server-side of the {@link {{name}}Service}.
|
||||
*/
|
||||
{{generated}}
|
||||
public interface {{name}}Provider extends InvocationProvider
|
||||
{
|
||||
{{#methods}}
|
||||
{{^-first}}
|
||||
|
||||
{{/-first}}
|
||||
/**
|
||||
* Handles a {@link {{name}}Service#{{method.name}}} request.
|
||||
*/
|
||||
void {{method.name}} (ClientObject caller{{#hasArgsSkipFirst}}, {{/hasArgsSkipFirst}}{{getArgListSkipFirst}}){{^listenerArgs.isEmpty}}
|
||||
|
||||
throws InvocationException{{/listenerArgs.isEmpty}};
|
||||
{{/methods}}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package {{package}};
|
||||
|
||||
{{#imports}}
|
||||
import {{this}};
|
||||
{{/imports}}
|
||||
|
||||
/**
|
||||
* Used to issue notifications to a {@link {{name}}Receiver} instance on a
|
||||
* client.
|
||||
*/
|
||||
public class {{name}}Sender extends InvocationSender
|
||||
{
|
||||
{{#methods}}
|
||||
/**
|
||||
* Issues a notification that will result in a call to {@link
|
||||
* {{name}}Receiver#{{method.name}}} on a client.
|
||||
*/
|
||||
public static void {{senderMethodName}} (
|
||||
ClientObject target{{#hasArgs}}, {{/hasArgs}}{{getArgList}})
|
||||
{
|
||||
sendNotification(
|
||||
target, {{name}}Decoder.RECEIVER_CODE, {{name}}Decoder.{{code}},
|
||||
new Object[] { {{getWrappedArgList}} }{{transport}});
|
||||
}
|
||||
|
||||
{{/methods}}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package {{package}} {
|
||||
|
||||
{{#imports}}
|
||||
import {{this}};
|
||||
{{/imports}}
|
||||
|
||||
/**
|
||||
* An ActionScript version of the Java {{name}}Service interface.
|
||||
*/
|
||||
public interface {{name}}Service extends InvocationService
|
||||
{
|
||||
{{#methods}}
|
||||
{{^-first}}
|
||||
|
||||
{{/-first}}
|
||||
// from Java interface {{name}}Service
|
||||
function {{method.name}} ({{getASArgListSkipFirst}}) :void;
|
||||
{{/methods}}
|
||||
}
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
package {{package}} {
|
||||
|
||||
{{#imports}}
|
||||
import {{this}};
|
||||
{{/imports}}
|
||||
|
||||
/**
|
||||
* A functional adapter for the {{name}}Service_{{listener.listenerName}}Listener interface.
|
||||
*/
|
||||
public class {{name}}Service_{{listener.listenerName}}ListenerAdapter
|
||||
implements {{name}}Service_{{listener.listenerName}}Listener
|
||||
{
|
||||
/**
|
||||
* Creates a new {{name}} service {{listener.listenerName}} listener that will delegate to the
|
||||
* given function(s). Any Function that is null will simply not be called.
|
||||
*/
|
||||
public function {{name}}Service_{{listener.listenerName}}ListenerAdapter (
|
||||
{{adapterCtorArgs}}failed :Function)
|
||||
{
|
||||
{{#listener.methods}}
|
||||
_{{method.name}} = {{method.name}};
|
||||
{{/listener.methods}}
|
||||
_failed = failed;
|
||||
}
|
||||
{{#listener.methods}}
|
||||
|
||||
// from Java {{name}}Service_{{listener.listenerName}}Listener
|
||||
public function {{method.name}} ({{getASArgList}}) :void
|
||||
{
|
||||
if (_{{method.name}} != null) {
|
||||
_{{method.name}}({{getASInvokeArgList}});
|
||||
}
|
||||
}
|
||||
{{/listener.methods}}
|
||||
|
||||
// from InvocationService_InvocationListener
|
||||
public function requestFailed (cause :String) :void
|
||||
{
|
||||
if (_failed != null) {
|
||||
_failed(cause);
|
||||
}
|
||||
}
|
||||
|
||||
{{#listener.methods}}
|
||||
protected var _{{method.name}} :Function;
|
||||
{{/listener.methods}}
|
||||
protected var _failed :Function;
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package {{package}} {
|
||||
|
||||
{{#imports}}
|
||||
import {{this}};
|
||||
{{/imports}}
|
||||
|
||||
/**
|
||||
* An ActionScript version of the Java {{name}}Service_{{listener.listenerName}}Listener interface.
|
||||
*/
|
||||
public interface {{name}}Service_{{listener.listenerName}}Listener
|
||||
extends InvocationService_InvocationListener
|
||||
{
|
||||
{{#listener.methods}}
|
||||
{{^-first}}
|
||||
|
||||
{{/-first}}
|
||||
// from Java {{name}}Service_{{listener.listenerName}}Listener
|
||||
function {{method.name}} ({{getASArgList}}) :void
|
||||
{{/listener.methods}}
|
||||
}
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
// GENERATED PREAMBLE START
|
||||
{{header}}
|
||||
package {{package}} {
|
||||
|
||||
{{#imports}}
|
||||
import {{this}};
|
||||
{{/imports}}
|
||||
// GENERATED PREAMBLE END
|
||||
|
||||
// GENERATED CLASSDECL START
|
||||
public class {{classname}} {{^extends.isEmpty}}extends {{#extends}}
|
||||
{{/extends.isEmpty}}
|
||||
{{^implements.isEmpty}}{{^extends.isEmpty}} {{/extends.isEmpty}}implements {{#implements}}
|
||||
{{/implements.isEmpty}}
|
||||
{
|
||||
// GENERATED CLASSDECL END
|
||||
|
||||
// GENERATED STREAMING START
|
||||
{{#fields}}
|
||||
public var {{name}} :{{simpleType}};
|
||||
{{/fields}}
|
||||
|
||||
{{#superclassStreamable}}override {{/superclassStreamable}}public function readObject (ins :ObjectInputStream) :void
|
||||
{
|
||||
{{#superclassStreamable}}
|
||||
super.readObject(ins);
|
||||
{{/superclassStreamable}}
|
||||
{{#fields}}
|
||||
{{name}} = ins.{{reader}};
|
||||
{{/fields}}
|
||||
}
|
||||
|
||||
{{#superclassStreamable}}override {{/superclassStreamable}}public function writeObject (out :ObjectOutputStream) :void
|
||||
{
|
||||
{{#superclassStreamable}}
|
||||
super.writeObject(out);
|
||||
{{/superclassStreamable}}
|
||||
{{#fields}}
|
||||
out.{{writer}};
|
||||
{{/fields}}
|
||||
}
|
||||
// GENERATED STREAMING END
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user