Author: heiko.braun(a)jboss.com
Date: 2009-11-06 08:44:23 -0500 (Fri, 06 Nov 2009)
New Revision: 246
Added:
branches/hbraun/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/InvocationAdapter.java
branches/hbraun/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WSInvocationAdapter.java
branches/hbraun/runtime/jbossesb-bpel/src/main/java/org/jboss/soa/esb/actions/bpel/ESBInvocationAdapter.java
Removed:
branches/hbraun/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/InvocationContext.java
branches/hbraun/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WSInvocationContext.java
branches/hbraun/runtime/jbossesb-bpel/src/main/java/org/jboss/soa/esb/actions/bpel/ESBInvocationContext.java
Modified:
branches/hbraun/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/BPELEngine.java
branches/hbraun/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/BPELEngineImpl.java
branches/hbraun/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/AbstractWebServiceEndpoint.java
branches/hbraun/runtime/jbossesb-bpel/src/main/java/org/jboss/soa/esb/actions/bpel/BPELInvoke.java
branches/hbraun/runtime/jbossesb-bpel/src/test/java/org/jboss/soa/esb/actions/bpel/TestBPELEngine.java
Log:
Docs and API comments
Modified:
branches/hbraun/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/BPELEngine.java
===================================================================
---
branches/hbraun/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/BPELEngine.java 2009-11-06
13:30:21 UTC (rev 245)
+++
branches/hbraun/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/BPELEngine.java 2009-11-06
13:44:23 UTC (rev 246)
@@ -38,11 +38,11 @@
/**
*
- * @param invocationContext
+ * @param invocationAdapter
* @throws BPELFault
* @throws Exception
*/
- public void invoke(InvocationContext invocationContext) throws BPELFault, Exception;
+ public void invoke(InvocationAdapter invocationAdapter) throws BPELFault, Exception;
/**
* This method closes the BPEL engine.
Copied:
branches/hbraun/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/InvocationAdapter.java
(from rev 245,
branches/hbraun/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/InvocationContext.java)
===================================================================
---
branches/hbraun/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/InvocationAdapter.java
(rev 0)
+++
branches/hbraun/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/InvocationAdapter.java 2009-11-06
13:44:23 UTC (rev 246)
@@ -0,0 +1,64 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.jboss.soa.bpel.runtime.engine;
+
+import org.apache.ode.bpel.iapi.Message;
+import org.apache.ode.bpel.iapi.MyRoleMessageExchange;
+
+import javax.xml.namespace.QName;
+
+/**
+ * Hides the message translation details when invoking ODE from
+ * an external component (i.e. ESB or WS).
+ *
+ * @see org.jboss.soa.bpel.runtime.engine.BPELEngine#invoke(InvocationAdapter)
+ *
+ * @author Heiko Braun <hbraun(a)redhat.com>
+ */
+public interface InvocationAdapter<T>
+{
+ String getOperationName();
+ QName getServiceName();
+
+ /**
+ * Callback from the Engine towards the adapter when
+ * turning an external message representation into an ODE request {@link
org.apache.ode.bpel.iapi.Message}
+ * @param mex
+ * @param odeRequest
+ */
+ void parseRequest(MyRoleMessageExchange mex, Message odeRequest);
+
+ /**
+ * Callback from the Engine towards the adapter when
+ * turning an ODE response {@link org.apache.ode.bpel.iapi.Message} into an external
format <T>
+ * @param mex
+ */
+ void createResponse(MyRoleMessageExchange mex);
+
+ /**
+ * Access the invocation result (response)
+ * @return T
+ */
+ T getInvocationResult();
+
+}
Deleted:
branches/hbraun/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/InvocationContext.java
===================================================================
---
branches/hbraun/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/InvocationContext.java 2009-11-06
13:30:21 UTC (rev 245)
+++
branches/hbraun/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/InvocationContext.java 2009-11-06
13:44:23 UTC (rev 246)
@@ -1,43 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-
-package org.jboss.soa.bpel.runtime.engine;
-
-import org.apache.ode.bpel.iapi.Message;
-import org.apache.ode.bpel.iapi.MyRoleMessageExchange;
-
-import javax.xml.namespace.QName;
-
-/**
- * @author Heiko Braun <hbraun(a)redhat.com>
- */
-public interface InvocationContext<T>
-{
- String getOperationName();
- QName getServiceName();
-
- void parseRequest(MyRoleMessageExchange mex, Message request);
- void parseResponse(MyRoleMessageExchange mex);
-
- T getInvocationResult();
-
-}
Modified:
branches/hbraun/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/BPELEngineImpl.java
===================================================================
---
branches/hbraun/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/BPELEngineImpl.java 2009-11-06
13:30:21 UTC (rev 245)
+++
branches/hbraun/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/BPELEngineImpl.java 2009-11-06
13:44:23 UTC (rev 246)
@@ -41,7 +41,7 @@
import org.jboss.soa.bpel.runtime.engine.BPELEngine;
import org.jboss.soa.bpel.runtime.engine.BPELFault;
import org.jboss.soa.bpel.runtime.engine.IntegrationLayer;
-import org.jboss.soa.bpel.runtime.engine.InvocationContext;
+import org.jboss.soa.bpel.runtime.engine.InvocationAdapter;
import org.w3c.dom.Element;
import javax.sql.DataSource;
@@ -96,7 +96,7 @@
* required.
* @throws Exception Failed to invoke the operation
*/
- public void invoke(InvocationContext invocationContext)
+ public void invoke(InvocationAdapter invocationAdapter)
throws BPELFault, Exception
{
boolean success = true;
@@ -109,7 +109,7 @@
_txMgr.begin();
if (__log.isDebugEnabled()) __log.debug("Starting transaction.");
- odeMex = createMessageExchange(invocationContext);
+ odeMex = createMessageExchange(invocationAdapter);
//odeMex.setProperty("isTwoWay",
Boolean.toString(msgContext.getAxisOperation() instanceof TwoChannelAxisOperation));
if (odeMex.getOperation() != null)
@@ -118,7 +118,7 @@
Message odeRequest =
odeMex.createMessage(odeMex.getOperation().getInput().getMessage().getQName());
// distinguish WS and ESB invocation
- invocationContext.parseRequest(odeMex, odeRequest);
+ invocationAdapter.parseRequest(odeMex, odeRequest);
// TODO: Might need to store session id/epr of caller?
//readHeader(msgContext, odeMex);
@@ -184,9 +184,9 @@
try {
// Refreshing the message exchange
odeMex = (MyRoleMessageExchange)
_bpelServer.getEngine().getMessageExchange(odeMex.getMessageExchangeId());
- onResponse(odeMex, invocationContext);
+ onResponse(odeMex, invocationAdapter);
- __log.debug("Returning: "+invocationContext.getInvocationResult());
+ __log.debug("Returning: "+ invocationAdapter.getInvocationResult());
commit = true;
@@ -225,17 +225,17 @@
}
- private MyRoleMessageExchange createMessageExchange(InvocationContext context)
+ private MyRoleMessageExchange createMessageExchange(InvocationAdapter adapter)
{
// Creating message exchange
String messageId = new GUID().toString();
MyRoleMessageExchange odeMex = _bpelServer.getEngine()
- .createMessageExchange(messageId, context.getServiceName(),
context.getOperationName());
- __log.debug("ODE routed to operation " + odeMex.getOperation() + "
from service " + context.getServiceName());
+ .createMessageExchange(messageId, adapter.getServiceName(),
adapter.getOperationName());
+ __log.debug("ODE routed to operation " + odeMex.getOperation() + "
from service " + adapter.getServiceName());
return odeMex;
}
- private void onResponse(MyRoleMessageExchange mex, InvocationContext invocationContext)
throws BPELFault, Exception {
+ private void onResponse(MyRoleMessageExchange mex, InvocationAdapter invocationAdapter)
throws BPELFault, Exception {
Element ret=null;
switch (mex.getStatus()) {
@@ -248,7 +248,7 @@
case RESPONSE:
if(true)
{
- invocationContext.parseResponse(mex);
+ invocationAdapter.createResponse(mex);
}
if (__log.isDebugEnabled())
Modified:
branches/hbraun/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/AbstractWebServiceEndpoint.java
===================================================================
---
branches/hbraun/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/AbstractWebServiceEndpoint.java 2009-11-06
13:30:21 UTC (rev 245)
+++
branches/hbraun/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/AbstractWebServiceEndpoint.java 2009-11-06
13:44:23 UTC (rev 246)
@@ -90,7 +90,7 @@
log.debug( "ODE inbound message: \n" +DOMWriter.printNode(soapEnvelope,
true) );
// Create invocation context
- WSInvocationContext invocationContext = new WSInvocationContext(
+ WSInvocationAdapter invocationContext = new WSInvocationAdapter(
messageElement.getLocalName(),
serviceQName,
soapAdapter
Copied:
branches/hbraun/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WSInvocationAdapter.java
(from rev 245,
branches/hbraun/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WSInvocationContext.java)
===================================================================
---
branches/hbraun/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WSInvocationAdapter.java
(rev 0)
+++
branches/hbraun/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WSInvocationAdapter.java 2009-11-06
13:44:23 UTC (rev 246)
@@ -0,0 +1,98 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.soa.bpel.runtime.ws;
+
+import org.apache.ode.bpel.iapi.Message;
+import org.apache.ode.bpel.iapi.MyRoleMessageExchange;
+import org.jboss.soa.bpel.runtime.engine.InvocationAdapter;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.MessageFactory;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+
+/**
+ * @author Heiko Braun <hbraun(a)redhat.com>
+ */
+public final class WSInvocationAdapter implements InvocationAdapter<SOAPMessage>
+{
+ private final String operationName;
+ private final QName serviceName;
+
+ private SOAPMessage soapRequestMessage;
+ private SOAPMessage soapResponseMessage;
+
+ private final SOAPMessageAdapter soapAdapter;
+
+ public WSInvocationAdapter(String operationName,
+ QName serviceName, SOAPMessageAdapter soapAdapter)
+ {
+ this.operationName = operationName;
+ this.serviceName = serviceName;
+ this.soapAdapter = soapAdapter;
+ }
+
+ public String getOperationName()
+ {
+ return operationName;
+ }
+
+ public QName getServiceName()
+ {
+ return serviceName;
+ }
+
+ public void parseRequest(MyRoleMessageExchange mex, Message request)
+ {
+ if(null==soapRequestMessage)
+ throw new IllegalArgumentException("No request SOAPMessage set");
+
+ soapAdapter.parseSoapRequest(request, soapRequestMessage, mex.getOperation());
+ }
+
+ public void createResponse(MyRoleMessageExchange mex)
+ {
+ try
+ {
+ // create SOAPEnvelope
+ soapResponseMessage = MessageFactory.newInstance().createMessage();
+ soapAdapter.createSoapResponse(soapResponseMessage, mex.getResponse(),
mex.getOperation());
+ }
+ catch (SOAPException e)
+ {
+ throw new RuntimeException("Failed to parse SOAP response", e);
+ }
+ }
+
+ public SOAPMessage getInvocationResult()
+ {
+ if(null==soapResponseMessage)
+ throw new IllegalArgumentException("No response SOAPMessage set");
+
+ return soapResponseMessage;
+ }
+
+ public void setSOAPMessage(SOAPMessage soapMessage)
+ {
+ this.soapRequestMessage = soapMessage;
+ }
+}
Deleted:
branches/hbraun/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WSInvocationContext.java
===================================================================
---
branches/hbraun/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WSInvocationContext.java 2009-11-06
13:30:21 UTC (rev 245)
+++
branches/hbraun/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WSInvocationContext.java 2009-11-06
13:44:23 UTC (rev 246)
@@ -1,98 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.soa.bpel.runtime.ws;
-
-import org.apache.ode.bpel.iapi.Message;
-import org.apache.ode.bpel.iapi.MyRoleMessageExchange;
-import org.jboss.soa.bpel.runtime.engine.InvocationContext;
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.MessageFactory;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPMessage;
-
-/**
- * @author Heiko Braun <hbraun(a)redhat.com>
- */
-public final class WSInvocationContext implements InvocationContext<SOAPMessage>
-{
- private final String operationName;
- private final QName serviceName;
-
- private SOAPMessage soapRequestMessage;
- private SOAPMessage soapResponseMessage;
-
- private final SOAPMessageAdapter soapAdapter;
-
- public WSInvocationContext(String operationName,
- QName serviceName, SOAPMessageAdapter soapAdapter)
- {
- this.operationName = operationName;
- this.serviceName = serviceName;
- this.soapAdapter = soapAdapter;
- }
-
- public String getOperationName()
- {
- return operationName;
- }
-
- public QName getServiceName()
- {
- return serviceName;
- }
-
- public void parseRequest(MyRoleMessageExchange mex, Message request)
- {
- if(null==soapRequestMessage)
- throw new IllegalArgumentException("No request SOAPMessage set");
-
- soapAdapter.parseSoapRequest(request, soapRequestMessage, mex.getOperation());
- }
-
- public void parseResponse(MyRoleMessageExchange mex)
- {
- try
- {
- // create SOAPEnvelope
- soapResponseMessage = MessageFactory.newInstance().createMessage();
- soapAdapter.createSoapResponse(soapResponseMessage, mex.getResponse(),
mex.getOperation());
- }
- catch (SOAPException e)
- {
- throw new RuntimeException("Failed to parse SOAP response", e);
- }
- }
-
- public SOAPMessage getInvocationResult()
- {
- if(null==soapResponseMessage)
- throw new IllegalArgumentException("No response SOAPMessage set");
-
- return soapResponseMessage;
- }
-
- public void setSOAPMessage(SOAPMessage soapMessage)
- {
- this.soapRequestMessage = soapMessage;
- }
-}
Modified:
branches/hbraun/runtime/jbossesb-bpel/src/main/java/org/jboss/soa/esb/actions/bpel/BPELInvoke.java
===================================================================
---
branches/hbraun/runtime/jbossesb-bpel/src/main/java/org/jboss/soa/esb/actions/bpel/BPELInvoke.java 2009-11-06
13:30:21 UTC (rev 245)
+++
branches/hbraun/runtime/jbossesb-bpel/src/main/java/org/jboss/soa/esb/actions/bpel/BPELInvoke.java 2009-11-06
13:44:23 UTC (rev 246)
@@ -180,8 +180,8 @@
QName serviceQName = new QName(getNamespace(serviceName),
getLocalPart(serviceName));
// Create invocationContext
- ESBInvocationContext invocationContext =
- new ESBInvocationContext(_config.getAttribute(OPERATION), serviceQName);
+ ESBInvocationAdapter invocationContext =
+ new ESBInvocationAdapter(_config.getAttribute(OPERATION), serviceQName);
invocationContext.setRequestXML(mesgElem);
// invoke ODE
Copied:
branches/hbraun/runtime/jbossesb-bpel/src/main/java/org/jboss/soa/esb/actions/bpel/ESBInvocationAdapter.java
(from rev 245,
branches/hbraun/runtime/jbossesb-bpel/src/main/java/org/jboss/soa/esb/actions/bpel/ESBInvocationContext.java)
===================================================================
---
branches/hbraun/runtime/jbossesb-bpel/src/main/java/org/jboss/soa/esb/actions/bpel/ESBInvocationAdapter.java
(rev 0)
+++
branches/hbraun/runtime/jbossesb-bpel/src/main/java/org/jboss/soa/esb/actions/bpel/ESBInvocationAdapter.java 2009-11-06
13:44:23 UTC (rev 246)
@@ -0,0 +1,90 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.soa.esb.actions.bpel;
+
+import org.apache.ode.bpel.iapi.Message;
+import org.apache.ode.bpel.iapi.MyRoleMessageExchange;
+import org.jboss.soa.bpel.runtime.engine.InvocationAdapter;
+import org.w3c.dom.Element;
+
+import javax.xml.namespace.QName;
+
+/**
+ * @author Heiko Braun <hbraun(a)redhat.com>
+ */
+public class ESBInvocationAdapter implements InvocationAdapter<Element>
+{
+ private String operationName;
+ private QName serviceName;
+ private Element requestXML;
+ private Element responseXML;
+
+ public ESBInvocationAdapter(String operationName, QName serviceName)
+ {
+ this.operationName = operationName;
+ this.serviceName = serviceName;
+ }
+
+ public String getOperationName()
+ {
+ return operationName;
+ }
+
+ public QName getServiceName()
+ {
+ return serviceName;
+ }
+
+ public void setRequestXML(Element requestXML)
+ {
+ this.requestXML = requestXML;
+ }
+
+ public void parseRequest(MyRoleMessageExchange mex, Message request)
+ {
+ if(null==this.requestXML)
+ throw new IllegalArgumentException("request XML not set");
+ request.setMessage(this.requestXML);
+ }
+
+ public void createResponse(MyRoleMessageExchange mex)
+ {
+ this.responseXML = mex.getResponse().getMessage();
+ }
+
+ public Element getInvocationResult()
+ {
+ return this.responseXML;
+ }
+
+ // test methods
+ Element getRequestXML()
+ {
+ return requestXML;
+ }
+
+ void setResponseXML(Element responseXML)
+ {
+ this.responseXML = responseXML;
+ }
+}
+
Deleted:
branches/hbraun/runtime/jbossesb-bpel/src/main/java/org/jboss/soa/esb/actions/bpel/ESBInvocationContext.java
===================================================================
---
branches/hbraun/runtime/jbossesb-bpel/src/main/java/org/jboss/soa/esb/actions/bpel/ESBInvocationContext.java 2009-11-06
13:30:21 UTC (rev 245)
+++
branches/hbraun/runtime/jbossesb-bpel/src/main/java/org/jboss/soa/esb/actions/bpel/ESBInvocationContext.java 2009-11-06
13:44:23 UTC (rev 246)
@@ -1,90 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.soa.esb.actions.bpel;
-
-import org.apache.ode.bpel.iapi.Message;
-import org.apache.ode.bpel.iapi.MyRoleMessageExchange;
-import org.jboss.soa.bpel.runtime.engine.InvocationContext;
-import org.w3c.dom.Element;
-
-import javax.xml.namespace.QName;
-
-/**
- * @author Heiko Braun <hbraun(a)redhat.com>
- */
-public class ESBInvocationContext implements InvocationContext<Element>
-{
- private String operationName;
- private QName serviceName;
- private Element requestXML;
- private Element responseXML;
-
- public ESBInvocationContext(String operationName, QName serviceName)
- {
- this.operationName = operationName;
- this.serviceName = serviceName;
- }
-
- public String getOperationName()
- {
- return operationName;
- }
-
- public QName getServiceName()
- {
- return serviceName;
- }
-
- public void setRequestXML(Element requestXML)
- {
- this.requestXML = requestXML;
- }
-
- public void parseRequest(MyRoleMessageExchange mex, Message request)
- {
- if(null==this.requestXML)
- throw new IllegalArgumentException("request XML not set");
- request.setMessage(this.requestXML);
- }
-
- public void parseResponse(MyRoleMessageExchange mex)
- {
- this.responseXML = mex.getResponse().getMessage();
- }
-
- public Element getInvocationResult()
- {
- return this.responseXML;
- }
-
- // test methods
- Element getRequestXML()
- {
- return requestXML;
- }
-
- void setResponseXML(Element responseXML)
- {
- this.responseXML = responseXML;
- }
-}
-
Modified:
branches/hbraun/runtime/jbossesb-bpel/src/test/java/org/jboss/soa/esb/actions/bpel/TestBPELEngine.java
===================================================================
---
branches/hbraun/runtime/jbossesb-bpel/src/test/java/org/jboss/soa/esb/actions/bpel/TestBPELEngine.java 2009-11-06
13:30:21 UTC (rev 245)
+++
branches/hbraun/runtime/jbossesb-bpel/src/test/java/org/jboss/soa/esb/actions/bpel/TestBPELEngine.java 2009-11-06
13:44:23 UTC (rev 246)
@@ -17,16 +17,13 @@
*/
package org.jboss.soa.esb.actions.bpel;
-import org.apache.ode.bpel.iapi.Message;
-import org.apache.ode.bpel.iapi.MyRoleMessageExchange;
import org.jboss.soa.bpel.runtime.engine.BPELEngine;
import org.jboss.soa.bpel.runtime.engine.BPELFault;
import org.jboss.soa.bpel.runtime.engine.IntegrationLayer;
-import org.jboss.soa.bpel.runtime.engine.InvocationContext;
+import org.jboss.soa.bpel.runtime.engine.InvocationAdapter;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
-import javax.xml.namespace.QName;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
@@ -70,7 +67,7 @@
}
- public void invoke(InvocationContext invocationContext)
+ public void invoke(InvocationAdapter invocationAdapter)
throws BPELFault, Exception {
if (m_fault != null) {
@@ -78,7 +75,7 @@
}
- ESBInvocationContext esbCtx = (ESBInvocationContext) invocationContext;
+ ESBInvocationAdapter esbCtx = (ESBInvocationAdapter) invocationAdapter;
m_request = esbCtx.getRequestXML();
esbCtx.setResponseXML(m_response);
}