Class ResourceMethodDispatcherFactory
- java.lang.Object
-
- org.glassfish.jersey.server.model.internal.ResourceMethodDispatcherFactory
-
- All Implemented Interfaces:
ResourceMethodDispatcher.Provider
@Singleton public final class ResourceMethodDispatcherFactory extends java.lang.Object implements ResourceMethodDispatcher.Provider
A resource method dispatcher provider factory.This class is used by
ResourceMethodInvoker
to create aResourceMethodDispatcher.Provider
instance that will be used to provide aResourceMethodDispatcher
instances for all resource method invocations.JAX-RS resource methods are invoked by
resource method invoker
. Whenever a new incoming request has been routed to a resource method and the method is being invoked by the resource method invoker, the invoker consults a registeredResourceMethodDispatcher.Provider
instance to retrieve aResourceMethodDispatcher
that will be ultimately used to dispatch the resource method invocation. This mechanism is useful for implementing any resource method interception logic.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.logging.Logger
LOGGER
private java.util.Collection<ResourceMethodDispatcher.Provider>
providers
-
Constructor Summary
Constructors Constructor Description ResourceMethodDispatcherFactory(java.util.Collection<ResourceMethodDispatcher.Provider> providers)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResourceMethodDispatcher
create(Invocable resourceMethod, java.lang.reflect.InvocationHandler handler, ConfiguredValidator validator)
Create aresource method dispatcher
for a giveninvocable resource method
.
-
-
-
Field Detail
-
LOGGER
private static final java.util.logging.Logger LOGGER
-
providers
private final java.util.Collection<ResourceMethodDispatcher.Provider> providers
-
-
Constructor Detail
-
ResourceMethodDispatcherFactory
ResourceMethodDispatcherFactory(java.util.Collection<ResourceMethodDispatcher.Provider> providers)
-
-
Method Detail
-
create
public ResourceMethodDispatcher create(Invocable resourceMethod, java.lang.reflect.InvocationHandler handler, ConfiguredValidator validator)
Description copied from interface:ResourceMethodDispatcher.Provider
Create aresource method dispatcher
for a giveninvocable 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 providedinvocation handler
whenever thedispatch(...)
method is called on that dispatcher instance.- Specified by:
create
in interfaceResourceMethodDispatcher.Provider
- Parameters:
resourceMethod
- the invocable resource method.handler
- invocation handler to be used for the resource method invocation.validator
- configured validator to be used for validation during resource method invocation- Returns:
- the resource method dispatcher, or
null
if it could not be created for the given resource method.
-
-