Interface BeanConfigPropertiesManager

All Known Subinterfaces:
BeanServer<T>
All Known Implementing Classes:
DefaultBeanServer

public interface BeanConfigPropertiesManager
A weakly typed properties manager for managing admin bean configurations by their name. The String key is the bean class name (see BeanConfig.getBeanClassName())), mapped with the relevant configuration properties.
Since:
8.0
Author:
Moran Avigdor, Itai Frenkel
  • Method Details

    • setBeanConfig

      void setBeanConfig(String beanClassName, Map<String,String> properties) throws EnabledBeanConfigCannotBeChangedException
      Defines a configuration for the specified bean. Overrides all previously set properties for that bean.

      An exception is raised if the bean is enabled.

      Parameters:
      beanClassName - the bean class name
      properties - the String key-value pairs used to configure this bean.
      Throws:
      EnabledBeanConfigCannotBeChangedException - The bean is enabled. Disable it first.
    • enableBean

      Disables a bean. The bean object is discarded but it's configuration remains. The bean can be enabled at a later time.

      If the bean is already disabled, the request is silently ignored.

      Parameters:
      beanClassName - the bean class name
      Throws:
      BeanConfigNotFoundException - bean configuration cannot be found.
      BeanConfigurationException - in the event of misconfiguration (such as failure to set an essential property).
      BeanInitializationException - if bean initialization fails.
    • disableBean

      void disableBean(String beanClassName) throws BeanConfigNotFoundException
      Disables a bean. The bean object is discarded but it's configuration remains. The bean can be enabled at a later time.

      If the bean is already disabled, the request is silently ignored.

      Parameters:
      beanClassName - the bean class name
      Throws:
      BeanConfigNotFoundException - bean configuration cannot be found.
    • isBeanEnabled

      boolean isBeanEnabled(String beanClassName)
      Parameters:
      beanClassName - the bean class name
      Returns:
      true if the bean is enabled, false if the bean is disabled.
    • removeBeanConfig

      boolean removeBeanConfig(String beanClassName) throws EnabledBeanConfigCannotBeChangedException, BeanConfigNotFoundException
      Removes a bean configuration.

      An exception is raised if the bean is enabled.

      Parameters:
      beanClassName - the bean class name
      Returns:
      true if removed ,false if it did not exist in the first place.
      Throws:
      EnabledBeanConfigCannotBeChangedException - The bean is enabled. Disable it first.
      BeanConfigNotFoundException - bean configuration cannot be found.
    • getBeanConfig

      Map<String,String> getBeanConfig(String beanClassName) throws BeanConfigNotFoundException
      Get the bean configuration.
      Parameters:
      beanClassName - the bean class name
      Returns:
      the String key-value pairs configuration properties.
      Throws:
      BeanConfigNotFoundException - bean configuration cannot be found. Put the configuration first.
    • getBeansClassNames

      String[] getBeansClassNames()
      Lists the class names of configured beans.
      Returns:
      an array of bean class names that have been configured bean. If no bean configuration exists, a zero length array is returned.
    • getEnabledBeansClassNames

      String[] getEnabledBeansClassNames()
      Lists the class names of enabled beans.
      Returns:
      an array of enabled beans. If no beans are enabled, a zero length array is returned.
      See Also:
    • disableAllBeans

      void disableAllBeans()
      Disable all currently enabled beans.
      See Also: