Package org.eclipse.jetty.servlet
Class DecoratingListener
- java.lang.Object
-
- org.eclipse.jetty.servlet.DecoratingListener
-
- All Implemented Interfaces:
java.util.EventListener,javax.servlet.ServletContextAttributeListener
- Direct Known Subclasses:
CdiDecoratingListener,DecoratingListener
public class DecoratingListener extends java.lang.Object implements javax.servlet.ServletContextAttributeListenerA ServletContextAttributeListener that listens for a context attribute to obtain a decorator instance. The instance is then either coerced to aDecoratoror reflected for decorator compatible methods so it can be added to theServletContextHandler.getObjectFactory()as aDecorator.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classDecoratingListener.DynamicDecorator
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String_attributeNameprivate ServletContextHandler_contextprivate Decorator_decoratorprivate static java.lang.invoke.MethodTypeDECORATE_TYPEprivate static java.lang.invoke.MethodTypeDESTROY_TYPE
-
Constructor Summary
Constructors Constructor Description DecoratingListener(ServletContextHandler context, java.lang.String attributeName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private DecoratorasDecorator(java.lang.Object object)voidattributeAdded(javax.servlet.ServletContextAttributeEvent event)voidattributeRemoved(javax.servlet.ServletContextAttributeEvent event)voidattributeReplaced(javax.servlet.ServletContextAttributeEvent event)java.lang.StringgetAttributeName()javax.servlet.ServletContextgetServletContext()
-
-
-
Field Detail
-
DECORATE_TYPE
private static final java.lang.invoke.MethodType DECORATE_TYPE
-
DESTROY_TYPE
private static final java.lang.invoke.MethodType DESTROY_TYPE
-
_context
private final ServletContextHandler _context
-
_attributeName
private final java.lang.String _attributeName
-
_decorator
private Decorator _decorator
-
-
Constructor Detail
-
DecoratingListener
public DecoratingListener(ServletContextHandler context, java.lang.String attributeName)
-
-
Method Detail
-
getAttributeName
public java.lang.String getAttributeName()
-
getServletContext
public javax.servlet.ServletContext getServletContext()
-
asDecorator
private Decorator asDecorator(java.lang.Object object)
-
attributeAdded
public void attributeAdded(javax.servlet.ServletContextAttributeEvent event)
- Specified by:
attributeAddedin interfacejavax.servlet.ServletContextAttributeListener
-
attributeRemoved
public void attributeRemoved(javax.servlet.ServletContextAttributeEvent event)
- Specified by:
attributeRemovedin interfacejavax.servlet.ServletContextAttributeListener
-
attributeReplaced
public void attributeReplaced(javax.servlet.ServletContextAttributeEvent event)
- Specified by:
attributeReplacedin interfacejavax.servlet.ServletContextAttributeListener
-
-