Interface BeanHandler


  • public interface BeanHandler
    Handler for spring bean management
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      <T> T autowire​(Class<T> type)
      Instantiates a bean of the given type and autowire it's dependencies
      <T> T autowire​(Object object)
      Initializes the given bean, autowiring it's dependencies
      <T> T autowireWithArgs​(Class<T> type, Object... constructorArgs)
      Instantiates a bean of the given type using the given constructor arguments, and autowire it's dependencies
      <T extends CustomBean>
      T
      customBean​(Class<T> expectedType, String className)
      Creates a custom bean, that is, a bean whose interface is known, but the implementation class name is dynamic
      void destroy​(Object bean)
      Destroys a bean.
      <T> T getBean​(Class<T> type)
      Returns a cacheable singleton bean by class, autowired with the context.
      <T extends CustomBean>
      T
      getBean​(Class<T> expectedType, String className)
      Returns a cacheable singleton bean by classname, autowired with the context.
      <T> T instantiate​(Class<T> type)
      Instantiates a bean of the given type
      <T> T instantiateWithArgs​(Class<T> type, Object... constructorArgs)
      Instantiates a bean of the given type with constructor arguments
    • Method Detail

      • autowire

        <T> T autowire​(Class<T> type)
        Instantiates a bean of the given type and autowire it's dependencies
      • autowire

        <T> T autowire​(Object object)
        Initializes the given bean, autowiring it's dependencies
      • autowireWithArgs

        <T> T autowireWithArgs​(Class<T> type,
                               Object... constructorArgs)
        Instantiates a bean of the given type using the given constructor arguments, and autowire it's dependencies
      • customBean

        <T extends CustomBean> T customBean​(Class<T> expectedType,
                                            String className)
        Creates a custom bean, that is, a bean whose interface is known, but the implementation class name is dynamic
      • getBean

        <T> T getBean​(Class<T> type)
        Returns a cacheable singleton bean by class, autowired with the context.
      • getBean

        <T extends CustomBean> T getBean​(Class<T> expectedType,
                                         String className)
        Returns a cacheable singleton bean by classname, autowired with the context.
      • instantiate

        <T> T instantiate​(Class<T> type)
        Instantiates a bean of the given type
      • instantiateWithArgs

        <T> T instantiateWithArgs​(Class<T> type,
                                  Object... constructorArgs)
        Instantiates a bean of the given type with constructor arguments