org.codehaus.enunciate.modules.jersey
Class EnunciateJerseyServletContainer
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
com.sun.jersey.spi.container.servlet.ServletContainer
org.codehaus.enunciate.modules.jersey.EnunciateJerseyServletContainer
- All Implemented Interfaces:
- java.io.Serializable, javax.servlet.Filter, javax.servlet.Servlet, javax.servlet.ServletConfig
public class EnunciateJerseyServletContainer
- extends com.sun.jersey.spi.container.servlet.ServletContainer
Enunciate-specific servlet container that adds additional Enunciate-supported functionality to the Jersey JAX-RS container. This additional functionality
includes:
- Loading known Enunciate providers
- Application of a JAXB namespace prefix mapper
- path-based resource conneg
- Automatic (and dynamic) leverage of Spring container, if found in the environment.
- Author:
- Ryan Heaton
- See Also:
- Serialized Form
| Nested classes/interfaces inherited from class com.sun.jersey.spi.container.servlet.ServletContainer |
com.sun.jersey.spi.container.servlet.ServletContainer.ContextInjectableProvider<T> |
| Fields inherited from class com.sun.jersey.spi.container.servlet.ServletContainer |
APPLICATION_CONFIG_CLASS, FEATURE_FILTER_FORWARD_ON_404, GLASSFISH_DEFAULT_ERROR_PAGE_RESPONSE, JSP_TEMPLATES_BASE_PATH, PROPERTY_FILTER_CONTEXT_PATH, PROPERTY_WEB_PAGE_CONTENT_REGEX, RESOURCE_CONFIG_CLASS |
|
Method Summary |
protected void |
configure(javax.servlet.ServletConfig sc,
com.sun.jersey.api.core.ResourceConfig rc,
com.sun.jersey.spi.container.WebApplication wa)
|
protected com.sun.jersey.spi.container.WebApplication |
create()
|
static java.lang.ClassLoader |
getDefaultClassLoader()
Return the default ClassLoader to use: typically the thread context
ClassLoader, if available; the ClassLoader that loaded the EnunciateJAXBContextResolver
class will be used as fallback. |
protected void |
initiate(com.sun.jersey.api.core.ResourceConfig rc,
com.sun.jersey.spi.container.WebApplication wa)
|
protected java.lang.Class |
loadClass(java.lang.String classname)
Loads a class from the classpath. |
protected java.io.InputStream |
loadResource(java.lang.String resource)
Loads a resource from the classpath. |
protected com.sun.jersey.core.spi.component.ioc.IoCComponentProviderFactory |
loadResourceProviderFacotry(com.sun.jersey.api.core.ResourceConfig rc)
Attempts to load the spring component provider factory, if spring is enabled. |
void |
service(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
|
| Methods inherited from class com.sun.jersey.spi.container.servlet.ServletContainer |
configure, configure, destroy, doFilter, doFilter, getDefaultResourceConfig, getDefaultResourceConfig, getServletContext, getStaticContentPattern, getWebConfig, init, init, init, load, reload, 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 |
EnunciateJerseyServletContainer
public EnunciateJerseyServletContainer()
configure
protected void configure(javax.servlet.ServletConfig sc,
com.sun.jersey.api.core.ResourceConfig rc,
com.sun.jersey.spi.container.WebApplication wa)
- Overrides:
configure in class com.sun.jersey.spi.container.servlet.ServletContainer
initiate
protected void initiate(com.sun.jersey.api.core.ResourceConfig rc,
com.sun.jersey.spi.container.WebApplication wa)
- Overrides:
initiate in class com.sun.jersey.spi.container.servlet.ServletContainer
create
protected com.sun.jersey.spi.container.WebApplication create()
- Overrides:
create in class com.sun.jersey.spi.container.servlet.ServletContainer
loadResourceProviderFacotry
protected com.sun.jersey.core.spi.component.ioc.IoCComponentProviderFactory loadResourceProviderFacotry(com.sun.jersey.api.core.ResourceConfig rc)
- Attempts to load the spring component provider factory, if spring is enabled.
- Parameters:
rc - The resource config.
- Returns:
- The component provider factory, or null if none.
service
public void service(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.servlet.ServletException,
java.io.IOException
- Overrides:
service in class com.sun.jersey.spi.container.servlet.ServletContainer
- Throws:
javax.servlet.ServletException
java.io.IOException
getDefaultClassLoader
public static java.lang.ClassLoader getDefaultClassLoader()
- Return the default ClassLoader to use: typically the thread context
ClassLoader, if available; the ClassLoader that loaded the EnunciateJAXBContextResolver
class will be used as fallback.
Call this method if you intend to use the thread context ClassLoader
in a scenario where you absolutely need a non-null ClassLoader reference:
for example, for class path resource loading (but not necessarily for
Class.forName, which accepts a null ClassLoader
reference as well).
- Returns:
- the default ClassLoader (never
null) - See Also:
Thread.getContextClassLoader()
loadResource
protected java.io.InputStream loadResource(java.lang.String resource)
- Loads a resource from the classpath.
- Parameters:
resource - The resource to load.
- Returns:
- The resource.
loadClass
protected java.lang.Class loadClass(java.lang.String classname)
throws java.lang.ClassNotFoundException
- Loads a class from the classpath.
- Parameters:
classname - The class name.
- Returns:
- The class.
- Throws:
java.lang.ClassNotFoundException