Package org.eclipse.jetty.util
Class DecoratedObjectFactory
- java.lang.Object
-
- org.eclipse.jetty.util.DecoratedObjectFactory
-
public class DecoratedObjectFactory extends Object implements Iterable<Decorator>
An ObjectFactory enhanced byDecoratorinstances.Consistent single location for all Decorator behavior, with equal behavior in a ServletContext and also for a stand alone client.
Used by ServletContextHandler, WebAppContext, WebSocketServerFactory, and WebSocketClient.
Can be found in the ServletContext Attributes at the
DecoratedObjectFactory.ATTRkey.
-
-
Constructor Summary
Constructors Constructor Description DecoratedObjectFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDecorator(Decorator decorator)voidclear()<T> TcreateInstance(Class<T> clazz)<T> Tdecorate(T obj)voiddestroy(Object obj)List<Decorator>getDecorators()Iterator<Decorator>iterator()voidsetDecorators(List<? extends Decorator> decorators)StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
ATTR
public static final String ATTR
ServletContext attribute for the active DecoratedObjectFactory
-
-
Method Detail
-
addDecorator
public void addDecorator(Decorator decorator)
-
clear
public void clear()
-
createInstance
public <T> T createInstance(Class<T> clazz) throws InstantiationException, IllegalAccessException, NoSuchMethodException, InvocationTargetException
-
decorate
public <T> T decorate(T obj)
-
destroy
public void destroy(Object obj)
-
-