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) |
javax.ws.rs.core.Response |
delete(String uri) |
protected void |
enhanceRequest(MockHttpRequest request) |
javax.ws.rs.core.Response |
executeEntity(String method,
String uri,
String contentType,
Object entity) |
Object |
getEntity(String uri) |
static InternalDispatcher |
getInstance() |
javax.ws.rs.core.Response |
getResponse(MockHttpRequest request) |
javax.ws.rs.core.Response |
getResponse(MockHttpRequest request,
Object entity) |
javax.ws.rs.core.Response |
getResponse(String uri) |
javax.ws.rs.core.Response |
postEntity(String uri,
Object entity) |
javax.ws.rs.core.Response |
postEntity(String uri,
String contentType,
Object entity) |
javax.ws.rs.core.Response |
putEntity(String uri,
Object entity) |
javax.ws.rs.core.Response |
putEntity(String uri,
String contentType,
Object entity) |
static void |
setInstance(InternalDispatcher instance) |
public static InternalDispatcher getInstance()
public static void setInstance(InternalDispatcher instance)
public javax.ws.rs.core.Response delete(String uri)
public javax.ws.rs.core.Response executeEntity(String method, String uri, String contentType, Object entity)
public javax.ws.rs.core.Response postEntity(String uri, String contentType, Object entity)
public javax.ws.rs.core.Response getResponse(String uri)
public javax.ws.rs.core.Response getResponse(MockHttpRequest request)
public javax.ws.rs.core.Response getResponse(MockHttpRequest request, Object entity)
protected void enhanceRequest(MockHttpRequest request)
public static MockHttpRequest createRequest(String relativeUri, String verb)
Copyright © 2020 JBoss by Red Hat. All rights reserved.