@ -85,14 +85,14 @@ class DisposableBeanAdapter implements DisposableBean, Runnable, Serializable {
private final boolean nonPublicAccessAllowed ;
private final boolean nonPublicAccessAllowed ;
private final AccessControlContext acc ;
private String destroyMethodName ;
private String destroyMethodName ;
private transient Method destroyMethod ;
private transient Method destroyMethod ;
private List < DestructionAwareBeanPostProcessor > beanPostProcessors ;
private List < DestructionAwareBeanPostProcessor > beanPostProcessors ;
private final AccessControlContext acc ;
/ * *
/ * *
* Create a new DisposableBeanAdapter for the given bean .
* Create a new DisposableBeanAdapter for the given bean .
@ -138,6 +138,22 @@ class DisposableBeanAdapter implements DisposableBean, Runnable, Serializable {
this . beanPostProcessors = filterPostProcessors ( postProcessors ) ;
this . beanPostProcessors = filterPostProcessors ( postProcessors ) ;
}
}
/ * *
* Create a new DisposableBeanAdapter for the given bean .
* @param bean the bean instance ( never { @code null } )
* @param postProcessors the List of BeanPostProcessors
* ( potentially DestructionAwareBeanPostProcessor ) , if any
* /
public DisposableBeanAdapter ( Object bean , List < BeanPostProcessor > postProcessors , AccessControlContext acc ) {
Assert . notNull ( bean , "Disposable bean must not be null" ) ;
this . bean = bean ;
this . beanName = null ;
this . invokeDisposableBean = ( this . bean instanceof DisposableBean ) ;
this . nonPublicAccessAllowed = true ;
this . acc = acc ;
this . beanPostProcessors = filterPostProcessors ( postProcessors ) ;
}
/ * *
/ * *
* Create a new DisposableBeanAdapter for the given bean .
* Create a new DisposableBeanAdapter for the given bean .
* /
* /
@ -149,9 +165,9 @@ class DisposableBeanAdapter implements DisposableBean, Runnable, Serializable {
this . beanName = beanName ;
this . beanName = beanName ;
this . invokeDisposableBean = invokeDisposableBean ;
this . invokeDisposableBean = invokeDisposableBean ;
this . nonPublicAccessAllowed = nonPublicAccessAllowed ;
this . nonPublicAccessAllowed = nonPublicAccessAllowed ;
this . acc = null ;
this . destroyMethodName = destroyMethodName ;
this . destroyMethodName = destroyMethodName ;
this . beanPostProcessors = postProcessors ;
this . beanPostProcessors = postProcessors ;
this . acc = null ;
}
}