Class ShiroEventBusBeanPostProcessor

  • All Implemented Interfaces:
    org.springframework.beans.factory.config.BeanPostProcessor

    public class ShiroEventBusBeanPostProcessor
    extends Object
    implements org.springframework.beans.factory.config.BeanPostProcessor
    Spring BeanPostProcessor that detects, EventBusAware and classes containing @Subscribe methods. Any classes implementing EventBusAware will have the setEventBus() method called with the eventBus. Any classes discovered with methods that are annotated with @Subscribe will be automaticly registered with the EventBus.

    NOTE: in a Spring environment implementing EventBusAware is not necessary, as you can just inject the EventBus with @Autowire.

    Since:
    1.4
    See Also:
    EventBusAware, Subscribe
    • Constructor Detail

      • ShiroEventBusBeanPostProcessor

        public ShiroEventBusBeanPostProcessor​(org.apache.shiro.event.EventBus eventBus)
    • Method Detail

      • postProcessBeforeInitialization

        public Object postProcessBeforeInitialization​(Object bean,
                                                      String beanName)
                                               throws org.springframework.beans.BeansException
        Specified by:
        postProcessBeforeInitialization in interface org.springframework.beans.factory.config.BeanPostProcessor
        Throws:
        org.springframework.beans.BeansException
      • postProcessAfterInitialization

        public Object postProcessAfterInitialization​(Object bean,
                                                     String beanName)
                                              throws org.springframework.beans.BeansException
        Specified by:
        postProcessAfterInitialization in interface org.springframework.beans.factory.config.BeanPostProcessor
        Throws:
        org.springframework.beans.BeansException