Package org.jboss.resteasy.core

## Class ResourceMethodInvoker

- java.lang.Object
- - org.jboss.resteasy.core.ResourceMethodInvoker

- All Implemented Interfaces:
    `JaxrsInterceptorRegistryListener`, `ResourceInvoker`

      public class ResourceMethodInvoker
      extends Object
      implements ResourceInvoker, JaxrsInterceptorRegistryListener

  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected AsyncResponseProvider` | `asyncResponseProvider` |
    `protected boolean` | `expectsBody` |
    `protected boolean` | `hasProduces` |
    `protected InjectorFactory` | `injector` |
    `protected boolean` | `isAsyncStreamProvider` |
    `protected boolean` | `isSse` |
    `protected boolean` | `isValidatable` |
    `protected ResourceMethod` | `method` |
    `protected Annotation[]` | `methodAnnotations` |
    `protected MethodInjector` | `methodInjector` |
    `protected boolean` | `methodIsValidatable` |
    `protected MethodStatisticsLogger` | `methodStatisticsLogger` |
    `protected ResteasyProviderFactory` | `parentProviderFactory` |
    `protected javax.ws.rs.container.ContainerRequestFilter[]` | `requestFilters` |
    `protected ResourceFactory` | `resource` |
    `protected javax.ws.rs.container.ResourceInfo` | `resourceInfo` |
    `protected ResteasyProviderFactory` | `resourceMethodProviderFactory` |
    `protected javax.ws.rs.container.ContainerResponseFilter[]` | `responseFilters` |
    `protected ConcurrentHashMap<String,​AtomicLong>` | `stats` |
    `protected GeneralValidator` | `validator` |
    `protected javax.ws.rs.ext.WriterInterceptor[]` | `writerInterceptors` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `ResourceMethodInvoker​(ResourceMethod method, InjectorFactory injector, ResourceFactory resource, ResteasyProviderFactory providerFactory)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `cleanup()` |
    `boolean` | `doesConsume​(javax.ws.rs.core.MediaType contentType)` |
    `boolean` | `doesProduce​(List<? extends javax.ws.rs.core.MediaType> accepts)` |
    `javax.ws.rs.core.MediaType[]` | `getConsumes()` |
    `Type` | `getGenericReturnType()` |
    `Set<String>` | `getHttpMethods()` |
    `Method` | `getMethod()` |
    `Annotation[]` | `getMethodAnnotations()` |
    `MethodStatisticsLogger` | `getMethodStatisticsLogger()` |
    `javax.ws.rs.core.MediaType[]` | `getProduces()` |
    `javax.ws.rs.container.ContainerRequestFilter[]` | `getRequestFilters()` |
    `Class<?>` | `getResourceClass()` |
    `javax.ws.rs.container.ContainerResponseFilter[]` | `getResponseFilters()` |
    `Class<?>` | `getReturnType()` |
    `Map<String,​AtomicLong>` | `getStats()` | Key is httpMethod called.
    `javax.ws.rs.ext.WriterInterceptor[]` | `getWriterInterceptors()` |
    `boolean` | `hasProduces()` |
    `protected void` | `incrementMethodCount​(String httpMethod)` |
    `void` | `initializeAsync​(ResteasyAsynchronousResponse asyncResponse)` |
    `BuiltResponse` | `invoke​(HttpRequest request, HttpResponse response)` |
    `BuiltResponse` | `invoke​(HttpRequest request, HttpResponse response, Object target)` |
    `CompletionStage<Object>` | `invokeDryRun​(HttpRequest request, HttpResponse response)` |
    `CompletionStage<Object>` | `invokeDryRun​(HttpRequest request, HttpResponse response, Object target)` |
    `protected BuiltResponse` | `invokeOnTarget​(HttpRequest request, HttpResponse response, Object target)` |
    `protected BuiltResponse` | `invokeOnTargetAfterFilter​(HttpRequest request, HttpResponse response, Object target)` |
    `protected CompletionStage<Object>` | `invokeOnTargetDryRun​(HttpRequest request, HttpResponse response, Object target)` |
    `boolean` | `isAsyncStreamProvider()` |
    `boolean` | `isSse()` |
    `void` | `markMethodAsAsync()` |
    `void` | `registryUpdated​(JaxrsInterceptorRegistry registry, JaxrsInterceptorRegistry.InterceptorFactory factory)` |
    `javax.ws.rs.core.MediaType` | `resolveContentType​(HttpRequest in, Object entity)` |
    `protected javax.ws.rs.core.MediaType` | `resolveContentTypeByAccept​(List<javax.ws.rs.core.MediaType> accepts, Object entity)` |
    `void` | `setMethodStatisticsLogger​(MethodStatisticsLogger msLogger)` |

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### methodInjector

          protected MethodInjector methodInjector

    - #### injector

          protected InjectorFactory injector

    - #### resource

          protected ResourceFactory resource

    - #### parentProviderFactory

          protected ResteasyProviderFactory parentProviderFactory

    - #### resourceMethodProviderFactory

          protected ResteasyProviderFactory resourceMethodProviderFactory

    - #### method

          protected ResourceMethod method

    - #### methodAnnotations

          protected Annotation[] methodAnnotations

    - #### requestFilters

          protected javax.ws.rs.container.ContainerRequestFilter[] requestFilters

    - #### responseFilters

          protected javax.ws.rs.container.ContainerResponseFilter[] responseFilters

    - #### writerInterceptors

          protected javax.ws.rs.ext.WriterInterceptor[] writerInterceptors

    - #### stats

          protected ConcurrentHashMap<String,​AtomicLong> stats

    - #### validator

          protected GeneralValidator validator

    - #### isValidatable

          protected boolean isValidatable

    - #### methodIsValidatable

          protected boolean methodIsValidatable

    - #### asyncResponseProvider

          protected AsyncResponseProvider asyncResponseProvider

    - #### isSse

          protected boolean isSse

    - #### isAsyncStreamProvider

          protected boolean isAsyncStreamProvider

    - #### resourceInfo

          protected javax.ws.rs.container.ResourceInfo resourceInfo

    - #### expectsBody

          protected boolean expectsBody

    - #### hasProduces

          protected final boolean hasProduces

    - #### methodStatisticsLogger

          protected MethodStatisticsLogger methodStatisticsLogger

  - ### Constructor Detail

    - #### ResourceMethodInvoker

          public ResourceMethodInvoker​(ResourceMethod method,
                                       InjectorFactory injector,
                                       ResourceFactory resource,
                                       ResteasyProviderFactory providerFactory)

  - ### Method Detail

    - #### hasProduces

          public boolean hasProduces()

      Specified by:
        `hasProduces` in interface `ResourceInvoker`

    - #### cleanup

          public void cleanup()

    - #### registryUpdated

          public void registryUpdated​(JaxrsInterceptorRegistry registry,
                                      JaxrsInterceptorRegistry.InterceptorFactory factory)

      Specified by:
        `registryUpdated` in interface `JaxrsInterceptorRegistryListener`

    - #### incrementMethodCount

          protected void incrementMethodCount​(String httpMethod)

    - #### getStats

          public Map<String,​AtomicLong> getStats()

      Key is httpMethod called.
      Returns:
        statistics map

    - #### getRequestFilters

          public javax.ws.rs.container.ContainerRequestFilter[] getRequestFilters()

    - #### getResponseFilters

          public javax.ws.rs.container.ContainerResponseFilter[] getResponseFilters()

    - #### getWriterInterceptors

          public javax.ws.rs.ext.WriterInterceptor[] getWriterInterceptors()

    - #### getGenericReturnType

          public Type getGenericReturnType()

    - #### getResourceClass

          public Class<?> getResourceClass()

    - #### getReturnType

          public Class<?> getReturnType()

    - #### getMethodAnnotations

          public Annotation[] getMethodAnnotations()

    - #### getMethod

          public Method getMethod()

      Specified by:
        `getMethod` in interface `ResourceInvoker`

    - #### invokeDryRun

          public CompletionStage<Object> invokeDryRun​(HttpRequest request,
                                                      HttpResponse response)

    - #### invoke

          public BuiltResponse invoke​(HttpRequest request,
                                      HttpResponse response)

      Specified by:
        `invoke` in interface `ResourceInvoker`

    - #### invokeDryRun

          public CompletionStage<Object> invokeDryRun​(HttpRequest request,
                                                      HttpResponse response,
                                                      Object target)

    - #### invoke

          public BuiltResponse invoke​(HttpRequest request,
                                      HttpResponse response,
                                      Object target)

      Specified by:
        `invoke` in interface `ResourceInvoker`

    - #### invokeOnTargetDryRun

          protected CompletionStage<Object> invokeOnTargetDryRun​(HttpRequest request,
                                                                 HttpResponse response,
                                                                 Object target)

    - #### invokeOnTarget

          protected BuiltResponse invokeOnTarget​(HttpRequest request,
                                                 HttpResponse response,
                                                 Object target)

    - #### invokeOnTargetAfterFilter

          protected BuiltResponse invokeOnTargetAfterFilter​(HttpRequest request,
                                                            HttpResponse response,
                                                            Object target)

    - #### initializeAsync

          public void initializeAsync​(ResteasyAsynchronousResponse asyncResponse)

    - #### doesProduce

          public boolean doesProduce​(List<? extends javax.ws.rs.core.MediaType> accepts)

    - #### doesConsume

          public boolean doesConsume​(javax.ws.rs.core.MediaType contentType)

    - #### resolveContentType

          public javax.ws.rs.core.MediaType resolveContentType​(HttpRequest in,
                                                               Object entity)

    - #### resolveContentTypeByAccept

          protected javax.ws.rs.core.MediaType resolveContentTypeByAccept​(List<javax.ws.rs.core.MediaType> accepts,
                                                                          Object entity)

    - #### getHttpMethods

          public Set<String> getHttpMethods()

    - #### getProduces

          public javax.ws.rs.core.MediaType[] getProduces()

    - #### getConsumes

          public javax.ws.rs.core.MediaType[] getConsumes()

    - #### isSse

          public boolean isSse()

    - #### isAsyncStreamProvider

          public boolean isAsyncStreamProvider()

    - #### markMethodAsAsync

          public void markMethodAsAsync()

    - #### setMethodStatisticsLogger

          public void setMethodStatisticsLogger​(MethodStatisticsLogger msLogger)

      Specified by:
        `setMethodStatisticsLogger` in interface `ResourceInvoker`

    - #### getMethodStatisticsLogger

          public MethodStatisticsLogger getMethodStatisticsLogger()

      Specified by:
        `getMethodStatisticsLogger` in interface `ResourceInvoker`