You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ode.apache.org by mr...@apache.org on 2008/08/08 02:42:37 UTC

svn commit: r683777 [1/2] - in /ode/branches/rtver: ./ axis2/src/main/java/org/apache/ode/axis2/ bpel-api/src/main/java/org/apache/ode/bpel/iapi/ bpel-api/src/main/java/org/apache/ode/bpel/rapi/ bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/...

Author: mriou
Date: Thu Aug  7 17:42:36 2008
New Revision: 683777

URL: http://svn.apache.org/viewvc?rev=683777&view=rev
Log:
Yoohoo, the whole branch compiles! The tests probably don't but hey, I'm not santa claus.

Added:
    ode/branches/rtver/bpel-api/src/main/java/org/apache/ode/bpel/rapi/ActivityModel.java
    ode/branches/rtver/bpel-api/src/main/java/org/apache/ode/bpel/rapi/ExtensibleElement.java
      - copied, changed from r683674, ode/branches/rtver/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/ExtensibleElement.java
    ode/branches/rtver/bpel-api/src/main/java/org/apache/ode/bpel/rapi/ExtensionBundle.java
    ode/branches/rtver/bpel-api/src/main/java/org/apache/ode/bpel/rapi/ExtensionValidator.java
      - copied, changed from r683674, ode/branches/rtver/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/ExtensionValidator.java
    ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/Messages.java
    ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/KonstExpressionLanguageRuntimeImpl.java
      - copied, changed from r683674, ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/explang/konst/KonstExpressionLanguageRuntimeImpl.java
Removed:
    ode/branches/rtver/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/ExtensionValidator.java
    ode/branches/rtver/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/ExtensibleElement.java
    ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/InstanceContextImpl.java
    ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/explang/konst/KonstExpressionLanguageRuntimeImpl.java
    ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/monitor/
Modified:
    ode/branches/rtver/Rakefile
    ode/branches/rtver/axis2/src/main/java/org/apache/ode/axis2/ODEServer.java
    ode/branches/rtver/bpel-api/src/main/java/org/apache/ode/bpel/iapi/ProcessConf.java
    ode/branches/rtver/bpel-api/src/main/java/org/apache/ode/bpel/rapi/ProcessModel.java
    ode/branches/rtver/bpel-api/src/main/java/org/apache/ode/bpel/rapi/Variable.java
    ode/branches/rtver/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelC.java
    ode/branches/rtver/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler.java
    ode/branches/rtver/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/ExtensionActivity.java
    ode/branches/rtver/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/ExtensionAssignOperation.java
    ode/branches/rtver/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/v2/AssignGenerator.java
    ode/branches/rtver/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/v2/BpelCompilerImpl.java
    ode/branches/rtver/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/v2/CompilerContext.java
    ode/branches/rtver/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/v2/ExtensionActivtityGenerator.java
    ode/branches/rtver/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler/XPathTest.java
    ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java
    ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelServerImpl.java
    ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/Contexts.java
    ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/MessageExchangeImpl.java
    ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/MyRoleMessageExchangeCache.java
    ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/MyRoleMessageExchangeImpl.java
    ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/ODEProcess.java
    ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerLinkMyRoleImpl.java
    ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerLinkPartnerRoleImpl.java
    ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerLinkRoleImpl.java
    ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerRoleMessageExchangeImpl.java
    ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/ProcessAndInstanceManagementImpl.java
    ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/ReliableMyRoleMessageExchangeImpl.java
    ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/ReliablePartnerRoleMessageExchangeImpl.java
    ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/TransactedMyRoleMessageExchangeImpl.java
    ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/TransactedPartnerRoleMessageExchangeImpl.java
    ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/UnreliableMyRoleMessageExchangeImpl.java
    ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/UnreliablePartnerRoleMessageExchangeImpl.java
    ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/extvar/ExternalVariableManager.java
    ode/branches/rtver/bpel-runtime/src/test/java/org/apache/ode/bpel/elang/xpath20/runtime/MockCompilerContext.java
    ode/branches/rtver/bpel-store/src/main/java/org/apache/ode/store/DeploymentUnitDir.java
    ode/branches/rtver/bpel-store/src/main/java/org/apache/ode/store/ProcessConfImpl.java
    ode/branches/rtver/bpel-store/src/main/java/org/apache/ode/store/ProcessStoreImpl.java
    ode/branches/rtver/bpel-test/src/main/java/org/apache/ode/test/BPELTestAbstract.java
    ode/branches/rtver/bpel-test/src/main/java/org/apache/ode/test/MockExtensionContext.java
    ode/branches/rtver/bpel-test/src/test/java/org/apache/ode/test/ExtensibilityTest.java
    ode/branches/rtver/jbi/src/main/java/org/apache/ode/jbi/OdeContext.java
    ode/branches/rtver/jbi/src/main/java/org/apache/ode/jbi/OdeLifeCycle.java
    ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/common/extension/AbstractExtensionBundle.java
    ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/ACTIVITY.java
    ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/BpelJacobRunnable.java
    ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/DebugInfo.java
    ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/EH_EVENT.java
    ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/OBase.java
    ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/OProcess.java
    ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/SCOPE.java
    ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/VariableInstance.java

Modified: ode/branches/rtver/Rakefile
URL: http://svn.apache.org/viewvc/ode/branches/rtver/Rakefile?rev=683777&r1=683776&r2=683777&view=diff
==============================================================================
--- ode/branches/rtver/Rakefile (original)
+++ ode/branches/rtver/Rakefile Thu Aug  7 17:42:36 2008
@@ -305,8 +305,7 @@
       DERBY, Java::JUnit::JUNIT_REQUIRES, JAVAX.persistence, OPENJPA, WSDL4J, JAVAX.transaction, 
       COMMONS.lang, COMMONS.httpclient, COMMONS.codec
 
-    test.with projects("jacob", "bpel-schemas",
-      "bpel-scripts", "scheduler-simple"),
+    test.with projects("jacob", "bpel-schemas", "bpel-scripts", "scheduler-simple", "runtime-repo"),
       COMMONS.collections, COMMONS.lang, COMMONS.logging, DERBY, JAVAX.connector,
       JAVAX.stream, JAVAX.transaction, JAXEN, HSQLDB, LOG4J, SAXON, XERCES, XMLBEANS, XALAN
 
@@ -414,7 +413,7 @@
   desc "ODE JBI Integration Layer"
   define "jbi" do
     compile.with projects("bpel-api", "bpel-compiler", "bpel-connector", "bpel-dao", "il-common",
-      "bpel-runtime", "scheduler-simple", "bpel-schemas", "bpel-store", "utils"),
+      "bpel-runtime", "scheduler-simple", "bpel-schemas", "bpel-store", "utils", "runtime-repo"),
       AXIOM, COMMONS.logging, COMMONS.pool, JAVAX.transaction, JBI, LOG4J, WSDL4J, XERCES
 
     package(:jar)

Modified: ode/branches/rtver/axis2/src/main/java/org/apache/ode/axis2/ODEServer.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/axis2/src/main/java/org/apache/ode/axis2/ODEServer.java?rev=683777&r1=683776&r2=683777&view=diff
==============================================================================
--- ode/branches/rtver/axis2/src/main/java/org/apache/ode/axis2/ODEServer.java (original)
+++ ode/branches/rtver/axis2/src/main/java/org/apache/ode/axis2/ODEServer.java Thu Aug  7 17:42:36 2008
@@ -47,7 +47,7 @@
 import org.apache.ode.axis2.service.ManagementService;
 import org.apache.ode.axis2.httpbinding.HttpExternalService;
 import org.apache.ode.axis2.soapbinding.SoapExternalService;
-import org.apache.ode.bpel.compiler.api.ExtensionValidator;
+import org.apache.ode.bpel.rapi.ExtensionValidator;
 import org.apache.ode.bpel.connector.BpelServerConnector;
 import org.apache.ode.bpel.dao.BpelDAOConnectionFactory;
 import org.apache.ode.bpel.engine.BpelServerImpl;
@@ -62,7 +62,6 @@
 import org.apache.ode.bpel.iapi.Scheduler;
 import org.apache.ode.bpel.iapi.EndpointReferenceContext;
 import org.apache.ode.bpel.intercept.MessageExchangeInterceptor;
-import org.apache.ode.bpel.runtime.extension.AbstractExtensionBundle;
 import org.apache.ode.il.dbutil.Database;
 import org.apache.ode.scheduler.simple.JdbcDelegate;
 import org.apache.ode.scheduler.simple.SimpleScheduler;
@@ -72,6 +71,7 @@
 import org.apache.ode.utils.fs.TempFileManager;
 import org.apache.ode.bpel.pmapi.InstanceManagement;
 import org.apache.ode.bpel.pmapi.ProcessManagement;
+import org.apache.ode.bpel.rapi.ExtensionBundle;
 
 /**
  * Server class called by our Axis hooks to handle all ODE lifecycle management.
@@ -540,7 +540,7 @@
                 String bundleCN = tokenizer.nextToken();
                 try {
                     // instantiate bundle
-                    AbstractExtensionBundle bundle = (AbstractExtensionBundle) Class.forName(bundleCN).newInstance();
+                    ExtensionBundle bundle = (ExtensionBundle) Class.forName(bundleCN).newInstance();
 
                     // register extension bundle (BPEL server)
                     _server.registerExtensionBundle(bundle);

Modified: ode/branches/rtver/bpel-api/src/main/java/org/apache/ode/bpel/iapi/ProcessConf.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/bpel-api/src/main/java/org/apache/ode/bpel/iapi/ProcessConf.java?rev=683777&r1=683776&r2=683777&view=diff
==============================================================================
--- ode/branches/rtver/bpel-api/src/main/java/org/apache/ode/bpel/iapi/ProcessConf.java (original)
+++ ode/branches/rtver/bpel-api/src/main/java/org/apache/ode/bpel/iapi/ProcessConf.java Thu Aug  7 17:42:36 2008
@@ -24,7 +24,6 @@
 import java.util.Date;
 import java.util.List;
 import java.util.Map;
-import java.util.Properties;
 
 import javax.wsdl.Definition;
 import javax.xml.namespace.QName;
@@ -59,6 +58,8 @@
      */
     long getVersion();
 
+    int getRuntimeVersion();
+
     /**
      * Is this a <em>transient</em> process? Transient processes are not persisted in the store.
      * @return <code>true</code> if this is a transient process.
@@ -114,7 +115,6 @@
     
     /**
      * Gets the WSDL definition used in a process into which a service is defined.
-     * @param processId
      * @param serviceName
      * @return definition
      */
