org.glassfish.jersey.server
Class ApplicationHandler

java.lang.Object
  extended by org.glassfish.jersey.server.ApplicationHandler
All Implemented Interfaces:
Inflector<javax.ws.rs.core.Request,Future<javax.ws.rs.core.Response>>

public final class ApplicationHandler
extends Object
implements Inflector<javax.ws.rs.core.Request,Future<javax.ws.rs.core.Response>>

Jersey server-side application handler. Container implementations use the ApplicationHanlder API to process requests by invoking the apply(request, responseWriter) method on a configured application handler instance.

Author:
Pavel Bucek (pavel.bucek at oracle.com), Jakub Podlesak (jakub.podlesak at oracle.com), Marek Potociar (marek.potociar at oracle.com)
See Also:
ResourceConfig, ContainerProvider

Constructor Summary
ApplicationHandler()
           
ApplicationHandler(javax.ws.rs.core.Application application)
           
ApplicationHandler(Class<? extends javax.ws.rs.core.Application> jaxrsApplicationClass)
           
 
Method Summary
 void apply(ContainerRequestContext containerContext)
          The main request/response processing entry point for Jersey container implementations.
 Future<javax.ws.rs.core.Response> apply(javax.ws.rs.core.Request request)
          Invokes a request and returns the response future.
 ResourceConfig getConfiguration()
           
 ServiceProviders getServiceProviders()
           
 org.glassfish.hk2.Services getServices()
          Returns Services relevant to current application.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ApplicationHandler

public ApplicationHandler()

ApplicationHandler

public ApplicationHandler(Class<? extends javax.ws.rs.core.Application> jaxrsApplicationClass)

ApplicationHandler

public ApplicationHandler(javax.ws.rs.core.Application application)
Method Detail

apply

public Future<javax.ws.rs.core.Response> apply(javax.ws.rs.core.Request request)
Invokes a request and returns the response future.

Specified by:
apply in interface Inflector<javax.ws.rs.core.Request,Future<javax.ws.rs.core.Response>>
Parameters:
request - request data.
Returns:
response future.

apply

public void apply(ContainerRequestContext containerContext)
The main request/response processing entry point for Jersey container implementations. The method invokes the request processing of the provided jax-rs request from the container request context and uses the container response writer from the provided container request context to suspend & resume the processing as well as write the response back to the container. If the container request context contains security context it will be registered for further request processing. Custom scope injections will be initialized into the request scope.

Parameters:
containerContext - container request context of the current request.

getServices

public org.glassfish.hk2.Services getServices()
Returns Services relevant to current application.

Returns:
Services instance.

getServiceProviders

public ServiceProviders getServiceProviders()

getConfiguration

public ResourceConfig getConfiguration()


Copyright © 2007-2012 Oracle Corporation. All Rights Reserved. Use is subject to license terms.