Top Description Fields Constructors Methods
org.eclipse.jetty.plus.annotation

public Class LifeCycleCallbackCollection

extends Object
Class Inheritance
Imports
java.util.Collection, .Collections, .HashSet, .Map, .Set, java.util.concurrent.ConcurrentHashMap, .ConcurrentMap, .CopyOnWriteArraySet, org.slf4j.Logger, .LoggerFactory

LifeCycleCallbackCollection This class collects the classes and methods that have been configured in web.xml with postconstruct/predestroy callbacks, or that contain the equivalent annotations. It is also responsible for calling the callbacks. This class is not threadsafe for concurrent modifications, but is threadsafe for reading with concurrent modifications.

Field Summary

Modifier and TypeField and Description
public static final String
private static final Logger
private final ConcurrentMap<String, Set<LifeCycleCallback>>
private final ConcurrentMap<String, Set<LifeCycleCallback>>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
add(LifeCycleCallback
the callback
callback
)

Add a Callback to the list of callbacks.

public void
callPostConstructCallback(Object
the object on which to attempt the callback
o
)

Call the method, if one exists, that is annotated with @PostConstruct or with <post-construct> in web.xml

public void
callPreDestroyCallback(Object
the object on which to attempt the callback
o
)

Call the method, if one exists, that is annotated with @PreDestroy or with <pre-destroy> in web.xml

public Map<String, Set<LifeCycleCallback>>

Returns:

the map of PostConstructCallbacks
getPostConstructCallbackMap
()

Generate a read-only view of the post-construct callbacks

public Set<LifeCycleCallback>
public Collection<LifeCycleCallback>

Returns:

the collection of PostConstructCallbacks
getPostConstructCallbacks
()

Amalgamate all post-construct callbacks and return a read only set

public Map<String, Set<LifeCycleCallback>>

Returns:

the map of PreDestroyCallbacks
getPreDestroyCallbackMap
()

Generate a read-only view of the pre-destroy callbacks

public Set<LifeCycleCallback>
public Collection<LifeCycleCallback>

Returns:

the collection of PreDestroyCallbacks
getPreDestroyCallbacks
()

Amalgamate all pre-destroy callbacks and return a read only set

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

LIFECYCLE_CALLBACK_COLLECTIONback to summary
public static final String LIFECYCLE_CALLBACK_COLLECTION
LOGback to summary
private static final Logger LOG
postConstructCallbacksMapback to summary
private final ConcurrentMap<String, Set<LifeCycleCallback>> postConstructCallbacksMap
preDestroyCallbacksMapback to summary
private final ConcurrentMap<String, Set<LifeCycleCallback>> preDestroyCallbacksMap

Constructor Detail

LifeCycleCallbackCollectionback to summary
public LifeCycleCallbackCollection()

Method Detail

addback to summary
public void add(LifeCycleCallback callback)

Add a Callback to the list of callbacks.

Parameters
callback:LifeCycleCallback

the callback

callPostConstructCallbackback to summary
public void callPostConstructCallback(Object o) throws Exception

Call the method, if one exists, that is annotated with @PostConstruct or with <post-construct> in web.xml

Parameters
o:Object

the object on which to attempt the callback

Exceptions
Exception:
if unable to call PostConstructCallback
callPreDestroyCallbackback to summary
public void callPreDestroyCallback(Object o) throws Exception

Call the method, if one exists, that is annotated with @PreDestroy or with <pre-destroy> in web.xml

Parameters
o:Object

the object on which to attempt the callback

Exceptions
Exception:
if unable to call PreDestroyCallback
getPostConstructCallbackMapback to summary
public Map<String, Set<LifeCycleCallback>> getPostConstructCallbackMap()

Generate a read-only view of the post-construct callbacks

Returns:Map<String, Set<LifeCycleCallback>>

the map of PostConstructCallbacks

getPostConstructCallbacksback to summary
public Set<LifeCycleCallback> getPostConstructCallbacks(Object o)
getPostConstructCallbacksback to summary
public Collection<LifeCycleCallback> getPostConstructCallbacks()

Amalgamate all post-construct callbacks and return a read only set

Returns:Collection<LifeCycleCallback>

the collection of PostConstructCallbacks

getPreDestroyCallbackMapback to summary
public Map<String, Set<LifeCycleCallback>> getPreDestroyCallbackMap()

Generate a read-only view of the pre-destroy callbacks

Returns:Map<String, Set<LifeCycleCallback>>

the map of PreDestroyCallbacks

getPreDestroyCallbacksback to summary
public Set<LifeCycleCallback> getPreDestroyCallbacks(Object o)
getPreDestroyCallbacksback to summary
public Collection<LifeCycleCallback> getPreDestroyCallbacks()

Amalgamate all pre-destroy callbacks and return a read only set

Returns:Collection<LifeCycleCallback>

the collection of PreDestroyCallbacks