Package org.openspaces.admin.bean
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 Summary
Modifier and TypeMethodDescriptionvoidDisable all currently enabled beans.voiddisableBean(String beanClassName) Disables a bean.voidenableBean(String beanClassName) Disables a bean.getBeanConfig(String beanClassName) Get the bean configuration.String[]Lists the class names of configured beans.String[]Lists the class names of enabled beans.booleanisBeanEnabled(String beanClassName) booleanremoveBeanConfig(String beanClassName) Removes a bean configuration.voidsetBeanConfig(String beanClassName, Map<String, String> properties) Defines a configuration for the specified bean.
-
Method Details
-
setBeanConfig
void setBeanConfig(String beanClassName, Map<String, String> properties) throws EnabledBeanConfigCannotBeChangedExceptionDefines 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 nameproperties- the String key-value pairs used to configure this bean.- Throws:
EnabledBeanConfigCannotBeChangedException- The bean is enabled. Disable it first.
-
enableBean
void enableBean(String beanClassName) throws BeanConfigNotFoundException, BeanConfigurationException, BeanInitializationException 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
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
- Parameters:
beanClassName- the bean class name- Returns:
trueif the bean is enabled,falseif 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:
trueif removed ,falseif it did not exist in the first place.- Throws:
EnabledBeanConfigCannotBeChangedException- The bean is enabled. Disable it first.BeanConfigNotFoundException- bean configuration cannot be found.
-
getBeanConfig
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:
-