Class LifecycleBeanPostProcessor

java.lang.Object
org.n52.iceland.config.spring.LifecycleBeanPostProcessor
All Implemented Interfaces:
org.springframework.beans.factory.config.BeanPostProcessor, org.springframework.beans.factory.config.DestructionAwareBeanPostProcessor, org.springframework.core.Ordered, org.springframework.core.PriorityOrdered

public class LifecycleBeanPostProcessor extends Object implements org.springframework.beans.factory.config.DestructionAwareBeanPostProcessor, org.springframework.core.PriorityOrdered
Bean post processor that calls Constructable.init() and Destroyable.destroy() for every bean that implements these interfaces. In contrast to the
invalid reference
javax.annotation.PostConstruct
and
invalid reference
javax.annotation.PreDestroy
annotations, these methods will also be called if they are declared in a super class of the bean. This postprocess will be called at the same stages, CommonAnnotationBeanPostProcessor would be called: Constructor Bean-Injections Settings-Injections init() ... destroy()
Since:
1.0.0
See Also:
  • Constructor Details

    • LifecycleBeanPostProcessor

      public LifecycleBeanPostProcessor()
  • Method Details

    • getOrder

      public int getOrder()
      Specified by:
      getOrder in interface org.springframework.core.Ordered
    • setOrder

      public void setOrder(int order)
    • postProcessAfterInitialization

      public Object postProcessAfterInitialization(Object bean, String beanName)
      Specified by:
      postProcessAfterInitialization in interface org.springframework.beans.factory.config.BeanPostProcessor
    • postProcessBeforeDestruction

      public void postProcessBeforeDestruction(Object bean, String beanName)
      Specified by:
      postProcessBeforeDestruction in interface org.springframework.beans.factory.config.DestructionAwareBeanPostProcessor
    • postProcessBeforeInitialization

      public Object postProcessBeforeInitialization(Object bean, String beanName)
      Specified by:
      postProcessBeforeInitialization in interface org.springframework.beans.factory.config.BeanPostProcessor
    • requiresDestruction

      public boolean requiresDestruction(Object bean)
      Specified by:
      requiresDestruction in interface org.springframework.beans.factory.config.DestructionAwareBeanPostProcessor