markap14 commented on a change in pull request #4110: NIFI-7226: Add Connection
Factory configuration properties to Publish…
URL: https://github.com/apache/nifi/pull/4110#discussion_r388478636
##########
File path:
nifi-nar-bundles/nifi-jms-bundle/nifi-jms-processors/src/main/java/org/apache/nifi/jms/cf/JMSConnectionFactoryProvider.java
##########
@@ -68,289 +52,36 @@
@SeeAlso(classNames = {"org.apache.nifi.jms.processors.ConsumeJMS",
"org.apache.nifi.jms.processors.PublishJMS"})
public class JMSConnectionFactoryProvider extends AbstractControllerService
implements JMSConnectionFactoryProviderDefinition {
- private final Logger logger =
LoggerFactory.getLogger(JMSConnectionFactoryProvider.class);
-
- private static final List<PropertyDescriptor> PROPERTY_DESCRIPTORS;
-
- private volatile boolean configured;
-
- private volatile ConnectionFactory connectionFactory;
-
- private static final String BROKER = "broker";
- private static final String CF_IMPL = "cf";
- private static final String CF_LIB = "cflib";
-
- public static final PropertyDescriptor CONNECTION_FACTORY_IMPL = new
PropertyDescriptor.Builder()
- .name(CF_IMPL)
- .displayName("MQ ConnectionFactory Implementation")
- .description("A fully qualified name of the JMS ConnectionFactory
implementation "
- + "class (i.e.,
org.apache.activemq.ActiveMQConnectionFactory)")
- .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
- .required(true)
-
.expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY)
- .build();
- public static final PropertyDescriptor CLIENT_LIB_DIR_PATH = new
PropertyDescriptor.Builder()
- .name(CF_LIB)
- .displayName("MQ Client Libraries path (i.e. /usr/jms/lib)")
- .description("Path to the directory with additional resources
(i.e., JARs, configuration files etc.) to be added "
- + "to the classpath. Such resources typically represent
target MQ client libraries for the "
- + "ConnectionFactory implementation. Required if target is
not ActiveMQ.")
- .addValidator(StandardValidators.createListValidator(true, true,
StandardValidators.createURLorFileValidator()))
- .required(false)
- .dynamicallyModifiesClasspath(true)
-
.expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY)
- .build();
-
- // ConnectionFactory specific properties
- public static final PropertyDescriptor BROKER_URI = new
PropertyDescriptor.Builder()
- .name(BROKER)
- .displayName("Broker URI")
- .description("URI pointing to the network location of the JMS
Message broker. Example for ActiveMQ: "
- + "'tcp://myhost:61616'. Examples for IBM MQ:
'myhost(1414)' and 'myhost01(1414),myhost02(1414)'")
- .addValidator(new NonEmptyBrokerURIValidator())
- .required(false)
-
.expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY)
- .build();
-
- public static final PropertyDescriptor SSL_CONTEXT_SERVICE = new
PropertyDescriptor.Builder()
- .name("SSL Context Service")
- .description("The SSL Context Service used to provide client
certificate information for TLS/SSL connections.")
- .required(false)
- .identifiesControllerService(SSLContextService.class)
- .build();
-
- static {
- PROPERTY_DESCRIPTORS =
Collections.unmodifiableList(Arrays.asList(CONNECTION_FACTORY_IMPL,
CLIENT_LIB_DIR_PATH, BROKER_URI, SSL_CONTEXT_SERVICE));
- }
+ protected JMSConnectionFactoryHandler delegate;
Review comment:
This is not thread-safe. It's a member variable that is accessed without
synchronization/protection. Must be, at a minimum, marked as `volatile`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services