Class BeanTearDownProcessor
java.lang.Object
net.shibboleth.shared.spring.config.BeanTearDownProcessor
- All Implemented Interfaces:
Aware,DisposableBean,ApplicationContextAware
public class BeanTearDownProcessor
extends Object
implements ApplicationContextAware, DisposableBean
A bean to teardown all beans in the application Context that have
the
OnTeardown annotation.- Since:
- 9.3.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ApplicationContextIf non null, theApplicationContextthat we were created inside.private static final org.slf4j.LoggerLogger. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()voidstatic voidtearDownBeans(ApplicationContext context) Given anApplicationContext, goes through all the (non-lazy init) beans, tearing down at the annotation point
-
Field Details
-
LOG
private static final org.slf4j.Logger LOGLogger. -
applicationContext
If non null, theApplicationContextthat we were created inside.
-
-
Constructor Details
-
BeanTearDownProcessor
public BeanTearDownProcessor()
-
-
Method Details
-
tearDownBeans
Given anApplicationContext, goes through all the (non-lazy init) beans, tearing down at the annotation point- Parameters:
context- the context to inspect.
-
destroy
If there is an
ApplicationContextthen iterate over all beans and call all the annotated tear down methods that each one implements (if any).- Specified by:
destroyin interfaceDisposableBean- Throws:
Exception
-
setApplicationContext
We save the
ApplicationContextfor use in teardown.- Specified by:
setApplicationContextin interfaceApplicationContextAware- Throws:
BeansException
-