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/01 02:29:45 UTC

svn commit: r681565 [2/5] - in /ode/branches/rtver: ./ bpel-api/src/main/java/org/apache/ode/bpel/common/ bpel-api/src/main/java/org/apache/ode/bpel/explang/ bpel-api/src/main/java/org/apache/ode/bpel/pmapi/ bpel-compiler/src/main/java/org/apache/ode/b...

Added: ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/InvalidProcessException.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/InvalidProcessException.java?rev=681565&view=auto
==============================================================================
--- ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/InvalidProcessException.java (added)
+++ ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/InvalidProcessException.java Thu Jul 31 17:29:41 2008
@@ -0,0 +1,74 @@
+/*
+ * 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.rtrep.rapi;
+
+/**
+ * A run-time exception indicating that the process is invalid. This should not
+ * normally occur: that is, a process should be found to be invalid before it is
+ * executed. Therefore, this can be viewed as a rather rare and serious
+ * condition.
+ */
+public class InvalidProcessException extends RuntimeException {
+    private static final long serialVersionUID = 9184731070635430159L;
+
+    public final static int DEFAULT_CAUSE_CODE = 0;
+
+    public final static int RETIRED_CAUSE_CODE = 1;
+
+    private final int causeCode;
+
+    public InvalidProcessException(String msg, Throwable cause) {
+        super(msg, cause);
+        this.causeCode = DEFAULT_CAUSE_CODE;
+    }
+
+    public InvalidProcessException(String msg) {
+        super(msg);
+        this.causeCode = DEFAULT_CAUSE_CODE;
+    }
+
+    public InvalidProcessException(Exception cause) {
+        super(cause);
+        this.causeCode = DEFAULT_CAUSE_CODE;
+    }
+
+    /**
+     * @param causeCode
+     */
+    public InvalidProcessException(final int causeCode) {
+        super();
+        this.causeCode = causeCode;
+    }
+
+    /**
+     * @param message
+     * @param causeCode
+     */
+    public InvalidProcessException(String message, final int causeCode) {
+        super(message);
+        this.causeCode = causeCode;
+    }
+
+    /**
+     * @return the cause code
+     */
+    public int getCauseCode() {
+        return causeCode;
+    }
+}

Added: ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/NoSuchOperationException.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/NoSuchOperationException.java?rev=681565&view=auto
==============================================================================
--- ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/NoSuchOperationException.java (added)
+++ ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/NoSuchOperationException.java Thu Jul 31 17:29:41 2008
@@ -0,0 +1,12 @@
+/**
+ * 
+ */
+package org.apache.ode.bpel.rtrep.rapi;
+
+/**
+ * @author mszefler
+ *
+ */
+public class NoSuchOperationException extends Exception {
+
+}

Added: ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/OdeRTInstance.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/OdeRTInstance.java?rev=681565&view=auto
==============================================================================
--- ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/OdeRTInstance.java (added)
+++ ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/OdeRTInstance.java Thu Jul 31 17:29:41 2008
@@ -0,0 +1,75 @@
+package org.apache.ode.bpel.rtrep.rapi;
+
+import java.io.IOException;
+import java.io.OutputStream;
+
+
+public interface OdeRTInstance {
+
+    enum InvokeResponseType {
+        REPLY,
+        FAULT, 
+        FAILURE
+    }
+
+    /**
+     * Set the execution context. 
+     * @param ctx
+     */
+    void setContext(OdeRTInstanceContext ctx);
+
+
+    /**
+     * Called when the engine creates an instance (i.e. a create-instance mex is received).
+     * @param messageExchangeId message exchange id for create-instance mex
+     */
+    void onCreateInstance(String messageExchangeId);
+
+
+    /**
+     * Called when the engine detects a matching selector (i.e. when a partner invokes the process). 
+     * 
+     * @param selectId selector identifier 
+     * @param messageExchangeId message exchange identifier
+     * @param selectorIdx which selector in the set matched
+     */
+    void onSelectEvent(String selectId, String messageExchangeId, int selectorIdx);
+
+    /**
+     * Called when an invoke received a response. 
+     * @param invokeId
+     * @param mexid
+     */
+    void onInvokeResponse(String invokeId, InvokeResponseType irt, String mexid);
+
+    
+    /**
+     * Called when the engine determines that a registered timer is ready to fire. 
+     * 
+     * @param timerId
+     */
+    void onTimerEvent(String timerId);
+
+    /**
+     * @return
+     */
+    boolean execute();
+
+    /**
+     * @param channel
+     * @param activityId
+     * @param action
+     */
+    void recoverActivity(String channel, long activityId, String action, FaultInfo fault);
+
+    /**
+     * Save the execution state into the given output stream, and return a cached representation of the state. The cached
+     * representation will be used by the engine to speed up state recovery (i.e. when de-serializing can be avoided).   
+     * 
+     * @return cached 
+     */
+    Object saveState(OutputStream os) throws IOException ;
+    
+
+	
+}

Added: ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/OdeRTInstanceContext.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/OdeRTInstanceContext.java?rev=681565&view=auto
==============================================================================
--- ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/OdeRTInstanceContext.java (added)
+++ ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/OdeRTInstanceContext.java Thu Jul 31 17:29:41 2008
@@ -0,0 +1,61 @@
+/*
+ * 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.rtrep.rapi;
+
+import org.apache.ode.bpel.evt.ProcessInstanceEvent;
+
+/**
+ *<p>A collection of interfaces that are implemented by the engine for the 
+ *benefit of the runtime. These interfaces expose facilities such as variables,
+ *communication, timed interrupts, process control, and recovery management. 
+ *</p>
+ *<p> 
+ * The basic idea here is that the engine provides "language-neutral" facilities,
+ * and the runtime is responsible for all the BPEL-specifics. In theory, one could
+ * implement a non-BPEL runtime on top of the engine. In other words, this interface
+ * is the wall that prevents BPEL, and JACOB specific things from getting into the
+ * engine (some concesssion is made to BPEL when it comes to the notion of partner
+ * links).
+ * </p>
+ */
+public interface OdeRTInstanceContext extends IOContext, ProcessControlContext, RecoveryContext, VariableContext {
+
+	Long getPid();
+
+	/**
+	 * Sends the bpel event.
+	 * 
+	 * @param event
+	 */
+	void sendEvent(ProcessInstanceEvent event);
+
+	/**
+	 * Generate a unique (and monotonic) ID in the context of this instance.
+	 * 
+	 * @return
+	 */
+	long genId();
+
+    /**
+     * @param mexId
+     * @param optionalFaultData
+     */
+    void noreply(String mexId, FaultInfo optionalFaultData);
+	
+}

Added: ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/OdeRuntime.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/OdeRuntime.java?rev=681565&view=auto
==============================================================================
--- ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/OdeRuntime.java (added)
+++ ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/OdeRuntime.java Thu Jul 31 17:29:41 2008
@@ -0,0 +1,23 @@
+package org.apache.ode.bpel.rtrep.rapi;
+
+import org.apache.ode.bpel.iapi.ProcessConf;
+import org.apache.ode.bpel.common.FaultException;
+import org.apache.ode.jacob.soup.ReplacementMap;
+import org.w3c.dom.Element;
+
+import javax.xml.namespace.QName;
+
+public interface OdeRuntime {
+    
+    void init(ProcessConf pconf);
+
+    OdeRTInstance newInstance(Object state);
+
+    ReplacementMap getReplacementMap(QName processName);
+
+    ProcessModel getModel();
+
+    void clear();
+
+    String extractProperty(Element msgData, PropertyAliasModel alias, String target) throws FaultException;
+}

Added: ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/PartnerLink.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/PartnerLink.java?rev=681565&view=auto
==============================================================================
--- ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/PartnerLink.java (added)
+++ ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/PartnerLink.java Thu Jul 31 17:29:41 2008
@@ -0,0 +1,8 @@
+package org.apache.ode.bpel.rtrep.rapi;
+
+public interface PartnerLink extends ScopedObject {
+
+	String getName();
+
+	PartnerLinkModel getModel();
+}

Added: ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/PartnerLinkModel.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/PartnerLinkModel.java?rev=681565&view=auto
==============================================================================
--- ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/PartnerLinkModel.java (added)
+++ ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/PartnerLinkModel.java Thu Jul 31 17:29:41 2008
@@ -0,0 +1,35 @@
+package org.apache.ode.bpel.rtrep.rapi;
+
+import javax.wsdl.Operation;
+import javax.wsdl.PortType;
+import java.util.Set;
+
+public interface PartnerLinkModel {
+	
+	int getId();
+	
+	String getName();
+	
+	boolean hasMyRole();
+
+	boolean hasPartnerRole();
+
+	String getMyRoleName();
+
+	Operation getMyRoleOperation(String operation);
+
+	String getPartnerRoleName();
+	
+	Operation getPartnerRoleOperation(String operation);
+
+	boolean isInitializePartnerRoleSet();
+
+	PortType getMyRolePortType();
+
+	PortType getPartnerRolePortType();
+
+	boolean isCreateInstanceOperation(Operation operation);
+
+    Set<CorrelationSetModel> getCorrelationSetsForOperation(Operation operation);
+
+}

Added: ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/ProcessControlContext.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/ProcessControlContext.java?rev=681565&view=auto
==============================================================================
--- ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/ProcessControlContext.java (added)
+++ ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/ProcessControlContext.java Thu Jul 31 17:29:41 2008
@@ -0,0 +1,33 @@
+package org.apache.ode.bpel.rtrep.rapi;
+
+
+/**
+ * Engine-provided context for process lifecycle management. 
+ * 
+ * @author mszefler
+ *
+ */
+public interface ProcessControlContext {
+
+	void forceFlush();
+
+	/**
+	 * Should be invoked by process template, signalling process completion with
+	 * no faults.
+	 * 
+	 */
+	void completedOk();
+
+	/**
+	 * Should be invoked by process template, signalling process completion with
+	 * fault.
+	 */
+	void completedFault(FaultInfo faultData);
+
+	/**
+	 * Terminates the process / sets state flag to terminate and ceases all
+	 * processing for the instance.
+	 */
+	void terminate();
+
+}

