riftsaw SVN: r379 - in trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime: ws and 1 other directory.
by riftsaw-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-12-11 07:09:21 -0500 (Fri, 11 Dec 2009)
New Revision: 379
Modified:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/JAXWSBindingContext.java
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/EndpointManager.java
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/ServiceEndpointReference.java
Log:
Interim fix for RIFTSAW-125
Modified: trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/JAXWSBindingContext.java
===================================================================
--- trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/JAXWSBindingContext.java 2009-12-10 20:27:56 UTC (rev 378)
+++ trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/JAXWSBindingContext.java 2009-12-11 12:09:21 UTC (rev 379)
@@ -80,7 +80,7 @@
);
ref = endpointManager.createEndpoint(endpointMD, wsdlReference, classLoader);
-
+
}
catch (Throwable e)
{
@@ -95,7 +95,7 @@
{
File targetWSDLFile = findWSDLFile(processId, myRoleEndpoint);
Definition wsdlDefinition = getWSDLDefinition(processId, myRoleEndpoint.serviceName);
- return new WSDLReference(wsdlDefinition, targetWSDLFile);
+ return new WSDLReference(wsdlDefinition, targetWSDLFile);
}
private File findWSDLFile(QName processId, Endpoint myRoleEndpoint)
@@ -115,7 +115,7 @@
if(url!=null)
{
targetWsdlFile = f;
- log.debug("Matching "+processId + " to WSDL file "+targetWsdlFile);
+ log.debug("Matching "+processId + " to WSDL file "+targetWsdlFile);
break;
}
@@ -129,20 +129,34 @@
if(null==targetWsdlFile)
throw new ContextException("Unable to find target WSDL file for "+ myRoleEndpoint);
-
+
return targetWsdlFile;
}
- public void deactivateMyRoleEndpoint(Endpoint myRoleEndpoint) {
+ public void deactivateMyRoleEndpoint(Endpoint myRoleEndpoint)
+ {
log.info("*** DEACTIVATING MY ROLE ENDPOINT: "+myRoleEndpoint);
- try
+ org.apache.ode.bpel.iapi.EndpointReference ref =
+ endpointManager.maintains(myRoleEndpoint.serviceName, myRoleEndpoint.portName);
+
+ if(null==ref)
{
- endpointManager.removeEndpoint(myRoleEndpoint.serviceName, myRoleEndpoint.portName);
+ // might happen when processes are retired.
+ // See https://jira.jboss.org/jira/browse/RIFTSAW-57
+ log.warn("Endpoint doesn't exist (Has it been undeployed before?): "
+ + myRoleEndpoint.serviceName + "/"+myRoleEndpoint.portName);
}
- catch (Throwable e)
+ else
{
- throw new ContextException("Failed to deactivate endpoint", e);
+ try
+ {
+ endpointManager.removeEndpoint(myRoleEndpoint.serviceName, myRoleEndpoint.portName);
+ }
+ catch (Throwable e)
+ {
+ throw new ContextException("Failed to deactivate endpoint", e);
+ }
}
}
Modified: trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/EndpointManager.java
===================================================================
--- trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/EndpointManager.java 2009-12-10 20:27:56 UTC (rev 378)
+++ trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/EndpointManager.java 2009-12-11 12:09:21 UTC (rev 379)
@@ -43,12 +43,8 @@
import javax.xml.namespace.QName;
import java.io.File;
-import java.io.FileOutputStream;
import java.io.IOException;
-import java.io.RandomAccessFile;
import java.net.URL;
-import java.nio.channels.FileChannel;
-import java.nio.channels.FileLock;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
@@ -193,6 +189,9 @@
{
String key = createEndpointKey(service, port);
ServiceEndpointReference ref = endpointMapping.get(key);
+ if(null==ref)
+ throw new IllegalStateException("Unable to resolve ServiceEndpointReference for key: "+key);
+
String deploymentId = ref.getDeploymentName();
if(ref!=null)
Modified: trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/ServiceEndpointReference.java
===================================================================
--- trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/ServiceEndpointReference.java 2009-12-10 20:27:56 UTC (rev 378)
+++ trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/ServiceEndpointReference.java 2009-12-11 12:09:21 UTC (rev 379)
@@ -86,4 +86,30 @@
{
return deploymentName;
}
+
+ @Override
+ public boolean equals(Object o)
+ {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ ServiceEndpointReference that = (ServiceEndpointReference) o;
+
+ if (!archiveLocation.equals(that.archiveLocation)) return false;
+ if (!deploymentName.equals(that.deploymentName)) return false;
+ if (!endpointId.equals(that.endpointId)) return false;
+ if (!serviceUrl.equals(that.serviceUrl)) return false;
+
+ return true;
+ }
+
+ @Override
+ public int hashCode()
+ {
+ int result = endpointId.hashCode();
+ result = 31 * result + serviceUrl.hashCode();
+ result = 31 * result + deploymentName.hashCode();
+ result = 31 * result + archiveLocation.hashCode();
+ return result;
+ }
}