Class RabbitChannelDefinitionProcessor
java.lang.Object
org.flowable.eventregistry.spring.rabbit.RabbitChannelDefinitionProcessor
- All Implemented Interfaces:
EventListener
,ChannelModelProcessor
,Aware
,BeanFactoryAware
,ApplicationContextAware
,ApplicationListener<ContextRefreshedEvent>
public class RabbitChannelDefinitionProcessor
extends Object
implements BeanFactoryAware, ApplicationContextAware, ApplicationListener<ContextRefreshedEvent>, ChannelModelProcessor
- Author:
- Filip Hrisafov
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ApplicationContext
protected BeanFactory
static final String
protected RabbitListenerContainerFactory<?>
protected String
protected boolean
protected StringValueResolver
protected RabbitListenerEndpointRegistry
protected BeanExpressionContext
protected final org.slf4j.Logger
protected com.fasterxml.jackson.databind.ObjectMapper
protected RabbitOperations
protected BeanExpressionResolver
-
Constructor Summary
ConstructorsConstructorDescriptionRabbitChannelDefinitionProcessor
(com.fasterxml.jackson.databind.ObjectMapper objectMapper) -
Method Summary
Modifier and TypeMethodDescriptionboolean
canProcess
(ChannelModel channelModel) boolean
canProcessIfChannelModelAlreadyRegistered
(ChannelModel channelModel) protected MessageListener
createMessageListener
(EventRegistry eventRegistry, InboundChannelModel inboundChannelModel) protected RabbitListenerEndpoint
createRabbitListenerEndpoint
(RabbitInboundChannelModel channelModel, String tenantId, EventRegistry eventRegistry) protected String
getEndpointId
(ChannelModel channelModel, String tenantId) void
protected void
processOutboundDefinition
(RabbitOutboundChannelModel channelDefinition) void
registerChannelModel
(ChannelModel channelModel, String tenantId, EventRegistry eventRegistry, EventRepositoryService eventRepositoryService, boolean fallbackToDefaultTenant) protected void
registerEndpoint
(RabbitListenerEndpoint endpoint, RabbitListenerContainerFactory<?> factory) Register a newRabbitListenerEndpoint
alongside theRabbitListenerContainerFactory
to use to create the underlying container.protected String
protected AcknowledgeMode
resolveAckMode
(RabbitInboundChannelModel channelDefinition) protected RabbitAdmin
resolveAdmin
(RabbitInboundChannelModel channelDefinition) protected RabbitListenerContainerFactory<?>
resolveContainerFactory
(RabbitListenerEndpoint endpoint, RabbitListenerContainerFactory<?> containerFactory) protected TaskExecutor
resolveExecutor
(RabbitInboundChannelModel channelDefinition) protected Object
resolveExpression
(String value) protected String
resolveExpressionAsStringOrInteger
(String value, String attribute) protected Integer
resolvePriority
(RabbitInboundChannelModel channelDefinition) protected void
resolveQueues
(Object resolvedValue, List<String> result, RabbitInboundChannelModel channelDefinition) protected String[]
resolveQueues
(RabbitInboundChannelModel channelDefinition) void
setApplicationContext
(ApplicationContext applicationContext) void
setBeanFactory
(BeanFactory beanFactory) void
setContainerFactory
(RabbitListenerContainerFactory<?> containerFactory) void
setContainerFactoryBeanName
(String containerFactoryBeanName) void
setEndpointRegistry
(RabbitListenerEndpointRegistry endpointRegistry) void
setRabbitOperations
(RabbitOperations rabbitOperations) void
unregisterChannelModel
(ChannelModel channelModel, String tenantId, EventRepositoryService eventRepositoryService) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.context.ApplicationListener
supportsAsyncExecution
-
Field Details
-
CHANNEL_ID_PREFIX
- See Also:
-
logger
protected final org.slf4j.Logger logger -
endpointRegistry
-
containerFactoryBeanName
-
rabbitOperations
-
containerFactory
-
beanFactory
-
applicationContext
-
contextRefreshed
protected boolean contextRefreshed -
objectMapper
protected com.fasterxml.jackson.databind.ObjectMapper objectMapper -
resolver
-
embeddedValueResolver
-
expressionContext
-
-
Constructor Details
-
RabbitChannelDefinitionProcessor
public RabbitChannelDefinitionProcessor(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
-
Method Details
-
canProcess
- Specified by:
canProcess
in interfaceChannelModelProcessor
-
canProcessIfChannelModelAlreadyRegistered
- Specified by:
canProcessIfChannelModelAlreadyRegistered
in interfaceChannelModelProcessor
-
registerChannelModel
public void registerChannelModel(ChannelModel channelModel, String tenantId, EventRegistry eventRegistry, EventRepositoryService eventRepositoryService, boolean fallbackToDefaultTenant) - Specified by:
registerChannelModel
in interfaceChannelModelProcessor
-
createRabbitListenerEndpoint
protected RabbitListenerEndpoint createRabbitListenerEndpoint(RabbitInboundChannelModel channelModel, String tenantId, EventRegistry eventRegistry) -
processOutboundDefinition
-
resolveExpressionAsStringOrInteger
-
resolveQueues
-
resolveQueues
protected void resolveQueues(Object resolvedValue, List<String> result, RabbitInboundChannelModel channelDefinition) -
resolvePriority
-
resolveAdmin
-
resolveAckMode
-
resolveExecutor
-
resolveExpression
-
createMessageListener
protected MessageListener createMessageListener(EventRegistry eventRegistry, InboundChannelModel inboundChannelModel) -
unregisterChannelModel
public void unregisterChannelModel(ChannelModel channelModel, String tenantId, EventRepositoryService eventRepositoryService) - Specified by:
unregisterChannelModel
in interfaceChannelModelProcessor
-
registerEndpoint
protected void registerEndpoint(RabbitListenerEndpoint endpoint, RabbitListenerContainerFactory<?> factory) Register a newRabbitListenerEndpoint
alongside theRabbitListenerContainerFactory
to use to create the underlying container.The
factory
may benull
if the default factory has to be used for that endpoint. -
resolveContainerFactory
protected RabbitListenerContainerFactory<?> resolveContainerFactory(RabbitListenerEndpoint endpoint, RabbitListenerContainerFactory<?> containerFactory) -
getEndpointId
-
resolve
-
setBeanFactory
- Specified by:
setBeanFactory
in interfaceBeanFactoryAware
- Throws:
BeansException
-
setApplicationContext
- Specified by:
setApplicationContext
in interfaceApplicationContextAware
- Throws:
BeansException
-
onApplicationEvent
- Specified by:
onApplicationEvent
in interfaceApplicationListener<ContextRefreshedEvent>
-
getRabbitOperations
-
setRabbitOperations
-
getEndpointRegistry
-
setEndpointRegistry
-
getContainerFactoryBeanName
-
setContainerFactoryBeanName
-
getContainerFactory
-
setContainerFactory
-