org.glassfish.jersey.server.model
Class AbstractJavaResourceMethodDispatcherProvider

java.lang.Object
  extended by org.glassfish.jersey.server.model.AbstractJavaResourceMethodDispatcherProvider
All Implemented Interfaces:
ResourceMethodDispatcher.Provider
Direct Known Subclasses:
MethodParamDispatcherProvider

public abstract class AbstractJavaResourceMethodDispatcherProvider
extends Object
implements ResourceMethodDispatcher.Provider

An abstract implementation of ResourceMethodDispatcher.Provider that creates instances of ResourceMethodDispatcher.

Implementing classes are required to override the #getInjectableValuesProvider(com.sun.jersey.api.model.AbstractResourceMethod) method to return a InjectableValuesProvider associated with the parameters of the abstract resource method.

Author:
Paul Sandoz, Marek Potociar (marek.potociar at oracle.com)

Constructor Summary
AbstractJavaResourceMethodDispatcherProvider()
           
 
Method Summary
 ResourceMethodDispatcher create(InvocableResourceMethod resourceMethod, InvocationHandler invocationHandler)
          Create a resource method dispatcher for a given invocable resource method.
protected abstract  List<org.glassfish.hk2.Factory<?>> createValueProviders(InvocableResourceMethod abstractResourceMethod)
          Get the injectable values provider for an abstract resource method.
protected  org.glassfish.hk2.Services getServices()
          Get the application-configured HK2 Services.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractJavaResourceMethodDispatcherProvider

public AbstractJavaResourceMethodDispatcherProvider()
Method Detail

create

public ResourceMethodDispatcher create(InvocableResourceMethod resourceMethod,
                                       InvocationHandler invocationHandler)
Description copied from interface: ResourceMethodDispatcher.Provider
Create a resource method dispatcher for a given invocable resource method.

If the provider supports the invocable resource method, it will return a new non-null dispatcher instance configured to invoke the supplied invocable resource method via the provided invocation handler whenever the dispatch(...) method is called on that dispatcher instance.

Specified by:
create in interface ResourceMethodDispatcher.Provider
Parameters:
resourceMethod - the invocable resource method.
invocationHandler - invocation handler to be used for the resource method invocation.
Returns:
the resource method dispatcher, or null if it could not be created for the given resource method.

getServices

protected final org.glassfish.hk2.Services getServices()
Get the application-configured HK2 Services.

Returns:
application-configured HK2 services.

createValueProviders

protected abstract List<org.glassfish.hk2.Factory<?>> createValueProviders(InvocableResourceMethod abstractResourceMethod)
Get the injectable values provider for an abstract resource method.

Parameters:
abstractResourceMethod - the abstract resource method.
Returns:
the injectable values provider, or null if no injectable values can be created for the parameters of the abstract resource method.


Copyright © 2007-2012 Oracle Corporation. All Rights Reserved. Use is subject to license terms.