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 2009/05/12 17:23:36 UTC

svn commit: r773939 [1/6] - in /ode/trunk: ./ axis2/src/main/java/org/apache/ode/axis2/ axis2/src/main/java/org/apache/ode/axis2/soapbinding/ bpel-api/src/main/java/org/apache/ode/bpel/evt/ bpel-api/src/main/java/org/apache/ode/bpel/iapi/ bpel-api/src/...

Author: mriou
Date: Tue May 12 15:23:30 2009
New Revision: 773939

URL: http://svn.apache.org/viewvc?rev=773939&view=rev
Log:
Merge of the restful branch. See http://markmail.org/message/sycrq3c5tbxy4ul7 for context.

Added:
    ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/RESTInMessageExchange.java
    ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/RESTOutMessageExchange.java
    ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/Resource.java
    ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/WSMessageExchange.java
    ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/Resource.java
    ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/ResourceModel.java
    ode/trunk/bpel-dao/src/main/java/org/apache/ode/bpel/dao/ResourceRouteDAO.java
    ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/ResourceRouteDaoImpl.java
    ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/hobj/HResourceRoute.java
    ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/ResourceRouteDAOImpl.java
    ode/trunk/engine/src/main/java/org/apache/ode/bpel/engine/IncomingMessageExchangeCache.java
    ode/trunk/engine/src/main/java/org/apache/ode/bpel/engine/ODERESTProcess.java
    ode/trunk/engine/src/main/java/org/apache/ode/bpel/engine/ODEWSProcess.java
    ode/trunk/engine/src/main/java/org/apache/ode/bpel/engine/RESTInMessageExchangeImpl.java
    ode/trunk/engine/src/main/java/org/apache/ode/bpel/engine/RESTOutMessageExchangeImpl.java
    ode/trunk/engine/src/main/java/org/apache/ode/bpel/memdao/ResourceRouteDAOImpl.java
    ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OCollect.java
    ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OComm.java
    ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OResource.java
    ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/ResourceInstance.java
Removed:
    ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/Content.java
    ode/trunk/engine/src/main/java/org/apache/ode/bpel/engine/MyRoleMessageExchangeCache.java
    ode/trunk/engine/src/main/java/org/apache/ode/bpel/runtime/InvalidProcessException.java
Modified:
    ode/trunk/Buildfile
    ode/trunk/axis2/src/main/java/org/apache/ode/axis2/BindingContextImpl.java
    ode/trunk/axis2/src/main/java/org/apache/ode/axis2/MessageExchangeContextImpl.java
    ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ODEService.java
    ode/trunk/axis2/src/main/java/org/apache/ode/axis2/soapbinding/SoapExternalService.java
    ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/evt/ProcessMessageExchangeEvent.java
    ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/BindingContext.java
    ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/BpelServer.java
    ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/InvocationStyle.java
    ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/MessageExchange.java
    ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/MessageExchangeContext.java
    ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/MyRoleMessageExchange.java
    ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/PartnerRoleMessageExchange.java
    ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/ProcessConf.java
    ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/IOContext.java
    ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/OdeRTInstanceContext.java
    ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/OdeRuntime.java
    ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/ProcessModel.java
    ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/VariableContext.java
    ode/trunk/bpel-dao/src/main/java/org/apache/ode/bpel/dao/BpelDAOConnection.java
    ode/trunk/bpel-dao/src/main/java/org/apache/ode/bpel/dao/MessageExchangeDAO.java
    ode/trunk/bpel-dao/src/main/java/org/apache/ode/bpel/dao/ProcessInstanceDAO.java
    ode/trunk/bpel-schemas/src/main/xsd/pmapi.xsd
    ode/trunk/bpel-store/src/main/java/org/apache/ode/store/ProcessConfImpl.java
    ode/trunk/bpel-test/src/main/java/org/apache/ode/test/BindingContextImpl.java
    ode/trunk/bpel-test/src/main/java/org/apache/ode/test/MessageExchangeContextImpl.java
    ode/trunk/bpel-test/src/test/java/org/apache/ode/test/MessageRouting20Test.java
    ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/SessionManager.java
    ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/BpelDAOConnectionImpl.java
    ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/MessageExchangeDaoImpl.java
    ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/ProcessInstanceDaoImpl.java
    ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/hobj/HCorrelatorSelector.java
    ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/hobj/HMessageExchange.java
    ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/hobj/HProcessInstance.java
    ode/trunk/dao-jpa-db/src/main/descriptors/persistence.derby.xml
    ode/trunk/dao-jpa-db/src/main/descriptors/persistence.mysql.xml
    ode/trunk/dao-jpa-db/src/main/descriptors/persistence.oracle.xml
    ode/trunk/dao-jpa-db/src/test/resources/META-INF/persistence.xml
    ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/BPELDAOConnectionImpl.java
    ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/MessageDAOImpl.java
    ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/MessageExchangeDAOImpl.java
    ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/ProcessInstanceDAOImpl.java
    ode/trunk/dao-jpa/src/main/resources/META-INF/persistence.xml
    ode/trunk/engine/src/main/java/org/apache/ode/bpel/engine/BpelInstanceWorker.java
    ode/trunk/engine/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java
    ode/trunk/engine/src/main/java/org/apache/ode/bpel/engine/BpelServerImpl.java
    ode/trunk/engine/src/main/java/org/apache/ode/bpel/engine/Contexts.java
    ode/trunk/engine/src/main/java/org/apache/ode/bpel/engine/MessageExchangeImpl.java
    ode/trunk/engine/src/main/java/org/apache/ode/bpel/engine/ODEProcess.java
    ode/trunk/engine/src/main/java/org/apache/ode/bpel/engine/PartnerLinkMyRoleImpl.java
    ode/trunk/engine/src/main/java/org/apache/ode/bpel/engine/PartnerLinkPartnerRoleImpl.java
    ode/trunk/engine/src/main/java/org/apache/ode/bpel/engine/PartnerRoleMessageExchangeImpl.java
    ode/trunk/engine/src/main/java/org/apache/ode/bpel/engine/ProcessAndInstanceManagementImpl.java
    ode/trunk/engine/src/main/java/org/apache/ode/bpel/engine/UnreliableMyRoleMessageExchangeImpl.java
    ode/trunk/engine/src/main/java/org/apache/ode/bpel/memdao/BpelDAOConnectionImpl.java
    ode/trunk/engine/src/main/java/org/apache/ode/bpel/memdao/MessageExchangeDAOImpl.java
    ode/trunk/engine/src/main/java/org/apache/ode/bpel/memdao/ProcessDaoImpl.java
    ode/trunk/engine/src/main/java/org/apache/ode/bpel/memdao/ProcessInstanceDaoImpl.java
    ode/trunk/engine/src/test/java/org/apache/ode/bpel/runtime/MockBpelServer.java
    ode/trunk/il-common/src/main/java/org/apache/ode/il/EmbeddedGeronimoFactory.java
    ode/trunk/il-common/src/main/java/org/apache/ode/il/config/OdeConfigProperties.java
    ode/trunk/il-common/src/main/java/org/apache/ode/il/dbutil/Database.java
    ode/trunk/jacob/src/main/java/org/apache/ode/jacob/vpu/JacobVPU.java
    ode/trunk/jbi/src/main/java/org/apache/ode/jbi/BindingContextImpl.java
    ode/trunk/jbi/src/main/java/org/apache/ode/jbi/MessageExchangeContextImpl.java
    ode/trunk/jbi/src/test/java/org/apache/ode/jbi/OdeJbiComponentLifeCycleTest.java
    ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OConstants.java
    ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OProcess.java
    ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OutstandingRequestManager.java
    ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/RuntimeImpl.java
    ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/RuntimeInstanceImpl.java
    ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/ASSIGN.java
    ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/BoundVariableEvaluationContext.java
    ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/EH_EVENT.java
    ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/ExprEvaluationContextImpl.java
    ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/ExtensionContextImpl.java
    ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/INVOKE.java
    ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OConstants.java
    ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OEventHandler.java
    ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OInvoke.java
    ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OPickReceive.java
    ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OProcess.java
    ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OReply.java
    ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OScope.java
    ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OVarType.java
    ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OdeInternalInstance.java
    ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OutstandingRequestManager.java
    ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/PICK.java
    ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/REPLY.java
    ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/RuntimeImpl.java
    ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/RuntimeInstanceImpl.java
    ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/SCOPE.java
    ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/ScopeFrame.java
    ode/trunk/runtimes/src/test/java/org/apache/ode/bpel/rtrep/v2/CoreBpelTest.java
    ode/trunk/scheduler-simple/src/main/java/org/apache/ode/scheduler/simple/JdbcDelegate.java
    ode/trunk/scheduler-simple/src/test/java/org/apache/ode/scheduler/simple/SimpleSchedulerTest.java
    ode/trunk/utils/src/main/java/org/apache/ode/utils/xsd/SchemaModelImpl.java

Modified: ode/trunk/Buildfile
URL: http://svn.apache.org/viewvc/ode/trunk/Buildfile?rev=773939&r1=773938&r2=773939&view=diff
==============================================================================
--- ode/trunk/Buildfile (original)
+++ ode/trunk/Buildfile Tue May 12 15:23:30 2009
@@ -186,18 +186,6 @@
 repositories.remote << "http://ws.zones.apache.org/repository2"
 repositories.release_to[:url] ||= "sftp://guest@localhost/home/guest"
 
-# Changing releases tag names
-class Release
-  class << self
-    def tag_with_apache_ode(version)
-      tag_without_apache_ode("APACHE_ODE_#{version.upcase}")
-    end
-    #alias :tag_without_apache_ode :tag
-    alias :tag :tag_with_apache_ode 
-  end
-end
-
-
 desc "Apache ODE"
 #define "ode", :group=>"org.apache.ode", :version=>VERSION_NUMBER do
 define "ode" do

Modified: ode/trunk/axis2/src/main/java/org/apache/ode/axis2/BindingContextImpl.java
URL: http://svn.apache.org/viewvc/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/BindingContextImpl.java?rev=773939&r1=773938&r2=773939&view=diff
==============================================================================
--- ode/trunk/axis2/src/main/java/org/apache/ode/axis2/BindingContextImpl.java (original)
+++ ode/trunk/axis2/src/main/java/org/apache/ode/axis2/BindingContextImpl.java Tue May 12 15:23:30 2009
@@ -171,4 +171,11 @@
         return extService;
     }
 
