com.sun.jersey.server.impl.container.servlet
Class ServletAdaptor

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by com.sun.jersey.spi.container.servlet.ServletContainer
              extended by com.sun.jersey.server.impl.container.servlet.ServletAdaptor
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Filter, javax.servlet.Servlet, javax.servlet.ServletConfig

public class ServletAdaptor
extends ServletContainer

A servlet container for deploying root resource classes with support for injecting persistence units.

Persistence units that may be injected must be configured in web.xml in the normal way plus an additional servlet parameter to enable the Jersey servlet to locate them in JNDI. E.g. with the following persistence unit configuration: persistence/widget WidgetPU the Jersey servlet requires an additional servlet parameter as follows: unit:WidgetPU persistence/widget Given the above, Jersey will inject the EntityManagerFactory found at java:comp/env/persistence/widget in JNDI when encountering a field or parameter annotated with @PersistenceUnit(unitName="WidgetPU").

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.sun.jersey.spi.container.servlet.ServletContainer
ServletContainer.ContextInjectableProvider<T>
 
Field Summary
 
Fields inherited from class com.sun.jersey.spi.container.servlet.ServletContainer
APPLICATION_CONFIG_CLASS, JSP_TEMPLATES_BASE_PATH, PROPERTY_WEB_PAGE_CONTENT_REGEX, RESOURCE_CONFIG_CLASS
 
Constructor Summary
ServletAdaptor()
           
 
Method Summary
protected  void configure(javax.servlet.ServletConfig servletConfig, ResourceConfig rc, WebApplication wa)
          Configure the ResourceConfig for a Servlet.
 
Methods inherited from class com.sun.jersey.spi.container.servlet.ServletContainer
configure, configure, create, destroy, doFilter, doFilter, getDefaultResourceConfig, getDefaultResourceConfig, getServletContext, getStaticContentPattern, getWebConfig, init, init, init, initiate, load, reload, service, service
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
 
Methods inherited from class javax.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServletAdaptor

public ServletAdaptor()
Method Detail

configure

protected void configure(javax.servlet.ServletConfig servletConfig,
                         ResourceConfig rc,
                         WebApplication wa)
Description copied from class: ServletContainer
Configure the ResourceConfig for a Servlet.

The ResourceConfig is configured such that the following classes may be injected onto the field of a root resource class or a parameter of a method of root resource class that is annotated with Context: ServletConfig.

An inheriting class may override this method to configure the ResourceConfig to provide alternative or additional instances that are resource or provider classes or instances, and may modify the features and properties of the ResourceConfig. For an inheriting class to extend configuration behaviour the overriding method MUST call super.configure(servletConfig, rc, wa) as the first statement of that method.

This method will be called only once at servlet initiation. Subsequent reloads of the Web application will not result in subsequence calls to this method.

Overrides:
configure in class ServletContainer
Parameters:
servletConfig - the Servlet configuration
rc - the Resource configuration
wa - the Web application


Copyright © 2011 Sun Microsystems, Inc. All Rights Reserved.