Package org.openspaces.core.bean
Interface BeanServer<T extends Bean>
- All Superinterfaces:
BeanConfigPropertiesManager
- All Known Implementing Classes:
DefaultBeanServer
-
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()voiddisableAllBeansAssignableTo(Class<?> interfaceClass) Disables all beans that implement the specified interface.getEnabledBean(String beanClassName) getEnabledBeansAssignableTo(Class<?>[] interfaceClasses) getEnabledBeansClassNamesAssignableTo(Class<?>[] interfaceClasses) booleanreplaceBeanAssignableTo(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.Methods inherited from interface org.openspaces.admin.bean.BeanConfigPropertiesManager
disableAllBeans, disableBean, enableBean, getBeanConfig, getBeansClassNames, getEnabledBeansClassNames, isBeanEnabled, removeBeanConfig, setBeanConfig
-
Method Details
-
getEnabledBean
- Returns:
- the bean instance of the specified class name, or null if not enabled.
-
disableAllBeansAssignableTo
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 implementbeanClassName- - the class name of the beanproperties- - 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 interfacesBeanConfigException- - if the bean initialization failed.
-
destroy
void destroy() -
getEnabledBeansAssignableTo
- 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
-