Author: objectiser
Date: 2010-07-02 10:49:38 -0400 (Fri, 02 Jul 2010)
New Revision: 832
Modified:
branches/RiftSaw-2.1.x/distribution/src/main/release/db/bpel.properties
branches/RiftSaw-2.1.x/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/JAXWSBindingContext.java
branches/RiftSaw-2.1.x/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/EndpointManager.java
trunk/distribution/src/main/release/db/bpel.properties
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
Log:
RIFTSAW-239 - added config property to determine whether web service interface should be
updated during deployment of new version of a BPEL process.
Modified: branches/RiftSaw-2.1.x/distribution/src/main/release/db/bpel.properties
===================================================================
--- branches/RiftSaw-2.1.x/distribution/src/main/release/db/bpel.properties 2010-07-02
10:04:43 UTC (rev 831)
+++ branches/RiftSaw-2.1.x/distribution/src/main/release/db/bpel.properties 2010-07-02
14:49:38 UTC (rev 832)
@@ -110,6 +110,14 @@
bpel.jaxws.client.initializer.impl=(a)jaxws.client.initializer.impl@
+# This property defines whether the Web Service interface should be updated when a new
version
+# of the BPEL process is deployed. If the property is false, then the web service
interface
+# will be updated when a new version is deployed, however this means that the service
will
+# briefly be unavailable during the transition. If the property is true, then the web
service
+# interface associated with the first deployed version will be maintained during the
deployment
+# of subsequent versions.
+bpel.ws.stableInterface = false
+
# all hibernate specific properties
hibernate.dialect=@dialect@
Modified:
branches/RiftSaw-2.1.x/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/JAXWSBindingContext.java
===================================================================
---
branches/RiftSaw-2.1.x/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/JAXWSBindingContext.java 2010-07-02
10:04:43 UTC (rev 831)
+++
branches/RiftSaw-2.1.x/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/JAXWSBindingContext.java 2010-07-02
14:49:38 UTC (rev 832)
@@ -67,7 +67,7 @@
org.apache.ode.bpel.iapi.EndpointReference ref =
endpointManager.maintains(myRoleEndpoint.serviceName, myRoleEndpoint.portName);
- if(ref!=null)
+ if(ref!=null && endpointManager.isStableInterface())
{
// might happen when processes are retired.
// See
https://jira.jboss.org/jira/browse/RIFTSAW-57
Modified:
branches/RiftSaw-2.1.x/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/EndpointManager.java
===================================================================
---
branches/RiftSaw-2.1.x/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/EndpointManager.java 2010-07-02
10:04:43 UTC (rev 831)
+++
branches/RiftSaw-2.1.x/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/EndpointManager.java 2010-07-02
14:49:38 UTC (rev 832)
@@ -69,12 +69,14 @@
protected final Log log = LogFactory.getLog(getClass());
// we should consider having our own OdeConfigProperties class if we need more
properties
private final static String BPEL_UDDI_REGISTRATION = "uddi.registration";
+ private static final String BPEL_WS_STABLE_INTERFACE = "ws.stableInterface";
private Map<String, ServiceEndpointReference> endpointMapping = new
ConcurrentHashMap<String, ServiceEndpointReference>();
private ServerConfig serverConfig;
private ExecutionEnvironment executionEnvironment;
private UDDIRegistration uddiRegistration = null;
+ private boolean stableInterface=false;
public EndpointManager(ExecutionEnvironment executionEnvironment)
{
@@ -88,7 +90,15 @@
log.error("Running without UDDI integration.");
}
}
+
+ stableInterface =
executionEnvironment.getOdeConfig().getProperty(BPEL_WS_STABLE_INTERFACE,
+ "false").equalsIgnoreCase("true");
+ log.info("Use stable interface: "+stableInterface);
}
+
+ public boolean isStableInterface() {
+ return(stableInterface);
+ }
public EndpointReference createEndpoint(EndpointMetaData metaData, WSDLReference
wsdlRef, final ClassLoader classLoader)
throws EndpointManagementException
@@ -150,6 +160,17 @@
mutableAttachments.addAttachment(JBossWebMetaData.class,
wmdFactory.createWebMetaData(classLoader));
mutableAttachments.addAttachment(DeploymentUnitFilter.class, new
RiftsawWSDeploymentUnitFilter());
+
+ if (!stableInterface) {
+ // Undeploy
+ try {
+ log.debug("Check if can remove existing service:
"+metaData.getServiceName()+":"+metaData.getPortName());
+ removeEndpoint(metaData.getServiceName(), metaData.getPortName());
+ } catch(IllegalStateException ise) {
+ // Ignore for now - endpoint may not exist if first version
+ }
+ }
+
getMainDeployer().deploy(deployment);
ServiceEndpointReference ref = new ServiceEndpointReference(
Modified: trunk/distribution/src/main/release/db/bpel.properties
===================================================================
--- trunk/distribution/src/main/release/db/bpel.properties 2010-07-02 10:04:43 UTC (rev
831)
+++ trunk/distribution/src/main/release/db/bpel.properties 2010-07-02 14:49:38 UTC (rev
832)
@@ -110,6 +110,14 @@
bpel.jaxws.client.initializer.impl=(a)jaxws.client.initializer.impl@
+# This property defines whether the Web Service interface should be updated when a new
version
+# of the BPEL process is deployed. If the property is false, then the web service
interface
+# will be updated when a new version is deployed, however this means that the service
will
+# briefly be unavailable during the transition. If the property is true, then the web
service
+# interface associated with the first deployed version will be maintained during the
deployment
+# of subsequent versions.
+bpel.ws.stableInterface = false
+
# all hibernate specific properties
hibernate.dialect=@dialect@
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 2010-07-02
10:04:43 UTC (rev 831)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/JAXWSBindingContext.java 2010-07-02
14:49:38 UTC (rev 832)
@@ -67,7 +67,7 @@
org.apache.ode.bpel.iapi.EndpointReference ref =
endpointManager.maintains(myRoleEndpoint.serviceName, myRoleEndpoint.portName);
- if(ref!=null)
+ if(ref!=null && endpointManager.isStableInterface())
{
// might happen when processes are retired.
// See
https://jira.jboss.org/jira/browse/RIFTSAW-57
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 2010-07-02
10:04:43 UTC (rev 831)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/EndpointManager.java 2010-07-02
14:49:38 UTC (rev 832)
@@ -69,12 +69,14 @@
protected final Log log = LogFactory.getLog(getClass());
// we should consider having our own OdeConfigProperties class if we need more
properties
private final static String BPEL_UDDI_REGISTRATION = "uddi.registration";
+ private static final String BPEL_WS_STABLE_INTERFACE = "ws.stableInterface";
private Map<String, ServiceEndpointReference> endpointMapping = new
ConcurrentHashMap<String, ServiceEndpointReference>();
private ServerConfig serverConfig;
private ExecutionEnvironment executionEnvironment;
private UDDIRegistration uddiRegistration = null;
+ private boolean stableInterface=false;
public EndpointManager(ExecutionEnvironment executionEnvironment)
{
@@ -88,7 +90,15 @@
log.error("Running without UDDI integration.");
}
}
+
+ stableInterface =
executionEnvironment.getOdeConfig().getProperty(BPEL_WS_STABLE_INTERFACE,
+ "false").equalsIgnoreCase("true");
+ log.info("Use stable interface: "+stableInterface);
}
+
+ public boolean isStableInterface() {
+ return(stableInterface);
+ }
public EndpointReference createEndpoint(EndpointMetaData metaData, WSDLReference
wsdlRef, final ClassLoader classLoader)
throws EndpointManagementException
@@ -150,6 +160,17 @@
mutableAttachments.addAttachment(JBossWebMetaData.class,
wmdFactory.createWebMetaData(classLoader));
mutableAttachments.addAttachment(DeploymentUnitFilter.class, new
RiftsawWSDeploymentUnitFilter());
+
+ if (!stableInterface) {
+ // Undeploy
+ try {
+ log.debug("Check if can remove existing service:
"+metaData.getServiceName()+":"+metaData.getPortName());
+ removeEndpoint(metaData.getServiceName(), metaData.getPortName());
+ } catch(IllegalStateException ise) {
+ // Ignore for now - endpoint may not exist if first version
+ }
+ }
+
getMainDeployer().deploy(deployment);
ServiceEndpointReference ref = new ServiceEndpointReference(