ContextResolver confusion

From: Bill Burke <>
Date: Fri, 06 Jun 2008 18:59:28 -0400

The "type" parameter to getContext() seems redundant, am I missing

public interface ContextResolver<T>
    T getContext(Class<?> type);

For this example:

@Context CustomInjectedType custom;

public class MyCustom implements ContextResolver<CustomInjectedType> {}

Isn't <T> enough information for the JAX-RS runtime to resolve what to
inject? All the runtime has to do is do
providerClass.getGenericInterfaces() and see what is a ContextResolver
and pull the type form that.

Or, am I missing what ContextResolver is supposed to do?


Bill Burke
JBoss, a division of Red Hat