public class GuiceContainer
extends com.sun.jersey.spi.container.servlet.ServletContainer
Servlet or Filter for deploying root resource classes
with Guice integration.
This class must be registered using
com.google.inject.servlet.ServletModule.
This class extends ServletContainer and initiates the
WebApplication with a Guice-based IoCComponentProviderFactory,
GuiceComponentProviderFactory, such that instances of resource and
provider classes declared and managed by Guice can be obtained.
Guice-bound classes will be automatically registered if such classes are root resource classes or provider classes. It is not necessary to provide initialization parameters for declaring classes in the web.xml unless a mixture of Guice-bound and Jersey-managed classes is required.
ServletModule,
Serialized Form| Modifier and Type | Class and Description |
|---|---|
class |
GuiceContainer.ServletGuiceComponentProviderFactory |
APPLICATION_CONFIG_CLASS, FEATURE_ALLOW_RAW_MANAGED_BEANS, 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| Constructor and Description |
|---|
GuiceContainer(com.google.inject.Injector injector)
Creates a new Injector.
|
| Modifier and Type | Method and Description |
|---|---|
protected com.sun.jersey.api.core.ResourceConfig |
getDefaultResourceConfig(Map<String,Object> props,
com.sun.jersey.spi.container.servlet.WebConfig webConfig) |
com.sun.jersey.spi.container.WebApplication |
getWebApplication() |
protected void |
initiate(com.sun.jersey.api.core.ResourceConfig config,
com.sun.jersey.spi.container.WebApplication webapp) |
configure, configure, configure, create, destroy, doFilter, doFilter, getDefaultResourceConfig, getServletContext, getStaticContentPattern, getWebConfig, init, init, init, load, reload, service, servicedoDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service@Inject public GuiceContainer(com.google.inject.Injector injector)
injector - the Guice injectorprotected com.sun.jersey.api.core.ResourceConfig getDefaultResourceConfig(Map<String,Object> props, com.sun.jersey.spi.container.servlet.WebConfig webConfig) throws javax.servlet.ServletException
getDefaultResourceConfig in class com.sun.jersey.spi.container.servlet.ServletContainerjavax.servlet.ServletExceptionprotected void initiate(com.sun.jersey.api.core.ResourceConfig config,
com.sun.jersey.spi.container.WebApplication webapp)
initiate in class com.sun.jersey.spi.container.servlet.ServletContainerpublic com.sun.jersey.spi.container.WebApplication getWebApplication()
Copyright © 2017. All Rights Reserved.