Codota Logo
InternalDispatcher
Code IndexAdd Codota to your IDE (free)

How to use
InternalDispatcher
in
org.jboss.resteasy.spi

Best Java code snippets using org.jboss.resteasy.spi.InternalDispatcher (Showing top 19 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
LocalDateTime l =
  • Codota Iconnew LocalDateTime()
  • Codota IconLocalDateTime.now()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseLocalDateTime(text)
  • Smart code suggestions by Codota
}
origin: alipay/sofa-rpc

public SofaSynchronousDispatcher(ResteasyProviderFactory providerFactory) {
  super(providerFactory);
  this.providerFactory = providerFactory;
  this.registry = new SofaResourceMethodRegistry(providerFactory); // CHANGE
  defaultContextObjects.put(Providers.class, providerFactory);
  defaultContextObjects.put(Registry.class, registry);
  defaultContextObjects.put(Dispatcher.class, this);
  defaultContextObjects.put(InternalDispatcher.class, InternalDispatcher.getInstance());
}
origin: org.jboss.resteasy/resteasy-jaxrs-20

public Response getResponse(String uri)
{
 return getResponse(createRequest(uri, "GET"));
}
origin: org.jboss.resteasy/resteasy-jaxrs-20

public Response getResponse(MockHttpRequest request, Object entity)
{
 try
 {
   Dispatcher dispatcher = getContextData(Dispatcher.class);
   if (dispatcher == null)
   {
    return null;
   }
   enhanceRequest(request);
   return dispatcher.internalInvocation(request, new MockHttpResponse(), entity);
 }
 finally
 {
 }
}
origin: org.jboss.resteasy/resteasy-jaxrs-20

public Response putEntity(String uri, String contentType, Object entity)
{
 return executeEntity("PUT", uri, contentType, entity);
}
origin: org.jboss.resteasy/resteasy-jaxrs-20

public Response putEntity(String uri, Object entity)
{
 return putEntity(uri, "*/*", entity);
}
origin: org.jboss.resteasy/resteasy-jaxrs-20

public Response postEntity(String uri, Object entity)
{
 return postEntity(uri, "*/*", entity);
}
origin: org.jboss.resteasy/resteasy-jaxrs-20

public Object getEntity(String uri)
{
 return getResponse(uri).getEntity();
}
origin: org.jboss.resteasy/resteasy-jaxrs-20

protected void enhanceRequest(MockHttpRequest request)
{
 HttpRequest previousRequest = getContextData(HttpRequest.class);
 if (previousRequest != null)
 {
   getHeaders(request).putAll(getHeaders(previousRequest));
 }
}
origin: org.jboss.resteasy/resteasy-jaxrs-20

public static MockHttpRequest createRequest(String relativeUri, String verb)
{
 UriInfo uriInfo = ResteasyProviderFactory.getContextData(UriInfo.class);
 URI baseUri = uriInfo.getBaseUri();
 URI absoluteUri = baseUri.resolve(parseRelativeUri(relativeUri));
 return MockHttpRequest.create(verb, absoluteUri, baseUri);
}
origin: org.jboss.resteasy/resteasy-jaxrs-20

public Response delete(String uri)
{
 return getResponse(createRequest(uri, "DELETE"));
}
origin: org.jboss.resteasy/resteasy-jaxrs-20

public Response postEntity(String uri, String contentType, Object entity)
{
 return executeEntity("POST", uri, contentType, entity);
}
origin: alipay/sofa-rpc

public SofaSynchronousDispatcher(ResteasyProviderFactory providerFactory) {
  super(providerFactory);
  this.providerFactory = providerFactory;
  this.registry = new SofaResourceMethodRegistry(providerFactory); // CHANGE
  defaultContextObjects.put(Providers.class, providerFactory);
  defaultContextObjects.put(Registry.class, registry);
  defaultContextObjects.put(Dispatcher.class, this);
  defaultContextObjects.put(InternalDispatcher.class, InternalDispatcher.getInstance());
}
origin: org.jboss.resteasy/resteasy-jaxrs-20

public Response executeEntity(String method, String uri, String contentType, Object entity)
{
 MockHttpRequest post = createRequest(uri, method);
 post.contentType(contentType);
 return getResponse(post, entity);
}
origin: alipay/sofa-rpc

dispatcher.getDefaultContextObjects().put(Registry.class, registry);
dispatcher.getDefaultContextObjects().put(Dispatcher.class, dispatcher);
dispatcher.getDefaultContextObjects().put(InternalDispatcher.class, InternalDispatcher.getInstance());
origin: alipay/sofa-rpc

dispatcher.getDefaultContextObjects().put(Registry.class, registry);
dispatcher.getDefaultContextObjects().put(Dispatcher.class, dispatcher);
dispatcher.getDefaultContextObjects().put(InternalDispatcher.class, InternalDispatcher.getInstance());
origin: org.jboss.resteasy/resteasy-jaxrs-20

public SynchronousDispatcher(ResteasyProviderFactory providerFactory)
{
 this.providerFactory = providerFactory;
 this.registry = new ResourceMethodRegistry(providerFactory);
 defaultContextObjects.put(Providers.class, providerFactory);
 defaultContextObjects.put(Registry.class, registry);
 defaultContextObjects.put(Dispatcher.class, this);
 defaultContextObjects.put(InternalDispatcher.class, InternalDispatcher.getInstance());
}
origin: com.alipay.sofa/sofa-rpc-all

public SofaSynchronousDispatcher(ResteasyProviderFactory providerFactory) {
  super(providerFactory);
  this.providerFactory = providerFactory;
  this.registry = new SofaResourceMethodRegistry(providerFactory); // CHANGE
  defaultContextObjects.put(Providers.class, providerFactory);
  defaultContextObjects.put(Registry.class, registry);
  defaultContextObjects.put(Dispatcher.class, this);
  defaultContextObjects.put(InternalDispatcher.class, InternalDispatcher.getInstance());
}
origin: com.alipay.sofa/sofa-rpc-all

dispatcher.getDefaultContextObjects().put(Registry.class, registry);
dispatcher.getDefaultContextObjects().put(Dispatcher.class, dispatcher);
dispatcher.getDefaultContextObjects().put(InternalDispatcher.class, InternalDispatcher.getInstance());
origin: org.jboss.resteasy/resteasy-jaxrs-20

dispatcher.getDefaultContextObjects().put(Registry.class, registry);
dispatcher.getDefaultContextObjects().put(Dispatcher.class, dispatcher);
dispatcher.getDefaultContextObjects().put(InternalDispatcher.class, InternalDispatcher.getInstance());
dispatcher.getDefaultContextObjects().put(ResteasyDeployment.class, this);
org.jboss.resteasy.spiInternalDispatcher

Javadoc

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".

Most used methods

  • getInstance
  • createRequest
  • enhanceRequest
  • executeEntity
  • getHeaders
  • getResponse
  • parseRelativeUri
  • postEntity
  • putEntity

Popular in Java

  • Reactive rest calls using spring rest template
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • onCreateOptionsMenu (Activity)
  • findViewById (Activity)
  • PrintWriter (java.io)
    Prints formatted representations of objects to a text-output stream. This class implements all of th
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • Path (java.nio.file)
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now