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
Jetty Container.
This container requires that the jetty server register CdiDecoratingListener
to dynamically register a decorator instance that wraps the WeldDecorator
added as an attribute. The jetty decorate module 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-spi module 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
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Containerstatic final StringFields inherited from class org.jboss.weld.environment.jetty.AbstractJettyContainer
INJECTOR_ATTRIBUTE_NAMEFields inherited from interface org.jboss.weld.environment.servlet.Container
CONTEXT_PARAM_CONTAINER_CLASS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringGet 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 Details
-
INSTANCE
-
JETTY_CDI_ATTRIBUTE
- See Also:
-
CDI_SPI_DECORATOR_MODE
- See Also:
-
CDI_DECORATING_LISTENER_MODE
- See Also:
-
CDI_DECORATING_LISTENER_ATTRIBUTE
- See Also:
-
-
Constructor Details
-
JettyContainer
public JettyContainer()
-
-
Method Details
-
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 Exception Description 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
Description copied from interface:ContainerInitialize web container.- Specified by:
initializein interfaceContainer- Overrides:
initializein classAbstractJettyContainer- Parameters:
context- the container context
-