Class ControlBusCommandRegistry
java.lang.Object
org.springframework.integration.support.management.ControlBusCommandRegistry
- All Implemented Interfaces:
- Aware,- BeanPostProcessor,- DestructionAwareBeanPostProcessor,- SmartInitializingSingleton,- ApplicationContextAware
public class ControlBusCommandRegistry
extends Object
implements ApplicationContextAware, SmartInitializingSingleton, DestructionAwareBeanPostProcessor
A global component to serve Control Bus command and respective SpEL expression relationships.
- Since:
- 6.4
- Author:
- Artem Bilan
- See Also:
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic final classThe Java Bean to represent a Control Bus command as a bean method with its parameter types.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidReturn registered Control Bus commands.getExpressionForCommand(String command, Class<?>... parameterTypes) Obtain a SpEL expression for the command to call with parameter types.postProcessAfterInitialization(Object bean, String beanName) voidpostProcessBeforeDestruction(Object bean, String beanName) voidregisterControlBusCommands(String beanName, Object bean) Manually register Control Bus commands (if any) for a specific bean.voidsetApplicationContext(ApplicationContext applicationContext) voidsetEagerInitialization(boolean eagerInitialization) Set totrueto turn on Control Bus commands loading after application context initialization.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.beans.factory.config.BeanPostProcessorpostProcessBeforeInitializationMethods inherited from interface org.springframework.beans.factory.config.DestructionAwareBeanPostProcessorrequiresDestruction
- 
Constructor Details- 
ControlBusCommandRegistrypublic ControlBusCommandRegistry()
 
- 
- 
Method Details- 
setEagerInitializationpublic void setEagerInitialization(boolean eagerInitialization) Set totrueto turn on Control Bus commands loading after application context initialization.- Parameters:
- eagerInitialization- true to initialize this registry eagerly.
 
- 
setApplicationContext- Specified by:
- setApplicationContextin interface- ApplicationContextAware
- Throws:
- BeansException
 
- 
afterSingletonsInstantiatedpublic void afterSingletonsInstantiated()- Specified by:
- afterSingletonsInstantiatedin interface- SmartInitializingSingleton
 
- 
postProcessAfterInitialization- Specified by:
- postProcessAfterInitializationin interface- BeanPostProcessor
- Throws:
- BeansException
 
- 
registerControlBusCommandsManually register Control Bus commands (if any) for a specific bean. The bean must be in instance ofLifecycle, orCustomizableThreadCreator, or marked with theManagedResource, orIntegrationManagedResourceannotation.- Parameters:
- beanName- the bean name for registration
- bean- the bean for registration
 
- 
postProcessBeforeDestruction- Specified by:
- postProcessBeforeDestructionin interface- DestructionAwareBeanPostProcessor
- Throws:
- BeansException
 
- 
getCommandsReturn registered Control Bus commands.- Returns:
- registered commands.
 
- 
getExpressionForCommandObtain a SpEL expression for the command to call with parameter types. The command must be in formatbeanName.methodName. (Or@beanName.methodName()for backward compatibility with simple expressions.) IfbeanNameis a complex literal, it has to be wrapped into single quotes, e.g.'some.complex.bean-name'. The target method to call must fit into theControlBusMethodFilterrequirements and match with the provided parameter types.- Parameters:
- command- the command to call.
- parameterTypes- the parameter types for the target method to call.
- Returns:
- the SpEL expression for the provided command.
- Throws:
- IllegalArgumentException- if provided command does not match to Control Bus requirements or target method contract.
 
 
-