|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.beans.factory.support.DisposableBeanAdapter
class DisposableBeanAdapter
Adapter that implements the DisposableBean and Runnable interfaces
performing various destruction steps on a given bean instance:
AbstractBeanFactory,
DisposableBean,
DestructionAwareBeanPostProcessor,
AbstractBeanDefinition.getDestroyMethodName()| Field Summary | |
|---|---|
private java.security.AccessControlContext |
acc
|
private java.lang.Object |
bean
|
private java.lang.String |
beanName
|
private java.util.List<DestructionAwareBeanPostProcessor> |
beanPostProcessors
|
private java.lang.reflect.Method |
destroyMethod
|
private java.lang.String |
destroyMethodName
|
private boolean |
invokeDisposableBean
|
private static Log |
logger
|
private boolean |
nonPublicAccessAllowed
|
| Constructor Summary | |
|---|---|
private |
DisposableBeanAdapter(java.lang.Object bean,
java.lang.String beanName,
boolean invokeDisposableBean,
boolean nonPublicAccessAllowed,
java.lang.String destroyMethodName,
java.util.List<DestructionAwareBeanPostProcessor> postProcessors)
Create a new DisposableBeanAdapter for the given bean. |
|
DisposableBeanAdapter(java.lang.Object bean,
java.lang.String beanName,
RootBeanDefinition beanDefinition,
java.util.List<BeanPostProcessor> postProcessors,
java.security.AccessControlContext acc)
Create a new DisposableBeanAdapter for the given bean. |
| Method Summary | |
|---|---|
void |
destroy()
Invoked by a BeanFactory on destruction of a singleton. |
private java.lang.reflect.Method |
determineDestroyMethod()
|
private java.util.List<DestructionAwareBeanPostProcessor> |
filterPostProcessors(java.util.List<BeanPostProcessor> postProcessors)
Search for all DestructionAwareBeanPostProcessors in the List. |
private java.lang.reflect.Method |
findDestroyMethod()
|
private void |
invokeCustomDestroyMethod(java.lang.reflect.Method destroyMethod)
Invoke the specified custom destroy method on the given bean. |
void |
run()
|
protected java.lang.Object |
writeReplace()
Serializes a copy of the state of this class, filtering out non-serializable BeanPostProcessors. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final Log logger
private final java.lang.Object bean
private final java.lang.String beanName
private final boolean invokeDisposableBean
private final boolean nonPublicAccessAllowed
private java.lang.String destroyMethodName
private transient java.lang.reflect.Method destroyMethod
private java.util.List<DestructionAwareBeanPostProcessor> beanPostProcessors
private final java.security.AccessControlContext acc
| Constructor Detail |
|---|
public DisposableBeanAdapter(java.lang.Object bean,
java.lang.String beanName,
RootBeanDefinition beanDefinition,
java.util.List<BeanPostProcessor> postProcessors,
java.security.AccessControlContext acc)
bean - the bean instance (never null)beanName - the name of the beanbeanDefinition - the merged bean definitionpostProcessors - the List of BeanPostProcessors
(potentially DestructionAwareBeanPostProcessor), if any
private DisposableBeanAdapter(java.lang.Object bean,
java.lang.String beanName,
boolean invokeDisposableBean,
boolean nonPublicAccessAllowed,
java.lang.String destroyMethodName,
java.util.List<DestructionAwareBeanPostProcessor> postProcessors)
| Method Detail |
|---|
private java.util.List<DestructionAwareBeanPostProcessor> filterPostProcessors(java.util.List<BeanPostProcessor> postProcessors)
postProcessors - the List to search
public void run()
run in interface java.lang.Runnablepublic void destroy()
DisposableBean
destroy in interface DisposableBeanprivate java.lang.reflect.Method determineDestroyMethod()
private java.lang.reflect.Method findDestroyMethod()
private void invokeCustomDestroyMethod(java.lang.reflect.Method destroyMethod)
This implementation invokes a no-arg method if found, else checking for a method with a single boolean argument (passing in "true", assuming a "force" parameter), else logging an error.
protected java.lang.Object writeReplace()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||