Author: cwiklik
Date: Mon Feb 12 21:16:54 2018
New Revision: 1824075

URL: http://svn.apache.org/viewvc?rev=1824075&view=rev
Log:
UIMA-5722 modified to use new API to authenticate AMQ  user. Was setUserName() 
now is setUsername(). Also added code to start Camel context after producer 
template is created. Previously camel was starting the context under the 
covers, now it must be done explicitly.

Modified:
    
uima/uima-ducc/trunk/uima-ducc-common/src/main/java/org/apache/uima/ducc/common/main/DuccAdmin.java
    
uima/uima-ducc/trunk/uima-ducc-common/src/main/java/org/apache/uima/ducc/common/main/DuccRmAdmin.java

Modified: 
uima/uima-ducc/trunk/uima-ducc-common/src/main/java/org/apache/uima/ducc/common/main/DuccAdmin.java
URL: 
http://svn.apache.org/viewvc/uima/uima-ducc/trunk/uima-ducc-common/src/main/java/org/apache/uima/ducc/common/main/DuccAdmin.java?rev=1824075&r1=1824074&r2=1824075&view=diff
==============================================================================
--- 
uima/uima-ducc/trunk/uima-ducc-common/src/main/java/org/apache/uima/ducc/common/main/DuccAdmin.java
 (original)
+++ 
uima/uima-ducc/trunk/uima-ducc-common/src/main/java/org/apache/uima/ducc/common/main/DuccAdmin.java
 Mon Feb 12 21:16:54 2018
@@ -115,7 +115,7 @@ public class DuccAdmin extends AbstractD
                                              path = 
Utils.resolvePlaceholderIfExists(brokerCredentialsFile, System.getProperties());
                                          Credentials credentials = 
BrokerCredentials.get(path);
                                                  if ( 
credentials.getUsername() != null && credentials.getPassword() != null ) {
-                                                       
duccAMQComponent.setUserName(credentials.getUsername());
+                                                       
duccAMQComponent.setUsername(credentials.getUsername());
                                                        
duccAMQComponent.setPassword(credentials.getPassword());
                                                  }   
                                } catch(FileNotFoundException e) {
@@ -125,6 +125,9 @@ public class DuccAdmin extends AbstractD
                            }
                                
context.addComponent("activemq",duccAMQComponent);
                                this.pt = context.createProducerTemplate();
+                               if ( !context.getStatus().isStarted() ) {
+                                       context.start();
+                               } 
                        } catch( Throwable exx) {
                                System.out.println("DuccAdmin Failed:"+exx);
                                System.exit(-1);

Modified: 
uima/uima-ducc/trunk/uima-ducc-common/src/main/java/org/apache/uima/ducc/common/main/DuccRmAdmin.java
URL: 
http://svn.apache.org/viewvc/uima/uima-ducc/trunk/uima-ducc-common/src/main/java/org/apache/uima/ducc/common/main/DuccRmAdmin.java?rev=1824075&r1=1824074&r2=1824075&view=diff
==============================================================================
--- 
uima/uima-ducc/trunk/uima-ducc-common/src/main/java/org/apache/uima/ducc/common/main/DuccRmAdmin.java
 (original)
+++ 
uima/uima-ducc/trunk/uima-ducc-common/src/main/java/org/apache/uima/ducc/common/main/DuccRmAdmin.java
 Mon Feb 12 21:16:54 2018
@@ -128,7 +128,7 @@ public class DuccRmAdmin
                         path = 
Utils.resolvePlaceholderIfExists(brokerCredentialsFile, System.getProperties());
                         Credentials credentials = BrokerCredentials.get(path);
                         if ( credentials.getUsername() != null && 
credentials.getPassword() != null ) {
-                                                       
duccAMQComponent.setUserName(credentials.getUsername());
+                                                       
duccAMQComponent.setUsername(credentials.getUsername());
                                                        
duccAMQComponent.setPassword(credentials.getPassword());
                         }   
                                } catch(FileNotFoundException e) {
@@ -147,6 +147,10 @@ public class DuccRmAdmin
                        context.addComponent("activemq",duccAMQComponent);
                        
                                this.pt = context.createProducerTemplate();
+                               if ( !context.getStatus().isStarted() ) {
+                                       context.start();
+                               } 
+
                        } catch( Throwable exx) {
                                System.out.println("DuccRmAdmin Failed:"+exx);
                                System.exit(-1);


Reply via email to