@@ -122,14 +122,12 @@
 
     /**
      * Gets the list of endpoints a process should provide.
-     * @param processId
      * @return map of partner link names and associated enpoints
      */
     Map<String, Endpoint> getProvideEndpoints();
 
     /**
      * Gets the list of endpoints a process invokes.
-     * @param processId
      * @return map of partner link names and associated enpoints
      */
     Map<String, Endpoint> getInvokeEndpoints();

Added: ode/branches/rtver/bpel-api/src/main/java/org/apache/ode/bpel/rapi/ActivityModel.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/bpel-api/src/main/java/org/apache/ode/bpel/rapi/ActivityModel.java?rev=683777&view=auto
==============================================================================
--- ode/branches/rtver/bpel-api/src/main/java/org/apache/ode/bpel/rapi/ActivityModel.java (added)
+++ ode/branches/rtver/bpel-api/src/main/java/org/apache/ode/bpel/rapi/ActivityModel.java Thu Aug  7 17:42:36 2008
@@ -0,0 +1,9 @@
+package org.apache.ode.bpel.rapi;
+
+import javax.xml.namespace.QName;
+import java.util.HashMap;
+
+public interface ActivityModel {
+
+    HashMap<QName, Object> getExtensibilityElements();
+}

Copied: ode/branches/rtver/bpel-api/src/main/java/org/apache/ode/bpel/rapi/ExtensibleElement.java (from r683674, ode/branches/rtver/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/ExtensibleElement.java)
URL: http://svn.apache.org/viewvc/ode/branches/rtver/bpel-api/src/main/java/org/apache/ode/bpel/rapi/ExtensibleElement.java?p2=ode/branches/rtver/bpel-api/src/main/java/org/apache/ode/bpel/rapi/ExtensibleElement.java&p1=ode/branches/rtver/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/ExtensibleElement.java&r1=683674&r2=683777&rev=683777&view=diff
==============================================================================
--- ode/branches/rtver/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/ExtensibleElement.java (original)
+++ ode/branches/rtver/bpel-api/src/main/java/org/apache/ode/bpel/rapi/ExtensibleElement.java Thu Aug  7 17:42:36 2008
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.ode.bpel.compiler.bom;
+package org.apache.ode.bpel.rapi;
 
 import org.w3c.dom.Element;
 

Added: ode/branches/rtver/bpel-api/src/main/java/org/apache/ode/bpel/rapi/ExtensionBundle.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/bpel-api/src/main/java/org/apache/ode/bpel/rapi/ExtensionBundle.java?rev=683777&view=auto
==============================================================================
--- ode/branches/rtver/bpel-api/src/main/java/org/apache/ode/bpel/rapi/ExtensionBundle.java (added)
+++ ode/branches/rtver/bpel-api/src/main/java/org/apache/ode/bpel/rapi/ExtensionBundle.java Thu Aug  7 17:42:36 2008
@@ -0,0 +1,13 @@
+package org.apache.ode.bpel.rapi;
+
+import javax.xml.namespace.QName;
+import java.util.Map;
+
+public interface ExtensionBundle {
+
+    String getNamespaceURI();
+
+    void registerExtensionActivities();
+
+    Map<QName, ExtensionValidator> getExtensionValidators();
+}

Copied: ode/branches/rtver/bpel-api/src/main/java/org/apache/ode/bpel/rapi/ExtensionValidator.java (from r683674, ode/branches/rtver/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/ExtensionValidator.java)
URL: http://svn.apache.org/viewvc/ode/branches/rtver/bpel-api/src/main/java/org/apache/ode/bpel/rapi/ExtensionValidator.java?p2=ode/branches/rtver/bpel-api/src/main/java/org/apache/ode/bpel/rapi/ExtensionValidator.java&p1=ode/branches/rtver/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/ExtensionValidator.java&r1=683674&r2=683777&rev=683777&view=diff
==============================================================================
--- ode/branches/rtver/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/ExtensionValidator.java (original)
+++ ode/branches/rtver/bpel-api/src/main/java/org/apache/ode/bpel/rapi/ExtensionValidator.java Thu Aug  7 17:42:36 2008
@@ -16,9 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.ode.bpel.compiler.api;
-
-import org.apache.ode.bpel.compiler.bom.ExtensibleElement;
+package org.apache.ode.bpel.rapi;
 
 /**
  * Interface that allows Ode extensions to validate an extension element's
@@ -32,8 +30,7 @@
      * 
      * @param compilerContext
      * @param element
-     * @throws CompilationException
      */
-    void validate(Object compilerContext, ExtensibleElement element) throws CompilationException;
+    void validate(Object compilerContext, ExtensibleElement element);
 
 }

Modified: ode/branches/rtver/bpel-api/src/main/java/org/apache/ode/bpel/rapi/ProcessModel.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/bpel-api/src/main/java/org/apache/ode/bpel/rapi/ProcessModel.java?rev=683777&r1=683776&r2=683777&view=diff
==============================================================================
--- ode/branches/rtver/bpel-api/src/main/java/org/apache/ode/bpel/rapi/ProcessModel.java (original)
+++ ode/branches/rtver/bpel-api/src/main/java/org/apache/ode/bpel/rapi/ProcessModel.java Thu Aug  7 17:42:36 2008
@@ -7,8 +7,6 @@
 
 public interface ProcessModel {
 
-//	OdeRTInstance newInstance();
-
 	PartnerLinkModel getPartnerLink(String name);
 	
 	PartnerLinkModel getPartnerLink(int partnerLinkModelId);
@@ -21,4 +19,5 @@
 
 	List<String> getCorrelators();
 
+    ActivityModel getChild(final int id);
 }

Modified: ode/branches/rtver/bpel-api/src/main/java/org/apache/ode/bpel/rapi/Variable.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/bpel-api/src/main/java/org/apache/ode/bpel/rapi/Variable.java?rev=683777&r1=683776&r2=683777&view=diff
==============================================================================
--- ode/branches/rtver/bpel-api/src/main/java/org/apache/ode/bpel/rapi/Variable.java (original)
+++ ode/branches/rtver/bpel-api/src/main/java/org/apache/ode/bpel/rapi/Variable.java Thu Aug  7 17:42:36 2008
@@ -1,7 +1,13 @@
 package org.apache.ode.bpel.rapi;
 
+import javax.xml.namespace.QName;
+
 public interface Variable extends ScopedObject {
 
 	String getName();
+
+    String getExternalId();
+
+    QName getElementType();
 	
 }

Modified: ode/branches/rtver/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelC.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelC.java?rev=683777&r1=683776&r2=683777&view=diff
==============================================================================
--- ode/branches/rtver/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelC.java (original)
+++ ode/branches/rtver/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelC.java Thu Aug  7 17:42:36 2008
@@ -33,7 +33,7 @@
 import org.apache.ode.bpel.compiler.api.CompilationException;
 import org.apache.ode.bpel.compiler.api.CompilationMessage;
 import org.apache.ode.bpel.compiler.api.CompileListener;
-import org.apache.ode.bpel.compiler.api.ExtensionValidator;
+import org.apache.ode.bpel.rapi.ExtensionValidator;
 import org.apache.ode.bpel.compiler.bom.BpelObjectFactory;
 import org.apache.ode.bpel.compiler.bom.Process;
 import org.apache.ode.bpel.rapi.ProcessModel;

Modified: ode/branches/rtver/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler.java?rev=683777&r1=683776&r2=683777&view=diff
==============================================================================
--- ode/branches/rtver/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler.java (original)
+++ ode/branches/rtver/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler.java Thu Aug  7 17:42:36 2008
@@ -1,7 +1,7 @@
 package org.apache.ode.bpel.compiler;
 
 import org.apache.ode.bpel.compiler.api.CompileListener;
-import org.apache.ode.bpel.compiler.api.ExtensionValidator;
+import org.apache.ode.bpel.rapi.ExtensionValidator;
 import org.apache.ode.bpel.compiler.bom.Process;
 import org.apache.ode.bpel.rapi.ProcessModel;
 import org.w3c.dom.Node;

Modified: ode/branches/rtver/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/ExtensionActivity.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/ExtensionActivity.java?rev=683777&r1=683776&r2=683777&view=diff
==============================================================================
--- ode/branches/rtver/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/ExtensionActivity.java (original)
+++ ode/branches/rtver/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/ExtensionActivity.java Thu Aug  7 17:42:36 2008
@@ -22,6 +22,7 @@
 import java.util.List;
 
 import org.w3c.dom.Element;
+import org.apache.ode.bpel.rapi.ExtensibleElement;
 
 /**
  * BOM representation of the BPEL <code>&lt;extensionActivity&gt;</code> activity. The

Modified: ode/branches/rtver/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/ExtensionAssignOperation.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/ExtensionAssignOperation.java?rev=683777&r1=683776&r2=683777&view=diff
==============================================================================
--- ode/branches/rtver/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/ExtensionAssignOperation.java (original)
+++ ode/branches/rtver/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/ExtensionAssignOperation.java Thu Aug  7 17:42:36 2008
@@ -19,6 +19,7 @@
 package org.apache.ode.bpel.compiler.bom;
 
 import org.apache.ode.bpel.compiler.bom.AssignActivity.AssignOperation;
+import org.apache.ode.bpel.rapi.ExtensibleElement;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
@@ -29,7 +30,7 @@
  * @author Tammo van Lessen (University of Stuttgart)
  */
 public class ExtensionAssignOperation extends BpelObject implements AssignOperation,
