Author: mriou
Date: Fri Feb 27 01:45:01 2009
New Revision: 748374
URL: http://svn.apache.org/viewvc?rev=748374&view=rev
Log:
Making life a little easier for tooling developers. DebuggerSupport is now
public at the IAPI level. No remoting yet but that wouldn't be too hard to add.
Added:
ode/branches/APACHE_ODE_1.X/bpel-api/src/main/java/org/apache/ode/bpel/iapi/DebuggerContext.java
Modified:
ode/branches/APACHE_ODE_1.X/bpel-api/src/main/java/org/apache/ode/bpel/iapi/BpelServer.java
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelServerImpl.java
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/DebuggerSupport.java
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/BpelRuntimeContext.java
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/INVOKE.java
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/test/java/org/apache/ode/bpel/runtime/CoreBpelTest.java
ode/branches/APACHE_ODE_1.X/bpel-store/src/main/java/org/apache/ode/store/ConfStoreConnectionFactory.java
ode/branches/APACHE_ODE_1.X/bpel-test/src/main/java/org/apache/ode/test/BPELTestAbstract.java
ode/branches/APACHE_ODE_1.X/bpel-test/src/test/java/org/apache/ode/test/BasicActivities20Test.java
Modified:
ode/branches/APACHE_ODE_1.X/bpel-api/src/main/java/org/apache/ode/bpel/iapi/BpelServer.java
URL:
http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-api/src/main/java/org/apache/ode/bpel/iapi/BpelServer.java?rev=748374&r1=748373&r2=748374&view=diff
==============================================================================
---
ode/branches/APACHE_ODE_1.X/bpel-api/src/main/java/org/apache/ode/bpel/iapi/BpelServer.java
(original)
+++
ode/branches/APACHE_ODE_1.X/bpel-api/src/main/java/org/apache/ode/bpel/iapi/BpelServer.java
Fri Feb 27 01:45:01 2009
@@ -118,5 +118,12 @@
void unregister(QName pid) throws BpelEngineException;
void cleanupProcess(QName pid) throws BpelEngineException;
+
+ /**
+ * @param pid The process definition QName
+ * @return The debugger support.
+ * @throws BpelEngineException if we could not find the process
+ */
+ DebuggerContext getDebugger(QName pid) throws BpelEngineException;
}
Added:
ode/branches/APACHE_ODE_1.X/bpel-api/src/main/java/org/apache/ode/bpel/iapi/DebuggerContext.java
URL:
http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-api/src/main/java/org/apache/ode/bpel/iapi/DebuggerContext.java?rev=748374&view=auto
==============================================================================
---
ode/branches/APACHE_ODE_1.X/bpel-api/src/main/java/org/apache/ode/bpel/iapi/DebuggerContext.java
(added)
+++
ode/branches/APACHE_ODE_1.X/bpel-api/src/main/java/org/apache/ode/bpel/iapi/DebuggerContext.java
Fri Feb 27 01:45:01 2009
@@ -0,0 +1,64 @@
+/*
+ * 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.iapi;
+
+import org.apache.ode.bpel.bdi.breaks.Breakpoint;
+
+/**
+ * Support for debugging a process:
+ * breakpoints, suspend, continue, step and terminate.
+ * <br/>
+ * This object is associated to a particular process definition.
+ * <p>
+ * iid: Process instance id.
+ * </p>
+ *
+ * @author mriou
+ */
+public interface DebuggerContext {
+
+ boolean step(Long iid);
+
+ boolean resume(final Long iid);
+
+ void suspend(final Long iid);
+
+ void terminate(final Long iid);
+
+ Breakpoint[] getGlobalBreakpoints();
+
+ Breakpoint[] getBreakpoints(Long iid);
+
+ void addGlobalBreakpoint(Breakpoint breakpoint);
+
+ void addBreakpoint(Long pid, Breakpoint breakpoint);
+
+ void removeGlobalBreakpoint(Breakpoint breakpoint);
+
+ void removeBreakpoint(Long iid, Breakpoint breakpoint);
+
+ /**
+ * @return the process model.
+ * Currently an {...@link org.apache.ode.bpel.o.OProcess}
+ * However it is not guaranteed that it will remain an OProcess
+ * in future versions of ODE or for different types
+ * of process lanaguage than BPEL.
+ */
+ public Object getProcessModel();
+}
Modified:
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java
URL:
http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java?rev=748374&r1=748373&r2=748374&view=diff
==============================================================================
---
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java
(original)
+++
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java
Fri Feb 27 01:45:01 2009
@@ -648,7 +648,19 @@
_bpelProcess._engine._contexts.scheduler.scheduleVolatileJob(true,
we.getDetail());
}
- public String invoke(PartnerLinkInstance partnerLink, Operation operation,
Element outgoingMessage,
+ /**
+ * Called back when the process executes an invokation.
+ *
+ * @param activityId The activity id in the process definition (id of
OInvoke)
+ * @param partnerLinkInstance The partner link variable instance
+ * @param operation The wsdl operation.
+ * @param outboundMsg The message sent outside as a DOM
+ * @param invokeResponseChannel Object called back when the response is
received.
+ * @return The instance id of the message exchange.
+ * @throws FaultException When the response is a fault or when the invoke
could not be executed
+ * in which case it is one of the bpel standard fault.
+ */
+ public String invoke(int aid, PartnerLinkInstance partnerLink, Operation
operation, Element outgoingMessage,
InvokeResponseChannel channel) throws FaultException {
PartnerLinkDAO plinkDAO = fetchPartnerLinkDAO(partnerLink);
@@ -715,6 +727,8 @@
PartnerRoleMessageExchangeImpl mex =
createPartnerRoleMessageExchangeImpl(mexDao, partnerLink,
operation, partnerEpr, myRoleEndpoint);
+ mex.setProperty("activityId", ""+aid);
+
List<BpelProcess> p2pProcesses = null;
Endpoint partnerEndpoint =
_bpelProcess.getInitialPartnerRoleEndpoint(partnerLink.partnerLink);
Modified:
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelServerImpl.java
URL:
http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelServerImpl.java?rev=748374&r1=748373&r2=748374&view=diff
==============================================================================
---
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelServerImpl.java
(original)
+++
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelServerImpl.java
Fri Feb 27 01:45:01 2009
@@ -39,6 +39,7 @@
import org.apache.ode.bpel.iapi.BpelEngineException;
import org.apache.ode.bpel.iapi.BpelEventListener;
import org.apache.ode.bpel.iapi.BpelServer;
+import org.apache.ode.bpel.iapi.DebuggerContext;
import org.apache.ode.bpel.iapi.EndpointReferenceContext;
import org.apache.ode.bpel.iapi.MessageExchangeContext;
import org.apache.ode.bpel.iapi.ProcessConf;
@@ -463,4 +464,7 @@
_contexts.bindingContext = bc;
}
+ public DebuggerContext getDebugger(QName pid) throws BpelEngineException {
+ return _engine._activeProcesses.get(pid)._debugger;
+ }
}
Modified:
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/DebuggerSupport.java
URL:
http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/DebuggerSupport.java?rev=748374&r1=748373&r2=748374&view=diff
==============================================================================
---
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/DebuggerSupport.java
(original)
+++
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/DebuggerSupport.java
Fri Feb 27 01:45:01 2009
@@ -20,6 +20,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.ode.bpel.iapi.DebuggerContext;
import org.apache.ode.bpel.bdi.breaks.Breakpoint;
import org.apache.ode.bpel.common.ProcessState;
import org.apache.ode.bpel.dao.BpelDAOConnection;
@@ -32,6 +33,7 @@
import org.apache.ode.bpel.evt.ProcessInstanceStateChangeEvent;
import org.apache.ode.bpel.evt.ProcessTerminationEvent;
import org.apache.ode.bpel.evt.ScopeCompletionEvent;
+import org.apache.ode.bpel.o.OProcess;
import org.apache.ode.bpel.pmapi.BpelManagementFacade;
import org.apache.ode.bpel.pmapi.InstanceNotFoundException;
import org.apache.ode.bpel.pmapi.ManagementException;
@@ -56,7 +58,7 @@
*
* @todo Need to revisit the whole stepping/suspend/resume mechanism.
*/
-public class DebuggerSupport {
+public class DebuggerSupport implements DebuggerContext {
private static final Log __log = LogFactory.getLog(DebuggerSupport.class);
private static final Messages __msgs =
MessageBundle.getMessages(Messages.class);
@@ -395,4 +397,14 @@
}
+
+ /**
+ * @return the process model. Currently an {...@link OProcess}
+ * However it is not guaranteed that it will remain an OProcess
+ * in future versions of ODE or for different types
+ * of process lanaguage than BPEL.
+ */
+ public Object getProcessModel() {
+ return _process.getOProcess();
+ }
}
Modified:
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/BpelRuntimeContext.java
URL:
http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/BpelRuntimeContext.java?rev=748374&r1=748373&r2=748374&view=diff
==============================================================================
---
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/BpelRuntimeContext.java
(original)
+++
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/BpelRuntimeContext.java
Fri Feb 27 01:45:01 2009
@@ -197,10 +197,20 @@
QName fault)
throws FaultException;
-
- String invoke(PartnerLinkInstance partnerLinkInstance,
- Operation operation,
- Element outboundMsg,
+ /**
+ * Called back when the process executes an invokation.
+ *
+ * @param activityId The activity id in the process definition (id of
OInvoke)
+ * @param partnerLinkInstance The partner link variable instance
+ * @param operation The wsdl operation.
+ * @param outboundMsg The message sent outside as a DOM
+ * @param invokeResponseChannel Object called back when the response is
received.
+ * @return The instance id of the message exchange.
+ * @throws FaultException When the response is a fault or when the invoke
could not be executed
+ * in which case it is one of the bpel standard fault.
+ */
+ String invoke(int activityId, PartnerLinkInstance partnerLinkInstance,
+ Operation operation, Element outboundMsg,
InvokeResponseChannel invokeResponseChannel) throws
FaultException;
Modified:
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/INVOKE.java
URL:
http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/INVOKE.java?rev=748374&r1=748373&r2=748374&view=diff
==============================================================================
---
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/INVOKE.java
(original)
+++
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/INVOKE.java
Fri Feb 27 01:45:01 2009
@@ -88,7 +88,7 @@
try {
if (!isTwoWay) {
FaultData faultData = null;
- getBpelRuntimeContext().invoke(
+ getBpelRuntimeContext().invoke(_oinvoke.getId(),
_scopeFrame.resolve(_oinvoke.partnerLink),
_oinvoke.operation, outboundMsg, null);
_self.parent.completed(faultData,
CompensationHandler.emptySet());
@@ -97,7 +97,7 @@
final VariableInstance outputVar =
_scopeFrame.resolve(_oinvoke.outputVar);
InvokeResponseChannel invokeResponseChannel =
newChannel(InvokeResponseChannel.class);
- final String mexId = getBpelRuntimeContext().invoke(
+ final String mexId =
getBpelRuntimeContext().invoke(_oinvoke.getId(),
_scopeFrame.resolve(_oinvoke.partnerLink),
_oinvoke.operation,
outboundMsg, invokeResponseChannel);
Modified:
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/test/java/org/apache/ode/bpel/runtime/CoreBpelTest.java
URL:
http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-runtime/src/test/java/org/apache/ode/bpel/runtime/CoreBpelTest.java?rev=748374&r1=748373&r2=748374&view=diff
==============================================================================
---
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/test/java/org/apache/ode/bpel/runtime/CoreBpelTest.java
(original)
+++
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/test/java/org/apache/ode/bpel/runtime/CoreBpelTest.java
Fri Feb 27 01:45:01 2009
@@ -149,7 +149,7 @@
throws FaultException {
}
- public String invoke(PartnerLinkInstance partnerLinkInstance, Operation
operation, Element outboundMsg,
+ public String invoke(int aid, PartnerLinkInstance partnerLinkInstance,
Operation operation, Element outboundMsg,
InvokeResponseChannel invokeResponseChannel) {
return null;
}
Modified:
ode/branches/APACHE_ODE_1.X/bpel-store/src/main/java/org/apache/ode/store/ConfStoreConnectionFactory.java
URL:
http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-store/src/main/java/org/apache/ode/store/ConfStoreConnectionFactory.java?rev=748374&r1=748373&r2=748374&view=diff
==============================================================================
---
ode/branches/APACHE_ODE_1.X/bpel-store/src/main/java/org/apache/ode/store/ConfStoreConnectionFactory.java
(original)
+++
ode/branches/APACHE_ODE_1.X/bpel-store/src/main/java/org/apache/ode/store/ConfStoreConnectionFactory.java
Fri Feb 27 01:45:01 2009
@@ -25,5 +25,5 @@
public interface ConfStoreConnectionFactory {
- ConfStoreConnection getConnection() ;
+ ConfStoreConnection getConnection();
}
Modified:
ode/branches/APACHE_ODE_1.X/bpel-test/src/main/java/org/apache/ode/test/BPELTestAbstract.java
URL:
http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-test/src/main/java/org/apache/ode/test/BPELTestAbstract.java?rev=748374&r1=748373&r2=748374&view=diff
==============================================================================
---
ode/branches/APACHE_ODE_1.X/bpel-test/src/main/java/org/apache/ode/test/BPELTestAbstract.java
(original)
+++
ode/branches/APACHE_ODE_1.X/bpel-test/src/main/java/org/apache/ode/test/BPELTestAbstract.java
Fri Feb 27 01:45:01 2009
@@ -314,8 +314,6 @@
ex.printStackTrace();
failure(d, "DEPLOY: Wrong exception; expected " +
d.expectedException + " but got " + ex.getClass(), ex);
}
-
-
return;
}
Modified:
ode/branches/APACHE_ODE_1.X/bpel-test/src/test/java/org/apache/ode/test/BasicActivities20Test.java
URL:
http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-test/src/test/java/org/apache/ode/test/BasicActivities20Test.java?rev=748374&r1=748373&r2=748374&view=diff
==============================================================================
---
ode/branches/APACHE_ODE_1.X/bpel-test/src/test/java/org/apache/ode/test/BasicActivities20Test.java
(original)
+++
ode/branches/APACHE_ODE_1.X/bpel-test/src/test/java/org/apache/ode/test/BasicActivities20Test.java
Fri Feb 27 01:45:01 2009
@@ -31,7 +31,7 @@
public class BasicActivities20Test extends BPELTestAbstract {
@Test public void testHelloWorld2() throws Throwable {
- go("/bpel/2.0/HelloWorld2");
+ go("/bpel/2.0/HelloWorld2");
}
@Test public void testNegativeTargetNS1() throws Throwable {