+    public void activateProvidedResource(Resource resource) {
+        throw new UnsupportedOperationException("RESTful resources not supported in Axis2 integration layer.");
+    }
+
+    public void deactivateProvidedResource(Resource resource) {
+        throw new UnsupportedOperationException("RESTful resources not supported in Axis2 integration layer.");
+    }
 }

Modified: ode/trunk/axis2/src/main/java/org/apache/ode/axis2/MessageExchangeContextImpl.java
URL: http://svn.apache.org/viewvc/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/MessageExchangeContextImpl.java?rev=773939&r1=773938&r2=773939&view=diff
==============================================================================
--- ode/trunk/axis2/src/main/java/org/apache/ode/axis2/MessageExchangeContextImpl.java (original)
+++ ode/trunk/axis2/src/main/java/org/apache/ode/axis2/MessageExchangeContextImpl.java Tue May 12 15:23:30 2009
@@ -25,14 +25,7 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.ode.bpel.iapi.BpelEngineException;
-import org.apache.ode.bpel.iapi.ContextException;
-import org.apache.ode.bpel.iapi.EndpointReference;
-import org.apache.ode.bpel.iapi.InvocationStyle;
-import org.apache.ode.bpel.iapi.MessageExchangeContext;
-import org.apache.ode.bpel.iapi.MyRoleMessageExchange;
-import org.apache.ode.bpel.iapi.PartnerRoleChannel;
-import org.apache.ode.bpel.iapi.PartnerRoleMessageExchange;
+import org.apache.ode.bpel.iapi.*;
 
 /**
  * Implementation of the ODE {@link org.apache.ode.bpel.iapi.MessageExchangeContext}
@@ -79,7 +72,9 @@
         invokePartnerUnreliable(mex);
     }
 
-    
+    public void invokeRestful(RESTOutMessageExchange mex) throws ContextException {
+        throw new UnsupportedOperationException("No support for RESTful invocations");
+    }
 
     public void onMyRoleMessageExchangeStateChanged(MyRoleMessageExchange myRoleMessageExchange) throws BpelEngineException {
         // Add code here to handle MEXs that we've "forgotten" about due to system failure etc.. mostly

Modified: ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ODEService.java
URL: http://svn.apache.org/viewvc/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ODEService.java?rev=773939&r1=773938&r2=773939&view=diff
==============================================================================
--- ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ODEService.java (original)
+++ ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ODEService.java Tue May 12 15:23:30 2009
@@ -39,14 +39,11 @@
 import org.apache.ode.il.epr.EndpointFactory;
 import org.apache.ode.il.epr.MutableEndpoint;
 import org.apache.ode.il.epr.WSAEndpoint;
-import org.apache.ode.bpel.iapi.BpelServer;
-import org.apache.ode.bpel.iapi.EndpointReference;
-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.iapi.MyRoleMessageExchange;
-import org.apache.ode.bpel.iapi.ProcessConf;
 import org.apache.ode.utils.*;
+import org.apache.ode.bpel.iapi.*;
+import org.apache.ode.utils.DOMUtils;
+import org.apache.ode.utils.GUID;
+import org.apache.ode.utils.Namespaces;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
@@ -194,7 +191,7 @@
             WSAEndpoint endpoint = new WSAEndpoint();
             endpoint.set(serviceEpr);
             // Extract the session ID for the local process.
-            odeMex.setProperty(MessageExchange.PROPERTY_SEP_MYROLE_SESSIONID, endpoint.getSessionId());
+            odeMex.setProperty(WSMessageExchange.PROPERTY_SEP_MYROLE_SESSIONID, endpoint.getSessionId());
         }
         if (ocse != null) {
             Element serviceEpr = (Element) ocse;
@@ -204,8 +201,8 @@
             // Save the session id of the remote process. Also, magically
             // initialize the EPR
             // of the partner to the EPR provided.
-            odeMex.setProperty(MessageExchange.PROPERTY_SEP_PARTNERROLE_SESSIONID, endpoint.getSessionId());
-            odeMex.setProperty(MessageExchange.PROPERTY_SEP_PARTNERROLE_EPR, DOMUtils.domToString(serviceEpr));
+            odeMex.setProperty(WSMessageExchange.PROPERTY_SEP_PARTNERROLE_SESSIONID, endpoint.getSessionId());
+            odeMex.setProperty(WSMessageExchange.PROPERTY_SEP_PARTNERROLE_EPR, DOMUtils.domToString(serviceEpr));
         }
     }
 

Modified: ode/trunk/axis2/src/main/java/org/apache/ode/axis2/soapbinding/SoapExternalService.java
URL: http://svn.apache.org/viewvc/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/soapbinding/SoapExternalService.java?rev=773939&r1=773938&r2=773939&view=diff
==============================================================================
--- ode/trunk/axis2/src/main/java/org/apache/ode/axis2/soapbinding/SoapExternalService.java (original)
+++ ode/trunk/axis2/src/main/java/org/apache/ode/axis2/soapbinding/SoapExternalService.java Tue May 12 15:23:30 2009
@@ -34,8 +34,6 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
-import org.apache.neethi.PolicyEngine;
-import org.apache.neethi.Policy;
 import org.apache.ode.axis2.ExternalService;
 import org.apache.ode.axis2.ODEService;
 import org.apache.ode.utils.Properties;
@@ -44,9 +42,7 @@
 import org.apache.ode.bpel.iapi.Message;
 import org.apache.ode.bpel.iapi.MessageExchange;
 import org.apache.ode.bpel.iapi.MessageExchange.FailureType;
-import org.apache.ode.bpel.iapi.PartnerRoleChannel;
-import org.apache.ode.bpel.iapi.PartnerRoleMessageExchange;
-import org.apache.ode.bpel.iapi.ProcessConf;
+import org.apache.ode.bpel.iapi.*;
 import org.apache.ode.il.OMUtils;
 import org.apache.ode.il.epr.EndpointFactory;
 import org.apache.ode.il.epr.MutableEndpoint;
@@ -54,7 +50,6 @@
 import org.apache.ode.utils.*;
 import org.apache.ode.utils.uuid.UUID;
 import org.apache.ode.utils.wsdl.Messages;
-import org.apache.rampart.RampartMessageData;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
@@ -63,9 +58,6 @@
 import javax.wsdl.Operation;
 import javax.xml.namespace.QName;
 import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URI;
 import java.net.URL;
 import java.net.MalformedURLException;
 import java.util.Map;
@@ -269,8 +261,8 @@
         WSAEndpoint myRoleWSAEPR = EndpointFactory.convertToWSA((MutableEndpoint) odeMex.getMyRoleEndpointReference());
         WSAEndpoint targetEPR = new WSAEndpoint(targetWSAEPR);
 
-        String partnerSessionId = odeMex.getProperty(MessageExchange.PROPERTY_SEP_PARTNERROLE_SESSIONID);
-        String myRoleSessionId = odeMex.getProperty(MessageExchange.PROPERTY_SEP_MYROLE_SESSIONID);
+        String partnerSessionId = odeMex.getProperty(WSMessageExchange.PROPERTY_SEP_PARTNERROLE_SESSIONID);
+        String myRoleSessionId = odeMex.getProperty(WSMessageExchange.PROPERTY_SEP_MYROLE_SESSIONID);
 
         if (partnerSessionId != null) {
             if (__log.isDebugEnabled()) {

Modified: ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/evt/ProcessMessageExchangeEvent.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/evt/ProcessMessageExchangeEvent.java?rev=773939&r1=773938&r2=773939&view=diff
==============================================================================
--- ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/evt/ProcessMessageExchangeEvent.java (original)
+++ ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/evt/ProcessMessageExchangeEvent.java Tue May 12 15:23:30 2009
@@ -37,6 +37,7 @@
     
     private QName _portType;
     private String _operation;
+    private String _resource;
     private String _mexId;
     private short _aspect;
 
@@ -85,4 +86,12 @@
     public void setPortType(QName portType) {
         _portType = portType;
     }
+
+    public String getResource() {
+        return _resource;
+    }
+
+    public void setResource(String resource) {
+        this._resource = resource;
+    }
 }

Modified: ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/BindingContext.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/BindingContext.java?rev=773939&r1=773938&r2=773939&view=diff
==============================================================================
--- ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/BindingContext.java (original)
+++ ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/BindingContext.java Tue May 12 15:23:30 2009
@@ -69,7 +69,20 @@
      * @param myRoleEndpoint
      */
     void deactivateMyRoleEndpoint(Endpoint myRoleEndpoint);
-    
+
+    /**
+     * Activates a resource the engine has to provide. The resource url may contain patterns such as
+     * http://example.com/order/{orderId}/
+     * @param resource
+     */
+    void activateProvidedResource(Resource resource);
+
+    /**
+     * Deactivates a resource provided by the engine.
+     * @param resource
+     */
+    void deactivateProvidedResource(Resource resource);
+
     /**
      * Create a communication channel for communicating with a partner. A default or
      * initial value for the partner endpoint may be given. 

Modified: ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/BpelServer.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/BpelServer.java?rev=773939&r1=773938&r2=773939&view=diff
==============================================================================
--- ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/BpelServer.java (original)
+++ ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/BpelServer.java Tue May 12 15:23:30 2009
@@ -130,11 +130,10 @@
      * 
      * @return {@link MyRoleMessageExchange} the newly created message exchange
      */
-    MyRoleMessageExchange createMessageExchange(InvocationStyle istyle, 
-            QName serviceId, 
-            String operation,
-            String foreignKey)
-            throws BpelEngineException;
+    MyRoleMessageExchange createMessageExchange(InvocationStyle istyle, QName serviceId, String operation,
+                                                String foreignKey) throws BpelEngineException;
+
+    RESTInMessageExchange createMessageExchange(Resource resource, String foreignKey) throws BpelEngineException;
 
     /**
      * Retrieve a message identified by the given identifer.

Modified: ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/InvocationStyle.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/InvocationStyle.java?rev=773939&r1=773938&r2=773939&view=diff
==============================================================================
--- ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/InvocationStyle.java (original)
+++ ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/InvocationStyle.java Tue May 12 15:23:30 2009
@@ -12,7 +12,6 @@
      */
     RELIABLE,
     
