Author: mriou
Date: Wed Dec 20 08:18:57 2006
New Revision: 489129

URL: http://svn.apache.org/viewvc?view=rev&rev=489129
Log:
Allowing moving the server directory around after process ahev been deployed. 
DU paths were absolute.

Modified:
    incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ODEServer.java
    
incubator/ode/trunk/bpel-store/src/main/java/org/apache/ode/store/ProcessStoreImpl.java

Modified: 
incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ODEServer.java
URL: 
http://svn.apache.org/viewvc/incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ODEServer.java?view=diff&rev=489129&r1=489128&r2=489129
==============================================================================
--- incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ODEServer.java 
(original)
+++ incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ODEServer.java 
Wed Dec 20 08:18:57 2006
@@ -433,6 +433,7 @@
     private void initProcessStore() {
         _store = new ProcessStoreImpl(_datasource, _dialect);
         _store.registerListener(new ProcessStoreListenerImpl());
+        _store.setDeployDir(new File(_workRoot, "processes"));
     }
 
     private void initBpelServer() {

Modified: 
incubator/ode/trunk/bpel-store/src/main/java/org/apache/ode/store/ProcessStoreImpl.java
URL: 
http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-store/src/main/java/org/apache/ode/store/ProcessStoreImpl.java?view=diff&rev=489129&r1=489128&r2=489129
==============================================================================
--- 
incubator/ode/trunk/bpel-store/src/main/java/org/apache/ode/store/ProcessStoreImpl.java
 (original)
+++ 
incubator/ode/trunk/bpel-store/src/main/java/org/apache/ode/store/ProcessStoreImpl.java
 Wed Dec 20 08:18:57 2006
@@ -65,6 +65,8 @@
     private String _guid = new GUID().toString();
 
     private DbConfStoreConnectionFactory _cf;
+    
+    private File _deployDir;
 
     /**
      * Executor used to process DB transactions. Allows us to isolate the TX 
context, and to ensure that only one TX gets executed a
@@ -195,7 +197,10 @@
 
                 dudao = conn.createDeploymentUnit(du.getName());
                 try {
-                    
dudao.setDeploymentUnitDir(deploymentUnitDirectory.getCanonicalPath());
+                    if (_deployDir == null)
+                        
dudao.setDeploymentUnitDir(deploymentUnitDirectory.getCanonicalPath());
+                    else 
+                        
dudao.setDeploymentUnitDir(deploymentUnitDirectory.getName());
                 } catch (IOException e1) {
                     String errmsg = "Error getting canonical path for " + 
du.getName()
                             + "; deployment unit will not be available after 
restart!";
@@ -514,7 +519,10 @@
 
         __log.debug("Loading deployment unit record from db: " + 
dudao.getName());
 
-        File dudir = new File(dudao.getDeploymentUnitDir());
+        File dudir;
+        if (_deployDir == null) dudir = new File(dudao.getDeploymentUnitDir());
+        else dudir = new File(_deployDir, dudao.getDeploymentUnitDir());
+
         if (!dudir.exists())
             throw new ContextException("Deployed directory " + dudir + " no 
longer there!");
         DeploymentUnitDir dud = new DeploymentUnitDir(dudir);
@@ -591,6 +599,10 @@
         }
 
         abstract V call(ConfStoreConnection conn);
+    }
+    
+    public void setDeployDir(File depDir) {
+        _deployDir = depDir;
     }
 
 }


Reply via email to