T - the type of JMSWorker which could be JMSPublisher or JMSConsumerpublic abstract class AbstractJMSProcessor<T extends JMSWorker> extends AbstractProcessor
| Modifier and Type | Class and Description |
|---|---|
(package private) static class |
AbstractJMSProcessor.ConnectionFactoryConfigValidator |
| Modifier and Type | Field and Description |
|---|---|
(package private) static String |
BYTES_MESSAGE |
(package private) static PropertyDescriptor |
CF_SERVICE |
(package private) static PropertyDescriptor |
CHARSET |
(package private) static PropertyDescriptor |
CLIENT_ID |
private AtomicInteger |
clientIdCounter |
private IJMSConnectionFactoryProvider |
connectionFactoryProvider |
(package private) static PropertyDescriptor |
DESTINATION |
(package private) static PropertyDescriptor |
DESTINATION_TYPE |
(package private) static List<PropertyDescriptor> |
JMS_CF_PROPERTIES |
(package private) static List<PropertyDescriptor> |
JNDI_JMS_CF_PROPERTIES |
(package private) static PropertyDescriptor |
PASSWORD |
(package private) static String |
QUEUE |
(package private) static PropertyDescriptor |
SESSION_CACHE_SIZE |
(package private) static String |
TEXT_MESSAGE |
(package private) static String |
TOPIC |
(package private) static PropertyDescriptor |
USER |
private BlockingQueue<T> |
workerPool |
| Constructor and Description |
|---|
AbstractJMSProcessor() |
| Modifier and Type | Method and Description |
|---|---|
private T |
buildTargetResource(ProcessContext context)
This method essentially performs initialization of this Processor by
obtaining an instance of the
ConnectionFactory from the
JMSConnectionFactoryProvider (ControllerService) and performing a
series of ConnectionFactory adaptations which eventually results
in an instance of the CachingConnectionFactory used to construct
JmsTemplate used by this Processor. |
void |
close() |
protected Collection<ValidationResult> |
customValidate(ValidationContext validationContext) |
protected abstract T |
finishBuildingJmsWorker(org.springframework.jms.connection.CachingConnectionFactory connectionFactory,
org.springframework.jms.core.JmsTemplate jmsTemplate,
ProcessContext processContext)
Finishes building one of the
JMSWorker subclasses T. |
protected static String |
getClientId(ProcessContext context) |
protected PropertyDescriptor |
getSupportedDynamicPropertyDescriptor(String propertyDescriptorName) |
void |
onTrigger(ProcessContext context,
ProcessSession session) |
protected abstract void |
rendezvousWithJms(ProcessContext context,
ProcessSession session,
T jmsWorker)
Delegate method to supplement
onTrigger(ProcessContext, ProcessSession) operation. |
protected void |
setClientId(ProcessContext context,
org.springframework.jms.connection.SingleConnectionFactory connectionFactory)
Set clientId for JMS connections when clientId is not null.
|
void |
setupConnectionFactoryProvider(ProcessContext context) |
void |
setupWorkerPool(ProcessContext context) |
void |
shutdownConnectionFactoryProvider(ProcessContext context) |
onTriggergetControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, getRelationships, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrueequals, getPropertyDescriptor, getPropertyDescriptors, getSupportedPropertyDescriptors, hashCode, onPropertyModified, validateclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validatestatic final String QUEUE
static final String TOPIC
static final String TEXT_MESSAGE
static final String BYTES_MESSAGE
static final PropertyDescriptor USER
static final PropertyDescriptor PASSWORD
static final PropertyDescriptor DESTINATION
static final PropertyDescriptor DESTINATION_TYPE
static final PropertyDescriptor CLIENT_ID
static final PropertyDescriptor SESSION_CACHE_SIZE
static final PropertyDescriptor CHARSET
static final PropertyDescriptor CF_SERVICE
static final List<PropertyDescriptor> JNDI_JMS_CF_PROPERTIES
static final List<PropertyDescriptor> JMS_CF_PROPERTIES
private volatile IJMSConnectionFactoryProvider connectionFactoryProvider
private volatile BlockingQueue<T extends JMSWorker> workerPool
private final AtomicInteger clientIdCounter
protected static String getClientId(ProcessContext context)
protected PropertyDescriptor getSupportedDynamicPropertyDescriptor(String propertyDescriptorName)
getSupportedDynamicPropertyDescriptor in class AbstractConfigurableComponentprotected Collection<ValidationResult> customValidate(ValidationContext validationContext)
customValidate in class AbstractConfigurableComponentpublic void onTrigger(ProcessContext context, ProcessSession session) throws ProcessException
onTrigger in class AbstractProcessorProcessException@OnScheduled public void setupConnectionFactoryProvider(ProcessContext context)
@OnUnscheduled public void shutdownConnectionFactoryProvider(ProcessContext context)
@OnScheduled public void setupWorkerPool(ProcessContext context)
@OnStopped public void close()
protected abstract void rendezvousWithJms(ProcessContext context, ProcessSession session, T jmsWorker) throws ProcessException
onTrigger(ProcessContext, ProcessSession) operation. It is
implemented by sub-classes to perform Processor specific
functionality.ProcessExceptionprotected abstract T finishBuildingJmsWorker(org.springframework.jms.connection.CachingConnectionFactory connectionFactory, org.springframework.jms.core.JmsTemplate jmsTemplate, ProcessContext processContext)
JMSWorker subclasses T.JMSPublisher,
JMSConsumerprivate T buildTargetResource(ProcessContext context)
ConnectionFactory from the
JMSConnectionFactoryProvider (ControllerService) and performing a
series of ConnectionFactory adaptations which eventually results
in an instance of the CachingConnectionFactory used to construct
JmsTemplate used by this Processor.protected void setClientId(ProcessContext context, org.springframework.jms.connection.SingleConnectionFactory connectionFactory)
context - context.connectionFactory - the connection factory.Copyright © 2021 Apache NiFi Project. All rights reserved.