public class Listener
extends org.jboss.weld.servlet.api.helpers.ForwardingServletListener
EnhancedListener
is registered as well.EnhancedListener
Modifier and Type | Field and Description |
---|---|
static String |
CONTAINER_ATTRIBUTE_NAME |
Constructor and Description |
---|
Listener() |
Modifier and Type | Method and Description |
---|---|
void |
contextDestroyed(javax.servlet.ServletContextEvent sce) |
void |
contextInitialized(javax.servlet.ServletContextEvent sce) |
protected org.jboss.weld.servlet.api.ServletListener |
delegate() |
static Listener |
using(javax.enterprise.inject.spi.BeanManager manager)
Creates a new Listener that uses the given
BeanManager instead of initializing a new Weld container instance. |
static Listener |
using(ContainerInstance container)
Creates a new Listener that uses the given
ContainerInstance (e.g. |
static Listener |
using(ContainerInstanceFactory container)
Creates a new Listener that uses the given
ContainerInstanceFactory for initializing Weld instance. |
public static final String CONTAINER_ATTRIBUTE_NAME
public static Listener using(javax.enterprise.inject.spi.BeanManager manager)
BeanManager
instead of initializing a new Weld container instance.manager
- the bean manager to be usedpublic static Listener using(ContainerInstance container)
ContainerInstance
(e.g. WeldContainer
) instead of initializing a
new Weld container instance. The listener does not take over the responsibility for container instance lifecycle management. It is the caller's
responsibility to shut down the container instance properly. The listener will not shut down the container instance when the Servlet context is
destroyed.container
- the container instance to be usedpublic static Listener using(ContainerInstanceFactory container)
ContainerInstanceFactory
for initializing Weld instance. A new Weld instance will be initialized using
ContainerInstanceFactory.initialize()
when the Servlet context is initialized. The Weld instance will be shut down when Servlet context is
destroyed.container
- the container factory to be usedpublic void contextInitialized(javax.servlet.ServletContextEvent sce)
contextInitialized
in interface javax.servlet.ServletContextListener
contextInitialized
in class org.jboss.weld.servlet.api.helpers.ForwardingServletListener
public void contextDestroyed(javax.servlet.ServletContextEvent sce)
contextDestroyed
in interface javax.servlet.ServletContextListener
contextDestroyed
in class org.jboss.weld.servlet.api.helpers.ForwardingServletListener
protected org.jboss.weld.servlet.api.ServletListener delegate()
delegate
in class org.jboss.weld.servlet.api.helpers.ForwardingServletListener
Copyright © 2019. All rights reserved.