You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ode.apache.org by mi...@apache.org on 2009/04/02 23:35:54 UTC
svn commit: r761434 - in
/ode/trunk/axis2/src/main/java/org/apache/ode/axis2: ODEServer.java
hooks/ODEAxisService.java
Author: midon
Date: Thu Apr 2 21:35:52 2009
New Revision: 761434
URL: http://svn.apache.org/viewvc?rev=761434&view=rev
Log:
ODEAxisService makes some assumptions on the service name, so let him pick the name
Modified:
ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ODEServer.java
ode/trunk/axis2/src/main/java/org/apache/ode/axis2/hooks/ODEAxisService.java
Modified: ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ODEServer.java
URL: http://svn.apache.org/viewvc/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ODEServer.java?rev=761434&r1=761433&r2=761434&view=diff
==============================================================================
--- ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ODEServer.java (original)
+++ ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ODEServer.java Thu Apr 2 21:35:52 2009
@@ -329,16 +329,12 @@
}
public ODEService createService(ProcessConf pconf, QName serviceName, String portName) throws AxisFault {
- // Since multiple processes may provide services at the same (JMS) endpoint, qualify
- // the (JMS) endpoint-specific NCName with a process-relative URI, if necessary.
- QName uniqueServiceName = new QName(
- ODEAxisService.extractServiceName(pconf, serviceName, portName));
-
- destroyService(uniqueServiceName, portName);
- AxisService axisService = ODEAxisService.createService(
- _axisConfig, pconf, serviceName, portName, uniqueServiceName.getLocalPart());
+ AxisService axisService = ODEAxisService.createService(_axisConfig, pconf, serviceName, portName);
ODEService odeService = new ODEService(axisService, pconf, serviceName, portName, _server);
+ QName uniqueServiceName = new QName(axisService.getName());
+ destroyService(uniqueServiceName, portName);
+
_services.put(uniqueServiceName, portName, odeService);
// Setting our new service on the ODE receiver
Modified: ode/trunk/axis2/src/main/java/org/apache/ode/axis2/hooks/ODEAxisService.java
URL: http://svn.apache.org/viewvc/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/hooks/ODEAxisService.java?rev=761434&r1=761433&r2=761434&view=diff
==============================================================================
--- ode/trunk/axis2/src/main/java/org/apache/ode/axis2/hooks/ODEAxisService.java (original)
+++ ode/trunk/axis2/src/main/java/org/apache/ode/axis2/hooks/ODEAxisService.java Thu Apr 2 21:35:52 2009
@@ -61,8 +61,7 @@
private static final Log LOG = LogFactory.getLog(ODEAxisService.class);
- public static AxisService createService(AxisConfiguration axisConfig, ProcessConf pconf, QName wsdlServiceName,
- String portName, String axisServiceName) throws AxisFault {
+ public static AxisService createService(AxisConfiguration axisConfig, ProcessConf pconf, QName wsdlServiceName, String portName) throws AxisFault {
Definition wsdlDefinition = pconf.getDefinitionForService(wsdlServiceName);
if (LOG.isDebugEnabled()) {
@@ -79,6 +78,8 @@
serviceBuilder.setCustomWSLD4JResolver(new Axis2WSDLLocator(baseUri));
serviceBuilder.setServerSide(true);
+ String axisServiceName = ODEAxisService.extractServiceName(pconf, wsdlServiceName, portName);
+
AxisService axisService = serviceBuilder.populateService();
axisService.setParent(axisConfig);
axisService.setName(axisServiceName);
@@ -148,22 +149,22 @@
/**
* Extract the JMS destination name that is embedded in the Axis service name.
- * @param serviceName the name of the axis service
+ * @param axisServiceName the name of the axis service
* @return the corresponding JMS destination name
*/
- private static String extractJMSDestinationName(String serviceName, String baseUri) {
+ private static String extractJMSDestinationName(String axisServiceName, String baseUri) {
String destinationPrefix = "dynamicQueues/";
- int index = serviceName.indexOf(destinationPrefix);
+ int index = axisServiceName.indexOf(destinationPrefix);
if (index == -1) {
destinationPrefix = "dynamicTopics/";
- index = serviceName.indexOf(destinationPrefix);
+ index = axisServiceName.indexOf(destinationPrefix);
}
if (index == -1) {
destinationPrefix = baseUri + "/";
- index = serviceName.indexOf(destinationPrefix);
- return (index != -1) ? serviceName.substring(destinationPrefix.length()) : serviceName;
+ index = axisServiceName.indexOf(destinationPrefix);
+ return (index != -1) ? axisServiceName.substring(destinationPrefix.length()) : axisServiceName;
} else {
- return serviceName.substring(index);
+ return axisServiceName.substring(index);
}
}
@@ -197,7 +198,7 @@
return url.startsWith("jms:");
}
- public static String extractServiceName(ProcessConf pconf, QName wsdlServiceName, String portName)
+ private static String extractServiceName(ProcessConf pconf, QName wsdlServiceName, String portName)
throws AxisFault {
String endpointUri = extractEndpointUri(pconf, wsdlServiceName, portName);
String derivedUri = deriveBaseServiceUri(pconf);
@@ -233,6 +234,8 @@
service = service.substring(0, queryIndex);
}
// Qualify shared JMS names with unique baseUri
+ // Since multiple processes may provide services at the same (JMS) endpoint, qualify
+ // the (JMS) endpoint-specific NCName with a process-relative URI, if necessary.
if (path.startsWith("jms")) {
boolean slashPresent = baseUri.endsWith("/") || service.startsWith("/");
service = baseUri + (slashPresent ? "" : "/") + service;