Added: ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/ProcessModel.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/ProcessModel.java?rev=681565&view=auto
==============================================================================
--- ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/ProcessModel.java (added)
+++ ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/ProcessModel.java Thu Jul 31 17:29:41 2008
@@ -0,0 +1,24 @@
+package org.apache.ode.bpel.rtrep.rapi;
+
+import java.util.Collection;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+public interface ProcessModel {
+
+//	OdeRTInstance newInstance();
+
+	PartnerLinkModel getPartnerLink(String name);
+	
+	PartnerLinkModel getPartnerLink(int partnerLinkModelId);
+
+	Collection<? extends PartnerLinkModel> getAllPartnerLinks();
+
+	String getGuid();
+
+	QName getQName();
+
+	List<String> getCorrelators();
+
+}

Added: ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/PropertyAliasModel.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/PropertyAliasModel.java?rev=681565&view=auto
==============================================================================
--- ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/PropertyAliasModel.java (added)
+++ ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/PropertyAliasModel.java Thu Jul 31 17:29:41 2008
@@ -0,0 +1,6 @@
+package org.apache.ode.bpel.rtrep.rapi;
+
+public interface PropertyAliasModel {
+    String getDescription();
+}
+

Added: ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/RecoveryContext.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/RecoveryContext.java?rev=681565&view=auto
==============================================================================
--- ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/RecoveryContext.java (added)
+++ ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/RecoveryContext.java Thu Jul 31 17:29:41 2008
@@ -0,0 +1,22 @@
+package org.apache.ode.bpel.rtrep.rapi;
+
+import java.util.Date;
+
+import org.w3c.dom.Element;
+
+/**
+ * Engine-provided methods for recovery management. 
+ * 
+ * @author mszefler
+ *
+ */
+public interface RecoveryContext {
+	
+	void registerActivityForRecovery(String channel, long activityId,
+			String reason, Date dateTime, Element details, String[] actions,
+			int retries);
+
+	void unregisterActivityForRecovery(String channel);
+
+
+}

Added: ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/ScopedObject.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/ScopedObject.java?rev=681565&view=auto
==============================================================================
--- ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/ScopedObject.java (added)
+++ ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/ScopedObject.java Thu Jul 31 17:29:41 2008
@@ -0,0 +1,6 @@
+package org.apache.ode.bpel.rtrep.rapi;
+
+public interface ScopedObject {
+
+	long getScopeId();
+}

Added: ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/Selector.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/Selector.java?rev=681565&view=auto
==============================================================================
--- ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/Selector.java (added)
+++ ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/Selector.java Thu Jul 31 17:29:41 2008
@@ -0,0 +1,32 @@
+package org.apache.ode.bpel.rtrep.rapi;
+
+import org.apache.ode.bpel.common.CorrelationKey;
+
+public interface Selector {
+
+    /**
+     * @return
+     */
+    boolean isOneWay();
+
+    /**
+     * @return
+     */
+    PartnerLink getPartnerLink();
+
+    /**
+     * @return
+     */
+    String getOperation();
+
+    /**
+     * @return
+     */
+    String getMesageExchangeId();
+
+    /**
+     * @return
+     */
+    CorrelationKey getCorrelationKey();
+
+}

Added: ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/UninitializedPartnerEPR.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/UninitializedPartnerEPR.java?rev=681565&view=auto
==============================================================================
--- ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/UninitializedPartnerEPR.java (added)
+++ ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/UninitializedPartnerEPR.java Thu Jul 31 17:29:41 2008
@@ -0,0 +1,18 @@
+/**
+ * 
+ */
+package org.apache.ode.bpel.rtrep.rapi;
+
+/**
+ * 
+ * Indicates that an IO operation was attempted on a partner whose EPR was not available. 
+ * 
+ * @author mszefler
+ *
+ */
+public class UninitializedPartnerEPR extends Exception {
+
+    
+    private static final long serialVersionUID = -3789589341379475183L;
+
+}

Added: ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/UninitializedVariableException.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/UninitializedVariableException.java?rev=681565&view=auto
==============================================================================
--- ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/UninitializedVariableException.java (added)
+++ ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/UninitializedVariableException.java Thu Jul 31 17:29:41 2008
@@ -0,0 +1,15 @@
+/**
+ * 
+ */
+package org.apache.ode.bpel.rtrep.rapi;
+
+/**
+ * Indicates that the engine could not complete an operation because a variable was not initialized.
+ * 
+ * @author mszefler
+ * 
+ */
+public class UninitializedVariableException extends Exception {
+    private static final long serialVersionUID = -5471946556457679403L;
+
+}

Added: ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/Variable.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/Variable.java?rev=681565&view=auto
==============================================================================
--- ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/Variable.java (added)
+++ ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/Variable.java Thu Jul 31 17:29:41 2008
@@ -0,0 +1,7 @@
+package org.apache.ode.bpel.rtrep.rapi;
+
+public interface Variable extends ScopedObject {
+
+	String getName();
+	
+}

Added: ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/VariableContext.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/VariableContext.java?rev=681565&view=auto
==============================================================================
--- ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/VariableContext.java (added)
+++ ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/rapi/VariableContext.java Thu Jul 31 17:29:41 2008
@@ -0,0 +1,171 @@
+package org.apache.ode.bpel.rtrep.rapi;
+
+import java.util.Collection;
+
+import javax.xml.namespace.QName;
+
+import org.apache.ode.bpel.common.CorrelationKey;
+import org.apache.ode.bpel.common.FaultException;
+import org.apache.ode.bpel.evar.IncompleteKeyException;
+import org.apache.ode.bpel.evar.ExternalVariableModuleException;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ * Engine provided methods for variable management.
+ * 
+ * @author mszefler
+ *
+ */
+public interface VariableContext {
+
+	/**
+	 * Create a scope instance object. As far as the engine is concerned
+	 * a scope is an abstract entity for grouping variables of various sorts.
+	 * 
+	 * @param parentScopeId
+	 *            id of parent scope (null if root scope)
+	 * @param scopeType
+	 *            the type of scope, i.e. the name of the scope
+	 * 
+	 * @return scope instance identifier
+	 */
+	Long createScopeInstance(Long parentScopeId, String scopename,
+			int scopemodelid);
+
+	
+	/**
+	 * Checks for variable initialization, i.e. has had a 'write'
+	 * 
+	 * @param variable
+	 *            variable
+	 * 
+	 * @return <code>true</code> if initialized
+	 */
+	boolean isVariableInitialized(Variable variable);
+
+	/** 
+	 * Fetch variable data from store. 
+	 */
+	Node fetchVariableData(Variable var, boolean forWriting);
+
+	/**
+	 * Save changes to variable. 
+	 * @param var variable identifier
+	 * @param changes changes
+	 */
+	void commitChanges(Variable var, Node changes);
+
+	/**
+	 * Initialize variable with a value. 
+	 * @param var variable identifier
+	 * @param initData value
+	 * @return mutable copy of data
+	 */
+	Node initializeVariable(Variable var, Node initData);
+
+    Node readExtVar(Variable variable, Element reference) throws ExternalVariableModuleException;
+
+    /**
+	 * Read variable property. Variable properties are simple nv-pair
+	 * annotations that can be assigned to each variable. 
+	 * @param variable
+	 * @param property
+	 * @return
+	 */
+	String readVariableProperty(Variable variable, QName property) throws UninitializedVariableException;
+
+	/**
+ 	 * Write variable property.  
+	 * @param variable
+	 * @param property
+	 * @param value
+	 * @throws UninitializedVariableException 
+	 */
+	void writeVariableProperty(Variable variable, QName property, String value) throws UninitializedVariableException;
+
+	
+	/**
+	 * Initializes endpoint references for partner links inside a scope.
+	 * 
+	 * @param parentScopeId
+	 * @param partnerLinks
+	 */
+	void initializePartnerLinks(Long parentScopeId,
+			Collection<? extends PartnerLinkModel> partnerLinks);
+
+
+	/**
+	 * Fetches the my-role endpoint reference data.
+	 * 
+	 * @param plink
+	 * @return
+	 * @throws FaultException
+	 */
+	Element fetchMyRoleEndpointReferenceData(PartnerLink plink);
+
+	Element fetchPartnerRoleEndpointReferenceData(PartnerLink pLink);
+
+	/**
+	 * Determine if the partner role of an endpoint has been initialized (either
+	 * explicitly throug assginment or via the deployment descriptor)
+	 * 
+	 * @param pLink
+	 *            partner link
+	 * @return
+	 */
+	boolean isPartnerRoleEndpointInitialized(PartnerLink pLink);
+
+	/**
+	 * Fetches our session id associated with the partner link instance. This
+	 * will always return a non-null value.
+	 * 
+	 * @param pLink
+	 *            partner link
+	 */
+	String fetchMySessionId(PartnerLink pLink);
+
+	/**
+	 * Fetches the partner's session id associated with the partner link
+	 * instance.
+	 * 
+	 * @param pLink
+	 *            partner link
+	 */
+	String fetchPartnersSessionId(PartnerLink pLink);
+
+	/**
+	 * Initialize the partner's session id for this partner link instance.
+	 * 
+	 * @param pLink
+	 *            partner link
+	 * @param session
+	 *            session identifier
+	 */
+	void initializePartnersSessionId(PartnerLink pLink, String session);
+
+	
+
+	/**
+	 * Writes a partner EPR.
+	 * 
+	 * @param variable
+	 * @param data
+	 * @throws FaultException
+	 */
+	void writeEndpointReference(PartnerLink partnerLink, Element data);
+
+	Node convertEndpointReference(Element epr, Node targetNode);
+
+	//
+	// Correlation variables
+	//
+	
+	boolean isCorrelationInitialized(CorrelationSet cset);
+
+	CorrelationKey readCorrelation(CorrelationSet cset);
+
+	void writeCorrelation(CorrelationSet cset, QName[] propNames,
+			CorrelationKey correlation);
+
+}

