Package jodd.petite.scope
Class ShutdownAwareScope
- java.lang.Object
-
- jodd.petite.scope.ShutdownAwareScope
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<BeanData>destroyableBeans
-
Constructor Summary
Constructors Constructor Description ShutdownAwareScope()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddestroyBean(BeanData beanData)Removes destroyable bean from the list and calls it destroy methods.protected booleanisBeanDestroyable(BeanData beanData)Returnstrueif bean is destroyable.protected voidregisterDestroyableBeans(BeanData beanData)Checks if bean data is destroyable (has destroy methods) and registers it for latershutdown().voidshutdown()Shutdowns the scope and calls all collected destroyable beans.protected inttotalRegisteredDestroyableBeans()Returns number of destroyable beans that have been registered.
-
-
-
Field Detail
-
destroyableBeans
protected java.util.List<BeanData> destroyableBeans
-
-
Method Detail
-
isBeanDestroyable
protected boolean isBeanDestroyable(BeanData beanData)
Returnstrueif bean is destroyable.
-
registerDestroyableBeans
protected void registerDestroyableBeans(BeanData beanData)
Checks if bean data is destroyable (has destroy methods) and registers it for latershutdown().
-
totalRegisteredDestroyableBeans
protected int totalRegisteredDestroyableBeans()
Returns number of destroyable beans that have been registered.
-
destroyBean
protected void destroyBean(BeanData beanData)
Removes destroyable bean from the list and calls it destroy methods. If bean is not destroyable, does nothing. Bean gets destroyed only once.
-
-