Package org.jboss.weld.environment.jetty
Class JettyContainer
- java.lang.Object
-
- org.jboss.weld.environment.servlet.AbstractContainer
-
- org.jboss.weld.environment.jetty.AbstractJettyContainer
-
- org.jboss.weld.environment.jetty.JettyContainer
-
- All Implemented Interfaces:
Container
public class JettyContainer extends AbstractJettyContainer
Jetty Container.This container requires that the jetty server register CdiDecoratingListener to dynamically register a decorator instance that wraps the
WeldDecoratoradded as an attribute. The jettydecoratemodule does this and indicates it's availability by setting the "org.eclipse.jetty.ee10.webapp.DecoratingListener" to the name of the watched attribute.Jetty also provides the
cdi-spimodule that may directly invoke the CDI SPI. This module indicates it's availability by setting the "org.eclipse.jetty.cdi" context attribute to "CdiSpiDecorator". If this module is used, then this JettyContainer only logs a message and does no further integration.- Since:
- Jetty 12+
- Author:
- Greg Wilkins
-
-
Field Summary
Fields Modifier and Type Field Description static StringCDI_DECORATING_LISTENER_ATTRIBUTEstatic StringCDI_DECORATING_LISTENER_MODEstatic StringCDI_SPI_DECORATOR_MODEstatic ContainerINSTANCEstatic StringJETTY_CDI_ATTRIBUTE-
Fields inherited from class org.jboss.weld.environment.jetty.AbstractJettyContainer
INJECTOR_ATTRIBUTE_NAME
-
Fields inherited from interface org.jboss.weld.environment.servlet.Container
CONTEXT_PARAM_CONTAINER_CLASS
-
-
Constructor Summary
Constructors Constructor Description JettyContainer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringclassToCheck()Get class name to check is we can use this container.voidinitialize(ContainerContext context)Initialize web container.booleantouch(org.jboss.weld.resources.spi.ResourceLoader resourceLoader, ContainerContext context)Touch if this container can be used.-
Methods inherited from class org.jboss.weld.environment.jetty.AbstractJettyContainer
destroy
-
-
-
-
Field Detail
-
INSTANCE
public static final Container INSTANCE
-
JETTY_CDI_ATTRIBUTE
public static final String JETTY_CDI_ATTRIBUTE
- See Also:
- Constant Field Values
-
CDI_SPI_DECORATOR_MODE
public static final String CDI_SPI_DECORATOR_MODE
- See Also:
- Constant Field Values
-
CDI_DECORATING_LISTENER_MODE
public static final String CDI_DECORATING_LISTENER_MODE
- See Also:
- Constant Field Values
-
CDI_DECORATING_LISTENER_ATTRIBUTE
public static final String CDI_DECORATING_LISTENER_ATTRIBUTE
- See Also:
- Constant Field Values
-
-
Method Detail
-
classToCheck
protected String classToCheck()
Description copied from class:AbstractContainerGet class name to check is we can use this container.- Specified by:
classToCheckin classAbstractContainer- Returns:
- the class name to check
-
touch
public boolean touch(org.jboss.weld.resources.spi.ResourceLoader resourceLoader, ContainerContext context) throws ExceptionDescription copied from interface:ContainerTouch if this container can be used. We should throw an exception if it cannot be used.- Specified by:
touchin interfaceContainer- Overrides:
touchin classAbstractContainer- Parameters:
resourceLoader- the ResourceLoader to use for class-availability testingcontext- the container context- Returns:
- true if touch was successful, false or exception otherwise
- Throws:
Exception- for any error
-
initialize
public void initialize(ContainerContext context)
Description copied from interface:ContainerInitialize web container.- Specified by:
initializein interfaceContainer- Overrides:
initializein classAbstractJettyContainer- Parameters:
context- the container context
-
-