Class LifeCycleCallbackCollection
- java.lang.Object
-
- org.eclipse.jetty.plus.annotation.LifeCycleCallbackCollection
-
public class LifeCycleCallbackCollection extends java.lang.Object
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
Fields Modifier and Type Field Description static java.lang.String
LIFECYCLE_CALLBACK_COLLECTION
-
Constructor Summary
Constructors Constructor Description LifeCycleCallbackCollection()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(LifeCycleCallback callback)
Add a Callback to the list of callbacks.void
callPostConstructCallback(java.lang.Object o)
Call the method, if one exists, that is annotated with@PostConstruct
or with<post-construct>
in web.xmlvoid
callPreDestroyCallback(java.lang.Object o)
Call the method, if one exists, that is annotated with@PreDestroy
or with<pre-destroy>
in web.xmljava.util.Map<java.lang.String,java.util.Set<LifeCycleCallback>>
getPostConstructCallbackMap()
Generate a read-only view of the post-construct callbacksjava.util.Collection<LifeCycleCallback>
getPostConstructCallbacks()
Amalgamate all post-construct callbacks and return a read only setjava.util.Set<LifeCycleCallback>
getPostConstructCallbacks(java.lang.Object o)
java.util.Map<java.lang.String,java.util.Set<LifeCycleCallback>>
getPreDestroyCallbackMap()
Generate a read-only view of the pre-destroy callbacksjava.util.Collection<LifeCycleCallback>
getPreDestroyCallbacks()
Amalgamate all pre-destroy callbacks and return a read only setjava.util.Set<LifeCycleCallback>
getPreDestroyCallbacks(java.lang.Object o)
-
-
-
Field Detail
-
LIFECYCLE_CALLBACK_COLLECTION
public static final java.lang.String LIFECYCLE_CALLBACK_COLLECTION
- See Also:
- Constant Field Values
-
-
Method Detail
-
add
public void add(LifeCycleCallback callback)
Add a Callback to the list of callbacks.- Parameters:
callback
- the callback
-
getPreDestroyCallbacks
public java.util.Set<LifeCycleCallback> getPreDestroyCallbacks(java.lang.Object o)
-
getPostConstructCallbacks
public java.util.Set<LifeCycleCallback> getPostConstructCallbacks(java.lang.Object o)
-
callPostConstructCallback
public void callPostConstructCallback(java.lang.Object o) throws java.lang.Exception
Call the method, if one exists, that is annotated with@PostConstruct
or with<post-construct>
in web.xml- Parameters:
o
- the object on which to attempt the callback- Throws:
java.lang.Exception
- if unable to callPostConstructCallback
-
callPreDestroyCallback
public void callPreDestroyCallback(java.lang.Object o) throws java.lang.Exception
Call the method, if one exists, that is annotated with@PreDestroy
or with<pre-destroy>
in web.xml- Parameters:
o
- the object on which to attempt the callback- Throws:
java.lang.Exception
- if unable to callPreDestroyCallback
-
getPostConstructCallbackMap
public java.util.Map<java.lang.String,java.util.Set<LifeCycleCallback>> getPostConstructCallbackMap()
Generate a read-only view of the post-construct callbacks- Returns:
- the map of
PostConstructCallback
s
-
getPreDestroyCallbackMap
public java.util.Map<java.lang.String,java.util.Set<LifeCycleCallback>> getPreDestroyCallbackMap()
Generate a read-only view of the pre-destroy callbacks- Returns:
- the map of
PreDestroyCallback
s
-
getPostConstructCallbacks
public java.util.Collection<LifeCycleCallback> getPostConstructCallbacks()
Amalgamate all post-construct callbacks and return a read only set- Returns:
- the collection of
PostConstructCallback
s
-
getPreDestroyCallbacks
public java.util.Collection<LifeCycleCallback> getPreDestroyCallbacks()
Amalgamate all pre-destroy callbacks and return a read only set- Returns:
- the collection of
PreDestroyCallback
s
-
-