Class RestBeanPostprocessor

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

    public class RestBeanPostprocessor
    extends Object
    implements org.springframework.beans.factory.config.BeanPostProcessor
    This class is used to register the properly annotated Rest endpoint classes. Since we implement this as a BeanPostProcessor we are 1.) depending on Spring and 2.) this will only work for beans known to Spring's ApplicationContext. An alternative would be to not rely on Spring at all and manually register the packages with REST endpoints. Since we think that the first approach makes for a much nicer API, we bit the bullet and went for the Spring dependency
    • Constructor Detail

      • RestBeanPostprocessor

        public RestBeanPostprocessor()
    • 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