Author: jeff.yuchang
Date: 2010-09-27 03:11:55 -0400 (Mon, 27 Sep 2010)
New Revision: 986
Modified:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/integration/ServerConfig.java
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/integration/ServerConfigImpl.java
trunk/runtime/uddi/src/main/java/org/jboss/soa/bpel/uddi/UDDIRegistrationImpl.java
Log:
* added nodeName in the bindingkey.
* fixed the webservice baseurl for the accesspoint.
Modified:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/integration/ServerConfig.java
===================================================================
---
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/integration/ServerConfig.java 2010-09-24
03:48:00 UTC (rev 985)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/integration/ServerConfig.java 2010-09-27
07:11:55 UTC (rev 986)
@@ -48,6 +48,8 @@
int getWebServiceSecurePort();
- public String getClusterNodeName();
+ String getClusterNodeName();
+ String getUddiNodeName();
+
}
\ No newline at end of file
Modified:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/integration/ServerConfigImpl.java
===================================================================
---
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/integration/ServerConfigImpl.java 2010-09-24
03:48:00 UTC (rev 985)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/integration/ServerConfigImpl.java 2010-09-27
07:11:55 UTC (rev 986)
@@ -242,4 +242,10 @@
public void setClusterNodeName(String clusterNodeName) {
this.clusterNodeName = clusterNodeName;
}
+
+
+ public String getUddiNodeName() {
+ return this.getWebServiceHost() + "-" + this.getWebServicePort();
+ }
+
}
Modified:
trunk/runtime/uddi/src/main/java/org/jboss/soa/bpel/uddi/UDDIRegistrationImpl.java
===================================================================
---
trunk/runtime/uddi/src/main/java/org/jboss/soa/bpel/uddi/UDDIRegistrationImpl.java 2010-09-24
03:48:00 UTC (rev 985)
+++
trunk/runtime/uddi/src/main/java/org/jboss/soa/bpel/uddi/UDDIRegistrationImpl.java 2010-09-27
07:11:55 UTC (rev 986)
@@ -21,6 +21,7 @@
*/
package org.jboss.soa.bpel.uddi;
+import java.net.MalformedURLException;
import java.net.URL;
import java.rmi.RemoteException;
import java.util.List;
@@ -44,6 +45,7 @@
import org.apache.juddi.v3.client.config.UDDIClientContainer;
import org.apache.juddi.v3.client.transport.TransportException;
import org.jboss.soa.bpel.runtime.engine.ode.UDDIRegistration;
+import org.jboss.soa.bpel.runtime.integration.ServerConfigFactory;
import org.jboss.soa.bpel.runtime.ws.WSDLReference;
import org.jboss.soa.bpel.runtime.ws.WebServiceClient;
import org.uddi.api_v3.AccessPoint;
@@ -79,7 +81,7 @@
UDDIClerk bpelClerk = null;
public static final String DEFAULT_SERVICE_KEY_FORMAT =
"uddi:${keyDomain}:bpel-services-";
- public static final String DEFAULT_BINDING_KEY_FORMAT =
"uddi:${keyDomain}:bindings-";
+ public static final String DEFAULT_BINDING_KEY_FORMAT =
"uddi:${keyDomain}:bindings-${nodeName}-";
//Can be set in the uddi.xml property section
public static final String LANG = "lang";
public static final String SERVICE_DESCRIPTION =
"serviceDescription";
@@ -198,6 +200,7 @@
if (bpelClerk!=null) {
try {
Properties properties = bpelClerk.getUDDINode().getProperties();
+ properties.put("nodeName",
ServerConfigFactory.getServerConfig().getUddiNodeName());
//Constructing the bindingKey
String bindingKey = TokenResolver.replaceTokens(DEFAULT_BINDING_KEY_FORMAT +
bindingName, properties);
if (properties.containsKey(BINDING_KEY_FORMAT)) {
@@ -238,6 +241,8 @@
String serviceName, String portName, URL accessUrl)
throws DispositionReportFaultMessage, RemoteException, ConfigurationException,
TransportException {
Properties properties = clerk.getUDDINode().getProperties();
+ properties.put("nodeName",
ServerConfigFactory.getServerConfig().getUddiNodeName());
+
//Constructing the serviceKey
String serviceKey = TokenResolver.replaceTokens(DEFAULT_SERVICE_KEY_FORMAT +
serviceName, properties);
if (properties.containsKey(SERVICE_KEY_FORMAT)) {
@@ -303,6 +308,7 @@
Properties properties = clerk.getUDDINode().getProperties();
BindingTemplate bindingTemplate = new BindingTemplate();
+
//Constructing the bindingKey
String bindingKey = TokenResolver.replaceTokens(DEFAULT_BINDING_KEY_FORMAT +
serviceName + "-"
+ portName, properties);
@@ -495,6 +501,27 @@
* @return
*/
private String getWebserviceBaseUrl() {
- return (properties.getProperty(WebServiceClient.BPEL_WEBSERVICE_BASEURL,
"http://localhost:8080"));
+ String url = properties.getProperty(WebServiceClient.BPEL_WEBSERVICE_BASEURL);
+ if (url != null) {
+ return url;
+ }
+
+ return getDefaultWebServiceBaseUrl();
}
+
+ private String getDefaultWebServiceBaseUrl() {
+ try {
+ String webServiceHost = ServerConfigFactory.getServerConfig().getWebServiceHost();
+ int webServicePort = ServerConfigFactory.getServerConfig().getWebServicePort();
+ URL theURL = new URL("http://" + webServiceHost + ":" +
webServicePort);
+ if (Boolean.valueOf(properties.getProperty(WebServiceClient.BPEL_WEBSERVICE_SECURE,
"false"))) {
+ int secureWebServicePort =
ServerConfigFactory.getServerConfig().getWebServicePort();
+ theURL = new URL("https://" + webServiceHost + ":" +
secureWebServicePort);
+ }
+ return theURL.toExternalForm();
+ } catch (MalformedURLException e) {
+ log.error("Error in constructing the webservice base url.", e);
+ return null;
+ }
+ }
}
Show replies by date