Author: mszefler
Date: Mon Aug 14 12:02:25 2006
New Revision: 431412

URL: http://svn.apache.org/viewvc?rev=431412&view=rev
Log:
Hacks to get deployment working.

Modified:
    
incubator/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelServerImpl.java

Modified: 
incubator/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelServerImpl.java
URL: 
http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelServerImpl.java?rev=431412&r1=431411&r2=431412&view=diff
==============================================================================
--- 
incubator/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelServerImpl.java
 (original)
+++ 
incubator/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelServerImpl.java
 Mon Aug 14 12:02:25 2006
@@ -40,12 +40,13 @@
 import java.io.ByteArrayOutputStream;
 import java.io.File;
 import java.io.InputStream;
-import java.net.URI;
 import java.util.ArrayList;
+
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.LinkedList;
 import java.util.List;
+import java.util.Map;
 import java.util.concurrent.CopyOnWriteArrayList;
 import java.util.concurrent.locks.ReadWriteLock;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
@@ -109,7 +110,7 @@
 
     private List<BpelEventListener> _listeners = new 
CopyOnWriteArrayList<BpelEventListener>();
 
-//    private List<DeploymentUnitImpl> _deployedUnits = new 
ArrayList<DeploymentUnitImpl>();
+    private Map<QName, DeploymentUnitImpl> _deploymentUnits = new 
HashMap<QName,DeploymentUnitImpl>();
 
     public BpelServerImpl() {
 
@@ -413,10 +414,13 @@
 
             // Figure out where on the local file system we can find the
             // deployment directory for this process
-            File deployDir = getProcessDeployDir(pid);
-
-            // Read in the deployment unit information
-            DeploymentUnitImpl du = new DeploymentUnitImpl(deployDir);
+            DeploymentUnitImpl du  = getDeploymentUnit(pid);
+            if (du == null) {
+                // Indicates process not deployed.
+                String errmsg = "Process " + pid + " is not deployed, it 
cannot be activated";
+                __log.error(errmsg);
+                throw new BpelEngineException(errmsg);
+            }
 
             // Load the compiled process from the database, note we do not want
             // to recompile / or read from the file system as
@@ -513,9 +517,8 @@
         }
     }
 
-    private File getProcessDeployDir(QName pid) {
-        // TODO: implement me.
-        throw new UnsupportedOperationException("todo");
+    private DeploymentUnitImpl getDeploymentUnit(QName pid) {
+        return _deploymentUnits.get(pid);
     }
 
     private void dbSetProcessActive(final QName pid, final boolean val) {
@@ -562,7 +565,7 @@
                         + "process referenced in the deployment descriptor: " 
+ processDD.getName());
             try {
 
-                deploy(processDD.getName(), deploymentUnitDirectory.toURI(), 
oprocess, du.getDocRegistry()
+                deploy(processDD.getName(), du, oprocess, du.getDocRegistry()
                         .getDefinitions(), processDD);
 
             } catch (Throwable e) {
@@ -574,7 +577,7 @@
         return du.getProcesses().keySet();
     }
 
-    private void deploy(final QName processId, final URI deployedURI, final 
OProcess oprocess,
+    private void deploy(final QName processId, final DeploymentUnitImpl du, 
final OProcess oprocess,
             final Definition4BPEL[] defs, TDeployment.Process processDD) {
         // First, make sure we are undeployed.
         undeploy(processId);
@@ -610,7 +613,6 @@
                     }
 
                     ProcessDAO newDao = conn.createProcess(processId, 
oprocess.getQName());
-                    newDao.setDeployURI(deployedURI);
                     newDao.setCompiledProcess(bits);
                     pi.init(newDao);
                     pi.update(newDao);
@@ -626,6 +628,8 @@
             throw new BpelEngineException("", dce);
         }
 
+        _deploymentUnits.put(processDD.getName(), du);
+        
         doActivateProcess(processId);
     }
 


Reply via email to