org.jboss.resteasy.spi
Class InternalDispatcher

java.lang.Object
  extended by org.jboss.resteasy.spi.InternalDispatcher

public class InternalDispatcher
extends java.lang.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
InternalDispatcher()
           
 
Method Summary
static MockHttpRequest createRequest(java.lang.String uri, java.lang.String verb)
           
 Response delete(java.lang.String uri)
           
protected  void enhanceRequest(MockHttpRequest request)
           
 java.lang.Object getEntity(java.lang.String uri)
           
static InternalDispatcher getInstance()
           
 Response getResponse(MockHttpRequest request)
           
 Response getResponse(MockHttpRequest request, java.lang.Object entity)
           
 Response getResponse(java.lang.String uri)
           
 Response postEntity(java.lang.String uri, java.lang.Object entity)
           
 Response putEntity(java.lang.String uri, java.lang.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 java.lang.Object getEntity(java.lang.String uri)

delete

public Response delete(java.lang.String uri)

putEntity

public Response putEntity(java.lang.String uri,
                          java.lang.Object entity)

postEntity

public Response postEntity(java.lang.String uri,
                           java.lang.Object entity)

getResponse

public Response getResponse(java.lang.String uri)

getResponse

public Response getResponse(MockHttpRequest request)

getResponse

public Response getResponse(MockHttpRequest request,
                            java.lang.Object entity)

enhanceRequest

protected void enhanceRequest(MockHttpRequest request)

createRequest

public static MockHttpRequest createRequest(java.lang.String uri,
                                            java.lang.String verb)


Copyright © 2010. All Rights Reserved.