Interface BeanServer<T extends Bean>

All Superinterfaces:
BeanConfigPropertiesManager
All Known Implementing Classes:
DefaultBeanServer

public interface BeanServer<T extends Bean> extends BeanConfigPropertiesManager
  • Method Details

    • getEnabledBean

      T getEnabledBean(String beanClassName)
      Returns:
      the bean instance of the specified class name, or null if not enabled.
    • disableAllBeansAssignableTo

      void disableAllBeansAssignableTo(Class<?> interfaceClass)
      Disables all beans that implement the specified interface.
    • replaceBeanAssignableTo

      boolean replaceBeanAssignableTo(Class<?>[] interfaceClasses, String beanClassName, Map<String,String> properties)
      Assuming there is at most one enabled bean that implements one of the specified interfaces, puts the specified configuration and enables a new bean in its place.
      Parameters:
      interfaceClasses - - the interface that the new and old bean need to implement
      beanClassName - - the class name of the bean
      properties - - the new bean configuration that is to replace the existing specified interface implementation.
      Returns:
      true -if bean reaplaced, false if no configuration change detected.
      Throws:
      IllegalStateException - - if more than one enabled bean implements any of the specified interfaces
      BeanConfigException - - if the bean initialization failed.
    • destroy

      void destroy()
    • getEnabledBeansAssignableTo

      List<T> getEnabledBeansAssignableTo(Class<?>[] interfaceClasses)
      Parameters:
      interfaceClasses - - the interface that the bean we are looking for needs to implement
      Returns:
      the enabled bean that implements any one of the specified interfaces.
    • getEnabledBeansClassNamesAssignableTo

      List<String> getEnabledBeansClassNamesAssignableTo(Class<?>[] interfaceClasses) throws ClassNotFoundException
      Parameters:
      interfaceClasses - - the interface that the bean we are looking for needs to implement
      Returns:
      the enabled bean class names that implements any one of the specified interfaces.
      Throws:
      ClassNotFoundException