I have a case where I calculate generic type information a bit
differently than the specification intends. The problem is that there
is no way to pass this generic information to Invocation, SyncInvoker,
or AsyncInvoker. i.e.
Type genericType = ...;
Class type = ...;
There no way to pass this information to Invocation, SyncInvoker,
AsyncInvoker, or override TypeLiteral in some way. Are you following me yet?
Solution 1:
Add additional methods to Invocation, SyncInvoker, and AsyncInvoker:
<method>(Class<T> type, Type genericType);
Solution 2: Make TypeLiteral non abstract and add a constructor
public class TypeLiteral<T> {
public TypeLiteral(Class<T> type, Type genericType) {
this.rawType = type;
this.type = genericType;
}
}
You might also want to move logic out of getType() and
getParameterTypes() into the protected constructor.
http://java.net/jira/browse/JAX_RS_SPEC-156
--
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com