com.sun.jersey.server.impl.container.servlet
Class ServletAdaptor
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
com.sun.jersey.spi.container.servlet.ServletContainer
com.sun.jersey.server.impl.container.servlet.ServletAdaptor
- All Implemented Interfaces:
- 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
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 |
ServletAdaptor
public ServletAdaptor()
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 configurationrc
- the Resource configurationwa
- the Web application
Copyright © 2013 Oracle Corporation. All Rights Reserved.