Modified: ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/ACTIVITY.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/ACTIVITY.java?rev=681565&r1=681564&r2=681565&view=diff
==============================================================================
--- ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/ACTIVITY.java (original)
+++ ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/ACTIVITY.java Thu Jul 31 17:29:41 2008
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.ode.bpel.runtime;
+package org.apache.ode.bpel.rtrep.v2;
 
 import org.apache.ode.bpel.evt.ActivityDisabledEvent;
 import java.io.Serializable;
@@ -24,21 +24,13 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.ode.bpel.common.FaultException;
 
 import org.apache.ode.bpel.evt.ActivityEvent;
 import org.apache.ode.bpel.evt.EventContext;
 import org.apache.ode.bpel.evt.ScopeEvent;
 import org.apache.ode.bpel.evt.VariableReadEvent;
-import org.apache.ode.bpel.explang.EvaluationContext;
-import org.apache.ode.bpel.o.OActivity;
-import org.apache.ode.bpel.o.OConstants;
-import org.apache.ode.bpel.o.OLink;
-import org.apache.ode.bpel.o.OMessageVarType;
-import org.apache.ode.bpel.o.OMessageVarType.Part;
+import org.apache.ode.bpel.common.FaultException;
 import org.apache.ode.jacob.IndexedObject;
-import org.apache.ode.bpel.evar.ExternalVariableModuleException;
-import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 
 /**
@@ -95,7 +87,7 @@
         }
         _scopeFrame.fillEventInfo(event);
         fillEventContext(event);
-        getBpelRuntimeContext().sendEvent(event);
+        getBpelRuntime().sendEvent(event);
     }
 
     /**
@@ -104,9 +96,8 @@
      */
     protected void fillEventContext(ScopeEvent event)
     {
-        EventContext eventContext = new EventContextImpl(_scopeFrame.oscope,
-                                                            _scopeFrame.scopeInstanceId,
-                                                            getBpelRuntimeContext());
+        EventContext eventContext = new EventContextImpl(
+                _scopeFrame.oscope, _scopeFrame.scopeInstanceId, getBpelRuntime());
         event.eventContext = eventContext;
     }
 
@@ -136,7 +127,7 @@
     }
 
     protected EvaluationContext getEvaluationContext() {
-        return new ExprEvaluationContextImpl(_scopeFrame, getBpelRuntimeContext());
+        return new ExprEvaluationContextImpl(_scopeFrame, getBpelRuntime());
     }
 
     private int getLineNo() {
@@ -146,43 +137,14 @@
         return -1;
     }
 