-																	ExtensibleElement {
+        ExtensibleElement {
 	private Element _childElement;
 	
     public ExtensionAssignOperation(Element el) {

Modified: ode/branches/rtver/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/v2/AssignGenerator.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/v2/AssignGenerator.java?rev=683777&r1=683776&r2=683777&view=diff
==============================================================================
--- ode/branches/rtver/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/v2/AssignGenerator.java (original)
+++ ode/branches/rtver/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/v2/AssignGenerator.java Thu Aug  7 17:42:36 2008
@@ -23,7 +23,7 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.ode.bpel.compiler.api.CompilationException;
-import org.apache.ode.bpel.compiler.api.ExtensionValidator;
+import org.apache.ode.bpel.rapi.ExtensionValidator;
 import org.apache.ode.bpel.compiler.bom.Activity;
 import org.apache.ode.bpel.compiler.bom.AssignActivity;
 import org.apache.ode.bpel.compiler.bom.Copy;

Modified: ode/branches/rtver/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/v2/BpelCompilerImpl.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/v2/BpelCompilerImpl.java?rev=683777&r1=683776&r2=683777&view=diff
==============================================================================
--- ode/branches/rtver/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/v2/BpelCompilerImpl.java (original)
+++ ode/branches/rtver/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/v2/BpelCompilerImpl.java Thu Aug  7 17:42:36 2008
@@ -48,7 +48,7 @@
 import org.apache.ode.bpel.compiler.api.CompilationException;
 import org.apache.ode.bpel.compiler.api.CompilationMessage;
 import org.apache.ode.bpel.compiler.api.CompileListener;
-import org.apache.ode.bpel.compiler.api.ExtensionValidator;
+import org.apache.ode.bpel.rapi.ExtensionValidator;
 import org.apache.ode.bpel.compiler.v2.CompilerContext;
 import org.apache.ode.bpel.compiler.v2.ExpressionCompiler;
 import org.apache.ode.bpel.compiler.bom.Activity;

Modified: ode/branches/rtver/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/v2/CompilerContext.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/v2/CompilerContext.java?rev=683777&r1=683776&r2=683777&view=diff
==============================================================================
--- ode/branches/rtver/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/v2/CompilerContext.java (original)
+++ ode/branches/rtver/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/v2/CompilerContext.java Thu Aug  7 17:42:36 2008
@@ -28,7 +28,7 @@
 import org.apache.ode.bpel.compiler.bom.ScopeLikeActivity;
 import org.apache.ode.bpel.compiler.SourceLocation;
 import org.apache.ode.bpel.compiler.api.CompilationException;
-import org.apache.ode.bpel.compiler.api.ExtensionValidator;
+import org.apache.ode.bpel.rapi.ExtensionValidator;
 import org.apache.ode.bpel.rtrep.v2.OActivity;
 import org.apache.ode.bpel.rtrep.v2.OExpression;
 import org.apache.ode.bpel.rtrep.v2.OLValueExpression;

Modified: ode/branches/rtver/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/v2/ExtensionActivtityGenerator.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/v2/ExtensionActivtityGenerator.java?rev=683777&r1=683776&r2=683777&view=diff
==============================================================================
--- ode/branches/rtver/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/v2/ExtensionActivtityGenerator.java (original)
+++ ode/branches/rtver/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/v2/ExtensionActivtityGenerator.java Thu Aug  7 17:42:36 2008
@@ -19,7 +19,7 @@
 package org.apache.ode.bpel.compiler.v2;
 
 import org.apache.ode.bpel.compiler.api.CompilationException;
-import org.apache.ode.bpel.compiler.api.ExtensionValidator;
+import org.apache.ode.bpel.rapi.ExtensionValidator;
 import org.apache.ode.bpel.compiler.bom.Activity;
 import org.apache.ode.bpel.compiler.bom.CompositeActivity;
 import org.apache.ode.bpel.compiler.bom.ExtensionActivity;

Modified: ode/branches/rtver/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler/XPathTest.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler/XPathTest.java?rev=683777&r1=683776&r2=683777&view=diff
==============================================================================
--- ode/branches/rtver/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler/XPathTest.java (original)
+++ ode/branches/rtver/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler/XPathTest.java Thu Aug  7 17:42:36 2008
@@ -32,7 +32,7 @@
 import org.apache.ode.bpel.compiler.api.CompilationException;
 import org.apache.ode.bpel.compiler.v2.CompilerContext;
 import org.apache.ode.bpel.compiler.v2.ExpressionCompiler;
-import org.apache.ode.bpel.compiler.api.ExtensionValidator;
+import org.apache.ode.bpel.rapi.ExtensionValidator;
 import org.apache.ode.bpel.compiler.api.SourceLocation;
 import org.apache.ode.bpel.compiler.bom.Activity;
 import org.apache.ode.bpel.compiler.bom.BpelObject;

Modified: ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java?rev=683777&r1=683776&r2=683777&view=diff
==============================================================================
--- ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java (original)
+++ ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java Thu Aug  7 17:42:36 2008
@@ -64,8 +64,6 @@
 import org.apache.ode.bpel.evar.ExternalVariableModuleException;
 import org.apache.ode.bpel.evar.ExternalVariableModule.Value;
 import org.apache.ode.bpel.rapi.*;
-import org.apache.ode.bpel.rtrep.common.extension.AbstractExtensionBundle;
-import org.apache.ode.bpel.rtrep.common.extension.ExtensionOperation;
 
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
@@ -537,6 +535,13 @@
         message.setHeader(header);
     }
 
+    public void executeCreateInstance(MessageExchangeDAO instantiatingMessageExchange) {
+        if (instantiatingMessageExchange == null) throw new NullPointerException();
+        _instantiatingMessageExchange = instantiatingMessageExchange;
+        _rti.onCreateInstance(instantiatingMessageExchange.getMessageExchangeId());
+        execute();
+    }
+
     void execute() {
         if (!_contexts.isTransacted())
             throw new BpelEngineException("MUST RUN IN TRANSACTION!");
@@ -890,22 +895,6 @@
         _forceFlush = true;
     }
     
-	public ExtensionOperation createExtensionActivityImplementation(QName name) {
-		if (name == null) {
-			return null;
-		}
-		AbstractExtensionBundle bundle = _contexts.extensionRegistry.get(name.getNamespaceURI());
-		if (bundle == null) {
-			return null;
-		} else {
-			try {
-				return bundle.getExtensionOperationInstance(name.getLocalPart());
-			} catch (Exception e) {
-				return null;
-			}
-        }
-    }
-
 	public Node readExtVar(Variable variable, Node reference) throws ExternalVariableModuleException {
 		Value val = _bpelProcess.getEVM().read(variable, reference, _iid);
 		return val.value;

Modified: ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelServerImpl.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelServerImpl.java?rev=683777&r1=683776&r2=683777&view=diff
==============================================================================
--- ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelServerImpl.java (original)
+++ ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelServerImpl.java Thu Aug  7 17:42:36 2008
@@ -61,12 +61,13 @@
 import org.apache.ode.bpel.iapi.Scheduler.JobInfo;
 import org.apache.ode.bpel.iapi.Scheduler.JobProcessorException;
 import org.apache.ode.bpel.intercept.MessageExchangeInterceptor;
-import org.apache.ode.bpel.o.OProcess;
-import org.apache.ode.bpel.runtime.extension.AbstractExtensionBundle;
 import org.apache.ode.utils.msg.MessageBundle;
 import org.apache.ode.utils.stl.CollectionsX;
 import org.apache.ode.utils.stl.MemberOfFunction;
 import org.apache.ode.bpel.evar.ExternalVariableModule;
+import org.apache.ode.bpel.rapi.ProcessModel;
+import org.apache.ode.bpel.rapi.OdeRuntime;
+import org.apache.ode.bpel.rapi.ExtensionBundle;
 
 /**
  * <p>
@@ -263,7 +264,7 @@
         }
     }
 
-    public void registerExtensionBundle(AbstractExtensionBundle bundle) {
+    public void registerExtensionBundle(ExtensionBundle bundle) {
     	_contexts.extensionRegistry.put(bundle.getNamespaceURI(), bundle);
     	bundle.registerExtensionActivities();
     }
@@ -344,7 +345,7 @@
 
             __log.debug("Registering process " + conf.getProcessId() + " with server.");
 
-            ODEProcess process = new ODEProcess(this, conf, null);
+            ODEProcess process = new ODEProcess(this, conf, null, buildRuntime(conf));
 
             for (Endpoint e : process.getServiceNames()) {
                 __log.debug("Register process: serviceId=" + e + ", process=" + process);
@@ -362,6 +363,17 @@
         }
     }
 
+    private OdeRuntime buildRuntime(ProcessConf conf) {
+        // Relying on package naming conventions to find our runtime
+        String qualifiedName = "org.apache.ode.bpel.rtrep.v" + conf.getRuntimeVersion() + ".RuntimeImpl";
+        try {
+            return (OdeRuntime) Class.forName(qualifiedName).newInstance();
+        } catch (Exception e) {
+            throw new RuntimeException("Couldn't instantiate ODE runtime version " + conf.getRuntimeVersion() +
+                    ", either your process definition version is outdated or we have a bug.");
+        }
+    }
+
     public void unregister(QName pid) throws BpelEngineException {
         if (__log.isTraceEnabled())
             __log.trace("unregister: " + pid);
@@ -556,7 +568,7 @@
                 assertNoTransaction();
             
             
-            return target.createNewMyRoleMex(istyle, targetService, operation, clientKey);
+            return target.createNewMyRoleMex(istyle, targetService, operation);
         } finally {
             _mngmtLock.readLock().unlock();
         }
@@ -571,8 +583,8 @@
             Callable<MessageExchange> loadMex = new Callable<MessageExchange>() {
 
                 public MessageExchange call() {
-                    MessageExchangeDAO mexdao = (inmemdao == null) ? mexdao = _contexts.dao.getConnection().getMessageExchange(
-                            mexId) : inmemdao;
+                    MessageExchangeDAO mexdao = (inmemdao == null) ?
+                            mexdao = _contexts.dao.getConnection().getMessageExchange(mexId) : inmemdao;
                     if (mexdao == null)
                         return null;
 
@@ -654,14 +666,14 @@
         return null;
     }
     
-    OProcess getOProcess(QName processId) {
+    ProcessModel getProcessModel(QName processId) {
         _mngmtLock.readLock().lock();
         try {
             ODEProcess process = _registeredProcesses.get(processId);
 
             if (process == null) return null;
 
-            return process.getOProcess();
+            return process.getProcessModel();
 
         } finally {
             _mngmtLock.readLock().unlock();
@@ -733,8 +745,7 @@
 
     private long randomExp(double mean) {
         double u = _random.nextDouble(); // Uniform
-        long delay = (long) (-Math.log(u) * mean); // Exponential
-        return delay;
+        return (long) (-Math.log(u) * mean);
     }
 
     private class ProcessDefReaper implements Runnable {
@@ -746,7 +757,6 @@
                     Thread.sleep(pollingTime);
                     _mngmtLock.writeLock().lockInterruptibly();
                     try {
-                        __log.debug("Kicking reaper, OProcess instances: " + OProcess.instanceCount);
                         // Copying the runnning process list to avoid synchronizatMessageExchangeInterion
                         // problems and a potential mess if a policy modifies the list
                         List<ODEProcess> candidates = new ArrayList<ODEProcess>(_registeredProcesses.values());
@@ -754,7 +764,6 @@
                             public boolean isMember(ODEProcess o) {
                                 return !o.hintIsHydrated();
                             }
-
                         });
 
                         // And the happy winners are...

Modified: ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/Contexts.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/Contexts.java?rev=683777&r1=683776&r2=683777&view=diff
==============================================================================
--- ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/Contexts.java (original)
+++ ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/Contexts.java Thu Aug  7 17:42:36 2008
@@ -43,8 +43,7 @@
 import org.apache.ode.bpel.iapi.Scheduler;
 import org.apache.ode.bpel.intercept.MessageExchangeInterceptor;
 import org.apache.ode.bpel.evar.ExternalVariableModule;
-import org.apache.ode.bpel.rtrep.common.extension.AbstractExtensionBundle;
-
+import org.apache.ode.bpel.rapi.ExtensionBundle;
 
 /**
  * Aggregation of all the contexts provided to the BPEL engine by the integration layer.
@@ -53,15 +52,10 @@
     private static final Log __log = LogFactory.getLog(Contexts.class);
     
     TransactionManager txManager;
-
     MessageExchangeContext mexContext;
-
     Scheduler scheduler;
-
     EndpointReferenceContext eprContext;
-
     BindingContext bindingContext;
-
     BpelDAOConnectionFactory dao;
 
     /** Global Message-Exchange interceptors. Must be copy-on-write!!! */
@@ -71,7 +65,7 @@
     final List<BpelEventListener> eventListeners = new CopyOnWriteArrayList<BpelEventListener>();
 
 	/** Global extension bundle registry **/
-    final Map<String, AbstractExtensionBundle> extensionRegistry = new ConcurrentHashMap<String, AbstractExtensionBundle>();
+    final Map<String, ExtensionBundle> extensionRegistry = new ConcurrentHashMap<String, ExtensionBundle>();
     
     /** Mapping from external variable engine identifier to the engine implementation. */
     final HashMap<QName, ExternalVariableModule> externalVariableEngines = new HashMap<QName, ExternalVariableModule>();

Modified: ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/MessageExchangeImpl.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/MessageExchangeImpl.java?rev=683777&r1=683776&r2=683777&view=diff
==============================================================================
--- ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/MessageExchangeImpl.java (original)
+++ ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/MessageExchangeImpl.java Thu Aug  7 17:42:36 2008
@@ -37,7 +37,7 @@
 import org.apache.ode.bpel.iapi.InvocationStyle;
 import org.apache.ode.bpel.iapi.Message;
 import org.apache.ode.bpel.iapi.MessageExchange;
-import org.apache.ode.bpel.o.OPartnerLink;
+import org.apache.ode.bpel.rapi.PartnerLinkModel;
 import org.apache.ode.utils.msg.MessageBundle;
 import org.w3c.dom.Element;
 
@@ -74,7 +74,7 @@
 
     final ODEProcess _process;
 
-    final OPartnerLink _oplink;
+    final PartnerLinkModel _oplink;
 
     /** Message-exchange id. */
     final String _mexId;
@@ -137,7 +137,7 @@
             ODEProcess process,
             Long iid,
             String mexId, 
-            OPartnerLink oplink, 
+            PartnerLinkModel oplink,
             PortType ptype, Operation operation) {
         _process = process;
         _contexts = process._contexts;

Added: ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/Messages.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/Messages.java?rev=683777&view=auto
==============================================================================
--- ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/Messages.java (added)
+++ ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/Messages.java Thu Aug  7 17:42:36 2008
@@ -0,0 +1,203 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.engine;
+
+import org.apache.ode.utils.msg.MessageBundle;
+
+import javax.xml.namespace.QName;
+import java.io.File;
+import java.net.URI;
+import java.util.Date;
+import java.util.Map;
+
+/**
+ * Message bundle used by the BPEL provider implementation.
+ * 
+ * @author mszefler
+ */
+public class Messages extends MessageBundle {
+
+    String msgBarProcessLoadErr() {
+        return format("Unable to load compiled BPEL process.");
+    }
+
+    String msgProcessDeployed(QName processId) {
+        return format("Process {0} deployed.", processId);
+    }
+
+    /** A database error prevented the operation from succeeding. */
+    String msgDbError() {
+        return format("A database error prevented the operation from succeeding.");
+    }
+
+    /** The instance "{0}" was not found in the database. */
+    String msgInstanceNotFound(Long pid) {
+        return format("The instance \"{0}\" was not found in the database.", pid);
+    }
+
+    String msgUnknownEPR(String epr) {
+        return format("Unkown EPR: {0}", epr);
+    }
+
+    String msgProcessRegistered(QName pid) {
+        return format("Registered process {0}.", pid);
+    }
+
+    String msgProcessUnregistered(QName pid) {
+        return format("Unregistered process {0}.", pid);
+    }
+    
+    String msgProcessUnregisterFailed(QName process) {
+        return format("Failed to unregister process {0}! Check database for consistency!", process);
+    }
+
+    String msgProcessNotFound(QName pid) {
+        return format("Process {0} not found. ", pid);
+    }
+
+    String msgProcessNotActive(QName processId) {
+        return format("Process {0} is not active. ", processId);
+    }
+
+    String msgProcessLoadError(QName processId) {
+        return format("Process {0}, could not be loaded. ", processId);
+    }
+
+    String msgDeployFailDescriptorURIInvalid(URI dduri) {
+        return format("Deployment failure: invalid deployment descriptor URI \"{0}\" ", dduri);
+    }
+
+    String msgDeployFailDescriptorInvalid(URI dduri) {
+        return format("Deployment failure: invalid/malformed deployment descriptor at \"{0}\"", dduri);
+    }
+
+    String msgDeployFailDescriptorIOError(URI dduri) {
+        return format("Deployment failure: IO error reading deployment descriptor at \"{0}\"", dduri);
+    }
+
+    /**
+     * Partner link declared in process deployment descriptor could not be found
+     * in process definition: {0}
+     */
+    String msgDDPartnerLinkNotFound(String partnerLinkName) {
+        return format("Partner link declared in process deployment descriptor could not be found in process " + "definition: {0}",
+                partnerLinkName);
+    }
+
+    String msgDDPartnerRoleNotFound(String partnerLinkName) {
+        return format("Role 'partnerRole' declared in process deployment descriptor isn't defined in process definition "
+                + "for partner link : {0}", partnerLinkName);
+    }
+
+    String msgDDMyRoleNotFound(String partnerLinkName) {
+        return format("Role 'myRole' declared in process deployment descriptor isn't defined in process definition for "
+                + "partner link : {0}", partnerLinkName);
+    }
+
+    String msgDDNoInitiliazePartnerRole(String partnerLinkName) {
+        return format("Partner link {0} is defined in process as initializePartnerRole=no, its partner role endpoint "
+                + "can't be initialized by deployment descriptor.", partnerLinkName);
+    }
+
+    String msgProcessDeployErrAlreadyDeployed(QName processId) {
+        return format("The process could not be deployed; another process is already deployed as {0}!", processId);
+    }
+
+    String msgScheduledJobReferencesUnknownInstance(Long iid) {
+        return format("Received a scheduled job event for unknown instance {0}", iid);
+    }
+
+    String msgReschedulingJobForInactiveProcess(QName processId, String jobId, Date rescheduled) {
+        return format("Received a scheduled job event for inactive process {0}; " + "rescheduling job {1} for {2}", processId,
+                jobId, rescheduled);
+    }
+
+    String msgProcessActivationError(QName pid) {
+        return format("Error activating process {0}", pid);
+    }
+
+    String msgOperationInterrupted() {
+        return format("Operation was interrupted.");
+    }
+
+    String msgServerStarted() {
+        return format("BPEL Server Started.");
+    }
+
+    String msgServerStopped() {
+        return format("BPEL Server Stopped.");
+    }
+
+    String msgUndefinedServicePort(QName service, String port) {
+        return format("The service name and port defined in your deployment descriptor couldn't be found "
+                + "in any WSDL document: {0} {1}.", service, port);
+    }
+
+    String msgInterceptorAborted(String mexId, String interceptor, String msg) {
+        return format("Message exchange {0} aborted by interceptor {1}: {2}", mexId, interceptor, msg);
+    }
+
+    String msgMyRoleRoutingFailure(String messageExchangeId) {
+        return format("Unable to route message exchange {0}, EPR was not specified "
+                + "and the target my-role could not be inferred.", messageExchangeId);
+    }
+
+    String msgPropertyAliasReturnedNullSet(String alias, String variable) {
+        return this.format("msgPropertyAliasReturnedNullSet: {0} {1}", alias, variable);
+    }
+
+    String msgUnknownOperation(String operationName, QName portType) {
+        return format("Unknown operation \"{0}\" for port type \"{1}\".", operationName, portType);
+    }
+
+    String msgPropertyAliasDerefFailedOnMessage(String aliasDescription, String reason) {
+        return this.format("Unable to evaluate apply property alias \"{0}\" to incoming message: {1}", aliasDescription, reason);
+    }
+
+    public String msgDeployStarting(File deploymentUnitDirectory) {
+        return format("Starting deployment of processes from directory \"{0}\". ", deploymentUnitDirectory);
+    }
+
+    public String msgDeployFailed(QName name, File deploymentUnitDirectory) {
+        return format("Deployment of process \"{0}\" from \"{1}\" failed.", name, deploymentUnitDirectory);
+    }
+
+    public String msgDeployRollback(File deploymentUnitDirectory) {
+        return format("Deployment of processes from \"{0}\" failed, rolling back. ", deploymentUnitDirectory);
+    }
+
+    public String msgExpLangRegistrationError(String expressionLanguageUri, Map<String, String> properties) {
+        return format("Error registering expression language \"" + expressionLanguageUri + "\" with properties " + properties);
+    }
+
+    public String msgScheduledJobFailed(Map<String, Object> jobDetail) {
+        return format("Scheduled job failed; jobDetail={0}", jobDetail);
+    }
+
+    public String msgDbConsistencyError(String detail) {
+        return format("Database consistency error: {0}", detail);
+    }
+
+    public String msgExtensionMustUnderstandError(QName name, String extensionUri) {
+        return format("Deployment of process \"{0}\" failed. The process model requires the " +
+        		"engine to understand language extensions defined by {1}. No extension bundle " +
+        		"has been registered for this namespace.", name, extensionUri);
+    }
+
+}

Modified: ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/MyRoleMessageExchangeCache.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/MyRoleMessageExchangeCache.java?rev=683777&r1=683776&r2=683777&view=diff
==============================================================================
--- ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/MyRoleMessageExchangeCache.java (original)
+++ ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/MyRoleMessageExchangeCache.java Thu Aug  7 17:42:36 2008
@@ -5,7 +5,6 @@
 import java.util.Iterator;
 
 import org.apache.ode.bpel.dao.MessageExchangeDAO;
-import org.apache.ode.bpel.o.OPartnerLink;
 
 /**
  * Manage {@link MyRoleMessageExchangeImpl} object references.
@@ -57,11 +56,8 @@
                 mex = _process.recreateMyRoleMex(mexdao);
                 _cache.put(mexdao.getMessageExchangeId(), new WeakReference<MyRoleMessageExchangeImpl>(mex));
             }
-                
             return mex;
-
         }
-
     }
 
     /**
@@ -74,7 +70,6 @@
             if (ref.get() == null)
                 i.remove();
         }
-
         _inserts = 0;
     }
 }

Modified: ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/MyRoleMessageExchangeImpl.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/MyRoleMessageExchangeImpl.java?rev=683777&r1=683776&r2=683777&view=diff
==============================================================================
--- ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/MyRoleMessageExchangeImpl.java (original)
+++ ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/MyRoleMessageExchangeImpl.java Thu Aug  7 17:42:36 2008
@@ -13,7 +13,7 @@
 import org.apache.ode.bpel.iapi.BpelEngineException;
 import org.apache.ode.bpel.iapi.Message;
 import org.apache.ode.bpel.iapi.MyRoleMessageExchange;
-import org.apache.ode.bpel.o.OPartnerLink;
+import org.apache.ode.bpel.rapi.PartnerLinkModel;
 
 abstract class MyRoleMessageExchangeImpl extends MessageExchangeImpl implements MyRoleMessageExchange {
 
@@ -25,8 +25,9 @@
 
     protected String _clientId;
 
-    public MyRoleMessageExchangeImpl(ODEProcess process, String mexId, OPartnerLink oplink, Operation operation, QName callee) {
-        super(process, null, mexId, oplink, oplink.myRolePortType, operation);
+    public MyRoleMessageExchangeImpl(ODEProcess process, String mexId, PartnerLinkModel oplink,
+                                     Operation operation, QName callee) {
+        super(process, null, mexId, oplink, oplink.getMyRolePortType(), operation);
         _callee = callee;
     }
 

Modified: ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/ODEProcess.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/ODEProcess.java?rev=683777&r1=683776&r2=683777&view=diff
==============================================================================
--- ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/ODEProcess.java (original)
+++ ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/ODEProcess.java Thu Aug  7 17:42:36 2008
@@ -18,7 +18,7 @@
  */
 package org.apache.ode.bpel.engine;
 
-import java.io.InputStream;
+import java.io.ByteArrayInputStream;
 import java.net.URI;
 import java.util.ArrayList;
 import java.util.Collections;
@@ -38,7 +38,6 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.ode.bpel.common.CorrelationKey;
-import org.apache.ode.bpel.common.FaultException;
 import org.apache.ode.bpel.dao.BpelDAOConnection;
 import org.apache.ode.bpel.dao.CorrelatorDAO;
 import org.apache.ode.bpel.dao.MessageDAO;
@@ -49,7 +48,6 @@
 import org.apache.ode.bpel.engine.extvar.ExternalVariableConf;
 import org.apache.ode.bpel.engine.extvar.ExternalVariableManager;
 import org.apache.ode.bpel.evt.ProcessInstanceEvent;
-import org.apache.ode.bpel.explang.ConfigurationException;
 import org.apache.ode.bpel.iapi.BpelEngineException;
 import org.apache.ode.bpel.iapi.BpelEventListener;
 import org.apache.ode.bpel.iapi.Endpoint;
@@ -71,25 +69,14 @@
 import org.apache.ode.bpel.intercept.InterceptorInvoker;
 import org.apache.ode.bpel.intercept.MessageExchangeInterceptor;
 import org.apache.ode.bpel.memdao.BpelDAOConnectionFactoryImpl;
-import org.apache.ode.bpel.o.OExpressionLanguage;
-import org.apache.ode.bpel.o.OPartnerLink;
-import org.apache.ode.bpel.o.OProcess;
-import org.apache.ode.bpel.o.Serializer;
-import org.apache.ode.bpel.runtime.ExpressionLanguageRuntimeRegistry;
-import org.apache.ode.bpel.runtime.PROCESS;
-import org.apache.ode.bpel.runtime.PropertyAliasEvaluationContext;
-import org.apache.ode.bpel.runtime.msgs.Messages;
-import org.apache.ode.bpel.runtime.channels.FaultData;
-import org.apache.ode.bpel.rapi.PartnerLinkModel;
-import org.apache.ode.bpel.rapi.FaultInfo;
+import org.apache.ode.bpel.memdao.ProcessInstanceDaoImpl;
+import org.apache.ode.bpel.rapi.*;
 import org.apache.ode.jacob.soup.ReplacementMap;
+import org.apache.ode.jacob.vpu.ExecutionQueueImpl;
 import org.apache.ode.utils.GUID;
 import org.apache.ode.utils.ObjectPrinter;
 import org.apache.ode.utils.msg.MessageBundle;
 import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
 
 /**
  * Entry point into the runtime of a BPEL process.
@@ -118,7 +105,7 @@
 
     final QName _pid;
 
-    private volatile OProcess _oprocess;
+    private volatile ProcessModel _processModel;
 
     // Has the process already been hydrated before?
     private boolean _hydratedOnce = false;
@@ -126,11 +113,9 @@
     /** Last time the process was used. */
     private volatile long _lastUsed;
 
-    DebuggerSupport _debugger;
+    volatile OdeRuntime _runtime;
 
-    ExpressionLanguageRuntimeRegistry _expLangRuntimeRegistry;
-    
-    private ReplacementMap _replacementMap;
+    DebuggerSupport _debugger;
 
     final ProcessConf _pconf;
 
@@ -160,7 +145,8 @@
     
     private ExternalVariableManager _evm;
     
-    ODEProcess(BpelServerImpl server, ProcessConf conf, BpelEventListener debugger) {
+    ODEProcess(BpelServerImpl server, ProcessConf conf, BpelEventListener debugger, OdeRuntime odeRuntime) {
+        _runtime = odeRuntime;
         _server = server;
         _pid = conf.getProcessId();
         _pconf = conf;
@@ -198,7 +184,7 @@
     void initExternalVariables() {
         List<Element> conf = _pconf.getExtensionElement(ExternalVariableConf.EXTVARCONF_ELEMENT);
         _extVarConf = new ExternalVariableConf(conf);
-        _evm = new ExternalVariableManager(_pid, _extVarConf, _contexts.externalVariableEngines, _oprocess);
+        _evm = new ExternalVariableManager(_pid, _extVarConf, _contexts.externalVariableEngines);
     }
     
 
@@ -219,15 +205,14 @@
         try {
             markused();
             BpelInstanceWorker iworker = _instanceWorkerCache.get(instanceDAO.getInstanceId());
-            final BpelRuntimeContextImpl processInstance = new BpelRuntimeContextImpl(iworker, instanceDAO);
+            final OdeRTInstance rti = _runtime.newInstance(getState(instanceDAO));
+            final BpelRuntimeContextImpl processInstance = new BpelRuntimeContextImpl(iworker, instanceDAO, rti);
             try {
                 iworker.execInCurrentThread(new Callable<Void>() {
-
                     public Void call() throws Exception {
                         processInstance.recoverActivity(channel, activityId, action, fault);
                         return null;
                     }
-
                 });
             } catch (Exception e) {
                 throw new BpelEngineException(e);
@@ -342,9 +327,9 @@
 
         BpelInstanceWorker worker = _instanceWorkerCache.get(mexdao.getInstance().getInstanceId());
         assert worker.isWorkerThread();
-        BpelRuntimeContextImpl instanceCtx = new BpelRuntimeContextImpl(worker, mexdao.getInstance(), new PROCESS(_oprocess),
-                mexdao);
-        instanceCtx.execute();
+        BpelRuntimeContextImpl rtictx = new BpelRuntimeContextImpl(
+                worker, mexdao.getInstance(), _runtime.newInstance(getState(mexdao.getInstance())));
+        rtictx.executeCreateInstance(mexdao);
     }
 
     void executeContinueInstanceMyRoleRequestReceived(MessageExchangeDAO mexdao) {
@@ -353,7 +338,8 @@
         BpelInstanceWorker worker = _instanceWorkerCache.get(mexdao.getInstance().getInstanceId());
         assert worker.isWorkerThread();
 
-        BpelRuntimeContextImpl instance = new BpelRuntimeContextImpl(worker, mexdao.getInstance());
+        OdeRTInstance rti = _runtime.newInstance(getState(mexdao.getInstance()));
+        BpelRuntimeContextImpl instance = new BpelRuntimeContextImpl(worker, mexdao.getInstance(), rti);
         int amp = mexdao.getChannel().indexOf('&');
         String groupId = mexdao.getChannel().substring(0, amp);
         int idx = Integer.valueOf(mexdao.getChannel().substring(amp + 1));
@@ -365,7 +351,8 @@
         BpelInstanceWorker worker = _instanceWorkerCache.get(instanceDao.getInstanceId());
         assert worker.isWorkerThread();
 
-        BpelRuntimeContextImpl brc = new BpelRuntimeContextImpl(worker, instanceDao);
+        OdeRTInstance rti = _runtime.newInstance(getState(instanceDao));
+        BpelRuntimeContextImpl brc = new BpelRuntimeContextImpl(worker, instanceDao, rti);
         brc.execute();
 
     }
@@ -374,7 +361,8 @@
         BpelInstanceWorker worker = _instanceWorkerCache.get(instanceDao.getInstanceId());
         assert worker.isWorkerThread();
 
-        BpelRuntimeContextImpl brc = new BpelRuntimeContextImpl(worker, instanceDao);
+        OdeRTInstance rti = _runtime.newInstance(getState(instanceDao));
+        BpelRuntimeContextImpl brc = new BpelRuntimeContextImpl(worker, instanceDao, rti);
         if (brc.injectTimerEvent(timerChannel)) brc.execute();
 
     }
@@ -413,14 +401,14 @@
             BpelInstanceWorker worker = _instanceWorkerCache.get(instanceDao.getInstanceId());
             assert worker.isWorkerThread();
 
-            BpelRuntimeContextImpl brc = new BpelRuntimeContextImpl(worker, instanceDao);
+            OdeRTInstance rti = _runtime.newInstance(getState(mexdao.getInstance()));
+            BpelRuntimeContextImpl brc = new BpelRuntimeContextImpl(worker, instanceDao, rti);
             brc.injectMyRoleMessageExchange(mroute.getGroupId(), mroute.getIndex(), mexdao);
             brc.execute();
         } else {
             __log.debug("MatcherEvent handling: nothing to do, no matching message in DB");
 
         }
-
     }
 
     void executeContinueInstancePartnerRoleResponseReceived(MessageExchangeDAO mexdao) {
@@ -432,7 +420,8 @@
         BpelInstanceWorker worker = _instanceWorkerCache.get(mexdao.getInstance().getInstanceId());
         assert worker.isWorkerThread();
 
-        BpelRuntimeContextImpl brc = new BpelRuntimeContextImpl(worker, mexdao.getInstance());
+        OdeRTInstance rti = _runtime.newInstance(getState(mexdao.getInstance()));
+        BpelRuntimeContextImpl brc = new BpelRuntimeContextImpl(worker, mexdao.getInstance(), rti);
 
         brc.injectPartnerResponse(mexdao.getMessageExchangeId(), mexdao.getChannel());
         brc.execute();
@@ -467,56 +456,7 @@
     }
 
     /**
-     * Extract the value of a BPEL property from a BPEL messsage variable.
-     * 
-     * @param msgData
-     *            message variable data
-     * @param alias
-     *            alias to apply
-     * @param target
-     *            description of the data (for error logging only)
-     * @return value of the property
-     * @throws FaultException
-     */
-    String extractProperty(Element msgData, OProcess.OPropertyAlias alias, String target) throws FaultException {
-        markused();
-        PropertyAliasEvaluationContext ectx = new PropertyAliasEvaluationContext(msgData, alias);
-        Node lValue = ectx.getRootNode();
-
-        if (alias.location != null)
-            lValue = _expLangRuntimeRegistry.evaluateNode(alias.location, ectx);
-
-        if (lValue == null) {
-            String errmsg = __msgs.msgPropertyAliasReturnedNullSet(alias.getDescription(), target);
-            if (__log.isErrorEnabled()) {
-                __log.error(errmsg);
-            }
-            throw new FaultException(getOProcess().constants.qnSelectionFailure, errmsg);
-        }
-
-        if (lValue.getNodeType() == Node.ELEMENT_NODE) {
-            // This is a bit hokey, we concatenate all the children's values; we
-            // really should be checking to make sure that we are only dealing
-            // with
-            // text and attribute nodes.
-            StringBuffer val = new StringBuffer();
-            NodeList nl = lValue.getChildNodes();
-            for (int i = 0; i < nl.getLength(); ++i) {
-                Node n = nl.item(i);
-                val.append(n.getNodeValue());
-            }
-            return val.toString();
-        } else if (lValue.getNodeType() == Node.TEXT_NODE) {
-            return ((Text) lValue).getWholeText();
-        } else
-            return null;
-    }
-
-    /**
      * Process the message-exchange interceptors.
-     * 
-     * @param mex
-     *            message exchange
      * @return <code>true</code> if execution should continue, <code>false</code> otherwise
      */
     boolean processInterceptors(MessageExchangeDAO mexdao, InterceptorInvoker invoker) {
@@ -542,9 +482,7 @@
     /**
      * Handle a work event; this method is called from the scheduler thread and should be very quick, i.e. any serious work needs to
      * be handed off to a separate thread.
-     * 
      * @throws JobProcessorException
-     * @see ODEProcess#handleWorkEvent(java.util.Map<java.lang.String,java.lang.Object>)
      */
     void handleWorkEvent(final JobInfo jobInfo) throws JobProcessorException {
         assert !_contexts.isTransacted() : "work events must be received outside of a transaction";
@@ -577,6 +515,30 @@
         return _server.enqueueTransaction(new ProcessCallable<T>(tx));
     }
 
+    private Object getState(ProcessInstanceDAO instanceDAO) {
+        ExecutionQueueImpl state = null;
+        if (isInMemory()) {
+            ProcessInstanceDaoImpl inmem = (ProcessInstanceDaoImpl) instanceDAO;
+            if (inmem.getSoup() != null) {
+                state = (ExecutionQueueImpl) inmem.getSoup();
+            }
+        } else {
+            byte[] daoState = instanceDAO.getExecutionState();
+            if (daoState != null) {
+                state = new ExecutionQueueImpl(getClass().getClassLoader());
+                state.setReplacementMap((ReplacementMap) _runtime.getReplacementMap(instanceDAO.getProcess().getProcessId()));
+
+                ByteArrayInputStream iis = new ByteArrayInputStream(daoState);
+                try {
+                    state.read(iis);
+                } catch (Exception ex) {
+                    throw new RuntimeException(ex);
+                }
+            }
+        }
+        return state;
+    }
+
     private void execInstanceEvent(WorkEvent we) {
         BpelInstanceWorker worker = _instanceWorkerCache.get(we.getIID());
         assert worker.isWorkerThread();
@@ -619,15 +581,15 @@
                 .getMessageExchange(mexId);
     }
 
-    private void setRoles(OProcess oprocess) {
-        _partnerRoles = new HashMap<OPartnerLink, PartnerLinkPartnerRoleImpl>();
-        _myRoles = new HashMap<OPartnerLink, PartnerLinkMyRoleImpl>();
+    private void setRoles(ProcessModel oprocess) {
+        _partnerRoles = new HashMap<PartnerLinkModel, PartnerLinkPartnerRoleImpl>();
+        _myRoles = new HashMap<PartnerLinkModel, PartnerLinkMyRoleImpl>();
         _endpointToMyRoleMap = new HashMap<Endpoint, PartnerLinkMyRoleImpl>();
 
         // Create myRole endpoint name mapping (from deployment descriptor)
-        HashMap<OPartnerLink, Endpoint> myRoleEndpoints = new HashMap<OPartnerLink, Endpoint>();
+        HashMap<PartnerLinkModel, Endpoint> myRoleEndpoints = new HashMap<PartnerLinkModel, Endpoint>();
         for (Map.Entry<String, Endpoint> provide : _pconf.getProvideEndpoints().entrySet()) {
-            OPartnerLink plink = oprocess.getPartnerLink(provide.getKey());
+            PartnerLinkModel plink = oprocess.getPartnerLink(provide.getKey());
             if (plink == null) {
                 String errmsg = "Error in deployment descriptor for process " + _pid + "; reference to unknown partner link "
                         + provide.getKey();
@@ -639,7 +601,7 @@
 
         // Create partnerRole initial value mapping
         for (Map.Entry<String, Endpoint> invoke : _pconf.getInvokeEndpoints().entrySet()) {
-            OPartnerLink plink = oprocess.getPartnerLink(invoke.getKey());
+            PartnerLinkModel plink = oprocess.getPartnerLink(invoke.getKey());
             if (plink == null) {
                 String errmsg = "Error in deployment descriptor for process " + _pid + "; reference to unknown partner link "
                         + invoke.getKey();
@@ -650,10 +612,10 @@
                     + invoke.getValue());
         }
 
-        for (OPartnerLink pl : oprocess.getAllPartnerLinks()) {
+        for (PartnerLinkModel pl : oprocess.getAllPartnerLinks()) {
             if (pl.hasMyRole()) {
                 Endpoint endpoint = myRoleEndpoints.get(pl);
-                if (endpoint == null && pl.initializePartnerRole)
+                if (endpoint == null && pl.isInitializePartnerRoleSet())
                     throw new IllegalArgumentException("No service name for myRole plink " + pl.getName());
                 PartnerLinkMyRoleImpl myRole = new PartnerLinkMyRoleImpl(this, pl, endpoint);
                 _myRoles.put(pl, myRole);
@@ -679,20 +641,6 @@
     }
 
     /**
-     * De-serialize the compiled process representation from a stream.
-     * 
-     * @param is
-     *            input stream
-     * @return process information from configuration database
-     */
-    private OProcess deserializeCompiledProcess(InputStream is) throws Exception {
-        OProcess compiledProcess;
-        Serializer ofh = new Serializer(is);
-        compiledProcess = ofh.readOProcess();
-        return compiledProcess;
-    }
-
-    /**
      * Get all the services that are implemented by this process.
      * 
      * @return list of qualified names corresponding to the myroles.
@@ -818,27 +766,27 @@
         }
     }
 
-    OProcess getOProcess() {
+    ProcessModel getProcessModel() {
         _hydrationLatch.latch(1);
         try {
-            return _oprocess;
+            return _processModel;
         } finally {
             _hydrationLatch.release(1);
         }
     }
 
-    private MyRoleMessageExchangeImpl newMyRoleMex(InvocationStyle istyle, String mexId, QName target, OPartnerLink oplink,
-            Operation operation) {
+    private MyRoleMessageExchangeImpl newMyRoleMex(InvocationStyle istyle, String mexId, QName target,
+                                                   PartnerLinkModel mplink, Operation operation) {
         MyRoleMessageExchangeImpl mex;
         switch (istyle) {
         case RELIABLE:
-            mex = new ReliableMyRoleMessageExchangeImpl(this, mexId, oplink, operation, target);
+            mex = new ReliableMyRoleMessageExchangeImpl(this, mexId, mplink, operation, target);
             break;
         case TRANSACTED:
-            mex = new TransactedMyRoleMessageExchangeImpl(this, mexId, oplink, operation, target);
+            mex = new TransactedMyRoleMessageExchangeImpl(this, mexId, mplink, operation, target);
             break;
         case UNRELIABLE:
-            mex = new UnreliableMyRoleMessageExchangeImpl(this, mexId, oplink, operation, target);
+            mex = new UnreliableMyRoleMessageExchangeImpl(this, mexId, mplink, operation, target);
             break;
         default:
             throw new AssertionError("Unexpected invocation style: " + istyle);
@@ -872,7 +820,7 @@
 
         _hydrationLatch.latch(1);
         try {
-            OPartnerLink plink = (OPartnerLink) _oprocess.getChild(mexdao.getPartnerLinkModelId());
+            PartnerLinkModel plink = _processModel.getPartnerLink(mexdao.getPartnerLinkModelId());
             if (plink == null) {
                 String errmsg = __msgs.msgDbConsistencyError("MexDao #" + mexdao.getMessageExchangeId()
                         + " referenced unknown pLinkModelId " + mexdao.getPartnerLinkModelId());
@@ -909,7 +857,7 @@
 
         _hydrationLatch.latch(1);
         try {
-            OPartnerLink plink = (OPartnerLink) _oprocess.getChild(mexdao.getPartnerLinkModelId());
+            PartnerLinkModel plink = _processModel.getPartnerLink(mexdao.getPartnerLinkModelId());
             PartnerLinkPartnerRoleImpl prole = _partnerRoles.get(plink);
             return prole.createPartnerRoleMex(mexdao);
         } finally {
@@ -941,29 +889,6 @@
 
     }
 
-    /**
-     * Used by {@link BpelRuntimeContextImpl} constructor. Should only be called from latched context.
-     * 
-     * @return
-     */
-    ReplacementMap getReplacementMap(QName processName) {
-        assert _hydrationLatch.isLatched(1);
-        if (processName.equals(_pid)) return _replacementMap;
-        else
-            try {
-                // We're asked for an older version of this process, fetching it
-                OProcess oprocess = _server.getOProcess(processName);
-                // Older versions may ventually need more expression languages
-                registerExprLang(oprocess);
-
-                return new ReplacementMapImpl(oprocess);
-            } catch (Exception e) {
-                String errmsg = "Error reloading compiled process " + _pid + "; the file appears to be corrupted.";
-                __log.error(errmsg);
-                throw new BpelEngineException(errmsg, e);
-            }
-    }
-
     public boolean isInMemory() {
         return _pconf.isTransient();
     }
@@ -976,7 +901,7 @@
      * Get a hint as to whether this process is hydrated. Note this is only a hint, since things could change.
      */
     public boolean hintIsHydrated() {
-        return _oprocess != null;
+        return _processModel != null;
     }
 
     /** Keep track of the time the process was last used. */
@@ -988,23 +913,23 @@
      * If necessary, create an object in the data store to represent the process. We'll re-use an existing object if it already
      * exists and matches the GUID.
      */
-    private void bounceProcessDAO(BpelDAOConnection conn, final QName pid, final long version, final OProcess oprocess) {
-        __log.debug("Creating process DAO for " + pid + " (guid=" + oprocess.guid + ")");
+    private void bounceProcessDAO(BpelDAOConnection conn, final QName pid, final long version, final ProcessModel mprocess) {
+        __log.debug("Creating process DAO for " + pid + " (guid=" + mprocess.getGuid() + ")");
         try {
             boolean create = true;
             ProcessDAO old = conn.getProcess(pid);
             if (old != null) {
                 __log.debug("Found ProcessDAO for " + pid + " with GUID " + old.getGuid());
-                if (oprocess.guid == null) {
+                if (mprocess.getGuid() == null) {
                     // No guid, old version assume its good
                     create = false;
                 } else {
-                    if (old.getGuid().equals(oprocess.guid)) {
+                    if (old.getGuid().equals(mprocess.getGuid())) {
                         // Guids match, no need to create
                         create = false;
                     } else {
                         // GUIDS dont match, delete and create new
-                        String errmsg = "ProcessDAO GUID " + old.getGuid() + " does not match " + oprocess.guid + "; replacing.";
+                        String errmsg = "ProcessDAO GUID " + old.getGuid() + " does not match " + mprocess.getGuid() + "; replacing.";
                         __log.debug(errmsg);
                         old.delete();
                     }
@@ -1012,8 +937,8 @@
             }
 
             if (create) {
-                ProcessDAO newDao = conn.createProcess(pid, oprocess.getQName(), oprocess.guid, (int) version);
-                for (String correlator : oprocess.getCorrelators()) {
+                ProcessDAO newDao = conn.createProcess(pid, mprocess.getQName(), mprocess.getGuid(), (int) version);
+                for (String correlator : mprocess.getCorrelators()) {
                     newDao.addCorrelator(correlator);
                 }
             }
@@ -1055,9 +980,7 @@
         _server.enqueueRunnable(new ProcessRunnable(worker));
     }
 
-    MyRoleMessageExchange createNewMyRoleMex(final InvocationStyle istyle, final QName targetService, final String operation,
-            final String clientKey) {
-
+    MyRoleMessageExchange createNewMyRoleMex(final InvocationStyle istyle, final QName targetService, final String operation) {
         final String mexId = new GUID().toString();
         _hydrationLatch.latch(1);
         try {
@@ -1069,7 +992,6 @@
                 throw new BpelEngineException("NoSuchOperation: " + operation);
 
             return newMyRoleMex(istyle, mexId, target._endpoint.serviceName, target._plinkDef, op);
-
         } finally {
             _hydrationLatch.release(1);
         }
@@ -1169,53 +1091,25 @@
         }
 
         private void doDehydrate() {
-            _oprocess = null;
+            _processModel = null;
             _partnerRoles = null;
             _myRoles = null;
             _endpointToMyRoleMap = null;
-            _replacementMap = null;
-            _expLangRuntimeRegistry = null;
         }
 
         private void doHydrate() {
             markused();
-            __log.debug("Rehydrating process " + _pconf.getProcessId());
-            try {
-                _oprocess = deserializeCompiledProcess(_pconf.getCBPInputStream());
-            } catch (Exception e) {
-                String errmsg = "Error reloading compiled process " + _pid + "; the file appears to be corrupted.";
-                __log.error(errmsg);
-                throw new BpelEngineException(errmsg, e);
-            }
-
-            _replacementMap = new ReplacementMapImpl(_oprocess);
-
-            // Create an expression language registry for this process
-            _expLangRuntimeRegistry = new ExpressionLanguageRuntimeRegistry();
-            registerExprLang(_oprocess);
-
-            // Checking for registered extension bundles, throw an exception when
-            // a "mustUnderstand" extension is not available
-            for (OProcess.OExtension extension : _oprocess.mustUnderstandExtensions) {
-            	if (extension.mustUnderstand) {
-            		if (_contexts.extensionRegistry.get(extension.namespaceURI) == null) {
-            			String msg = __msgs.msgExtensionMustUnderstandError(_pid, extension.namespaceURI);
-            			__log.error(msg);
-            			throw new BpelEngineException(msg);
-            		}
-            	} else {
-        			__log.warn("The process declares the extension namespace " + extension.namespaceURI + " that is unkown to the engine");
-        		}
-            }
+            _runtime.init(_pconf);
+            _processModel = _runtime.getModel();
 
-            setRoles(_oprocess);
+            setRoles(_processModel);
     		initExternalVariables();
     
             if (!_hydratedOnce) {
                 for (PartnerLinkPartnerRoleImpl prole : _partnerRoles.values()) {
                     if (prole._initialPartner != null) {
                         PartnerRoleChannel channel = _contexts.bindingContext.createPartnerRoleChannel(_pid,
-                                prole._plinkDef.partnerRolePortType, prole._initialPartner);
+                                prole._plinkDef.getPartnerRolePortType(), prole._initialPartner);
                         prole._channel = channel;
                         _partnerChannels.put(prole._initialPartner, prole._channel);
                         EndpointReference epr = channel.getInitialEndpointReference();
@@ -1242,16 +1136,16 @@
             }
 
             if (isInMemory()) {
-                bounceProcessDAO(_inMemDao.getConnection(), _pid, _pconf.getVersion(), _oprocess);
+                bounceProcessDAO(_inMemDao.getConnection(), _pid, _pconf.getVersion(), _processModel);
             } else if (_contexts.isTransacted()) {
                 // If we have a transaction, we do this in the current transaction.
-                bounceProcessDAO(_contexts.dao.getConnection(), _pid, _pconf.getVersion(), _oprocess);
+                bounceProcessDAO(_contexts.dao.getConnection(), _pid, _pconf.getVersion(), _processModel);
             } else {
                 // If we do not have a transaction we need to create one.
                 try {
                     _contexts.execTransaction(new Callable<Object>() {
                         public Object call() throws Exception {
-                            bounceProcessDAO(_contexts.dao.getConnection(), _pid, _pconf.getVersion(), _oprocess);
+                            bounceProcessDAO(_contexts.dao.getConnection(), _pid, _pconf.getVersion(), _processModel);
                             return null;
                         }
                     });
@@ -1273,7 +1167,7 @@
     }
 
     void invokePartner(MessageExchangeDAO mexdao) {
-        OPartnerLink oplink = (OPartnerLink) _oprocess.getChild(mexdao.getPartnerLinkModelId());
+        PartnerLinkModel oplink = (PartnerLinkModel) _processModel.getPartnerLink(mexdao.getPartnerLinkModelId());
         PartnerLinkPartnerRoleImpl partnerRole = _partnerRoles.get(oplink);
         Endpoint partnerEndpoint = getInitialPartnerRoleEndpoint(oplink);
         ODEProcess p2pProcess = null;
@@ -1377,31 +1271,16 @@
      * @param prolemex
      */
     private void p2pWakeup(final MessageExchangeDAO prolemex) {
-
         try {
             doInstanceWork(prolemex.getInstance().getInstanceId(), new Callable<Void>() {
-
                 public Void call() throws Exception {
                     executeContinueInstancePartnerRoleResponseReceived(prolemex);
                     return null;
                 }
-
             });
         } catch (Exception ex) {
             throw new BpelEngineException(ex);
         }
     }
 
-    private void registerExprLang(OProcess oprocess) {
-        for (OExpressionLanguage elang : oprocess.expressionLanguages) {
-            try {
-                _expLangRuntimeRegistry.registerRuntime(elang);
-            } catch (ConfigurationException e) {
-                String msg = __msgs.msgExpLangRegistrationError(elang.expressionLanguageUri, elang.properties);
-                __log.error(msg, e);
-                throw new BpelEngineException(msg, e);
-            }
-        }
-    }
-
 }
\ No newline at end of file

Modified: ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerLinkMyRoleImpl.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerLinkMyRoleImpl.java?rev=683777&r1=683776&r2=683777&view=diff
==============================================================================
--- ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerLinkMyRoleImpl.java (original)
+++ ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerLinkMyRoleImpl.java Thu Aug  7 17:42:36 2008
@@ -18,11 +18,7 @@
  */
 package org.apache.ode.bpel.engine;
 
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
+import java.util.*;
 
 import javax.wsdl.Operation;
 import javax.xml.namespace.QName;
@@ -46,11 +42,11 @@
 import org.apache.ode.bpel.iapi.ProcessState;
 import org.apache.ode.bpel.iapi.MessageExchange.FailureType;
 import org.apache.ode.bpel.iapi.MyRoleMessageExchange.CorrelationStatus;
-import org.apache.ode.bpel.o.OMessageVarType;
-import org.apache.ode.bpel.o.OPartnerLink;
-import org.apache.ode.bpel.o.OProcess;
-import org.apache.ode.bpel.o.OScope;
 import org.apache.ode.bpel.runtime.InvalidProcessException;
+import org.apache.ode.bpel.engine.Messages;
+import org.apache.ode.bpel.rapi.PartnerLinkModel;
+import org.apache.ode.bpel.rapi.CorrelationSetModel;
+import org.apache.ode.bpel.rapi.PropertyAliasModel;
 import org.apache.ode.utils.CollectionUtils;
 import org.apache.ode.utils.ObjectPrinter;
 import org.apache.ode.utils.msg.MessageBundle;
@@ -67,16 +63,16 @@
     /** The local endpoint for this "myrole". */
     public Endpoint _endpoint;
 
-    PartnerLinkMyRoleImpl(ODEProcess process, OPartnerLink plink, Endpoint endpoint) {
+    PartnerLinkMyRoleImpl(ODEProcess process, PartnerLinkModel plink, Endpoint endpoint) {
         super(process, plink);
         _endpoint = endpoint;
     }
 
     public String toString() {
         StringBuffer buf = new StringBuffer("{PartnerLinkRole-");
-        buf.append(_plinkDef.name);
+        buf.append(_plinkDef.getName());
         buf.append('.');
-        buf.append(_plinkDef.myRoleName);
+        buf.append(_plinkDef.getMyRoleName());
         buf.append(" on ");
         buf.append(_endpoint);
         buf.append('}');
@@ -97,7 +93,7 @@
 
         Operation operation = getMyRoleOperation(mex.getOperation());
         if (operation == null) {
-            __log.error(__msgs.msgUnknownOperation(mex.getOperation(), _plinkDef.myRolePortType.getQName()));
+            __log.error(__msgs.msgUnknownOperation(mex.getOperation(), _plinkDef.getMyRolePortType().getQName()));
             MexDaoUtil.setFailed(mex, FailureType.UNKNOWN_OPERATION, mex.getOperation());
             return null;
         }
@@ -186,8 +182,8 @@
                 correlator.removeRoutes(messageRoute.getGroupId(), instanceDao);
 
                 // send process instance event
-                CorrelationMatchEvent evt = new CorrelationMatchEvent(new QName(_process.getOProcess().targetNamespace, _process
-                        .getOProcess().getName()), _process.getProcessDAO().getProcessId(), instanceDao.getInstanceId(), matchedKey);
+                CorrelationMatchEvent evt = new CorrelationMatchEvent(_process.getProcessModel().getQName(),
+                        _process.getProcessDAO().getProcessId(), instanceDao.getInstanceId(), matchedKey);
                 evt.setPortType(mex.getPortType());
                 evt.setOperation(operation.getName());
                 evt.setMexId(mex.getMessageExchangeId());
@@ -216,7 +212,7 @@
                         .getMessageExchangeId(), keys);
 
                 evt.setProcessId(_process.getProcessDAO().getProcessId());
-                evt.setProcessName(new QName(_process.getOProcess().targetNamespace, _process.getOProcess().getName()));
+                evt.setProcessName(_process.getProcessModel().getQName());
                 _process._debugger.onEvent(evt);
 
                 mex.setCorrelationStatus(MyRoleMessageExchange.CorrelationStatus.QUEUED.toString());
@@ -247,8 +243,8 @@
         ProcessInstanceDAO newInstance = processDAO.createInstance(correlator);
 
         // send process instance event
-        NewProcessInstanceEvent evt = new NewProcessInstanceEvent(new QName(_process.getOProcess().targetNamespace, _process
-                .getOProcess().getName()), processDAO.getProcessId(), newInstance.getInstanceId());
+        NewProcessInstanceEvent evt = new NewProcessInstanceEvent(_process.getProcessModel().getQName(),
+                processDAO.getProcessId(), newInstance.getInstanceId());
         evt.setPortType(mex.getPortType());
         evt.setOperation(operation.getName());
         evt.setMexId(mex.getMessageExchangeId());
@@ -261,8 +257,7 @@
 
     @SuppressWarnings("unchecked")
     private Operation getMyRoleOperation(String operationName) {
-        Operation op = _plinkDef.getMyRoleOperation(operationName);
-        return op;
+        return _plinkDef.getMyRoleOperation(operationName);
     }
 
     private CorrelationKey[] computeCorrelationKeys(MessageExchangeDAO mex, Operation operation) {
@@ -270,11 +265,10 @@
         javax.wsdl.Message msgDescription = operation.getInput().getMessage();
         List<CorrelationKey> keys = new ArrayList<CorrelationKey>();
 
-        Set<OScope.CorrelationSet> csets = _plinkDef.getCorrelationSetsForOperation(operation);
+        Set<CorrelationSetModel> csets = _plinkDef.getCorrelationSetsForOperation(operation);
 
-        for (OScope.CorrelationSet cset : csets) {
-            CorrelationKey key = computeCorrelationKey(cset, _process.getOProcess().messageTypes.get(msgDescription.getQName()),
-                    msg);
+        for (CorrelationSetModel cset : csets) {
+            CorrelationKey key = computeCorrelationKey(cset, msgDescription.getQName(), msg);
             keys.add(key);
         }
 
@@ -286,24 +280,14 @@
         return keys.toArray(new CorrelationKey[keys.size()]);
     }
 
-    private CorrelationKey computeCorrelationKey(OScope.CorrelationSet cset, OMessageVarType messagetype, Element msg) {
-        String[] values = new String[cset.properties.size()];
-
+    private CorrelationKey computeCorrelationKey(CorrelationSetModel cset, QName messageName, Element msg) {
+        Set<PropertyAliasModel> aliases = cset.getAliases(messageName);
+        String[] values = new String[aliases.size()];
         int jIdx = 0;
-        for (Iterator j = cset.properties.iterator(); j.hasNext(); ++jIdx) {
-            OProcess.OProperty property = (OProcess.OProperty) j.next();
-            OProcess.OPropertyAlias alias = property.getAlias(messagetype);
-
-            if (alias == null) {
-                // TODO: Throw a real exception! And catch this at compile
-                // time.
-                throw new IllegalArgumentException("No alias matching property '" + property.name + "' with message type '"
-                        + messagetype + "'");
-            }
-
+        for (PropertyAliasModel alias : aliases) {
             String value;
             try {
-                value = _process.extractProperty(msg, alias, msg.toString());
+                value = _process._runtime.extractProperty(msg, alias, msg.toString());
             } catch (FaultException fe) {
                 String emsg = __msgs.msgPropertyAliasDerefFailedOnMessage(alias.getDescription(), fe.getMessage());
                 __log.error(emsg, fe);
@@ -312,8 +296,7 @@
             values[jIdx] = value;
         }
 
-        CorrelationKey key = new CorrelationKey(cset.getId(), values);
-        return key;
+        return new CorrelationKey(cset.getId(), values);
     }
 
 }

Modified: ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerLinkPartnerRoleImpl.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerLinkPartnerRoleImpl.java?rev=683777&r1=683776&r2=683777&view=diff
==============================================================================
--- ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerLinkPartnerRoleImpl.java (original)
+++ ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerLinkPartnerRoleImpl.java Thu Aug  7 17:42:36 2008
@@ -36,7 +36,7 @@
 import org.apache.ode.bpel.iapi.MessageExchange.FailureType;
 import org.apache.ode.bpel.iapi.MessageExchange.MessageExchangePattern;
 import org.apache.ode.bpel.iapi.MessageExchange.Status;
-import org.apache.ode.bpel.o.OPartnerLink;
+import org.apache.ode.bpel.rapi.PartnerLinkModel;
 import org.w3c.dom.Element;
 
 /**
@@ -53,7 +53,7 @@
 
     public PartnerRoleChannel _channel;
 
-    PartnerLinkPartnerRoleImpl(ODEProcess process, OPartnerLink plink, Endpoint initialPartner) {
+    PartnerLinkPartnerRoleImpl(ODEProcess process, PartnerLinkModel plink, Endpoint initialPartner) {
         super(process, plink);
         _initialPartner = initialPartner;
     }

Modified: ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerLinkRoleImpl.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerLinkRoleImpl.java?rev=683777&r1=683776&r2=683777&view=diff
==============================================================================
--- ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerLinkRoleImpl.java (original)
+++ ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerLinkRoleImpl.java Thu Aug  7 17:42:36 2008
@@ -19,24 +19,21 @@
 package org.apache.ode.bpel.engine;
 
 import org.apache.ode.bpel.iapi.EndpointReference;
-import org.apache.ode.bpel.o.OPartnerLink;
+import org.apache.ode.bpel.rapi.PartnerLinkModel;
 
-/**
- * @author Matthieu Riou <mriou at apache dot org>
- */
 abstract class PartnerLinkRoleImpl {
-    protected OPartnerLink _plinkDef;
+    protected PartnerLinkModel _plinkDef;
     protected EndpointReference _initialEPR;
     protected ODEProcess _process;
     protected Contexts _contexts;
 
-    PartnerLinkRoleImpl(ODEProcess process, OPartnerLink plink) {
+    PartnerLinkRoleImpl(ODEProcess process, PartnerLinkModel plink) {
         _plinkDef = plink;
         _process = process;
         _contexts = _process._contexts;
     }
     String getPartnerLinkName() {
-        return _plinkDef.name;
+        return _plinkDef.getName();
     }
     /**
      * Get the initial value of this role's EPR. This value is obtained from