Top Description Fields Constructors Methods
org.eclipse.jetty.util

public Class DecoratedObjectFactory

extends Object
implements Iterable<Decorator>, Decorator
Class Inheritance
All Implemented Interfaces
org.eclipse.jetty.util.Decorator, java.lang.Iterable
Imports
java.lang.reflect.InvocationTargetException, java.util.ArrayList, .Collections, .Iterator, .List, org.slf4j.Logger, .LoggerFactory

An ObjectFactory enhanced by Decorator instances.

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.ATTR key.

Field Summary

Modifier and TypeField and Description
public static final String
ATTR

ServletContext attribute for the active DecoratedObjectFactory

private static final ThreadLocal<Object>
private final List<Decorator>
private static final Logger

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
public static void
public void
public <T> T
public <T> T
public void
public static void
public static Object
public List<Decorator>
public Iterator<Decorator>
iterator()

Implements java.lang.Iterable.iterator.

Returns an iterator over elements of type T.
public boolean
public void
setDecorators(List<? extends Decorator> decorators)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

ATTRback to summary
public static final String ATTR

ServletContext attribute for the active DecoratedObjectFactory

decoratorInfoback to summary
private static final ThreadLocal<Object> decoratorInfo
decoratorsback to summary
private final List<Decorator> decorators
LOGback to summary
private static final Logger LOG

Constructor Detail

DecoratedObjectFactoryback to summary
public DecoratedObjectFactory()

Method Detail

addDecoratorback to summary
public void addDecorator(Decorator decorator)
associateInfoback to summary
public static void associateInfo(Object info)
clearback to summary
public void clear()
createInstanceback to summary
public <T> T createInstance(Class<T> clazz) throws InstantiationException, IllegalAccessException, NoSuchMethodException, InvocationTargetException
decorateback to summary
public <T> T decorate(T obj)

Implements org.eclipse.jetty.util.Decorator.decorate.

destroyback to summary
public void destroy(Object obj)

Implements org.eclipse.jetty.util.Decorator.destroy.

disassociateInfoback to summary
public static void disassociateInfo()
getAssociatedInfoback to summary
public static Object getAssociatedInfo()
getDecoratorsback to summary
public List<Decorator> getDecorators()
iteratorback to summary
public Iterator<Decorator> iterator()

Implements java.lang.Iterable.iterator.

Doc from java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

Returns:Iterator<Decorator>

an Iterator.

Annotations
@Override
removeDecoratorback to summary
public boolean removeDecorator(Decorator decorator)
setDecoratorsback to summary
public void setDecorators(List<? extends Decorator> decorators)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override