Class LifeCycleCallbackCollection
java.lang.Object
org.eclipse.jetty.plus.annotation.LifeCycleCallbackCollection
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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(LifeCycleCallback callback) Add a Callback to the list of callbacks.void
Call the method, if one exists, that is annotated with@PostConstruct
or with<post-construct>
in web.xmlvoid
Call the method, if one exists, that is annotated with@PreDestroy
or with<pre-destroy>
in web.xmlGenerate a read-only view of the post-construct callbacksAmalgamate all post-construct callbacks and return a read only setGenerate a read-only view of the pre-destroy callbacksAmalgamate all pre-destroy callbacks and return a read only set
-
Field Details
-
LIFECYCLE_CALLBACK_COLLECTION
- See Also:
-
-
Constructor Details
-
LifeCycleCallbackCollection
public LifeCycleCallbackCollection()
-
-
Method Details
-
add
Add a Callback to the list of callbacks.- Parameters:
callback
- the callback
-
getPreDestroyCallbacks
-
getPreDestroyCallbacks
Amalgamate all pre-destroy callbacks and return a read only set- Returns:
- the collection of
PreDestroyCallback
s
-
getPostConstructCallbacks
-
getPostConstructCallbacks
Amalgamate all post-construct callbacks and return a read only set- Returns:
- the collection of
PostConstructCallback
s
-
callPostConstructCallback
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:
Exception
- if unable to callPostConstructCallback
-
callPreDestroyCallback
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:
Exception
- if unable to callPreDestroyCallback
-
getPostConstructCallbackMap
Generate a read-only view of the post-construct callbacks- Returns:
- the map of
PostConstructCallback
s
-
getPreDestroyCallbackMap
Generate a read-only view of the pre-destroy callbacks- Returns:
- the map of
PreDestroyCallback
s
-