Allow the specification of legacy services for which provider interfaces should
not be generated. Cleaned up the generated provider interface formatting a bit. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3715 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -11,6 +11,7 @@ import java.lang.reflect.Modifier;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -78,6 +79,22 @@ public class GenServiceTask extends InvocationTask
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Used to track services for which we should not generate a provider
|
||||||
|
* interface. */
|
||||||
|
public class Providerless
|
||||||
|
{
|
||||||
|
public void setService (String className)
|
||||||
|
{
|
||||||
|
_providerless.add(className);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// documentation inherited
|
||||||
|
public Providerless createProviderless ()
|
||||||
|
{
|
||||||
|
return new Providerless();
|
||||||
|
}
|
||||||
|
|
||||||
// documentation inherited
|
// documentation inherited
|
||||||
protected void processService (File source, Class service)
|
protected void processService (File source, Class service)
|
||||||
{
|
{
|
||||||
@@ -133,8 +150,10 @@ public class GenServiceTask extends InvocationTask
|
|||||||
imports.keySet().iterator());
|
imports.keySet().iterator());
|
||||||
generateDispatcher(source, sname, spackage, methods,
|
generateDispatcher(source, sname, spackage, methods,
|
||||||
imports.keySet().iterator());
|
imports.keySet().iterator());
|
||||||
generateProvider(source, sname, spackage, methods, listeners,
|
if (!_providerless.contains(sname)) {
|
||||||
imports.keySet().iterator());
|
generateProvider(source, sname, spackage, methods, listeners,
|
||||||
|
imports.keySet().iterator());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void generateMarshaller (
|
protected void generateMarshaller (
|
||||||
@@ -260,6 +279,9 @@ public class GenServiceTask extends InvocationTask
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Services for which we should not generate provider interfaces. */
|
||||||
|
protected HashSet _providerless = new HashSet();
|
||||||
|
|
||||||
/** Specifies the path to the marshaller template. */
|
/** Specifies the path to the marshaller template. */
|
||||||
protected static final String MARSHALLER_TMPL =
|
protected static final String MARSHALLER_TMPL =
|
||||||
"com/threerings/presents/tools/marshaller.tmpl";
|
"com/threerings/presents/tools/marshaller.tmpl";
|
||||||
|
|||||||
@@ -10,15 +10,14 @@ import $import;
|
|||||||
public interface ${name}Provider extends InvocationProvider
|
public interface ${name}Provider extends InvocationProvider
|
||||||
{
|
{
|
||||||
#foreach ($m in $methods)
|
#foreach ($m in $methods)
|
||||||
|
#if ($velocityCount > 1)
|
||||||
|
|
||||||
|
#end
|
||||||
/**
|
/**
|
||||||
* Handles a {@link ${name}Service#$m.method.name} request.
|
* Handles a {@link ${name}Service#$m.method.name} request.
|
||||||
*/
|
*/
|
||||||
#if ($m.listenerArgs.size() > 0)
|
public void $m.method.name (ClientObject caller#if ($m.hasArgs()), #end$m.getArgList(true))#if ($m.listenerArgs.size() > 0)
|
||||||
public void $m.method.name (ClientObject caller, $m.getArgList(true))
|
|
||||||
throws InvocationException;
|
|
||||||
#else
|
|
||||||
public void $m.method.name (ClientObject caller, $m.getArgList(true));
|
|
||||||
#end
|
|
||||||
|
|
||||||
|
throws InvocationException#end;
|
||||||
#end
|
#end
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user