You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fx-dev@ws.apache.org by da...@apache.org on 2007/05/25 16:45:35 UTC
svn commit: r541674 - in /webservices/kandula/branches/Kandula_1/src:
conf/kandula.properties java/org/apache/kandula/KandulaConfig.java
Author: dasarath
Date: Fri May 25 07:45:34 2007
New Revision: 541674
URL: http://svn.apache.org/viewvc?view=rev&rev=541674
Log:
The patch changes the kandula.properties contents to include two URLs:
* kandula.localService=http://localhost:8181/axis/services/
This is the address Kandula will tell any partner when handing out references.
* kandula.preferredCoordinationService=http://localhost:8281/axis/services/
This is the address where Kandula will try to reach a Kandula
activiation service to create new transaction contexts.
Hannes Erven, Georg Hicker
Modified:
webservices/kandula/branches/Kandula_1/src/conf/kandula.properties
webservices/kandula/branches/Kandula_1/src/java/org/apache/kandula/KandulaConfig.java
Modified: webservices/kandula/branches/Kandula_1/src/conf/kandula.properties
URL: http://svn.apache.org/viewvc/webservices/kandula/branches/Kandula_1/src/conf/kandula.properties?view=diff&rev=541674&r1=541673&r2=541674
==============================================================================
--- webservices/kandula/branches/Kandula_1/src/conf/kandula.properties (original)
+++ webservices/kandula/branches/Kandula_1/src/conf/kandula.properties Fri May 25 07:45:34 2007
@@ -1,4 +1,9 @@
-
+# Service endpoint where the local kandula services can be reached.
# ending '/' required
+kandula.localService=http://localhost:8181/axis/services/
-kandula.context=http://127.0.0.1:8080/axis/services/
\ No newline at end of file
+# Service endpoint where the activation service to be used for new coordination contexts can be reached.
+# If this setting is empty or commented out, the kandula.localService endpoint is used to create new
+# contexts.
+# ending '/' required
+kandula.preferredCoordinationService=http://localhost:8281/axis/services/
Modified: webservices/kandula/branches/Kandula_1/src/java/org/apache/kandula/KandulaConfig.java
URL: http://svn.apache.org/viewvc/webservices/kandula/branches/Kandula_1/src/java/org/apache/kandula/KandulaConfig.java?view=diff&rev=541674&r1=541673&r2=541674
==============================================================================
--- webservices/kandula/branches/Kandula_1/src/java/org/apache/kandula/KandulaConfig.java (original)
+++ webservices/kandula/branches/Kandula_1/src/java/org/apache/kandula/KandulaConfig.java Fri May 25 07:45:34 2007
@@ -1,6 +1,19 @@
/*
- * Created on Jan 6, 2006
+ * Copyright 2007 The Apache Software Foundation.
+ *
+ * Licensed 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.
*
+ * @author Dasarath Weeratunge, Hannes Erven, Georg Hicker
*/
package org.apache.kandula;
@@ -9,21 +22,23 @@
import java.util.Properties;
/**
- * @author Dasarath Weeratunge
+ * @author Dasarath Weeratunge, Hannes Erven, Georg Hicker
*
*/
public class KandulaConfig {
private static final String PROPERTY_FILE = "kandula.properties";
- private static final String CONTEXT_PROPERTY = "kandula.context";
+ private static final String LOCAL_SERVICE__PROPERTY = "kandula.localService";
+
+ private static final String PREFERRED_SERVICE__PROPERTY = "kandula.preferredCoordinationService";
private static KandulaConfig instance = new KandulaConfig();
private Properties properties = null;
private KandulaConfig() {
- properties = new Properties();
+ this.properties = new Properties();
loadProperties();
}
@@ -32,11 +47,10 @@
}
private void loadProperties() {
- InputStream in = getClass().getClassLoader().getResourceAsStream(
- PROPERTY_FILE);
+ InputStream in = getClass().getClassLoader().getResourceAsStream(PROPERTY_FILE);
try {
- properties.load(in);
+ this.properties.load(in);
in.close();
} catch (IOException e) {
e.printStackTrace();
@@ -45,7 +59,29 @@
}
public String getContext() {
- return properties.getProperty(CONTEXT_PROPERTY);
+ return this.properties.getProperty(LOCAL_SERVICE__PROPERTY);
+ }
+
+ /**
+ * Return the configured local kandula services endpoint base URL, eg.
+ * http://test1.kandula.apache.org:8280/axis/services/
+ * @return String-URL
+ */
+ public String getLocalServicesURL() {
+ return this.properties.getProperty(LOCAL_SERVICE__PROPERTY);
}
-}
\ No newline at end of file
+ /**
+ * Return the configured preferred kandula coordination services endpoint base URL, eg.
+ * http://my-favorite-coordinator.bar.foo.org:8180/axis/services/
+ * @return String-URL
+ */
+ public String getKandulaServicesURL(){
+ final String externalURL = this.properties.getProperty(PREFERRED_SERVICE__PROPERTY);
+
+ if (externalURL != null && externalURL.length()>0)
+ return externalURL;
+
+ return getContext();
+ }
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: kandula-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: kandula-dev-help@ws.apache.org