-    
     /**
      * Transacted style -- the IL/engine will enroll the operation with the current transaction. The IL/engine will
      * block until the operation completes. 

Modified: ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/MessageExchange.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/MessageExchange.java?rev=773939&r1=773938&r2=773939&view=diff
==============================================================================
--- ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/MessageExchange.java (original)
+++ ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/MessageExchange.java Tue May 12 15:23:30 2009
@@ -26,8 +26,6 @@
 /**
  * A representation of a communication (message-exchange) between the BPEL 
  * BPEL engine and an  external "partner".
- * 
- * @author mszefler
  */
 public interface MessageExchange {
 
@@ -103,8 +101,7 @@
      * time.
      * @return unique message exchange identifier
      */
-    String getMessageExchangeId()
-            throws BpelEngineException;
+    String getMessageExchangeId() throws BpelEngineException;
 
 
     /**
@@ -130,16 +127,14 @@
      *
      * @return name of the operation (WSDL 1.1) /message exchange (WSDL 1.2?).
      */
-    String getOperationName()
-            throws BpelEngineException;
+    String getOperationName() throws BpelEngineException;
 
 
     /**
      * Get a reference to the end-point targeted by this message exchange.
      * @return end-point reference for this message exchange
      */
-    EndpointReference getEndpointReference()
-            throws BpelEngineException;
+    EndpointReference getEndpointReference() throws BpelEngineException;
 
 
     AckType getAckType();
@@ -187,36 +182,6 @@
     Message getResponse();
 
     /**
-     * Get the fault type.
-     * @return fault type, or <code>null</code> if not available/applicable.
-     */
-    QName getFault();
-
-    String getFaultExplanation();
-
-    /**
-     * Get the fault resposne message.
-     * @return fault response, or <code>null</code> if not available/applicable.
-     */
-    Message getFaultResponse();
-
-    /**
-     * Get the operation description for this message exchange.
-     * It is possible that the description cannot be resolved, for example if
-     * the EPR is unknown or if the operation does not exist.
-     * @return WSDL operation description or <code>null</code> if not availble
-     */
-    Operation getOperation();
-
-    /**
-     * Get the port type description for this message exchange.
-     * It is possible that the description cannot be resolved, for example if
-     * the EPR is unknown or if the operation does not exist.
-     * @return WSDL port type description or <code>null</code> if not available.
-     */
-    PortType getPortType();
-
-    /**
      * Set a message exchange property. Message exchange properties are not
      * interpreted by the engine--they exist to enable the integration layer
      * to persist information about the exchange.
@@ -240,13 +205,6 @@
     public Set<String> getPropertyNames();
 
     /**
-     * Report whether the operation is "safe" in the sense of the WSDL1.2 meaning of the term. That is,
-     * is the operation side-effect free?
-     * @return <code>true</code> if the operation is safe, <code>false</code> otherwise. 
-     */
-    public boolean isSafe();
-    
-    /**
      * Should be called by the external partner when it's done with the
      * message exchange. Ncessary for a better resource management and
      * proper mex cleanup.

Modified: ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/MessageExchangeContext.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/MessageExchangeContext.java?rev=773939&r1=773938&r2=773939&view=diff
==============================================================================
--- ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/MessageExchangeContext.java (original)
+++ ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/MessageExchangeContext.java Tue May 12 15:23:30 2009
@@ -89,6 +89,8 @@
     
     void invokePartnerTransacted(PartnerRoleMessageExchange mex) throws ContextException;
 
+    void invokeRestful(RESTOutMessageExchange mex) throws ContextException;
+
     /**
      * Cancel an async/reliable partner-role message exchange. 
      * @param mex message exchange that should be cancelled. 

Modified: ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/MyRoleMessageExchange.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/MyRoleMessageExchange.java?rev=773939&r1=773938&r2=773939&view=diff
==============================================================================
--- ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/MyRoleMessageExchange.java (original)
+++ ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/MyRoleMessageExchange.java Tue May 12 15:23:30 2009
@@ -28,7 +28,7 @@
  * that is provided by the engine for message-exchanges where the engine acts as
  * the server (i.e. where the engine is "invoked").
  */
-public interface MyRoleMessageExchange extends MessageExchange {
+public interface MyRoleMessageExchange extends WSMessageExchange {
 
     /**
      * Enumeration of message correlation results.

Modified: ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/PartnerRoleMessageExchange.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/PartnerRoleMessageExchange.java?rev=773939&r1=773938&r2=773939&view=diff
==============================================================================
--- ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/PartnerRoleMessageExchange.java (original)
+++ ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/PartnerRoleMessageExchange.java Tue May 12 15:23:30 2009
@@ -29,7 +29,7 @@
  * @author Maciej Szefler - m s z e f l e r @ g m a i l . c o m
  * 
  */
-public interface PartnerRoleMessageExchange extends MessageExchange {
+public interface PartnerRoleMessageExchange extends WSMessageExchange {
 
 
     /**

Modified: ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/ProcessConf.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/ProcessConf.java?rev=773939&r1=773938&r2=773939&view=diff
==============================================================================
--- ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/ProcessConf.java (original)
+++ ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/ProcessConf.java Tue May 12 15:23:30 2009
@@ -30,14 +30,13 @@
 import javax.xml.namespace.QName;
 
 import org.apache.ode.bpel.evt.BpelEvent;
+import org.apache.ode.bpel.rapi.ProcessModel;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 
 /**
  * Deployed process configuration. IMPORTANT: Implementations of this class <em>MUST BE IMMUTABLE</em>,
  * otherwise the engine will get confused.  
- * 
- * @author mriou <mriou at apache dot org>
  */
 public interface ProcessConf {
 
@@ -64,13 +63,26 @@
      * @return <code>true</code> if this is a transient process.
      */
     boolean isTransient();
-    
+
+    /**
+     * Indicates whether this process implements REST-style resources.
+     */
+    boolean isRestful();
+
     /**
      * Get the CBP stream. 
      * @return new stream to the CBP file.
      */
     InputStream getCBPInputStream();
-   
+
+    /**
+     * Returns the process model is it's already been loaded. Implementations of ProcessConf aren't required to
+     * implement this method, it's only present for optimization purposes. Users should default to getCBPInputStream()
+     * when this method isn't supported.
+     * @throw UnsupportedOperationException
+     */
+    ProcessModel getProcessModel();
+
     /**
      * Get the path of the BPEL document, relative to its deployment unit 
      * @return Relative path of BPEL document

Added: ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/RESTInMessageExchange.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/RESTInMessageExchange.java?rev=773939&view=auto
==============================================================================
--- ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/RESTInMessageExchange.java (added)
+++ ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/RESTInMessageExchange.java Tue May 12 15:23:30 2009
@@ -0,0 +1,27 @@
+package org.apache.ode.bpel.iapi;
+
+import java.util.concurrent.TimeoutException;
+
+/**
+ * Message exchange used for a web-service based interaction between the integration layer and the
+ * engine. Adds resource information.
+ */
+public interface RESTInMessageExchange extends MessageExchange {
+
+    Resource getResource();
+
+    Status invokeBlocking() throws BpelEngineException, TimeoutException;
+
+    void setRequest(Message message);
+
+    /**
+     * Does that resource instantiates a new process?
+     * @return
+     */
+    boolean isInstantiatingResource();
+
+    /**
+     * Sets a query parameter extracted from the requested URL
+     */
+    void setParameter(String name, String value);
+}

Added: ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/RESTOutMessageExchange.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/RESTOutMessageExchange.java?rev=773939&view=auto
==============================================================================
--- ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/RESTOutMessageExchange.java (added)
+++ ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/RESTOutMessageExchange.java Tue May 12 15:23:30 2009
@@ -0,0 +1,24 @@
+package org.apache.ode.bpel.iapi;
+
+import org.w3c.dom.Element;
+
+import javax.xml.namespace.QName;
+
+/**
+ * Outgoing RESTful message exchange implemented by the engine and used by IL implementations
+ * that can provide RESTful interactions.
+ */
+public interface RESTOutMessageExchange extends MessageExchange {
+
+    Resource getTargetResource();
+
+    Message getRequest();
+
+    void reply(Message response) throws BpelEngineException;
+
+    void replyWithFailure(MessageExchange.FailureType type, String description, Element details) throws BpelEngineException;
+
+    void replyWithFault(QName faultType, Message outputFaultMessage) throws BpelEngineException;
+
+    void replyOneWayOk();
+}

Added: ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/Resource.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/Resource.java?rev=773939&view=auto
==============================================================================
--- ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/Resource.java (added)
+++ ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/Resource.java Tue May 12 15:23:30 2009
@@ -0,0 +1,43 @@
+package org.apache.ode.bpel.iapi;
+
+/**
+ * Web RESTful resource, includes URL, method and content type (defaults to XML).
+ */
+public class Resource {
+
+    private String url;
+    private String contentType;
+    private String method;
+
+    public Resource() { }
+
+    public Resource(String url, String contentType, String method) {
+        this.url = url;
+        this.contentType = contentType;
+        this.method = method;
+    }
+
+    public String getUrl() {
+        return url;
+    }
+
+    public void setUrl(String url) {
+        this.url = url;
+    }
+
+    public String getContentType() {
+        return contentType;
+    }
+
+    public void setContentType(String contentType) {
+        this.contentType = contentType;
+    }
+
+    public String getMethod() {
+        return method;
+    }
+
+    public void setMethod(String method) {
+        this.method = method;
+    }
+}

Added: ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/WSMessageExchange.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/WSMessageExchange.java?rev=773939&view=auto
==============================================================================
--- ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/WSMessageExchange.java (added)
+++ ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/WSMessageExchange.java Tue May 12 15:23:30 2009
@@ -0,0 +1,68 @@
+package org.apache.ode.bpel.iapi;
+
+import javax.xml.namespace.QName;
+import javax.wsdl.Operation;
+import javax.wsdl.PortType;
+
+/**
+ * Message exchange used for a web-service based interaction between the integration layer and the
+ * engine. Adds portType and operation information.
+ */
+public interface WSMessageExchange extends MessageExchange {
+
+    static String PROPERTY_SEP_MYROLE_SESSIONID = "org.apache.ode.bpel.myRoleSessionId";
+    static String PROPERTY_SEP_PARTNERROLE_SESSIONID = "org.apache.ode.bpel.partnerRoleSessionId";
+    static String PROPERTY_SEP_PARTNERROLE_EPR = "org.apache.ode.bpel.partnerRoleEPR";
+
+    /**
+     * Get the name of the operation (WSDL 1.1) / message exchange (WSDL 1.2?).
+     *
+     * @return name of the operation (WSDL 1.1) /message exchange (WSDL 1.2?).
+     */
+    String getOperationName() throws BpelEngineException;
+
+
+    /**
+     * Get a reference to the end-point targeted by this message exchange.
+     * @return end-point reference for this message exchange
+     */
+    EndpointReference getEndpointReference() throws BpelEngineException;
+
+    /**
+     * Get the fault type.
+     * @return fault type, or <code>null</code> if not available/applicable.
+     */
+    QName getFault();
+
+    String getFaultExplanation();
+
+    /**
+     * Get the fault resposne message.
+     * @return fault response, or <code>null</code> if not available/applicable.
+     */
+    Message getFaultResponse();
+
+    /**
+     * Get the operation description for this message exchange.
+     * It is possible that the description cannot be resolved, for example if
+     * the EPR is unknown or if the operation does not exist.
+     * @return WSDL operation description or <code>null</code> if not availble
+     */
+    Operation getOperation();
+
+    /**
+     * Get the port type description for this message exchange.
+     * It is possible that the description cannot be resolved, for example if
+     * the EPR is unknown or if the operation does not exist.
+     * @return WSDL port type description or <code>null</code> if not available.
+     */
+    PortType getPortType();
+
+    /**
+     * Report whether the operation is "safe" in the sense of the WSDL1.2 meaning of the term. That is,
+     * is the operation side-effect free?
+     * @return <code>true</code> if the operation is safe, <code>false</code> otherwise.
+     */
+    public boolean isSafe();
+
+}

Modified: ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/IOContext.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/IOContext.java?rev=773939&r1=773938&r2=773939&view=diff
==============================================================================
--- ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/IOContext.java (original)
+++ ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/IOContext.java Tue May 12 15:23:30 2009
@@ -1,6 +1,7 @@
 package org.apache.ode.bpel.rapi;
 
 import java.util.Date;
+import java.util.Map;
 
 import javax.wsdl.Operation;
 import javax.xml.namespace.QName;
@@ -44,6 +45,8 @@
      */
     void reply(String mexId, PartnerLink plink, String opName, Element msg, QName fault) throws NoSuchOperationException;
 
+    void reply(String mexId, Resource resource, Element msg, QName fault) throws NoSuchOperationException;
+
     /**
      * Invoke a partner.
      * 
@@ -58,6 +61,8 @@
     String /* MexId */invoke(String invokeId, PartnerLink partnerLinkInstance, Operation operation, Element outboundMsg)
             throws UninitializedPartnerEPR;
 
+    String invoke(String requestId, org.apache.ode.bpel.iapi.Resource resource, Element outgoingMessage);
+
     /**
      * Get partner's response to an invoke.
      * 
@@ -86,8 +91,13 @@
      */
     Element getMyRequest(String mexId);
 
+
     void releasePartnerMex(String mexId, boolean instanceSucceeded);
 
+    public Map<String,String> getProperties(String mexId);
+
+    void setInstantiatingMex(String mexId);
+
     Element getSourceEPR(String mexId);
 
     String getSourceSessionId(String mexId);

Modified: ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/OdeRTInstanceContext.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/OdeRTInstanceContext.java?rev=773939&r1=773938&r2=773939&view=diff
==============================================================================
--- ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/OdeRTInstanceContext.java (original)
+++ ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/OdeRTInstanceContext.java Tue May 12 15:23:30 2009
@@ -39,7 +39,8 @@
  */
 public interface OdeRTInstanceContext extends IOContext, ProcessControlContext, RecoveryContext, VariableContext {
 
-    Long getPid();
+
+	Long getInstanceId();
 
     /**
      * Sends the bpel event.

Modified: ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/OdeRuntime.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/OdeRuntime.java?rev=773939&r1=773938&r2=773939&view=diff
==============================================================================
--- ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/OdeRuntime.java (original)
+++ ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/OdeRuntime.java Tue May 12 15:23:30 2009
@@ -24,5 +24,8 @@
 
     String extractMatch(Element msgData, PropertyExtractor extractor) throws FaultException;
 
+    String extractAddress(ResourceModel resource) throws FaultException;
+
     void setExtensionRegistry(Map<String, ExtensionBundleRuntime> extensionRegistry);
+
 }

Modified: ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/ProcessModel.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/ProcessModel.java?rev=773939&r1=773938&r2=773939&view=diff
==============================================================================
--- ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/ProcessModel.java (original)
+++ ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/ProcessModel.java Tue May 12 15:23:30 2009
@@ -15,6 +15,8 @@
 
     String getGuid();
 
+    Collection<? extends ResourceModel> getProvidedResources();
+
     QName getQName();
 
     List<String> getCorrelators();
@@ -22,8 +24,10 @@
     ActivityModel getChild(final int id);
 
     int getModelVersion();
-    
+
     ConstantsModel getConstantsModel();
     
     ScopeModel getProcessScope();
+
+    byte[] getGlobalState();
 }

Added: ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/Resource.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/Resource.java?rev=773939&view=auto
==============================================================================
--- ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/Resource.java (added)
+++ ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/Resource.java Tue May 12 15:23:30 2009
@@ -0,0 +1,10 @@
+package org.apache.ode.bpel.rapi;
+
+public interface Resource {
+
+    String getName();
+
+    ResourceModel getModel();
+
+    Long getScopeInstanceId();
+}

Added: ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/ResourceModel.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/ResourceModel.java?rev=773939&view=auto
==============================================================================
--- ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/ResourceModel.java (added)
+++ ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/ResourceModel.java Tue May 12 15:23:30 2009
@@ -0,0 +1,17 @@
+package org.apache.ode.bpel.rapi;
+
+/**
+ * Compiled representation of a web resource.
+ */
+public interface ResourceModel {
+
+    String getName();
+
+    Object getSubpath();
+
+    ResourceModel getReference();
+
+    String getMethod();
+
+    boolean isInstantiateResource();
+}

Modified: ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/VariableContext.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/VariableContext.java?rev=773939&r1=773938&r2=773939&view=diff
==============================================================================
--- ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/VariableContext.java (original)
+++ ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/VariableContext.java Tue May 12 15:23:30 2009
@@ -89,6 +89,13 @@
     void initializePartnerLinks(Long parentScopeId,
                                 Collection<? extends PartnerLinkModel> partnerLinks);
 
+    void initializeResource(Long parentScopeId, ResourceModel resource, String url);
+
+    void initializeInstantiatingUrl(String url);
+
+    String getInstantiatingUrl();
+
+    void checkResourceRoute(Resource instance, String pickResponseChannel, int selectorIdx);
 
     /**
      * Fetches the my-role endpoint reference data.

Modified: ode/trunk/bpel-dao/src/main/java/org/apache/ode/bpel/dao/BpelDAOConnection.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-dao/src/main/java/org/apache/ode/bpel/dao/BpelDAOConnection.java?rev=773939&r1=773938&r2=773939&view=diff
==============================================================================
--- ode/trunk/bpel-dao/src/main/java/org/apache/ode/bpel/dao/BpelDAOConnection.java (original)
+++ ode/trunk/bpel-dao/src/main/java/org/apache/ode/bpel/dao/BpelDAOConnection.java Tue May 12 15:23:30 2009
@@ -131,4 +131,13 @@
      * @return a ProcessManagement DAO
      */
     ProcessManagementDAO getProcessManagement();
+
+    ResourceRouteDAO getResourceRoute(String url, String method);
+
+    void deleteResourceRoute(String url, String method);
+
+    /**
+     * Potentially loads a lot of (small) records, handle with care.
+     */
+    List<ResourceRouteDAO> getAllResourceRoutes();
 }

Modified: ode/trunk/bpel-dao/src/main/java/org/apache/ode/bpel/dao/MessageExchangeDAO.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-dao/src/main/java/org/apache/ode/bpel/dao/MessageExchangeDAO.java?rev=773939&r1=773938&r2=773939&view=diff
==============================================================================
--- ode/trunk/bpel-dao/src/main/java/org/apache/ode/bpel/dao/MessageExchangeDAO.java (original)
+++ ode/trunk/bpel-dao/src/main/java/org/apache/ode/bpel/dao/MessageExchangeDAO.java Tue May 12 15:23:30 2009
@@ -20,10 +20,12 @@
 
 import java.util.Date;
 import java.util.Set;
+import java.util.Map;
 
 import javax.xml.namespace.QName;
 
 import org.apache.ode.bpel.iapi.InvocationStyle;
+import org.apache.ode.bpel.iapi.Resource;
 import org.apache.ode.bpel.iapi.MessageExchange.AckType;
 import org.apache.ode.bpel.iapi.MessageExchange.FailureType;
 import org.apache.ode.bpel.iapi.MessageExchange.MessageExchangePattern;
@@ -176,6 +178,10 @@
 
     Element getEPR();
 
+    String getResource();
+
+    void setResource(String resourceStr);
+
     MessageExchangePattern getPattern();
 
     /**
@@ -248,6 +254,8 @@
 
     Set<String> getPropertyNames();
 
+    Map<String,String> getProperties();
+
     void setPartnerLink(PartnerLinkDAO plinkDAO);
 
     PartnerLinkDAO getPartnerLink();
@@ -279,4 +287,7 @@
     
     void setPipedPID(QName pipedPid);
 
+    boolean isInstantiatingResource();
+
+    void setInstantiatingResource(boolean inst);
  }

Modified: ode/trunk/bpel-dao/src/main/java/org/apache/ode/bpel/dao/ProcessInstanceDAO.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-dao/src/main/java/org/apache/ode/bpel/dao/ProcessInstanceDAO.java?rev=773939&r1=773938&r2=773939&view=diff
==============================================================================
--- ode/trunk/bpel-dao/src/main/java/org/apache/ode/bpel/dao/ProcessInstanceDAO.java (original)
+++ ode/trunk/bpel-dao/src/main/java/org/apache/ode/bpel/dao/ProcessInstanceDAO.java Tue May 12 15:23:30 2009
@@ -165,9 +165,6 @@
 
     /**
      * Returns all the scopes belonging to this isntance.
-     * 
-     * @param scopeName
-     * @return
      */
     Collection<ScopeDAO> getScopes();
 
@@ -179,6 +176,14 @@
     CorrelatorDAO getInstantiatingCorrelator();
 
     /**
+     * Returns the URL this instance has been instantiated under.
+     * @return
+     */
+    String getInstantiatingUrl();
+    
+    void setInstantiatingUrl(String url);
+
+    /**
      * Returns all variable instances matching the variable name for a specified scope.
      */
     XmlDataDAO[] getVariables(String variableName, int scopeModelId);
@@ -252,8 +257,11 @@
      * Create an activity recovery object for a given activity instance. Specify the reason and optional data associated with the
      * failure. Date/time failure occurred, and the recovery channel and available recovery actions.
      */
-    void createActivityRecovery(String channel, long activityId, String reason, Date dateTime, Element data, String[] actions,
-            int retries);
+    void createActivityRecovery(String channel, long activityId, String reason, Date dateTime,
+                                Element data, String[] actions, int retries);
+
+
+    void createResourceRoute(String url, String method, String pickResponseChannel, int selectorIdx);
 
     /**
      * Delete previously registered activity recovery.
@@ -264,6 +272,8 @@
 
     public void setExecutionStateCounter(int stateCounter);
 
+    Set<String> getAllResourceRoutes();
+
     /**
      * Transport object holding the date of the first and last instance event along with the number events.
      */

Added: ode/trunk/bpel-dao/src/main/java/org/apache/ode/bpel/dao/ResourceRouteDAO.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-dao/src/main/java/org/apache/ode/bpel/dao/ResourceRouteDAO.java?rev=773939&view=auto
==============================================================================
--- ode/trunk/bpel-dao/src/main/java/org/apache/ode/bpel/dao/ResourceRouteDAO.java (added)
+++ ode/trunk/bpel-dao/src/main/java/org/apache/ode/bpel/dao/ResourceRouteDAO.java Tue May 12 15:23:30 2009
@@ -0,0 +1,22 @@
+package org.apache.ode.bpel.dao;
+
+public interface ResourceRouteDAO {
+    public String getUrl();
+
+    public void setUrl(String url);
+
+    public String getMethod();
+
+    public void setMethod(String method);
+
+    public String getPickResponseChannel();
+
+    public void setPickResponseChannel(String pickResponseChannel);
+
+    public int getSelectorIdx();
+
+    public void setSelectorIdx(int selectorIdx);
+
+    public ProcessInstanceDAO getInstance();
+
+}

Modified: ode/trunk/bpel-schemas/src/main/xsd/pmapi.xsd
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-schemas/src/main/xsd/pmapi.xsd?rev=773939&r1=773938&r2=773939&view=diff
==============================================================================
--- ode/trunk/bpel-schemas/src/main/xsd/pmapi.xsd (original)
+++ ode/trunk/bpel-schemas/src/main/xsd/pmapi.xsd Tue May 12 15:23:30 2009
@@ -595,7 +595,6 @@
                 </annotation>
             </element>
             <element name="failures" type="pmapi:tFailuresInfo" minOccurs="0"/>
-            <element name="myElement" type="string"/>
         </sequence>
     </complexType>
     <complexType name="tScopeRef">

Modified: ode/trunk/bpel-store/src/main/java/org/apache/ode/store/ProcessConfImpl.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-store/src/main/java/org/apache/ode/store/ProcessConfImpl.java?rev=773939&r1=773938&r2=773939&view=diff
==============================================================================
--- ode/trunk/bpel-store/src/main/java/org/apache/ode/store/ProcessConfImpl.java (original)
+++ ode/trunk/bpel-store/src/main/java/org/apache/ode/store/ProcessConfImpl.java Tue May 12 15:23:30 2009
@@ -46,6 +46,7 @@
 import org.apache.ode.bpel.iapi.ProcessState;
 import org.apache.ode.bpel.iapi.EndpointReferenceContext;
 import org.apache.ode.bpel.iapi.EndpointReference;
+import org.apache.ode.bpel.rapi.ProcessModel;
 import org.apache.ode.store.DeploymentUnitDir.CBPInfo;
 import org.apache.ode.utils.DOMUtils;
 import org.apache.ode.utils.HierarchicalProperties;
@@ -220,6 +221,10 @@
         }
     }
 
+    public ProcessModel getProcessModel() {
+        throw new UnsupportedOperationException();
+    }
+
     public String getBpelDocument() {
         CBPInfo cbpInfo = _du.getCBPInfo(getType());
         if (cbpInfo == null)
@@ -277,6 +282,10 @@
         return _inMemory;
     }
 
+    public boolean isRestful() {
+        return getProvideEndpoints().size() == 0;
+    }
+
     public void setTransient(boolean t) {
         _pinfo.setInMemory(t);
         _inMemory = t;

Modified: ode/trunk/bpel-test/src/main/java/org/apache/ode/test/BindingContextImpl.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-test/src/main/java/org/apache/ode/test/BindingContextImpl.java?rev=773939&r1=773938&r2=773939&view=diff
==============================================================================
--- ode/trunk/bpel-test/src/main/java/org/apache/ode/test/BindingContextImpl.java (original)
+++ ode/trunk/bpel-test/src/main/java/org/apache/ode/test/BindingContextImpl.java Tue May 12 15:23:30 2009
@@ -21,10 +21,7 @@
 import javax.wsdl.PortType;
 import javax.xml.namespace.QName;
 
-import org.apache.ode.bpel.iapi.BindingContext;
-import org.apache.ode.bpel.iapi.Endpoint;
-import org.apache.ode.bpel.iapi.EndpointReference;
-import org.apache.ode.bpel.iapi.PartnerRoleChannel;
+import org.apache.ode.bpel.iapi.*;
 import org.apache.ode.utils.DOMUtils;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
@@ -54,4 +51,11 @@
 		return new PartnerRoleChannelImpl();
 	}
 
+    public void activateProvidedResource(Resource resource) {
+        throw new UnsupportedOperationException();
+    }
+
+    public void deactivateProvidedResource(Resource resource) {
+        throw new UnsupportedOperationException();
+    }
 }

Modified: ode/trunk/bpel-test/src/main/java/org/apache/ode/test/MessageExchangeContextImpl.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-test/src/main/java/org/apache/ode/test/MessageExchangeContextImpl.java?rev=773939&r1=773938&r2=773939&view=diff
==============================================================================
--- ode/trunk/bpel-test/src/main/java/org/apache/ode/test/MessageExchangeContextImpl.java (original)
+++ ode/trunk/bpel-test/src/main/java/org/apache/ode/test/MessageExchangeContextImpl.java Tue May 12 15:23:30 2009
@@ -25,15 +25,7 @@
 
 import javax.xml.namespace.QName;
 
-import org.apache.ode.bpel.iapi.BpelEngineException;
-import org.apache.ode.bpel.iapi.ContextException;
-import org.apache.ode.bpel.iapi.EndpointReference;
-import org.apache.ode.bpel.iapi.InvocationStyle;
-import org.apache.ode.bpel.iapi.Message;
-import org.apache.ode.bpel.iapi.MessageExchangeContext;
-import org.apache.ode.bpel.iapi.MyRoleMessageExchange;
-import org.apache.ode.bpel.iapi.PartnerRoleChannel;
-import org.apache.ode.bpel.iapi.PartnerRoleMessageExchange;
+import org.apache.ode.bpel.iapi.*;
 import org.apache.ode.utils.DOMUtils;
 import org.w3c.dom.Element;
 import org.xml.sax.SAXException;
@@ -150,13 +142,14 @@
 
     public void invokePartnerReliable(PartnerRoleMessageExchange mex) throws ContextException {
         // TODO Auto-generated method stub
-        
     }
 
     public void invokePartnerTransacted(PartnerRoleMessageExchange mex) throws ContextException {
         // TODO Auto-generated method stub
-        
     }
 
+    public void invokeRestful(RESTOutMessageExchange mex) throws ContextException {
+        throw new UnsupportedOperationException("No support for RESTful invocations");
+    }
 
 }

Modified: ode/trunk/bpel-test/src/test/java/org/apache/ode/test/MessageRouting20Test.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-test/src/test/java/org/apache/ode/test/MessageRouting20Test.java?rev=773939&r1=773938&r2=773939&view=diff
==============================================================================
--- ode/trunk/bpel-test/src/test/java/org/apache/ode/test/MessageRouting20Test.java (original)
+++ ode/trunk/bpel-test/src/test/java/org/apache/ode/test/MessageRouting20Test.java Tue May 12 15:23:30 2009
@@ -57,9 +57,9 @@
 		 * <receive> and a subsequent <pick> that does not define a correlation
 		 * key. The BPEL compiler should throw an exception indicating
 		 * the BPEL code error ( verify with spec ).
-		 * 
+		 *
 		 * See JIRA ODE-64
-		 * 
+		 *
 		 */
 		// TODO fix the bug first
 		negative("target/test-classes/bpel/2.0/NegativeCorrelationTest");
@@ -73,11 +73,11 @@
 		 * compiler should throw an exception indicating
 		 * the BPEL error ( verify with spec ) or at runtime
 		 * a clear initialization exception should be thrown.
-		 * 
+		 *
 		 * See JIRA ODE-61.
-		 * 
+		 *
 		 * The message exchange should return with a Fault/Failure.
-		 * 
+		 *
 		 */
 		// TODO fix the bug first
 		negative("target/test-classes/bpel/2.0/NegativeInitializationTest");

Modified: ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/SessionManager.java
URL: http://svn.apache.org/viewvc/ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/SessionManager.java?rev=773939&r1=773938&r2=773939&view=diff
==============================================================================
--- ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/SessionManager.java (original)
+++ ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/SessionManager.java Tue May 12 15:23:30 2009
@@ -100,7 +100,8 @@
             .addClass(HVariableProperty.class)
             .addClass(HBpelEvent.class)
 	        .addClass(HFaultData.class)
-	    .addClass(HActivityRecovery.class)
+	        .addClass(HActivityRecovery.class)
+	        .addClass(HResourceRoute.class)
             .addClass(HLargeData.class);
   }
 

Modified: ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/BpelDAOConnectionImpl.java
URL: http://svn.apache.org/viewvc/ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/BpelDAOConnectionImpl.java?rev=773939&r1=773938&r2=773939&view=diff
==============================================================================
--- ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/BpelDAOConnectionImpl.java (original)
+++ ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/BpelDAOConnectionImpl.java Tue May 12 15:23:30 2009
@@ -90,7 +90,33 @@
         }
 	}
 
