dev@jsr311.java.net

ContextResolver confusion

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

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

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

For this example:

@Context CustomInjectedType custom;

@Provider
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?

Thanks







-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com