turcsanyip 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_r388543771
 
 

 ##########
 File path: 
nifi-nar-bundles/nifi-jms-bundle/nifi-jms-processors/src/main/java/org/apache/nifi/jms/cf/JMSConnectionFactoryHandler.java
 ##########
 @@ -0,0 +1,248 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.nifi.jms.cf;
+
+import org.apache.nifi.components.PropertyDescriptor;
+import org.apache.nifi.context.PropertyContext;
+import org.apache.nifi.controller.ConfigurationContext;
+import org.apache.nifi.logging.ComponentLog;
+import org.apache.nifi.processor.ProcessContext;
+import org.apache.nifi.ssl.SSLContextService;
+import org.apache.nifi.ssl.SSLContextService.ClientAuth;
+
+import javax.jms.ConnectionFactory;
+import javax.net.ssl.SSLContext;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+import static 
org.apache.nifi.jms.cf.JMSConnectionFactoryProperties.JMS_BROKER_URI;
+import static 
org.apache.nifi.jms.cf.JMSConnectionFactoryProperties.JMS_CONNECTION_FACTORY_IMPL;
+import static 
org.apache.nifi.jms.cf.JMSConnectionFactoryProperties.JMS_SSL_CONTEXT_SERVICE;
+
+/**
+ * Handler class to create a JMS Connection Factory by instantiating the 
vendor specific javax.jms.ConnectionFactory
+ * implementation class and configuring the Connection Factory object directly.
+ * The handler can be used from controller services and processors as well.
+ */
+public class JMSConnectionFactoryHandler implements 
IJMSConnectionFactoryProvider {
+
+    private final PropertyContext context;
+    private final Set<PropertyDescriptor> propertyDescriptors;
+    private final ComponentLog logger;
+
+    public JMSConnectionFactoryHandler(ConfigurationContext context, 
ComponentLog logger) {
 
 Review comment:
   We need to call `getProperties()` on the context object (in order to access 
the dynamic properties) but this method is not exposed on PropertyContext. Both 
ConfigurationContext and ProcessContext have it (with the same name) but their 
superclass does not.
   If PropertyContext was used, we would need to type check / type cast the 
object passed in. Also handle the other subtypes. I think the duplicated 
constructor is a better deal.

----------------------------------------------------------------
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

Reply via email to