-	public ProcessDAO createProcess(QName pid, QName type, String guid, long version) {
+    public ResourceRouteDAO getResourceRoute(String url, String method) {
+        try {
+            Criteria criteria = _session.createCriteria(HResourceRoute.class);
+            criteria.add(Expression.eq("url", url));
+            criteria.add(Expression.eq("method", method));
+            HResourceRoute hrr = (HResourceRoute) criteria.uniqueResult();
+            return hrr == null ? null : new ResourceRouteDaoImpl(_sm, hrr);
+        } catch (HibernateException e) {
+            __log.error("DbError", e);
+            throw e;
+        }
+    }
+
+    public void deleteResourceRoute(String url, String method) {
+        _session.createQuery("delete from HResourceRoute r where r.url = :url and r.method = :method")
+                .setString("url", url).setString("method", method).executeUpdate();
+    }
+
+    public List<ResourceRouteDAO> getAllResourceRoutes() {
+        List<HResourceRoute> hrr = _session.createCriteria(HResourceRoute.class).list();
+        ArrayList<ResourceRouteDAO> rr = new ArrayList<ResourceRouteDAO>(hrr.size());
+        for (HResourceRoute hroute : hrr)
+            rr.add(new ResourceRouteDaoImpl(_sm, hroute));
+        return rr;
+    }
+
+    public ProcessDAO createProcess(QName pid, QName type, String guid, long version) {
         HProcess process = new HProcess();
         process.setProcessId(pid.toString());
         process.setTypeName(type.getLocalPart());

Modified: ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/MessageExchangeDaoImpl.java
URL: http://svn.apache.org/viewvc/ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/MessageExchangeDaoImpl.java?rev=773939&r1=773938&r2=773939&view=diff
==============================================================================
--- ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/MessageExchangeDaoImpl.java (original)
+++ ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/MessageExchangeDaoImpl.java Tue May 12 15:23:30 2009
@@ -22,6 +22,7 @@
 import java.util.Collections;
 import java.util.Date;
 import java.util.Set;
+import java.util.Map;
 
 import javax.xml.namespace.QName;
 
@@ -48,7 +49,6 @@
 public class MessageExchangeDaoImpl extends HibernateDao implements MessageExchangeDAO {
 
     private HMessageExchange _hself;
-    
 
     // Used when provided process and instance aren't hibernate implementations. The relation
     // therefore can't be persisted. Used for in-mem DAOs so that doesn't matter much. 
@@ -152,7 +152,7 @@
     }
 
     public void setOperation(String opname) {
-      entering("MessageExchangeDaoImpl.setOperation");
+        entering("MessageExchangeDaoImpl.setOperation");
         _hself.setOperationName(opname);
         update();
     }
@@ -348,6 +348,10 @@
         // This deletes endpoint LData, callbackEndpoint LData, request HMessage, response HMessage, HMessageExchangeProperty 
     }
 
+    public Map<String,String> getProperties() {
+        return _hself.getProperties();
+    }
+    
     public InvocationStyle getInvocationStyle() {
         return _hself.getInvocationStyle() == null ? null : InvocationStyle.valueOf(_hself.getInvocationStyle());
     }
@@ -398,4 +402,20 @@
         _hself.setPipedPID(pipedPid == null ? null : pipedPid.toString());
         
     }
