public class LifeCycleCallbackCollection extends Object
Modifier and Type | Field and Description |
---|---|
static String |
LIFECYCLE_CALLBACK_COLLECTION |
Constructor and Description |
---|
LifeCycleCallbackCollection() |
Modifier and Type | Method and Description |
---|---|
void |
add(LifeCycleCallback callback)
Add a Callback to the list of callbacks.
|
void |
callPostConstructCallback(Object o)
Call the method, if one exists, that is annotated with
@PostConstruct
or with <post-construct> in web.xml |
void |
callPreDestroyCallback(Object o)
Call the method, if one exists, that is annotated with
@PreDestroy
or with <pre-destroy> in web.xml |
Map<String,List<LifeCycleCallback>> |
getPostConstructCallbackMap()
Generate a read-only view of the post-construct callbacks
|
Collection<LifeCycleCallback> |
getPostConstructCallbacks()
Amalgamate all post-construct callbacks and return a read only list
|
List<LifeCycleCallback> |
getPostConstructCallbacks(Object o) |
Map<String,List<LifeCycleCallback>> |
getPreDestroyCallbackMap()
Generate a read-only view of the pre-destroy callbacks
|
Collection<LifeCycleCallback> |
getPreDestroyCallbacks()
Amalgamate all pre-destroy callbacks and return a read only list
|
List<LifeCycleCallback> |
getPreDestroyCallbacks(Object o) |
public static final String LIFECYCLE_CALLBACK_COLLECTION
public void add(LifeCycleCallback callback)
callback
- the callbackpublic List<LifeCycleCallback> getPreDestroyCallbacks(Object o)
public List<LifeCycleCallback> getPostConstructCallbacks(Object o)
public void callPostConstructCallback(Object o) throws Exception
@PostConstruct
or with <post-construct>
in web.xmlo
- the object on which to attempt the callbackException
- if unable to call PostConstructCallback
public void callPreDestroyCallback(Object o) throws Exception
@PreDestroy
or with <pre-destroy>
in web.xmlo
- the object on which to attempt the callbackException
- if unable to call PreDestroyCallback
public Map<String,List<LifeCycleCallback>> getPostConstructCallbackMap()
PostConstructCallback
spublic Map<String,List<LifeCycleCallback>> getPreDestroyCallbackMap()
PreDestroyCallback
spublic Collection<LifeCycleCallback> getPostConstructCallbacks()
PostConstructCallback
spublic Collection<LifeCycleCallback> getPreDestroyCallbacks()
PreDestroyCallback
sCopyright © 1995-2015 Webtide. All Rights Reserved.