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".
Constructor and Description |
---|
InternalDispatcher() |
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) |
public static InternalDispatcher getInstance()
public static void setInstance(InternalDispatcher instance)
public Response executeEntity(String method, String uri, String contentType, Object entity)
public Response getResponse(MockHttpRequest request)
public Response getResponse(MockHttpRequest request, Object entity)
protected void enhanceRequest(MockHttpRequest request)
public static MockHttpRequest createRequest(String relativeUri, String verb)
Copyright © 2021 JBoss by Red Hat. All rights reserved.