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=431466&r1=431465&r2=431466&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 16:17:48 2006 @@ -47,6 +47,7 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.HashSet; import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.locks.ReadWriteLock; import java.util.concurrent.locks.ReentrantReadWriteLock; @@ -76,6 +77,7 @@ import org.apache.ode.bpel.iapi.MessageExchangeContext; import org.apache.ode.bpel.iapi.MessageExchangeInterceptor; import org.apache.ode.bpel.iapi.Scheduler; +import org.apache.ode.bpel.iapi.DeploymentUnit; import org.apache.ode.bpel.o.OExpressionLanguage; import org.apache.ode.bpel.o.OPartnerLink; import org.apache.ode.bpel.o.OProcess; @@ -157,6 +159,42 @@ } + public boolean undeploy(File file) { + DeploymentUnit du = null; + for (DeploymentUnitImpl deploymentUnit : new HashSet<DeploymentUnitImpl>(_deploymentUnits.values())) { + if (deploymentUnit.getDeployDir().getName().equals(file.getName())) du = deploymentUnit; + } + if (du == null) { + __log.warn("Couldn't deploy " + file.getName() + ", package was not found."); + return false; + } + else { + boolean success = true; + for (QName pName : du.getProcessNames()) { + success = success && undeploy(pName); + } + System.out.println("### Trying to delete " + du.getDeployDir().getAbsolutePath()); + rm(du.getDeployDir()); + + for (QName pname : du.getProcessNames()) { + _deploymentUnits.remove(pname); + } + + + return success; + } + } + + private void rm(File f) { + if (f.isDirectory()) { + for (File child : f.listFiles()) + rm(child); + f.delete(); + } else { + f.delete(); + } + } + public void registerBpelEventListener(BpelEventListener listener) { _listeners.add(listener); } @@ -173,8 +211,7 @@ /** * Find the active processes in the database. - * - * @return + * @return list of process qnames */ private List<QName> findActive() { @@ -262,7 +299,7 @@ /** * Load the parsed and compiled BPEL process definition from the database. - * + * * @param processId * process identifier * @return process information from configuration database @@ -397,7 +434,7 @@ /** * Activate the process in the engine. - * + * * @param pid */ private void doActivateProcess(final QName pid) { @@ -491,21 +528,21 @@ throw new BpelEngineException(errmsg); } - + TService service = invoke.getService(); // NOTE: service can be null for partner links if (service == null) continue; - + __log.debug("Processing <invoke> element for process " + pid + ": partnerlink " + plinkName + " --> " + service); partnerRoleIntialValues.put(plink, new Endpoint(service.getName(), service.getPort())); } - + BpelProcess process = new BpelProcess(pid, du, - compiledProcess, myRoleEndpoints, + compiledProcess, myRoleEndpoints, partnerRoleIntialValues, null, elangRegistry, localMexInterceptors); @@ -555,22 +592,22 @@ * Deploys a process. */ public Collection<QName> deploy(File deploymentUnitDirectory) { - + __log.info(__msgs.msgDeployStarting(deploymentUnitDirectory)); - + DeploymentUnitImpl du = new DeploymentUnitImpl(deploymentUnitDirectory); ArrayList<QName> deployed = new ArrayList<QName> (); BpelEngineException failed = null; // Going trough each process declared in the dd for (TDeployment.Process processDD : du.getDeploymentDescriptor().getDeploy().getProcessList()) { - + // If a type is not specified, assume the process id is also the type. QName type = processDD.getType() != null ? processDD.getType() : processDD.getName(); OProcess oprocess = du.getProcesses().get(type); if (oprocess == null) throw new BpelEngineException("Could not find the compiled process definition for BPEL" + - "type " + type + " when deploying process " + processDD.getName() + "type " + type + " when deploying process " + processDD.getName() + " in " + deploymentUnitDirectory); try { @@ -581,12 +618,11 @@ } catch (Throwable e) { String errmsg = __msgs.msgDeployFailed(processDD.getName(), deploymentUnitDirectory); __log.error(errmsg, e); - failed = new BpelEngineException(errmsg,e); break; } } - + // Roll back succesfull deployments if we failed. if (failed != null) { if (!deployed.isEmpty()) { @@ -598,14 +634,14 @@ __log.fatal("Unexpect error undeploying process " + pid, t); } } - } + } throw failed; - } else + } else return du.getProcesses().keySet(); } private void deploy(final QName processId, final DeploymentUnitImpl du, final OProcess oprocess, - final Definition4BPEL[] defs, TDeployment.Process processDD) { + final Definition4BPEL[] defs, TDeployment.Process processDD) { // First, make sure we are undeployed. undeploy(processId); @@ -630,8 +666,7 @@ _db.exec(new BpelDatabase.Callable<ProcessDAO>() { public ProcessDAO run(BpelDAOConnection conn) throws Exception { // Hack, but at least for now we need to ensure that we are - // the only - // process with this process id. + // the only process with this process id. ProcessDAO old = conn.getProcess(processId); if (old != null) { String errmsg = __msgs.msgProcessDeployErrAlreadyDeployed(processId); @@ -656,7 +691,7 @@ } _deploymentUnits.put(processDD.getName(), du); - + doActivateProcess(processId); } @@ -673,7 +708,7 @@ /** * Get the flag that determines whether processes marked as active are * automatically activated at startup. - * + * * @return */ public boolean isAutoActivate() { @@ -683,7 +718,7 @@ /** * Set the flag the determines whether processes marked as active are * automatically activated at startup. - * + * * @param autoActivate */ public void setAutoActivate(boolean autoActivate) { @@ -695,12 +730,7 @@ // TODO Auto-generated method stub } - public void undeploy(File serviceUnitRootPath) { - // TODO Auto-generated method stub - - } - // public void readState() { // File duState = new File(_deploymentDir, ".state"); // if (duState.exists()) { @@ -750,5 +780,5 @@ // + "even they don't (or do) need to.", e); // } //} - + }
Modified: incubator/ode/trunk/bpel-scripts/src/main/resources/2.0/good/AsyncProcess/AsyncProcess2.wsdl URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-scripts/src/main/resources/2.0/good/AsyncProcess/AsyncProcess2.wsdl?rev=431466&r1=431465&r2=431466&view=diff ============================================================================== --- incubator/ode/trunk/bpel-scripts/src/main/resources/2.0/good/AsyncProcess/AsyncProcess2.wsdl (original) +++ incubator/ode/trunk/bpel-scripts/src/main/resources/2.0/good/AsyncProcess/AsyncProcess2.wsdl Mon Aug 14 16:17:48 2006 @@ -25,7 +25,7 @@ xmlns:typ="uri:com.bptest.types" xmlns:resp="uri:com.bptest.responder" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" - xmlns:plnk="http://schemas.xmlsoap.org/ws/2004/03/partner-link/" + xmlns:plnk="http://schemas.xmlsoap.org/ws/2004/03/partner-link/" xmlns="http://schemas.xmlsoap.org/wsdl/"> <types> Modified: incubator/ode/trunk/dao-hibernate/src/test/java/org/apache/ode/daohib/bpel/ListProcessTest.java URL: http://svn.apache.org/viewvc/incubator/ode/trunk/dao-hibernate/src/test/java/org/apache/ode/daohib/bpel/ListProcessTest.java?rev=431466&r1=431465&r2=431466&view=diff ============================================================================== --- incubator/ode/trunk/dao-hibernate/src/test/java/org/apache/ode/daohib/bpel/ListProcessTest.java (original) +++ incubator/ode/trunk/dao-hibernate/src/test/java/org/apache/ode/daohib/bpel/ListProcessTest.java Mon Aug 14 16:17:48 2006 @@ -29,7 +29,7 @@ import java.util.*; /** - * Testing BpelDAOConnectionImpl.listProcesses. We're just producing a lot + * Testing BpelDAOConnectionImpl.listAllProcesses. We're just producing a lot * of different filter combinations and test if they execute ok. To really * test that the result is the one expected would take a huge test database * (with at least a process and an instance for every possible combination). Modified: incubator/ode/trunk/pom.xml URL: http://svn.apache.org/viewvc/incubator/ode/trunk/pom.xml?rev=431466&r1=431465&r2=431466&view=diff ============================================================================== --- incubator/ode/trunk/pom.xml (original) +++ incubator/ode/trunk/pom.xml Mon Aug 14 16:17:48 2006 @@ -52,6 +52,7 @@ | and execution. | --> + <activationVersion>1.1</activationVersion> <antVersion>1.6.5</antVersion> <axisVersion>1.3</axisVersion> <axis2Version>1.0</axis2Version> @@ -139,7 +140,7 @@ <module>soap</module> <module>bpel-scheduler-quartz</module> - <module>distro-jbi</module> + <!-- module>distro-jbi</module --> <!--module>integration</module--> </modules> @@ -491,6 +492,11 @@ <version>${quartzVersion}</version> </dependency> + <dependency> + <groupId>javax.activation</groupId> + <artifactId>activation</artifactId> + <version>${activationVersion}</version> + </dependency> <dependency> <groupId>axis2</groupId> <artifactId>axis2</artifactId>
