Hi Dasarath,
thanks for wading through the "millions" of patches currently floating
around ;-)
Here comes another small one, and I remember discussing about it on the
mailing list.
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. This should be a fixed IP address or fully qualified
hostname (unchanged irt what is currently in SVN)
* 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.
Why use a non-local coordination service? e.g. because you are behind a
firewall and cannot provide the web services to your resources yourself.
* include documentation about the values to set inline in the config file.
Allowing to create transaction contexts at remote site will also
introduce the possibility for service providers to offer transaction
coordination services and guarantee all transaction partners a correct,
independent and reliable coordination.
(This is perhaps more relevant in the context of WSBA).
Best regards,
-hannes
Index: src/conf/kandula.properties
===================================================================
--- src/conf/kandula.properties (revision 541468)
+++ src/conf/kandula.properties (working copy)
@@ -1,4 +1,9 @@
+# Service endpoint where the local kandula services can be reached.
+# ending '/' required
+kandula.localService=http://localhost:8181/axis/services/
+# 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.context=http://127.0.0.1:8080/axis/services/
\ No newline at end of file
+kandula.preferredCoordinationService=http://localhost:8281/axis/services/
Index: src/java/org/apache/kandula/KandulaConfig.java
===================================================================
--- src/java/org/apache/kandula/KandulaConfig.java (revision 541468)
+++ src/java/org/apache/kandula/KandulaConfig.java (working copy)
@@ -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);
}
-}
\ No newline at end of file
+ /**
+ * 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);
+ }
+
+ /**
+ * 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]