-    //
-    // Syntactic sugar for methods that used to be on BpelRuntimeContext.. 
-    //
-    
-    Node fetchVariableData(VariableInstance variable, boolean forWriting) 
-        throws FaultException
-    {
-    	return _scopeFrame.fetchVariableData(getBpelRuntimeContext(), variable, forWriting);
-	}
-
-    Node fetchVariableData(VariableInstance var, OMessageVarType.Part part, boolean forWriting)
-        throws FaultException 
-    {
-      return _scopeFrame.fetchVariableData(getBpelRuntimeContext(), var, part, forWriting);
-    }
-    
-    Node initializeVariable(VariableInstance lvar, Node val) 
-        throws ExternalVariableModuleException
-    {
-    	return _scopeFrame.initializeVariable(getBpelRuntimeContext(), lvar, val);
-    }
-
-    void commitChanges(VariableInstance lval, Node lvalue) 
-        throws ExternalVariableModuleException
-    {
-    	_scopeFrame.commitChanges(getBpelRuntimeContext(),lval, lvalue);
-	}
-
-    Node getPartData(Element message, Part part) {
-    	return _scopeFrame.getPartData(message, part);
+    Node fetchVariableData(VariableInstance variable, boolean forWriting) throws FaultException {
+        if (variable.declaration.extVar != null) {
+            return getBpelRuntime().fetchVariableData(_scopeFrame.resolve(variable.declaration.extVar.related), forWriting);
+        } else {
+            return getBpelRuntime().fetchVariableData(variable, forWriting);
+        }
     }
 
-    
-    //
-    // End syntactic sugar.
-    //
-    
     public static final class Key implements Serializable {
         private static final long serialVersionUID = 1L;
 

Modified: ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/ACTIVITYGUARD.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/ACTIVITYGUARD.java?rev=681565&r1=681564&r2=681565&view=diff
==============================================================================
--- ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/ACTIVITYGUARD.java (original)
+++ ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/ACTIVITYGUARD.java Thu Jul 31 17:29:41 2008
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.ode.bpel.runtime;
+package org.apache.ode.bpel.rtrep.v2;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -26,20 +26,16 @@
 import org.apache.ode.bpel.evt.ActivityExecStartEvent;
 import org.apache.ode.bpel.evt.ActivityFailureEvent;
 import org.apache.ode.bpel.evt.ActivityRecoveryEvent;
-import org.apache.ode.bpel.o.OActivity;
-import org.apache.ode.bpel.o.OExpression;
-import org.apache.ode.bpel.o.OLink;
-import org.apache.ode.bpel.o.OScope;
-import org.apache.ode.bpel.o.OFailureHandling;
-import org.apache.ode.bpel.runtime.channels.FaultData;
-import org.apache.ode.bpel.runtime.channels.LinkStatusChannelListener;
-import org.apache.ode.bpel.runtime.channels.ParentScopeChannel;
-import org.apache.ode.bpel.runtime.channels.ParentScopeChannelListener;
-import org.apache.ode.bpel.runtime.channels.TerminationChannelListener;
-import org.apache.ode.bpel.runtime.channels.ActivityRecoveryChannel;
-import org.apache.ode.bpel.runtime.channels.ActivityRecoveryChannelListener;
-import org.apache.ode.bpel.runtime.channels.TimerResponseChannel;
-import org.apache.ode.bpel.runtime.channels.TimerResponseChannelListener;
+import org.apache.ode.bpel.rtrep.v2.channels.FaultData;
+import org.apache.ode.bpel.rtrep.v2.channels.LinkStatusChannelListener;
+import org.apache.ode.bpel.rtrep.v2.channels.ParentScopeChannel;
+import org.apache.ode.bpel.rtrep.v2.channels.ParentScopeChannelListener;
+import org.apache.ode.bpel.rtrep.v2.channels.TerminationChannelListener;
+import org.apache.ode.bpel.rtrep.v2.channels.ActivityRecoveryChannel;
+import org.apache.ode.bpel.rtrep.v2.channels.ActivityRecoveryChannelListener;
+import org.apache.ode.bpel.rtrep.v2.channels.TimerResponseChannel;
+import org.apache.ode.bpel.rtrep.v2.channels.TimerResponseChannelListener;
+import org.apache.ode.bpel.rtrep.rapi.InvalidProcessException;
 import org.apache.ode.jacob.ChannelListener;
 import org.apache.ode.jacob.SynchChannel;
 
@@ -135,8 +131,8 @@
         if (transitionCondition == null)
             return true;
 
-        return getBpelRuntimeContext().getExpLangRuntime().evaluateAsBoolean(transitionCondition,
-                new ExprEvaluationContextImpl(_scopeFrame, getBpelRuntimeContext()));
+        return getBpelRuntime().getExpLangRuntime().evaluateAsBoolean(transitionCondition,
+                new ExprEvaluationContextImpl(_scopeFrame, getBpelRuntime()));
 
     }
 
@@ -154,7 +150,7 @@
             return _linkVals.values().contains(Boolean.TRUE);
 
         try {
-            return getBpelRuntimeContext().getExpLangRuntime().evaluateAsBoolean(_oactivity.joinCondition,
+            return getBpelRuntime().getExpLangRuntime().evaluateAsBoolean(_oactivity.joinCondition,
                     new ExprEvaluationContextImpl(null, null,_linkVals));
         } catch (Exception e) {
             String msg = "Unexpected error evaluating a join condition: " + _oactivity.joinCondition;
@@ -180,7 +176,7 @@
 
     /**
      * Intercepts the
-     * {@link ParentScopeChannel#completed(org.apache.ode.bpel.runtime.channels.FaultData, java.util.Set<org.apache.ode.bpel.runtime.CompensationHandler>)}
+     * {@link ParentScopeChannel#completed(org.apache.ode.bpel.rtrep.v2.channels.FaultData, java.util.Set<org.apache.ode.bpel.rtrep.v2.CompensationHandler>)}
      * call, to evaluate transition conditions before returning to the parent.
      */
     private class TCONDINTERCEPT extends BpelJacobRunnable {
@@ -258,7 +254,7 @@
                     Date future = new Date(new Date().getTime() + 
                         (failureHandling == null ? 0L : failureHandling.retryDelay * 1000));
                     final TimerResponseChannel timerChannel = newChannel(TimerResponseChannel.class);
-                    getBpelRuntimeContext().registerTimer(timerChannel, future);
+                    getBpelRuntime().registerTimer(timerChannel, future);
                     object(false, new TimerResponseChannelListener(timerChannel) {
                         private static final long serialVersionUID = -261911108068231376L;
                             public void onTimeout() {
@@ -276,7 +272,7 @@
                         __log.debug("ActivityRecovery: Activity " + _self.aId + " requires recovery");
                     sendEvent(new ActivityFailureEvent(_failure.reason));
                     final ActivityRecoveryChannel recoveryChannel = newChannel(ActivityRecoveryChannel.class);
-                    getBpelRuntimeContext().registerActivityForRecovery(
+                    getBpelRuntime().registerActivityForRecovery(
                         recoveryChannel, _self.aId, _failure.reason, _failure.dateTime, _failure.data,
                         new String[] { "retry", "cancel", "fault" }, _failure.retryCount);
                     object(false, new ActivityRecoveryChannelListener(recoveryChannel) {
@@ -285,7 +281,7 @@
                             if (__log.isDebugEnabled())
                                 __log.debug("ActivityRecovery: Retrying activity " + _self.aId + " (user initiated)");
                             sendEvent(new ActivityRecoveryEvent("retry"));
-                            getBpelRuntimeContext().unregisterActivityForRecovery(recoveryChannel);
+                            getBpelRuntime().unregisterActivityForRecovery(recoveryChannel);
                             ++_failure.retryCount;
                             startGuardedActivity();
                         }
@@ -293,14 +289,14 @@
                             if (__log.isDebugEnabled())
                                 __log.debug("ActivityRecovery: Cancelling activity " + _self.aId + " (user initiated)");
                             sendEvent(new ActivityRecoveryEvent("cancel"));
-                            getBpelRuntimeContext().unregisterActivityForRecovery(recoveryChannel);
+                            getBpelRuntime().unregisterActivityForRecovery(recoveryChannel);
                             cancelled();
                         }
                         public void fault(FaultData faultData) {
                             if (__log.isDebugEnabled())
                                 __log.debug("ActivityRecovery: Faulting activity " + _self.aId + " (user initiated)");
                             sendEvent(new ActivityRecoveryEvent("fault"));
-                            getBpelRuntimeContext().unregisterActivityForRecovery(recoveryChannel);
+                            getBpelRuntime().unregisterActivityForRecovery(recoveryChannel);
                             if (faultData == null)
                                 faultData = createFault(OFailureHandling.FAILURE_FAULT_NAME, _self.o, _failure.reason);
                             completed(faultData, CompensationHandler.emptySet());
@@ -311,7 +307,7 @@
                         public void terminate() {
                             if (__log.isDebugEnabled())
                                 __log.debug("ActivityRecovery: Cancelling activity " + _self.aId + " (terminated by scope)");
-                            getBpelRuntimeContext().unregisterActivityForRecovery(recoveryChannel);
+                            getBpelRuntime().unregisterActivityForRecovery(recoveryChannel);
                             cancelled();
                         }
                     }));

Modified: ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/ASSIGN.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/ASSIGN.java?rev=681565&r1=681564&r2=681565&view=diff
==============================================================================
--- ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/ASSIGN.java (original)
+++ ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/ASSIGN.java Thu Jul 31 17:29:41 2008
@@ -16,37 +16,22 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.ode.bpel.runtime;
+package org.apache.ode.bpel.rtrep.v2;
 
 import java.util.List;
 
 import javax.xml.namespace.QName;
-import java.net.URI;
+import java.io.StringWriter;
+import java.io.PrintWriter;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.ode.bpel.common.FaultException;
-import org.apache.ode.bpel.compiler.bom.ExtensibilityQNames;
 import org.apache.ode.bpel.evt.PartnerLinkModificationEvent;
 import org.apache.ode.bpel.evt.ScopeEvent;
 import org.apache.ode.bpel.evt.VariableModificationEvent;
-import org.apache.ode.bpel.explang.EvaluationContext;
-import org.apache.ode.bpel.o.OAssign;
-import org.apache.ode.bpel.o.OElementVarType;
-import org.apache.ode.bpel.o.OExpression;
-import org.apache.ode.bpel.o.OLink;
-import org.apache.ode.bpel.o.OMessageVarType;
-import org.apache.ode.bpel.o.OScope;
-import org.apache.ode.bpel.o.OAssign.DirectRef;
-import org.apache.ode.bpel.o.OAssign.LValueExpression;
-import org.apache.ode.bpel.o.OAssign.PropertyRef;
-import org.apache.ode.bpel.o.OAssign.VariableRef;
-import org.apache.ode.bpel.o.OMessageVarType.Part;
-import org.apache.ode.bpel.o.OProcess.OProperty;
-import org.apache.ode.bpel.o.OScope.Variable;
-import org.apache.ode.bpel.runtime.channels.FaultData;
-import org.apache.ode.bpel.runtime.extension.ExtensionContext;
-import org.apache.ode.bpel.runtime.extension.ExtensionOperation;
+import org.apache.ode.bpel.rtrep.v2.channels.FaultData;
+import org.apache.ode.bpel.rtrep.common.extension.ExtensionContext;
 import org.apache.ode.utils.DOMUtils;
 import org.apache.ode.utils.Namespaces;
 import org.apache.ode.utils.msg.MessageBundle;
@@ -61,7 +46,7 @@
 
 /**
  * Assign activity run-time template.
- * 
+ *
  * @author Ode team
  * @author Tammo van Lessen (University of Stuttgart) - extensionAssignOperation
  */
@@ -85,16 +70,16 @@
         for (OAssign.OAssignOperation operation : oassign.operations) {
             try {
                 if (operation instanceof OAssign.Copy) {
-                	copy((OAssign.Copy)operation);
+                    copy((OAssign.Copy)operation);
                 } else if (operation instanceof OAssign.ExtensionAssignOperation) {
-                	invokeExtensionAssignOperation((OAssign.ExtensionAssignOperation)operation);
+                    invokeExtensionAssignOperation((OAssign.ExtensionAssignOperation)operation);
                 }
             } catch (FaultException fault) {
                 faultData = createFault(fault.getQName(), operation, fault
                         .getMessage());
                 break;
             } catch (ExternalVariableModuleException e) {
-            	__log.error("Exception while initializing external variable", e);
+                __log.error("Exception while initializing external variable", e);
                 _self.parent.failure(e.toString(), null);
                 return;
             }
@@ -119,7 +104,7 @@
     }
 
     private Node evalLValue(OAssign.LValue to) throws FaultException, ExternalVariableModuleException {
-        final BpelRuntimeContext napi = getBpelRuntimeContext();
+        final RuntimeInstanceImpl napi = getBpelRuntime();
         Node lval = null;
         if (!(to instanceof OAssign.PartnerLinkRef)) {
             VariableInstance lvar = _scopeFrame.resolve(to.getVariable());
@@ -133,7 +118,7 @@
                     val = tempwrapper;
                 } else doc.appendChild(val);
                 // Only external variables need to be initialized, others are new and going to be overwtitten
-                if (lvar.declaration.extVar != null) lval = initializeVariable(lvar, val);
+                if (lvar.declaration.extVar != null) lval = getBpelRuntime().initializeVariable(lvar, val);
                 else lval = val;
             } else
                 lval = fetchVariableData(lvar, true);
@@ -141,7 +126,7 @@
         return lval;
     }
 
-	/**
+    /**
      * Get the r-value. There are several possibilities:
      * <ul>
      * <li>a message is selected - an element representing the whole message is
@@ -172,11 +157,10 @@
             __log.debug("Evaluating FROM expression \"" + from + "\".");
 
         Node retVal;
-        if (from instanceof DirectRef) {
+        if (from instanceof OAssign.DirectRef) {
             OAssign.DirectRef dref = (OAssign.DirectRef) from;
             sendVariableReadEvent(_scopeFrame.resolve(dref.variable));
-            Node data = fetchVariableData(
-                    _scopeFrame.resolve(dref.variable), false);
+            Node data = fetchVariableData(_scopeFrame.resolve(dref.variable), false);
             retVal = DOMUtils.findChildByName((Element)data, dref.elName);
         } else if (from instanceof OAssign.VariableRef) {
             OAssign.VariableRef varRef = (OAssign.VariableRef) from;
@@ -193,8 +177,8 @@
             OAssign.PartnerLinkRef pLinkRef = (OAssign.PartnerLinkRef) from;
             PartnerLinkInstance pLink = _scopeFrame.resolve(pLinkRef.partnerLink);
             Node tempVal =pLinkRef.isMyEndpointReference ?
-                    getBpelRuntimeContext().fetchMyRoleEndpointReferenceData(pLink)
-                    : getBpelRuntimeContext().fetchPartnerRoleEndpointReferenceData(pLink);
+                    getBpelRuntime().fetchMyRoleEndpointReferenceData(pLink)
+                    : getBpelRuntime().fetchPartnerRoleEndpointReferenceData(pLink);
             if (__log.isDebugEnabled())
                 __log.debug("RValue is a partner link, corresponding endpoint "
                         + tempVal.getClass().getName() + " has value " + DOMUtils.domToString(tempVal));
@@ -202,8 +186,7 @@
         } else if (from instanceof OAssign.Expression) {
             List<Node> l;
             OExpression expr = ((OAssign.Expression) from).expression;
-
-            l = getBpelRuntimeContext().getExpLangRuntime().evaluate(expr, getEvaluationContext());
+            l = getBpelRuntime().getExpLangRuntime().evaluate(expr, getEvaluationContext());
 
             if (l.size() == 0) {
                 String msg = __msgs.msgRValueNoNodesSelected(expr.toString());
@@ -312,7 +295,7 @@
         return retVal;
     }
 
-	private void copy(OAssign.Copy ocopy) throws FaultException, ExternalVariableModuleException {
+    private void copy(OAssign.Copy ocopy) throws FaultException, ExternalVariableModuleException {
 
         if (__log.isDebugEnabled())
             __log.debug("Assign.copy(" + ocopy + ")");
@@ -321,22 +304,22 @@
 
         // Check for message to message - copy, we can do this efficiently in
         // the database.
-        if ((ocopy.to instanceof VariableRef && ((VariableRef) ocopy.to)
+        if ((ocopy.to instanceof OAssign.VariableRef && ((OAssign.VariableRef) ocopy.to)
                 .isMessageRef())
-                || (ocopy.from instanceof VariableRef && ((VariableRef) ocopy.from)
+                || (ocopy.from instanceof OAssign.VariableRef && ((OAssign.VariableRef) ocopy.from)
                 .isMessageRef())) {
 
-            if ((ocopy.to instanceof VariableRef && ((VariableRef) ocopy.to)
+            if ((ocopy.to instanceof OAssign.VariableRef && ((OAssign.VariableRef) ocopy.to)
                     .isMessageRef())
-                    && ocopy.from instanceof VariableRef
-                    && ((VariableRef) ocopy.from).isMessageRef()) {
+                    && ocopy.from instanceof OAssign.VariableRef
+                    && ((OAssign.VariableRef) ocopy.from).isMessageRef()) {
 
                 final VariableInstance lval = _scopeFrame.resolve(ocopy.to
                         .getVariable());
                 final VariableInstance rval = _scopeFrame
-                        .resolve(((VariableRef) ocopy.from).getVariable());
+                        .resolve(((OAssign.VariableRef) ocopy.from).getVariable());
                 Element lvalue = (Element) fetchVariableData(rval, false);
-                initializeVariable(lval, lvalue);
+                getBpelRuntime().initializeVariable(lval, lvalue);
                 se = new VariableModificationEvent(lval.declaration.name);
                 ((VariableModificationEvent)se).setNewValue(lvalue);
             } else {
@@ -361,7 +344,7 @@
             Node lvaluePtr = lvalue;
             boolean headerAssign = false;
             if (ocopy.to instanceof OAssign.DirectRef) {
-                DirectRef dref = ((DirectRef) ocopy.to);
+                OAssign.DirectRef dref = ((OAssign.DirectRef) ocopy.to);
                 Element el = DOMUtils.findChildByName((Element)lvalue, dref.elName);
                 if (el == null) {
                     el = (Element) ((Element)lvalue).appendChild(lvalue.getOwnerDocument()
@@ -369,18 +352,17 @@
                 }
                 lvaluePtr = el;
             } else if (ocopy.to instanceof OAssign.VariableRef) {
-                VariableRef varRef = ((VariableRef) ocopy.to);
+                OAssign.VariableRef varRef = ((OAssign.VariableRef) ocopy.to);
                 if (varRef.headerPart != null) headerAssign = true;
                 lvaluePtr = evalQuery(lvalue, varRef.part != null ? varRef.part : varRef.headerPart, varRef.location,
                         new EvaluationContextProxy(varRef.getVariable(), lvalue));
             } else if (ocopy.to instanceof OAssign.PropertyRef) {
-                PropertyRef propRef = ((PropertyRef) ocopy.to);
+                OAssign.PropertyRef propRef = ((OAssign.PropertyRef) ocopy.to);
                 lvaluePtr = evalQuery(lvalue, propRef.propertyAlias.part,
                         propRef.propertyAlias.location,
-                        new EvaluationContextProxy(propRef.getVariable(),
-                                lvalue));
+                        new EvaluationContextProxy(propRef.getVariable(), lvalue));
             } else if (ocopy.to instanceof OAssign.LValueExpression) {
-                LValueExpression lexpr = (LValueExpression) ocopy.to;
+                OAssign.LValueExpression lexpr = (OAssign.LValueExpression) ocopy.to;
                 lvaluePtr = evalQuery(lvalue, null, lexpr.expression,
                         new EvaluationContextProxy(lexpr.getVariable(), lvalue));
                 if (__log.isDebugEnabled())
@@ -397,7 +379,7 @@
             } else {
                 // Sneakily converting the EPR if it's not the format expected by the lvalue
                 if (ocopy.from instanceof OAssign.PartnerLinkRef) {
-                    rvalue = getBpelRuntimeContext().convertEndpointReference((Element)rvalue, lvaluePtr);
+                    rvalue = getBpelRuntime().convertEndpointReference((Element)rvalue, lvaluePtr);
                     if (rvalue.getNodeType() == Node.DOCUMENT_NODE)
                         rvalue = ((Document)rvalue).getDocumentElement();
                 }
@@ -413,8 +395,8 @@
                 final VariableInstance lval = _scopeFrame.resolve(ocopy.to.getVariable());
                 if (__log.isDebugEnabled())
                     __log.debug("ASSIGN Writing variable '" + lval.declaration.name +
-                                "' value '" + DOMUtils.domToString(lvalue) +"'");
-                commitChanges(lval, lvalue);
+                            "' value '" + DOMUtils.domToString(lvalue) +"'");
+                getBpelRuntime().commitChanges(lval, lvalue);
                 se = new VariableModificationEvent(lval.declaration.name);
                 ((VariableModificationEvent)se).setNewValue(lvalue);
             }
@@ -425,7 +407,7 @@
         sendEvent(se);
     }
 
-	private void replaceEndpointRefence(PartnerLinkInstance plval, Node rvalue) throws FaultException {
+    private void replaceEndpointRefence(PartnerLinkInstance plval, Node rvalue) throws FaultException {
         // Eventually wrapping with service-ref element if we've been directly assigned some
         // value that isn't wrapped.
         if (rvalue.getNodeType() == Node.TEXT_NODE ||
@@ -441,11 +423,11 @@
             rvalue = serviceRef;
         }
 
-        getBpelRuntimeContext().writeEndpointReference(plval, (Element)rvalue);
+        getBpelRuntime().writeEndpointReference(plval, (Element)rvalue);
     }
 
     private Element replaceElement(Element lval, Element ptr, Element src,
-                                boolean keepSrcElement) {
+                                   boolean keepSrcElement) {
         Document doc = ptr.getOwnerDocument();
         Node parent = ptr.getParentNode();
         if (keepSrcElement) {
@@ -474,7 +456,7 @@
         }
         parent.replaceChild(replacement, ptr);
         DOMUtils.copyNSContext(ptr, replacement);
-        
+
         return (lval == ptr) ? replacement :  lval;
     }
 
@@ -592,32 +574,43 @@
         return data;
     }
 
-    private void invokeExtensionAssignOperation(OAssign.ExtensionAssignOperation eao) throws FaultException {
-    	final ExtensionContext context = new ExtensionContextImpl(_self, _scopeFrame, getBpelRuntimeContext());
-    	final QName extensionId = DOMUtils.getElementQName(eao.nestedElement.getElement());
-    	try {
-    		ExtensionOperation ea = getBpelRuntimeContext().createExtensionActivityImplementation(extensionId);
-    		if (ea == null) {
-    			if (eao.getOwner().mustUnderstandExtensions.contains(extensionId.getNamespaceURI())) {
-    				__log.warn("Lookup of extension activity " + extensionId + " failed.");
-    				throw new FaultException(ExtensibilityQNames.UNKNOWN_EA_FAULT_NAME, "Lookup of extension activity " + extensionId + " failed. No implementation found.");
-    			} else {
-    				// act like <empty> - do nothing
-    				context.complete();
-    				return;
-    			}
-    		}
+    private void invokeExtensionAssignOperation(
+            OAssign.ExtensionAssignOperation eao) throws FaultException {
+        try {
+            final ExtensionContext helper = new ExtensionContextImpl(_self.o, _scopeFrame, getBpelRuntime());
+            final ExtensionResponseChannel responseChannel = newChannel(ExtensionResponseChannel.class);
+
+            getBpelRuntime().executeExtension(
+                    DOMUtils.getElementQName(eao.nestedElement.getElement()),
+                    helper, eao.nestedElement.getElement(), responseChannel);
+
+            object(new ExtensionResponseChannelListener(responseChannel) {
+                private static final long serialVersionUID = 1L;
+
+                public void onCompleted() {
+                    _self.parent.completed(null, CompensationHandler.emptySet());
+                }
+
+                public void onFailure(Throwable t) {
+                    StringWriter sw = new StringWriter();
+                    t.printStackTrace(new PrintWriter(sw));
+                    FaultData fault = createFault(new QName(Namespaces.WSBPEL2_0_FINAL_EXEC,
+                            "subLanguageExecutionFault"), _self.o, sw.getBuffer().toString());
+                    _self.parent.completed(fault, CompensationHandler.emptySet());
+                };
+            });
 
-    		ea.run(context, eao.nestedElement.getElement());
-    	} catch (FaultException fault) {
+        } catch (FaultException fault) {
             __log.error(fault);
-            context.completeWithFault(fault);
-		}
+            FaultData faultData = createFault(fault.getQName(), _self.o, fault
+                    .getMessage());
+            _self.parent.completed(faultData, CompensationHandler.emptySet());
+        }
     }
-    
+
     private class EvaluationContextProxy implements EvaluationContext {
 
-        private Variable _var;
+        private OScope.Variable _var;
 
         private Node _varNode;
 
@@ -625,7 +618,7 @@
 
         private EvaluationContext _ctx;
 
-        private EvaluationContextProxy(Variable var, Node varNode) {
+        private EvaluationContextProxy(OScope.Variable var, Node varNode) {
             _var = var;
             _varNode = varNode;
             _ctx = getEvaluationContext();
@@ -640,42 +633,28 @@
             } else
                 return _ctx.readVariable(variable, part);
 
-        }		/**
-     * @see org.apache.ode.bpel.explang.EvaluationContext#readMessageProperty(org.apache.ode.bpel.o.OScope.Variable,
-     *      org.apache.ode.bpel.o.OProcess.OProperty)
-     */
-    public String readMessageProperty(Variable variable, OProperty property)
-            throws FaultException {
-        return _ctx.readMessageProperty(variable, property);
-    }
+        }
+
+        public String readMessageProperty(OScope.Variable variable, OProcess.OProperty property)
+                throws FaultException {
+            return _ctx.readMessageProperty(variable, property);
+        }
 
-        /**
-         * @see org.apache.ode.bpel.explang.EvaluationContext#isLinkActive(org.apache.ode.bpel.o.OLink)
-         */
         public boolean isLinkActive(OLink olink) throws FaultException {
             return _ctx.isLinkActive(olink);
         }
 
-        /**
-         * @see org.apache.ode.bpel.explang.EvaluationContext#getRootNode()
-         */
         public Node getRootNode() {
             return _rootNode;
         }
 
-        /**
-         * @see org.apache.ode.bpel.explang.EvaluationContext#evaluateQuery(org.w3c.dom.Node,
-         *      org.apache.ode.bpel.o.OExpression)
-         */
         public Node evaluateQuery(Node root, OExpression expr)
                 throws FaultException {
             _rootNode = root;
-            return getBpelRuntimeContext().getExpLangRuntime()
-                    .evaluateNode(expr, this);
-
+            return getBpelRuntime().getExpLangRuntime().evaluateNode(expr, this);
         }
 
-        public Node getPartData(Element message, Part part) throws FaultException {
+        public Node getPartData(Element message, OMessageVarType.Part part) throws FaultException {
             return _ctx.getPartData(message,part);
         }
 
@@ -686,10 +665,6 @@
         public boolean narrowTypes() {
             return false;
         }
-
-		public URI getBaseResourceURI() {
-			return _ctx.getBaseResourceURI();
-		}
     }
 
 }

Modified: ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/ASSIGNMessages.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/ASSIGNMessages.java?rev=681565&r1=681564&r2=681565&view=diff
==============================================================================
--- ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/ASSIGNMessages.java (original)
+++ ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/ASSIGNMessages.java Thu Jul 31 17:29:41 2008
@@ -18,7 +18,7 @@
  * under the License.
  */
 
-package org.apache.ode.bpel.runtime;
+package org.apache.ode.bpel.rtrep.v2;
 
 import org.apache.ode.utils.msg.MessageBundle;
 

Modified: ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/ActivityInfo.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/ActivityInfo.java?rev=681565&r1=681564&r2=681565&view=diff
==============================================================================
--- ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/ActivityInfo.java (original)
+++ ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/ActivityInfo.java Thu Jul 31 17:29:41 2008
@@ -16,13 +16,12 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.ode.bpel.runtime;
+package org.apache.ode.bpel.rtrep.v2;
 
 import java.io.Serializable;
 
-import org.apache.ode.bpel.o.OActivity;
-import org.apache.ode.bpel.runtime.channels.ParentScopeChannel;
-import org.apache.ode.bpel.runtime.channels.TerminationChannel;
+import org.apache.ode.bpel.rtrep.v2.channels.ParentScopeChannel;
+import org.apache.ode.bpel.rtrep.v2.channels.TerminationChannel;
 
 class ActivityInfo implements Serializable {
 

Modified: ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/ActivityTemplateFactory.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/ActivityTemplateFactory.java?rev=681565&r1=681564&r2=681565&view=diff
==============================================================================
--- ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/ActivityTemplateFactory.java (original)
+++ ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/ActivityTemplateFactory.java Thu Jul 31 17:29:41 2008
@@ -16,9 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.ode.bpel.runtime;
-
-import org.apache.ode.bpel.o.*;
+package org.apache.ode.bpel.rtrep.v2;
 
 /**
  * Factory for creating activity template objects.

Modified: ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/BpelJacobRunnable.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/BpelJacobRunnable.java?rev=681565&r1=681564&r2=681565&view=diff
==============================================================================
--- ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/BpelJacobRunnable.java (original)
+++ ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/BpelJacobRunnable.java Thu Jul 31 17:29:41 2008
@@ -16,16 +16,14 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.ode.bpel.runtime;
+package org.apache.ode.bpel.rtrep.v2;
 
 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.o.OBase;
-import org.apache.ode.bpel.o.OProcess;
-import org.apache.ode.bpel.o.OVarType;
-import org.apache.ode.bpel.runtime.channels.FaultData;
+import org.apache.ode.bpel.rtrep.v2.channels.FaultData;
+import org.apache.ode.bpel.rtrep.rapi.OdeRTInstanceContext;
 import org.apache.ode.jacob.JacobRunnable;
 import org.apache.ode.jacob.vpu.JacobVPU;
 import org.w3c.dom.Element;
@@ -43,8 +41,8 @@
 public abstract class BpelJacobRunnable extends JacobRunnable {
     private static final Log __log = LogFactory.getLog(BpelJacobRunnable.class);
 
-    protected BpelRuntimeContext getBpelRuntimeContext() {
-        BpelRuntimeContext nativeApi = (BpelRuntimeContext) JacobVPU.activeJacobThread().getExtension(BpelRuntimeContext.class);
+    protected RuntimeInstanceImpl getBpelRuntime() {
+        RuntimeInstanceImpl nativeApi = (RuntimeInstanceImpl) JacobVPU.activeJacobThread().getExtension(OdeRTInstanceContext.class);
         assert nativeApi != null;
         return nativeApi;
     }
@@ -77,7 +75,7 @@
         }
         // if correlation set is already initialized,
         // then skip
-        if (getBpelRuntimeContext().isCorrelationInitialized(cset)) {
+        if (getBpelRuntime().isCorrelationInitialized(cset)) {
           // if already set, we ignore
             if (__log.isDebugEnabled()) {
                 __log.debug("OCorrelation set " + cset + " is already set: ignoring");
@@ -91,18 +89,18 @@
 
         for (int i = 0; i < cset.declaration.properties.size(); ++i) {
             OProcess.OProperty property = cset.declaration.properties.get(i);
-            propValues[i] = getBpelRuntimeContext().readProperty(variable, property);
+            propValues[i] = getBpelRuntime().readProperty(variable, property);
             propNames[i] = property.name.toString();
             if (__log.isDebugEnabled())
               __log.debug("Setting correlation property " + propNames[i] + "=" + propValues[i]);
         }
 
         CorrelationKey ckeyVal = new CorrelationKey(cset.declaration.getId(), propValues);
-        getBpelRuntimeContext().writeCorrelation(cset,ckeyVal);
+        getBpelRuntime().writeCorrelation(cset,ckeyVal);
     }
     
     protected long genMonotonic() {
-        return getBpelRuntimeContext().genId();
+        return getBpelRuntime().genId();
     }
 
 }

Modified: ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/COMPENSATE.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/COMPENSATE.java?rev=681565&r1=681564&r2=681565&view=diff
==============================================================================
--- ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/COMPENSATE.java (original)
+++ ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/COMPENSATE.java Thu Jul 31 17:29:41 2008
@@ -16,10 +16,8 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.ode.bpel.runtime;
+package org.apache.ode.bpel.rtrep.v2;
 
-import org.apache.ode.bpel.o.OCompensate;
-import org.apache.ode.bpel.o.OScope;
 import org.apache.ode.jacob.SynchChannel;
 import org.apache.ode.jacob.SynchChannelListener;
 
@@ -28,24 +26,24 @@
  * Runtime implementation of the <code>&lt;compensate&gt;</code> activity.
  */
 class COMPENSATE extends ACTIVITY {
-  private static final long serialVersionUID = -467758076635337675L;
-  private OCompensate _ocompact;
+    private static final long serialVersionUID = -467758076635337675L;
+    private OCompensate _ocompact;
 
-  public COMPENSATE(ActivityInfo self, ScopeFrame scopeFrame, LinkFrame linkFrame) {
-    super(self, scopeFrame, linkFrame);
-    _ocompact = (OCompensate) self.o;
-  }
-
-  public final void run() {
-    OScope scopeToCompensate = _ocompact.compensatedScope;
-    SynchChannel sc = newChannel(SynchChannel.class);
-    _self.parent.compensate(scopeToCompensate,sc);
-    object(new SynchChannelListener(sc) {
-    private static final long serialVersionUID = 3763991229748926216L;
-
-    public void ret() {
-        _self.parent.completed(null, CompensationHandler.emptySet());
-      }
-    });
-  }
+    public COMPENSATE(ActivityInfo self, ScopeFrame scopeFrame, LinkFrame linkFrame) {
+        super(self, scopeFrame, linkFrame);
+        _ocompact = (OCompensate) self.o;
+    }
+
+    public final void run() {
+        OScope scopeToCompensate = _ocompact.compensatedScope;
+        SynchChannel sc = newChannel(SynchChannel.class);
+        _self.parent.compensate(scopeToCompensate,sc);
+        object(new SynchChannelListener(sc) {
+            private static final long serialVersionUID = 3763991229748926216L;
+
+            public void ret() {
+                _self.parent.completed(null, CompensationHandler.emptySet());
+            }
+        });
+    }
 }

Copied: ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/COMPENSATIONHANDLER_.java (from r680846, ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/COMPENSATIONHANDLER_.java)
URL: http://svn.apache.org/viewvc/ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/COMPENSATIONHANDLER_.java?p2=ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/COMPENSATIONHANDLER_.java&p1=ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/COMPENSATIONHANDLER_.java&r1=680846&r2=681565&rev=681565&view=diff
==============================================================================
--- ode/branches/rtver/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/COMPENSATIONHANDLER_.java (original)
+++ ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/COMPENSATIONHANDLER_.java Thu Jul 31 17:29:41 2008
@@ -16,16 +16,15 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.ode.bpel.runtime;
+package org.apache.ode.bpel.rtrep.v2;
 
 import org.apache.ode.bpel.evt.CompensationHandlerRegistered;
 import org.apache.ode.bpel.evt.ScopeEvent;
-import org.apache.ode.bpel.o.OScope;
-import org.apache.ode.bpel.runtime.channels.CompensationChannelListener;
-import org.apache.ode.bpel.runtime.channels.FaultData;
-import org.apache.ode.bpel.runtime.channels.ParentScopeChannel;
-import org.apache.ode.bpel.runtime.channels.ParentScopeChannelListener;
-import org.apache.ode.bpel.runtime.channels.TerminationChannel;
+import org.apache.ode.bpel.rtrep.v2.channels.CompensationChannelListener;
+import org.apache.ode.bpel.rtrep.v2.channels.FaultData;
+import org.apache.ode.bpel.rtrep.v2.channels.ParentScopeChannel;
+import org.apache.ode.bpel.rtrep.v2.channels.ParentScopeChannelListener;
+import org.apache.ode.bpel.rtrep.v2.channels.TerminationChannel;
 import org.apache.ode.jacob.SynchChannel;
 
 import java.util.Iterator;
@@ -67,7 +66,7 @@
 
                 ScopeFrame compHandlerScopeFrame = new ScopeFrame(
                     _self.compensated.oscope.compensationHandler,
-                    getBpelRuntimeContext().createScopeInstance(_self.compensated.scopeInstanceId, _self.compensated.oscope.compensationHandler),
+                    getBpelRuntime().createScopeInstance(_self.compensated.scopeInstanceId, _self.compensated.oscope.compensationHandler),
                     _self.compensated,
                     _completedChildren);
 
@@ -102,7 +101,7 @@
 
     private void sendEvent(ScopeEvent event) {
         _self.compensated.fillEventInfo(event);
-        getBpelRuntimeContext().sendEvent(event);
+        getBpelRuntime().sendEvent(event);
     }
 
     public String toString() {

Modified: ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/ChildInfo.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/ChildInfo.java?rev=681565&r1=681564&r2=681565&view=diff
==============================================================================
--- ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/ChildInfo.java (original)
+++ ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/ChildInfo.java Thu Jul 31 17:29:41 2008
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.ode.bpel.runtime;
+package org.apache.ode.bpel.rtrep.v2;
 
 import java.io.Serializable;
 

Modified: ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/CompensationHandler.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/CompensationHandler.java?rev=681565&r1=681564&r2=681565&view=diff
==============================================================================
--- ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/CompensationHandler.java (original)
+++ ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/CompensationHandler.java Thu Jul 31 17:29:41 2008
@@ -16,9 +16,9 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.ode.bpel.runtime;
+package org.apache.ode.bpel.rtrep.v2;
 
-import org.apache.ode.bpel.runtime.channels.CompensationChannel;
+import org.apache.ode.bpel.rtrep.v2.channels.CompensationChannel;
 
 import java.io.Serializable;
 import java.util.Collections;

Modified: ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/CorrelationSetInstance.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/CorrelationSetInstance.java?rev=681565&r1=681564&r2=681565&view=diff
==============================================================================
--- ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/CorrelationSetInstance.java (original)
+++ ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/CorrelationSetInstance.java Thu Jul 31 17:29:41 2008
@@ -16,17 +16,24 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.ode.bpel.runtime;
+package org.apache.ode.bpel.rtrep.v2;
 
-import org.apache.ode.bpel.o.OScope;
+import org.apache.ode.bpel.rtrep.rapi.CorrelationSet;
 
-public class CorrelationSetInstance {
-  public OScope.CorrelationSet declaration;
-  public Long scopeInstance;
+public class CorrelationSetInstance implements CorrelationSet {
+    public OScope.CorrelationSet declaration;
+    public Long scopeInstance;
 
-  public CorrelationSetInstance(Long scopeInstanceId, OScope.CorrelationSet cset) {
-    this.scopeInstance = scopeInstanceId;
-    this.declaration = cset;
-  }
+    public CorrelationSetInstance(Long scopeInstanceId, OScope.CorrelationSet cset) {
+        this.scopeInstance = scopeInstanceId;
+        this.declaration = cset;
+    }
 
+    public String getName() {
+        return declaration.name;
+    }
+
+    public long getScopeId() {
+        return scopeInstance;
+    }
 }

Modified: ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/DebugInfo.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/DebugInfo.java?rev=681565&r1=681564&r2=681565&view=diff
==============================================================================
--- ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/DebugInfo.java (original)
+++ ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/DebugInfo.java Thu Jul 31 17:29:41 2008
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.ode.bpel.o;
+package org.apache.ode.bpel.rtrep.v2;
 
 import javax.xml.namespace.QName;
 import java.io.Serializable;

Modified: ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/EH_EVENT.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/EH_EVENT.java?rev=681565&r1=681564&r2=681565&view=diff
==============================================================================
--- ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/EH_EVENT.java (original)
+++ ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/EH_EVENT.java Thu Jul 31 17:29:41 2008
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.ode.bpel.runtime;
+package org.apache.ode.bpel.rtrep.v2;
 
 import java.util.HashSet;
 import java.util.Set;
@@ -25,18 +25,16 @@
 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.o.OEventHandler;
-import org.apache.ode.bpel.o.OScope;
-import org.apache.ode.bpel.runtime.channels.EventHandlerControlChannel;
-import org.apache.ode.bpel.runtime.channels.EventHandlerControlChannelListener;
-import org.apache.ode.bpel.runtime.channels.FaultData;
-import org.apache.ode.bpel.runtime.channels.ParentScopeChannel;
-import org.apache.ode.bpel.runtime.channels.ParentScopeChannelListener;
-import org.apache.ode.bpel.runtime.channels.PickResponseChannel;
-import org.apache.ode.bpel.runtime.channels.PickResponseChannelListener;
-import org.apache.ode.bpel.runtime.channels.TerminationChannel;
-import org.apache.ode.bpel.runtime.channels.TerminationChannelListener;
-import org.apache.ode.bpel.evt.ScopeEvent;
+import org.apache.ode.bpel.rtrep.v2.channels.EventHandlerControlChannel;
+import org.apache.ode.bpel.rtrep.v2.channels.EventHandlerControlChannelListener;
+import org.apache.ode.bpel.rtrep.v2.channels.FaultData;
+import org.apache.ode.bpel.rtrep.v2.channels.ParentScopeChannel;
+import org.apache.ode.bpel.rtrep.v2.channels.ParentScopeChannelListener;
+import org.apache.ode.bpel.rtrep.v2.channels.PickResponseChannel;
+import org.apache.ode.bpel.rtrep.v2.channels.PickResponseChannelListener;
+import org.apache.ode.bpel.rtrep.v2.channels.TerminationChannel;
+import org.apache.ode.bpel.rtrep.v2.channels.TerminationChannelListener;
+import org.apache.ode.bpel.rtrep.rapi.InvalidProcessException;
 import org.apache.ode.bpel.evt.VariableModificationEvent;
 import org.apache.ode.jacob.ChannelListener;
 import org.apache.ode.jacob.SynchChannel;
@@ -118,18 +116,18 @@
                 PartnerLinkInstance pLinkInstance = _scopeFrame.resolve(_oevent.partnerLink);
                 if (_oevent.matchCorrelation == null) {
                     // Adding a route for opaque correlation. In this case correlation is done on "out-of-band" session id.
-                    String sessionId = getBpelRuntimeContext().fetchMySessionId(pLinkInstance);
+                    String sessionId = getBpelRuntime().fetchMySessionId(pLinkInstance);
                     key = new CorrelationKey(-1, new String[] {sessionId});
                 } else {
-                    if (!getBpelRuntimeContext().isCorrelationInitialized(_scopeFrame.resolve(_oevent.matchCorrelation))) {
+                    if (!getBpelRuntime().isCorrelationInitialized(_scopeFrame.resolve(_oevent.matchCorrelation))) {
                         throw new FaultException(_oevent.getOwner().constants.qnCorrelationViolation,"Correlation not initialized.");
                     }
-                    key = getBpelRuntimeContext().readCorrelation(_scopeFrame.resolve(_oevent.matchCorrelation));
+                    key = getBpelRuntime().readCorrelation(_scopeFrame.resolve(_oevent.matchCorrelation));
                     assert key != null;
                 }
 
                 selector =  new Selector(0,pLinkInstance,_oevent.operation.getName(), _oevent.operation.getOutput() == null, _oevent.messageExchangeId, key);
-                getBpelRuntimeContext().select(pickResponseChannel, null, false, new Selector[] { selector} );
+                getBpelRuntime().select(pickResponseChannel, null, false, new Selector[] { selector} );
                 instance(new WAITING(pickResponseChannel));
             } catch(FaultException e){
                 __log.error(e);
@@ -166,7 +164,7 @@
                             terminateActive();
                             _terminated = true;
                             if (_pickResponseChannel != null)
-                                getBpelRuntimeContext().cancel(_pickResponseChannel);
+                                getBpelRuntime().cancel(_pickResponseChannel);
                             instance(WAITING.this);
                         }
                     });
@@ -180,7 +178,7 @@
                         public void stop() {
                             _stopped = true;
                             if (_pickResponseChannel != null)
-                                getBpelRuntimeContext().cancel(_pickResponseChannel);
+                                getBpelRuntime().cancel(_pickResponseChannel);
                             instance(WAITING.this);
                         }
                     });
@@ -220,25 +218,25 @@
                         public void onRequestRcvd(int selectorIdx, String mexId) {
                             // The receipt of the message causes a new scope to be created:
                             ScopeFrame ehScopeFrame = new ScopeFrame(_oevent,
-                                    getBpelRuntimeContext().createScopeInstance(_scopeFrame.scopeInstanceId, _oevent),
+                                    getBpelRuntime().createScopeInstance(_scopeFrame.scopeInstanceId, _oevent),
                                     _scopeFrame,
                                     _comps,
                                     _fault);
 
                             if (_oevent.variable != null) {
-                                Element msgEl = getBpelRuntimeContext().getMyRequest(mexId);
+                                Element msgEl = getBpelRuntime().getMyRequest(mexId);
 
                                 if (msgEl != null) {
                                     try {
                                         VariableInstance vinst = ehScopeFrame.resolve(_oevent.variable);
-                                        getBpelRuntimeContext().writeVariable(vinst, msgEl);
+                                        getBpelRuntime().initializeVariable(vinst, msgEl);
 
                                         VariableModificationEvent se = new VariableModificationEvent(vinst.declaration.name);
                                         se.setNewValue(msgEl);
                                         _scopeFrame.fillEventInfo(se);
                                         if (_oevent.debugInfo != null)
                                             se.setLineNo(_oevent.debugInfo.startLine);
-                                        getBpelRuntimeContext().sendEvent(se);
+                                        getBpelRuntime().sendEvent(se);
                                     } catch (Exception ex) {
                                         __log.fatal(ex);
                                         throw new InvalidProcessException(ex);
@@ -254,18 +252,18 @@
 
                                 if (_oevent.partnerLink.hasPartnerRole()) {
                                     // Trying to initialize partner epr based on a message-provided epr/session.
-                                    if (!getBpelRuntimeContext().isPartnerRoleEndpointInitialized(ehScopeFrame
+                                    if (!getBpelRuntime().isPartnerRoleEndpointInitialized(ehScopeFrame
                                             .resolve(_oevent.partnerLink)) || !_oevent.partnerLink.initializePartnerRole) {
-                                        Node fromEpr = getBpelRuntimeContext().getSourceEPR(mexId);
+                                        Node fromEpr = getBpelRuntime().getSourceEPR(mexId);
                                         if (fromEpr != null) {
-                                            getBpelRuntimeContext().writeEndpointReference(
+                                            getBpelRuntime().writeEndpointReference(
                                                     ehScopeFrame.resolve(_oevent.partnerLink), (Element) fromEpr);
                                         }
                                     }
 
-                                    String partnersSessionId = getBpelRuntimeContext().getSourceSessionId(mexId);
+                                    String partnersSessionId = getBpelRuntime().getSourceSessionId(mexId);
                                     if (partnersSessionId != null)
-                                        getBpelRuntimeContext().initializePartnersSessionId(ehScopeFrame.resolve(_oevent.partnerLink),
+                                        getBpelRuntime().initializePartnersSessionId(ehScopeFrame.resolve(_oevent.partnerLink),
                                                 partnersSessionId);
                                 }
 

Modified: ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/EMPTY.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/EMPTY.java?rev=681565&r1=681564&r2=681565&view=diff
==============================================================================
--- ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/EMPTY.java (original)
+++ ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/EMPTY.java Thu Jul 31 17:29:41 2008
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.ode.bpel.runtime;
+package org.apache.ode.bpel.rtrep.v2;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;

Modified: ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/EXTENSIONACTIVITY.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/EXTENSIONACTIVITY.java?rev=681565&r1=681564&r2=681565&view=diff
==============================================================================
--- ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/EXTENSIONACTIVITY.java (original)
+++ ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/EXTENSIONACTIVITY.java Thu Jul 31 17:29:41 2008
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.ode.bpel.runtime;
+package org.apache.ode.bpel.rtrep.v2;
 
 import javax.xml.namespace.QName;
 
@@ -25,8 +25,10 @@
 import org.apache.ode.bpel.common.FaultException;
 import org.apache.ode.bpel.compiler.bom.ExtensibilityQNames;
 import org.apache.ode.bpel.o.OExtensionActivity;
-import org.apache.ode.bpel.runtime.extension.ExtensionContext;
-import org.apache.ode.bpel.runtime.extension.ExtensionOperation;
+import org.apache.ode.bpel.rtrep.v2.extension.ExtensionContext;
+import org.apache.ode.bpel.rtrep.v2.extension.ExtensionOperation;
+import org.apache.ode.bpel.rtrep.common.extension.ExtensionOperation;
+import org.apache.ode.bpel.rtrep.common.extension.ExtensionContext;
 import org.apache.ode.utils.DOMUtils;
 
 /**
@@ -48,14 +50,15 @@
 	}
 
     public final void run() {
-    	final ExtensionContext context = new ExtensionContextImpl(_self, _scopeFrame, getBpelRuntimeContext());
+    	final ExtensionContext context = new ExtensionContextImpl(_self, _scopeFrame, getBpelRuntime());
     	final QName extensionId = DOMUtils.getElementQName(_oext.nestedElement.getElement());
     	try {
-    		ExtensionOperation ea = getBpelRuntimeContext().createExtensionActivityImplementation(extensionId);
+    		ExtensionOperation ea = getBpelRuntime().createExtensionActivityImplementation(extensionId);
     		if (ea == null) {
     			if (_oext.getOwner().mustUnderstandExtensions.contains(extensionId.getNamespaceURI())) {
     				__log.warn("Lookup of extension activity " + extensionId + " failed.");
-    				throw new FaultException(ExtensibilityQNames.UNKNOWN_EA_FAULT_NAME, "Lookup of extension activity " + extensionId + " failed. No implementation found.");
+    				throw new FaultException(ExtensibilityQNames.UNKNOWN_EA_FAULT_NAME,
+                            "Lookup of extension activity " + extensionId + " failed. No implementation found.");
     			} else {
     				// act like <empty> - do nothing
     				context.complete();

Copied: ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/EvaluationContext.java (from r680846, ode/branches/rtver/bpel-api/src/main/java/org/apache/ode/bpel/explang/EvaluationContext.java)
URL: http://svn.apache.org/viewvc/ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/EvaluationContext.java?p2=ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/EvaluationContext.java&p1=ode/branches/rtver/bpel-api/src/main/java/org/apache/ode/bpel/explang/EvaluationContext.java&r1=680846&r2=681565&rev=681565&view=diff
==============================================================================
--- ode/branches/rtver/bpel-api/src/main/java/org/apache/ode/bpel/explang/EvaluationContext.java (original)
+++ ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/EvaluationContext.java Thu Jul 31 17:29:41 2008
@@ -16,16 +16,11 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.ode.bpel.explang;
+package org.apache.ode.bpel.rtrep.v2;
 
 import java.net.URI;
 
 import org.apache.ode.bpel.common.FaultException;
-import org.apache.ode.bpel.o.OExpression;
-import org.apache.ode.bpel.o.OLink;
-import org.apache.ode.bpel.o.OMessageVarType;
-import org.apache.ode.bpel.o.OProcess;
-import org.apache.ode.bpel.o.OScope;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 
@@ -103,10 +98,4 @@
      */
     boolean narrowTypes();
     
-	/**
-	 * Retrieves the base URI that the BPEL Process execution contextis running relative to.
-	 * 
-	 * @return URI - the URI representing the absolute physical file path location that this process is defined within.
-	 */
-	URI getBaseResourceURI();    
 }

Modified: ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/EventContextImpl.java
URL: http://svn.apache.org/viewvc/ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/EventContextImpl.java?rev=681565&r1=681564&r2=681565&view=diff
==============================================================================
--- ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/EventContextImpl.java (original)
+++ ode/branches/rtver/runtime-repo/src/main/java/org/apache/ode/bpel/rtrep/v2/EventContextImpl.java Thu Jul 31 17:29:41 2008
@@ -16,11 +16,9 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.ode.bpel.runtime;
+package org.apache.ode.bpel.rtrep.v2;
 
 import org.apache.ode.bpel.evt.EventContext;
-import org.apache.ode.bpel.o.OScope;
-import org.apache.ode.bpel.o.OScope.Variable;
 import org.apache.ode.utils.DOMUtils;
 import org.w3c.dom.Node;
 
@@ -43,7 +41,7 @@
     /**
      * BPEL Runtime Context
      */
-    private BpelRuntimeContext __runtimeContext;
+    private RuntimeInstanceImpl __runtimeContext;
 
     /**
      * Constructor
@@ -51,7 +49,7 @@
      * @param __scopeInstanceId Scope Instance ID
      * @param __runtimeContext BPEL Runtime Context
      */
-    public EventContextImpl(OScope __scope, Long __scopeInstanceId, BpelRuntimeContext __runtimeContext)
+    public EventContextImpl(OScope __scope, Long __scopeInstanceId, RuntimeInstanceImpl __runtimeContext)
     {
         this.__scope = __scope;
         this.__scopeInstanceId = __scopeInstanceId;
@@ -68,9 +66,9 @@
         String value = null;
         try
         {
-            Variable var = __scope.getVisibleVariable(varName);
+            OScope.Variable var = __scope.getVisibleVariable(varName);
             VariableInstance varInstance = new VariableInstance(__scopeInstanceId, var);
-            Node varNode = __runtimeContext.readVariable(varInstance.scopeInstance, varInstance.declaration.name, false);
+            Node varNode = __runtimeContext.fetchVariableData(varInstance, false);
             value = DOMUtils.domToString(varNode);
         }
         catch(Throwable e)