+
+    public void setResource(String resource) {
+        _hself.setResource(resource);
+    }
+
+    public String getResource() {
+        return _hself.getResource();
+    }
+
+    public boolean isInstantiatingResource() {
+        return _hself.isInstantiatingResource();
+    }
+
+    public void setInstantiatingResource(boolean inst) {
+        _hself.setInstantiatingResource(inst);
+    }
 }

Modified: ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/ProcessInstanceDaoImpl.java
URL: http://svn.apache.org/viewvc/ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/ProcessInstanceDaoImpl.java?rev=773939&r1=773938&r2=773939&view=diff
==============================================================================
--- ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/ProcessInstanceDaoImpl.java (original)
+++ ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/ProcessInstanceDaoImpl.java Tue May 12 15:23:30 2009
@@ -510,7 +510,32 @@
 
     public void setExecutionStateCounter(int stateCounter) {
         _instance.setExecutionStateCounter(stateCounter);
+    }
+
+    public String getInstantiatingUrl() {
+        return _instance.getInstantiatingUrl();
+    }
 
+    public void setInstantiatingUrl(String url) {
+        _instance.setInstantiatingUrl(url);
     }
 
+    public void createResourceRoute(String url, String method, String pickResponseChannel, int selectorIdx) {
+        HResourceRoute resRoute = new HResourceRoute();
+        resRoute.setUrl(url);
+        resRoute.setMethod(method);
+        resRoute.setChannelId(pickResponseChannel);
+        resRoute.setIndex(selectorIdx);
+        resRoute.setInstance(_instance);
+        getSession().save(resRoute);
+    }
+
+    public Set<String> getAllResourceRoutes() {
+        Set<HResourceRoute> rr = _instance.getResourceRoutes();
+        HashSet<String> rs = new HashSet<String>();
+        for (HResourceRoute hResourceRoute : rr) {
+            rs.add(hResourceRoute.getUrl() + "~" + hResourceRoute.getMethod());
+        }
+        return rs;
+    }
 }

