Author: objectiser
Date: 2009-11-30 14:53:54 -0500 (Mon, 30 Nov 2009)
New Revision: 348
Modified:
branches/ODE/ODE-1.x-fixes/bpel-store/src/main/java/org/apache/ode/store/ProcessStoreImpl.java
Log:
Use version number associated with deployment, if specified as "XXX-num.jar".
Modified:
branches/ODE/ODE-1.x-fixes/bpel-store/src/main/java/org/apache/ode/store/ProcessStoreImpl.java
===================================================================
---
branches/ODE/ODE-1.x-fixes/bpel-store/src/main/java/org/apache/ode/store/ProcessStoreImpl.java 2009-11-27
18:15:31 UTC (rev 347)
+++
branches/ODE/ODE-1.x-fixes/bpel-store/src/main/java/org/apache/ode/store/ProcessStoreImpl.java 2009-11-30
19:53:54 UTC (rev 348)
@@ -197,13 +197,9 @@
Collection<QName> deployed;
_rw.writeLock().lock();
- // Process and DU use a monotonically increased single version number.
- long version = exec(new Callable<Long>() {
- public Long call(ConfStoreConnection conn) {
- return conn.getNextVersion();
- }
- });
+ long version=calculateVersion(deploymentUnitDirectory);
+
try {
if (_deploymentUnits.containsKey(du.getName())) {
String errmsg = __msgs.msgDeployFailDuplicateDU(du.getName());
@@ -315,6 +311,38 @@
return deployed;
}
+ protected long calculateVersion(File deploymentUnitDirectory) {
+ long version=0;
+
+ int index=deploymentUnitDirectory.getName().lastIndexOf('-');
+
+ if (index != -1) {
+ try {
+ String ver=deploymentUnitDirectory.getName().substring(index+1);
+
+ if (ver.endsWith(".jar")) {
+ ver = ver.substring(0, ver.length()-4);
+ }
+
+ version = Long.valueOf(ver);
+ } catch(Exception e) {
+ __log.warn("Unable to infer process version from deployment unit
'"+
+ deploymentUnitDirectory.getName()+"'", e);
+ }
+ }
+
+ if (version == 0) {
+ // Process and DU use a monotonically increased single version number.
+ version = exec(new Callable<Long>() {
+ public Long call(ConfStoreConnection conn) {
+ return conn.getNextVersion();
+ }
+ });
+ }
+
+ return(version);
+ }
+
public Collection<QName> undeploy(final File dir) {
return undeploy(dir.getName());
}
Show replies by date