@Singleton public final class ResourceMethodDispatcherFactory extends java.lang.Object implements ResourceMethodDispatcher.Provider
This class is used by ResourceMethodInvoker
to
create a ResourceMethodDispatcher.Provider
instance
that will be used to provide a ResourceMethodDispatcher
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 registered
ResourceMethodDispatcher.Provider
instance to retrieve
a ResourceMethodDispatcher
that will be ultimately used
to dispatch the resource method invocation. This mechanism is useful for implementing any resource method
interception logic.
Modifier and Type | Field and Description |
---|---|
private static java.util.logging.Logger |
LOGGER |
private java.util.Collection<ResourceMethodDispatcher.Provider> |
providers |
Constructor and Description |
---|
ResourceMethodDispatcherFactory(java.util.Collection<ResourceMethodDispatcher.Provider> providers) |
Modifier and Type | Method and Description |
---|---|
ResourceMethodDispatcher |
create(Invocable resourceMethod,
java.lang.reflect.InvocationHandler handler,
ConfiguredValidator validator)
Create a
resource method dispatcher for
a given invocable resource method . |
private static final java.util.logging.Logger LOGGER
private final java.util.Collection<ResourceMethodDispatcher.Provider> providers
ResourceMethodDispatcherFactory(java.util.Collection<ResourceMethodDispatcher.Provider> providers)
public ResourceMethodDispatcher create(Invocable resourceMethod, java.lang.reflect.InvocationHandler handler, ConfiguredValidator validator)
ResourceMethodDispatcher.Provider
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.create
in interface ResourceMethodDispatcher.Provider
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 invocationnull
if it could not be
created for the given resource method.