Added: ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/ResourceRouteDaoImpl.java
URL: http://svn.apache.org/viewvc/ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/ResourceRouteDaoImpl.java?rev=773939&view=auto
==============================================================================
--- ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/ResourceRouteDaoImpl.java (added)
+++ ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/ResourceRouteDaoImpl.java Tue May 12 15:23:30 2009
@@ -0,0 +1,52 @@
+package org.apache.ode.daohib.bpel;
+
+import org.apache.ode.bpel.dao.ResourceRouteDAO;
+import org.apache.ode.bpel.dao.ProcessInstanceDAO;
+import org.apache.ode.daohib.bpel.hobj.HResourceRoute;
+import org.apache.ode.daohib.SessionManager;
+
+public class ResourceRouteDaoImpl extends HibernateDao implements ResourceRouteDAO {
+
+    HResourceRoute _self;
+
+    public ResourceRouteDaoImpl(SessionManager sessionManager, HResourceRoute hrr) {
+        super(sessionManager, hrr);
+        _self = hrr;
+    }
+
+    public String getUrl() {
+        return _self.getUrl();
+    }
+
+    public void setUrl(String url) {
+        _self.setUrl(url);
+    }
+
+    public String getMethod() {
+        return _self.getMethod();
+    }
+
+    public void setMethod(String method) {
+        _self.setMethod(method);
+    }
+
+    public String getPickResponseChannel() {
+        return _self.getChannelId();
+    }
+
+    public void setPickResponseChannel(String channelId) {
+        _self.setChannelId(channelId);
+    }
+
+    public int getSelectorIdx() {
+        return _self.getIndex();
+    }
+
+    public void setSelectorIdx(int index) {
+        _self.setIndex(index);
+    }
+
+    public ProcessInstanceDAO getInstance() {
+        return new ProcessInstanceDaoImpl(_sm, _self.getInstance());
+    }
+}

Modified: ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/hobj/HCorrelatorSelector.java
URL: http://svn.apache.org/viewvc/ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/hobj/HCorrelatorSelector.java?rev=773939&r1=773938&r2=773939&view=diff
==============================================================================
--- ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/hobj/HCorrelatorSelector.java (original)
+++ ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/hobj/HCorrelatorSelector.java Tue May 12 15:23:30 2009
@@ -43,7 +43,7 @@
         _instance = instance;
     }
 
-    /**
+    /** after c
      * @hibernate.property column="SELGRPID"
      * @hibernate.column name="SELGRPID" index="IDX_SELECTOR_SELGRPID" not-null="true"
      */

Modified: ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/hobj/HMessageExchange.java
URL: http://svn.apache.org/viewvc/ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/hobj/HMessageExchange.java?rev=773939&r1=773938&r2=773939&view=diff
==============================================================================
--- ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/hobj/HMessageExchange.java (original)
+++ ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/hobj/HMessageExchange.java Tue May 12 15:23:30 2009
@@ -57,6 +57,8 @@
 
     private HPartnerLink _partnerLink;
 
+    private String _resource;
+
     private String _clientKey;
 
     private HProcessInstance _instance;
@@ -93,6 +95,8 @@
 
     private String _pipedPid;
 
+    private boolean _instantiatingResource;
+
     /**
      * 
      */
@@ -426,4 +430,27 @@
     public void setPipedPID(String ppid) {
         _pipedPid = ppid;
     }
+
+    /**
+     * @hibernate.property column="RESOURCE" length="255"
+     */
+    public String getResource() {
+        return _resource;
+    }
+
+    public void setResource(String resource) {
+        this._resource = resource;
+    }
+
+    /**
+     * @hibernate.property column="INST_RES"
+     */
+    public boolean isInstantiatingResource() {
+        return _instantiatingResource;
+    }
+
+    public void setInstantiatingResource(boolean inst) {
+        _instantiatingResource = inst;
+    }
+
 }

