servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ccust...@apache.org
Subject svn commit: r749926 - /servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/jca/JCAFlow.java
Date Wed, 04 Mar 2009 07:03:18 GMT
Author: ccustine
Date: Wed Mar  4 07:03:18 2009
New Revision: 749926

URL: http://svn.apache.org/viewvc?rev=749926&view=rev
Log:
SM-1822 - Add JMS connection credentials to JCAFlow

Modified:
    servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/jca/JCAFlow.java

Modified: servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/jca/JCAFlow.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/jca/JCAFlow.java?rev=749926&r1=749925&r2=749926&view=diff
==============================================================================
--- servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/jca/JCAFlow.java
(original)
+++ servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/jca/JCAFlow.java
Wed Mar  4 07:03:18 2009
@@ -114,6 +114,8 @@
     private ActiveMQTopic advisoryTopic;
     private EndpointListener endpointListener;
     private ComponentListener componentListener;
+    private String userName;
+    private String password;
 
     public JCAFlow() {
     }
@@ -193,6 +195,40 @@
     }
 
     /**
+     *
+     * @return Returns the password used for the JMS connections.
+     */
+    public String getPassword() {
+        return password;
+    }
+
+    /**
+     * Set the password to use in JMS connections.
+     * 
+     * @param password
+     */
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+    /**
+     *
+     * @return Returns the userName used for the JMS connections.
+     */
+    public String getUserName() {
+        return userName;
+    }
+
+    /**
+     * Sets the userName to use in JMS connections.
+     *
+     * @param userName
+     */
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    /**
      * Initialize the Region
      * 
      * @param broker
@@ -601,7 +637,12 @@
                 return;
             }
         }
-        Connection connection = managedConnectionFactory.createConnection();
+        Connection connection;
+        if (userName != null) {
+            connection = managedConnectionFactory.createConnection(userName, password);
+        } else {
+            connection = managedConnectionFactory.createConnection();
+        }
         try {
             Session session = connection.createSession(transacted, transacted ? Session.SESSION_TRANSACTED
: Session.AUTO_ACKNOWLEDGE);
             ObjectMessage msg = session.createObjectMessage(object);



Mime
View raw message