stratos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From im...@apache.org
Subject stratos git commit: Set default jndi.properties.dir to carbon home
Date Tue, 16 Jun 2015 12:13:11 GMT
Repository: stratos
Updated Branches:
  refs/heads/master 22de6a65a -> b26359336


Set default jndi.properties.dir to carbon home


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/b2635933
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/b2635933
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/b2635933

Branch: refs/heads/master
Commit: b26359336e92ccaf29f62cbaeaec3345f009d50b
Parents: 22de6a6
Author: Imesh Gunaratne <imesh@apache.org>
Authored: Tue Jun 16 17:43:03 2015 +0530
Committer: Imesh Gunaratne <imesh@apache.org>
Committed: Tue Jun 16 17:43:03 2015 +0530

----------------------------------------------------------------------
 .../messaging/broker/connect/amqp/AmqpTopicConnector.java      | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/b2635933/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/broker/connect/amqp/AmqpTopicConnector.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/broker/connect/amqp/AmqpTopicConnector.java
b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/broker/connect/amqp/AmqpTopicConnector.java
index 7d347ca..448989e 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/broker/connect/amqp/AmqpTopicConnector.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/broker/connect/amqp/AmqpTopicConnector.java
@@ -19,11 +19,13 @@
 
 package org.apache.stratos.messaging.broker.connect.amqp;
 
+import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.stratos.messaging.broker.connect.TopicConnector;
 import org.apache.stratos.messaging.domain.exception.MessagingException;
 import org.apache.stratos.messaging.util.MessagingUtil;
+import org.wso2.carbon.utils.CarbonUtils;
 
 import javax.jms.*;
 import javax.naming.InitialContext;
@@ -46,6 +48,10 @@ public abstract class AmqpTopicConnector implements TopicConnector {
     public void create() {
         try {
             String jndiPropFileDir = System.getProperty("jndi.properties.dir");
+            if(StringUtils.isEmpty(jndiPropFileDir)) {
+                // jndi.properties.dir system property not found, set default
+                jndiPropFileDir = CarbonUtils.getCarbonHome();
+            }
             Properties environment = MessagingUtil.getProperties(jndiPropFileDir + File.separator
+ "jndi.properties");
             environment.put("org.wso2.carbon.context.RequestBaseContext", "true"); // always
returns the base context.
             initialContext = new InitialContext(environment);


Mime
View raw message