Handle parameterized types in invocation services and receivers.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6232 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2010-10-23 19:37:51 +00:00
parent a5c9acf288
commit e0dfddb46b
3 changed files with 21 additions and 1 deletions
@@ -49,4 +49,13 @@ public abstract class InvocationDispatcher<T extends InvocationMarshaller>
log.warning("Requested to dispatch unknown method", "provider", provider,
"sourceOid", source.getOid(), "methodId", methodId, "args", args);
}
/**
* Performs type casts in a way that works for parameterized types as well as simple types.
*/
@SuppressWarnings("unchecked")
protected <T> T cast (Object value)
{
return (T)value;
}
}