Modified: ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/hobj/HProcessInstance.java
URL: http://svn.apache.org/viewvc/ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/hobj/HProcessInstance.java?rev=773939&r1=773938&r2=773939&view=diff
==============================================================================
--- ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/hobj/HProcessInstance.java (original)
+++ ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/hobj/HProcessInstance.java Tue May 12 15:23:30 2009
@@ -45,6 +45,8 @@
     /** Foreign key to the instantiating {@link HCorrelator}. */
     private HCorrelator _instantiatingCorrelator;
 
+    private String _instantiatingUrl;
+
     /** Scope instances belonging to this process instnace. */
     private Collection<HScope> _scopes = new HashSet<HScope>();
 
@@ -57,6 +59,8 @@
 
     private Set<HMessageExchange> _messageExchanges = new HashSet<HMessageExchange>();
 
+    private Set<HResourceRoute> _resourceRoutes = new HashSet<HResourceRoute>();
+
     private HFaultData _fault;
 
     private HLargeData _jacobState;
@@ -161,6 +165,19 @@
     }
 
     /**
+     * @hibernate.set lazy="true" inverse="true" cascade="delete"
+     * @hibernate.collection-key column="PIID"
+     * @hibernate.collection-one-to-many class="org.apache.ode.daohib.bpel.hobj.HResourceRoute"
+     */
+    public Set<HResourceRoute> getResourceRoutes() {
+        return _resourceRoutes;
+    }
+
+    public void setResourceRoutes(Set<HResourceRoute> rroutes) {
+        _resourceRoutes = rroutes;
+    }
+
+    /**
      * @hibernate.property column="PREVIOUS_STATE"
      */
     public short getPreviousState() {
@@ -290,4 +307,15 @@
         
     }
 
+    /**
+     * @hibernate.property column="INSTANTIATE_URL" size=255
+     * @return
+     */
+    public String getInstantiatingUrl() {
+        return _instantiatingUrl;
+    }
+
+    public void setInstantiatingUrl(String instantiatingUrl) {
+        _instantiatingUrl = instantiatingUrl;
+    }
 }

Added: ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/hobj/HResourceRoute.java
URL: http://svn.apache.org/viewvc/ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/hobj/HResourceRoute.java?rev=773939&view=auto
==============================================================================
--- ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/hobj/HResourceRoute.java (added)
+++ ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/hobj/HResourceRoute.java Tue May 12 15:23:30 2009
@@ -0,0 +1,72 @@
+package org.apache.ode.daohib.bpel.hobj;
+
+/**
+ * @hibernate.class table="BPEL_RES_ROUTE"
+ */
+public class HResourceRoute extends HObject {
+
+    private String _url;
+    private String _method;
+    private String _channelId;
+    private int _index;
+    private HProcessInstance _instance;
+
+    public HResourceRoute() {
+        super();
+    }
+
+    /**
+     * @hibernate.property column="URL" not-null="true" size="255" unique="true"
+     */
+    public String getUrl() {
+        return _url;
+    }
+
+    public void setUrl(String url) {
+        _url = url;
+    }
+
+    /**
+     * @hibernate.property column="METHOD" not-null="true" size="8"
+     */
+    public String getMethod() {
+        return _method;
+    }
+
+    public void setMethod(String method) {
+        _method = method;
+    }
+
+    /**
+     * @hibernate.property column="CHANNEL" not-null="true"
+     */
+    public String getChannelId() {
+        return _channelId;
+    }
+
+    public void setChannelId(String channelId) {
+        _channelId = channelId;
+    }
+
+    /**
+     * @hibernate.property column="INDEX" not-null="true"
+     */
+    public int getIndex() {
+        return _index;
+    }
+
+    public void setIndex(int index) {
+        _index = index;
+    }
+
+    /**
+     * @hibernate.many-to-one column="PIID"
+     */
+    public HProcessInstance getInstance() {
+        return _instance;
+    }
+
+    public void setInstance(HProcessInstance instance) {
+        _instance = instance;
+    }
+}

Modified: ode/trunk/dao-jpa-db/src/main/descriptors/persistence.derby.xml
URL: http://svn.apache.org/viewvc/ode/trunk/dao-jpa-db/src/main/descriptors/persistence.derby.xml?rev=773939&r1=773938&r2=773939&view=diff
==============================================================================
--- ode/trunk/dao-jpa-db/src/main/descriptors/persistence.derby.xml (original)
+++ ode/trunk/dao-jpa-db/src/main/descriptors/persistence.derby.xml Tue May 12 15:23:30 2009
@@ -31,6 +31,7 @@
         <class>org.apache.ode.dao.jpa.PartnerLinkDAOImpl</class>
         <class>org.apache.ode.dao.jpa.ProcessDAOImpl</class>
         <class>org.apache.ode.dao.jpa.ProcessInstanceDAOImpl</class>
+        <class>org.apache.ode.dao.jpa.ResourceRouteDAOImpl</class>
         <class>org.apache.ode.dao.jpa.ScopeDAOImpl</class>
         <class>org.apache.ode.dao.jpa.XmlDataDAOImpl</class>
         

Modified: ode/trunk/dao-jpa-db/src/main/descriptors/persistence.mysql.xml
URL: http://svn.apache.org/viewvc/ode/trunk/dao-jpa-db/src/main/descriptors/persistence.mysql.xml?rev=773939&r1=773938&r2=773939&view=diff
==============================================================================
--- ode/trunk/dao-jpa-db/src/main/descriptors/persistence.mysql.xml (original)
+++ ode/trunk/dao-jpa-db/src/main/descriptors/persistence.mysql.xml Tue May 12 15:23:30 2009
@@ -31,6 +31,7 @@
         <class>org.apache.ode.dao.jpa.PartnerLinkDAOImpl</class>
         <class>org.apache.ode.dao.jpa.ProcessDAOImpl</class>
         <class>org.apache.ode.dao.jpa.ProcessInstanceDAOImpl</class>
+        <class>org.apache.ode.dao.jpa.ResourceRouteDAOImpl</class>
         <class>org.apache.ode.dao.jpa.ScopeDAOImpl</class>
         <class>org.apache.ode.dao.jpa.XmlDataDAOImpl</class>
 

Modified: ode/trunk/dao-jpa-db/src/main/descriptors/persistence.oracle.xml
URL: http://svn.apache.org/viewvc/ode/trunk/dao-jpa-db/src/main/descriptors/persistence.oracle.xml?rev=773939&r1=773938&r2=773939&view=diff
==============================================================================
--- ode/trunk/dao-jpa-db/src/main/descriptors/persistence.oracle.xml (original)
+++ ode/trunk/dao-jpa-db/src/main/descriptors/persistence.oracle.xml Tue May 12 15:23:30 2009
@@ -31,6 +31,7 @@
         <class>org.apache.ode.dao.jpa.PartnerLinkDAOImpl</class>
         <class>org.apache.ode.dao.jpa.ProcessDAOImpl</class>
         <class>org.apache.ode.dao.jpa.ProcessInstanceDAOImpl</class>
+        <class>org.apache.ode.dao.jpa.ResourceRouteDAOImpl</class>
         <class>org.apache.ode.dao.jpa.ScopeDAOImpl</class>
         <class>org.apache.ode.dao.jpa.XmlDataDAOImpl</class>
 

Modified: ode/trunk/dao-jpa-db/src/test/resources/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/ode/trunk/dao-jpa-db/src/test/resources/META-INF/persistence.xml?rev=773939&r1=773938&r2=773939&view=diff
==============================================================================
--- ode/trunk/dao-jpa-db/src/test/resources/META-INF/persistence.xml (original)
+++ ode/trunk/dao-jpa-db/src/test/resources/META-INF/persistence.xml Tue May 12 15:23:30 2009
@@ -31,6 +31,7 @@
         <class>org.apache.ode.dao.jpa.PartnerLinkDAOImpl</class>
         <class>org.apache.ode.dao.jpa.ProcessDAOImpl</class>
         <class>org.apache.ode.dao.jpa.ProcessInstanceDAOImpl</class>
+        <class>org.apache.ode.dao.jpa.ResourceRouteDAOImpl</class>
         <class>org.apache.ode.dao.jpa.ScopeDAOImpl</class>
         <class>org.apache.ode.dao.jpa.XmlDataDAOImpl</class>
 

Modified: ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/BPELDAOConnectionImpl.java
URL: http://svn.apache.org/viewvc/ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/BPELDAOConnectionImpl.java?rev=773939&r1=773938&r2=773939&view=diff
==============================================================================
--- ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/BPELDAOConnectionImpl.java (original)
+++ ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/BPELDAOConnectionImpl.java Tue May 12 15:23:30 2009
@@ -308,6 +308,23 @@
         return (MessageExchangeDAOImpl) l.get(0);
     }
 
+    public ResourceRouteDAO getResourceRoute(String url, String method) {
+        List l = _em.createQuery("select r from ResourceRouteDAOImpl r where r._url = ?1 and r._method = ?2")
+            .setParameter(1, url).setParameter(2, method).getResultList();
+        if (l.size() == 0) return null;
+        ResourceRouteDAOImpl m = (ResourceRouteDAOImpl) l.get(0);
+        return m;
+    }
+
+    public List<ResourceRouteDAO> getAllResourceRoutes() {
+        return _em.createQuery("select r from ResourceRouteDAOImpl r").getResultList();
+    }
+
+    public void deleteResourceRoute(String url, String method) {
+        _em.createQuery("delete from ResourceRouteDAOImpl r where r._url = ?1 and r._method = ?2")
+            .setParameter(1, url).setParameter(2, method).executeUpdate();
+    }
+
     public EntityManager getEntityManager() {
         return _em;
     }

