org.jboss.resteasy.spi

## Class InternalDispatcher

- java.lang.Object
- - org.jboss.resteasy.spi.InternalDispatcher

-     public class InternalDispatcher
      extends Object

  InternalDispatch represents a "forward" in servlet terms. You can perform an internal GET/POST/DELETE/PUT using IntenalDispatch using Java Object. For example:

       @GET
       @Produces("text/plain")
       @Path("/forward/object")
       public SomeObject forward(@Context InternalDispatcher dispatcher)
       {
          return (SomeObject) dispatcher.getEntity("/some-object");
       }

  That previous snippet performs an internal request to /some-object and returns the Object representation of the Resource that lives at "/some-object".

  Version:
    $Revision: 1 $
  Author:
    Solomon Duskis

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `InternalDispatcher()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static MockHttpRequest` | `createRequest(String relativeUri, String verb)`
    `Response` | `delete(String uri)`
    `protected void` | `enhanceRequest(MockHttpRequest request)`
    `Response` | `executeEntity(String method, String uri, String contentType, Object entity)`
    `Object` | `getEntity(String uri)`
    `static InternalDispatcher` | `getInstance()`
    `Response` | `getResponse(MockHttpRequest request)`
    `Response` | `getResponse(MockHttpRequest request, Object entity)`
    `Response` | `getResponse(String uri)`
    `Response` | `postEntity(String uri, Object entity)`
    `Response` | `postEntity(String uri, String contentType, Object entity)`
    `Response` | `putEntity(String uri, Object entity)`
    `Response` | `putEntity(String uri, String contentType, Object entity)`
    `static void` | `setInstance(InternalDispatcher instance)`

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

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

- - ### Constructor Detail

    - #### InternalDispatcher

          public InternalDispatcher()

  - ### Method Detail

    - #### getInstance

          public static InternalDispatcher getInstance()

    - #### setInstance

          public static void setInstance(InternalDispatcher instance)

    - #### getEntity

          public Object getEntity(String uri)

    - #### delete

          public Response delete(String uri)

    - #### putEntity

          public Response putEntity(String uri,
                           String contentType,
                           Object entity)

    - #### putEntity

          public Response putEntity(String uri,
                           Object entity)

    - #### executeEntity

          public Response executeEntity(String method,
                               String uri,
                               String contentType,
                               Object entity)

    - #### postEntity

          public Response postEntity(String uri,
                            String contentType,
                            Object entity)

    - #### postEntity

          public Response postEntity(String uri,
                            Object entity)

    - #### getResponse

          public Response getResponse(String uri)

    - #### getResponse

          public Response getResponse(MockHttpRequest request)

    - #### getResponse

          public Response getResponse(MockHttpRequest request,
                             Object entity)

    - #### enhanceRequest

          protected void enhanceRequest(MockHttpRequest request)

    - #### createRequest

          public static MockHttpRequest createRequest(String relativeUri,
                                      String verb)

Copyright © 2014. All Rights Reserved.