Modified: ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/MessageDAOImpl.java
URL: http://svn.apache.org/viewvc/ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/MessageDAOImpl.java?rev=773939&r1=773938&r2=773939&view=diff
==============================================================================
--- ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/MessageDAOImpl.java (original)
+++ ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/MessageDAOImpl.java Tue May 12 15:23:30 2009
@@ -67,7 +67,7 @@
     }
 
     public MessageDAOImpl(QName type, MessageExchangeDAOImpl me) {
-        _type = type.toString();
+        if (_type != null) _type = type.toString();
     }
 
     public Element getData() {

Modified: ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/MessageExchangeDAOImpl.java
URL: http://svn.apache.org/viewvc/ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/MessageExchangeDAOImpl.java?rev=773939&r1=773938&r2=773939&view=diff
==============================================================================
--- ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/MessageExchangeDAOImpl.java (original)
+++ ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/MessageExchangeDAOImpl.java Tue May 12 15:23:30 2009
@@ -19,12 +19,7 @@
 
 package org.apache.ode.dao.jpa;
 
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.StringTokenizer;
+import java.util.*;
 
 import javax.persistence.Basic;
 import javax.persistence.CascadeType;
@@ -86,6 +81,8 @@
     private char _direction;
 	@Lob   @Column(name="EPR")
     private String _epr;
+	@Basic   @Column(name="RESOURCE", length=255)
+    private String _resource;
 	@Transient private
     Element _eprElement;
 	@Basic @Column(name="FAULT")
@@ -140,6 +137,9 @@
     @Basic @Column(name="PIPED_PID")
     private String _pipedPid;
 
+    @Basic @Column(name="INST_RES")
+    private boolean _instantiatingResource;
+
     public MessageExchangeDAOImpl() {}
     
 	public MessageExchangeDAOImpl(String mexId, char direction){
@@ -248,6 +248,14 @@
         return propNames;
 	}
 
+    public Map<String,String> getProperties() {
+        HashMap<String,String> res = new  HashMap<String, String>();
+        for (MexProperty prop : _props) {
+            res.put(prop.getPropertyKey(), prop.getPropertyValue());
+        }
+        return res;
+    }
+
 	public MessageDAO getRequest() {
 		return _request;
 	}
@@ -427,4 +435,20 @@
     public void setPipedPID(QName pipedPid) {
         _pipedPid = pipedPid == null ? null : pipedPid.toString();
     }
+
+    public String getResource() {
+        return _resource;
+    }
+
+    public void setResource(String resourceStr) {
+        _resource = resourceStr;
+    }
+
+    public boolean isInstantiatingResource() {
+        return _instantiatingResource;
+    }
+
+    public void setInstantiatingResource(boolean inst) {
+        _instantiatingResource = inst;
+    }
 }

Modified: ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/ProcessInstanceDAOImpl.java
URL: http://svn.apache.org/viewvc/ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/ProcessInstanceDAOImpl.java?rev=773939&r1=773938&r2=773939&view=diff
==============================================================================
--- ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/ProcessInstanceDAOImpl.java (original)
+++ ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/ProcessInstanceDAOImpl.java Tue May 12 15:23:30 2009
@@ -69,7 +69,10 @@
     private long _sequence;
 	@Basic @Column(name="DATE_CREATED")
     private Date _dateCreated = new Date();
-    
+
+	@Basic @Column(name="INSTANTIATE_URL", length=255)
+    private String _instantiatingUrl;
+
     @Basic @Column(name="EXEC_STATE_COUNTER")
     private int _execStateCounter;
 	
@@ -79,12 +82,13 @@
     private Collection<ScopeDAO> _scopes = new ArrayList<ScopeDAO>();
 	@OneToMany(targetEntity=ActivityRecoveryDAOImpl.class,mappedBy="_instance",fetch=FetchType.LAZY,cascade={CascadeType.ALL})
     private Collection<ActivityRecoveryDAO> _recoveries = new ArrayList<ActivityRecoveryDAO>();
-
     @Basic @Column(name="FAULT_ID", insertable=false, updatable=false, nullable=true)
     @SuppressWarnings("unused")
     private long _faultId;
 	@OneToOne(fetch=FetchType.LAZY,cascade={CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}) @Column(name="FAULT_ID")
 	private FaultDAOImpl _fault;
+    @OneToMany(targetEntity=ResourceRouteDAOImpl.class,mappedBy="_instance",fetch=FetchType.LAZY,cascade={CascadeType.ALL})
+    private Collection<ResourceRouteDAO> _resourceRoutes = new ArrayList<ResourceRouteDAO>();
 	@ManyToOne(fetch=FetchType.LAZY,cascade={CascadeType.PERSIST}) @Column(name="PROCESS_ID")
 	private ProcessDAOImpl _process;
 	@ManyToOne(fetch=FetchType.LAZY,cascade={CascadeType.PERSIST}) @Column(name="INSTANTIATING_CORRELATOR_ID")
@@ -210,7 +214,29 @@
 
     }
 
-	public void finishCompletion() {
+    public String getInstantiatingUrl() {
+        return _instantiatingUrl;
+    }
+
+    public void setInstantiatingUrl(String url) {
+        _instantiatingUrl = url;
+    }
+
+    public void createResourceRoute(String url, String method, String pickResponseChannel, int selectorIdx) {
+        ResourceRouteDAOImpl rr = new ResourceRouteDAOImpl(url, method, pickResponseChannel, selectorIdx, this);
+        rr.setInstance(this);
+        _resourceRoutes.add(rr);
+    }
+
+    public Set<String> getAllResourceRoutes() {
+        HashSet<String> rs = new HashSet<String>();
+        for (ResourceRouteDAO resourceRoute : _resourceRoutes) {
+            rs.add(resourceRoute.getUrl() + "~" + resourceRoute.getMethod());
+        }
+        return rs;
+    }
+
+    public void finishCompletion() {
 	    // make sure we have completed.
 	    assert (ProcessState.isFinished(this.getState()));
 	    // let our process know that we've done our work.

Added: ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/ResourceRouteDAOImpl.java
URL: http://svn.apache.org/viewvc/ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/ResourceRouteDAOImpl.java?rev=773939&view=auto
==============================================================================
--- ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/ResourceRouteDAOImpl.java (added)
+++ ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/ResourceRouteDAOImpl.java Tue May 12 15:23:30 2009
@@ -0,0 +1,83 @@
+package org.apache.ode.dao.jpa;
+
+import org.apache.ode.bpel.dao.ResourceRouteDAO;
+
+import javax.persistence.*;
+
+@Entity
+@Table(name="ODE_RESOURCE_ROUTE")
+public class ResourceRouteDAOImpl extends OpenJPADAO implements ResourceRouteDAO {
+
+    @Id @Column(name="ID")
+  	@GeneratedValue(strategy= GenerationType.AUTO)
+	  private Long _id;
+    @Basic @Column(name="URL", length=255)
+    private String _url;
+    @Basic @Column(name="METHOD", length=8)
+    private String _method;
+    @Basic @Column(name="CHANNEL")
+    private String _channelId;
+    @Basic @Column(name="ROUTE_INDEX")
+    private int _index;
+
+    @ManyToOne(fetch=FetchType.LAZY,cascade={CascadeType.PERSIST}) @Column(name="INSTANCE_ID")
+    private ProcessInstanceDAOImpl _instance;
+
+    public ResourceRouteDAOImpl() { }
+
+    public ResourceRouteDAOImpl(String url, String method, String channelId, int index, ProcessInstanceDAOImpl instance) {
+        _url = url;
+        _channelId = channelId;
+        _index = index;
+        _instance = instance;
+        _method = method;
+    }
+
+    public Long getId() {
+        return _id;
+    }
+
+    public void setId(Long id) {
+        _id = id;
+    }
+
+    public String getUrl() {
+        return _url;
+    }
+
+    public void setUrl(String url) {
+        _url = url;
+    }
+
+    public String getPickResponseChannel() {
+        return _channelId;
+    }
+
+    public void setPickResponseChannel(String channelId) {
+        _channelId = channelId;
+    }
+
+    public int getSelectorIdx() {
+        return _index;
+    }
+
+    public void setSelectorIdx(int index) {
+        _index = index;
+    }
+
+    public String getMethod() {
+        return _method;
+    }
+
+    public void setMethod(String method) {
+        _method = method;
+    }
+
+    public ProcessInstanceDAOImpl getInstance() {
+        return _instance;
+    }
+
+    public void setInstance(ProcessInstanceDAOImpl instance) {
+        _instance = instance;
+    }
+}

Modified: ode/trunk/dao-jpa/src/main/resources/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/ode/trunk/dao-jpa/src/main/resources/META-INF/persistence.xml?rev=773939&r1=773938&r2=773939&view=diff
==============================================================================
--- ode/trunk/dao-jpa/src/main/resources/META-INF/persistence.xml (original)
+++ ode/trunk/dao-jpa/src/main/resources/META-INF/persistence.xml Tue May 12 15:23:30 2009
@@ -37,6 +37,7 @@
         <class>org.apache.ode.dao.jpa.PartnerLinkDAOImpl</class>
         <class>org.apache.ode.dao.jpa.ProcessDAOImpl</class>
         <class>org.apache.ode.dao.jpa.ProcessInstanceDAOImpl</class>
+        <class>org.apache.ode.dao.jpa.ResourceRouteDAOImpl</class>
         <class>org.apache.ode.dao.jpa.ScopeDAOImpl</class>
         <class>org.apache.ode.dao.jpa.XmlDataDAOImpl</class>
         <class>org.apache.ode.dao.jpa.CorrSetProperty</class>

Modified: ode/trunk/engine/src/main/java/org/apache/ode/bpel/engine/BpelInstanceWorker.java
URL: http://svn.apache.org/viewvc/ode/trunk/engine/src/main/java/org/apache/ode/bpel/engine/BpelInstanceWorker.java?rev=773939&r1=773938&r2=773939&view=diff
==============================================================================
--- ode/trunk/engine/src/main/java/org/apache/ode/bpel/engine/BpelInstanceWorker.java (original)
+++ ode/trunk/engine/src/main/java/org/apache/ode/bpel/engine/BpelInstanceWorker.java Tue May 12 15:23:30 2009
@@ -77,7 +77,6 @@
      *             forwarded from {@link Callable#call()}
      */
     <T> T execInCurrentThread(Callable<T> callable) throws Exception {
-
         // Allow recursive invocations. This allows us to nest P2P invocations to an arbitrary depth.
         if (isWorkerThread())
             return doInstanceWork(callable);
@@ -103,13 +102,11 @@
             throw new BpelEngineException("Thread interrupted.", ex);
         }
 
-
         try {
             return doInstanceWork(callable);
         } finally {
             finished.release();
         }
-
     }