Author: mszefler Date: Mon Jun 25 16:27:03 2007 New Revision: 550637 URL: http://svn.apache.org/viewvc?view=rev&rev=550637 Log: BART
Modified: incubator/ode/branches/bart/axis2/src/main/java/org/apache/ode/axis2/MessageExchangeContextImpl.java incubator/ode/branches/bart/bpel-api/src/main/java/org/apache/ode/bpel/iapi/MessageExchangeContext.java incubator/ode/branches/bart/bpel-api/src/main/java/org/apache/ode/bpel/iapi/PartnerRoleMessageExchange.java incubator/ode/branches/bart/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java incubator/ode/branches/bart/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerRoleMessageExchangeImpl.java Modified: incubator/ode/branches/bart/axis2/src/main/java/org/apache/ode/axis2/MessageExchangeContextImpl.java URL: http://svn.apache.org/viewvc/incubator/ode/branches/bart/axis2/src/main/java/org/apache/ode/axis2/MessageExchangeContextImpl.java?view=diff&rev=550637&r1=550636&r2=550637 ============================================================================== --- incubator/ode/branches/bart/axis2/src/main/java/org/apache/ode/axis2/MessageExchangeContextImpl.java (original) +++ incubator/ode/branches/bart/axis2/src/main/java/org/apache/ode/axis2/MessageExchangeContextImpl.java Mon Jun 25 16:27:03 2007 @@ -23,6 +23,7 @@ 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.InvocationStyle; import org.apache.ode.bpel.iapi.MessageExchangeContext; import org.apache.ode.bpel.iapi.MyRoleMessageExchange; import org.apache.ode.bpel.iapi.PartnerRoleMessageExchange; @@ -39,11 +40,11 @@ public MessageExchangeContextImpl(ODEServer server) { } - public void invokePartner(PartnerRoleMessageExchange partnerRoleMessageExchange, InvocationStyle style) throws ContextException { + public void invokePartner(PartnerRoleMessageExchange partnerRoleMessageExchange) throws ContextException { if (__log.isDebugEnabled()) __log.debug("Invoking a partner operation: " + partnerRoleMessageExchange.getOperationName()); - ExternalService service = (ExternalService)partnerRoleMessageExchange.getChannel(); + ExternalService service = (ExternalService)partnerRoleMessageExchange.getPartnerRoleChannel(); if (__log.isDebugEnabled()) __log.debug("The service to invoke is the external service " + service); service.invoke(partnerRoleMessageExchange); @@ -57,8 +58,4 @@ // mex reply when invoking the engine. } - public boolean isStyleSupported(PartnerRoleMessageExchange mex, InvocationStyle style) { - // Currently, we only support BLOCKING invokes. - return style == InvocationStyle.BLOCKING; - } } Modified: incubator/ode/branches/bart/bpel-api/src/main/java/org/apache/ode/bpel/iapi/MessageExchangeContext.java URL: http://svn.apache.org/viewvc/incubator/ode/branches/bart/bpel-api/src/main/java/org/apache/ode/bpel/iapi/MessageExchangeContext.java?view=diff&rev=550637&r1=550636&r2=550637 ============================================================================== --- incubator/ode/branches/bart/bpel-api/src/main/java/org/apache/ode/bpel/iapi/MessageExchangeContext.java (original) +++ incubator/ode/branches/bart/bpel-api/src/main/java/org/apache/ode/bpel/iapi/MessageExchangeContext.java Mon Jun 25 16:27:03 2007 @@ -81,7 +81,13 @@ * @throws ContextException * if the port does not support the operation */ - void invokePartner(PartnerRoleMessageExchange mex) throws ContextException; + void invokePartnerBlocking(PartnerRoleMessageExchange mex) throws ContextException; + + void invokePartnerAsynch(PartnerRoleMessageExchange mex) throws ContextException; + + void invokePartnerReliable(PartnerRoleMessageExchange mex) throws ContextException; + + void invokePartnerTransacted(PartnerRoleMessageExchange mex) throws ContextException; /** * Method used to asynchronously deliver to the integration layer the BPEL engine's response to an invocation that could not Modified: incubator/ode/branches/bart/bpel-api/src/main/java/org/apache/ode/bpel/iapi/PartnerRoleMessageExchange.java URL: http://svn.apache.org/viewvc/incubator/ode/branches/bart/bpel-api/src/main/java/org/apache/ode/bpel/iapi/PartnerRoleMessageExchange.java?view=diff&rev=550637&r1=550636&r2=550637 ============================================================================== --- incubator/ode/branches/bart/bpel-api/src/main/java/org/apache/ode/bpel/iapi/PartnerRoleMessageExchange.java (original) +++ incubator/ode/branches/bart/bpel-api/src/main/java/org/apache/ode/bpel/iapi/PartnerRoleMessageExchange.java Mon Jun 25 16:27:03 2007 @@ -44,7 +44,7 @@ * * @return communication channel, an object created by the IL */ - PartnerRoleChannel getChannel(); + PartnerRoleChannel getPartnerRoleChannel(); /** * Indicate that the partner faulted in processing the message exchange. Modified: incubator/ode/branches/bart/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java URL: http://svn.apache.org/viewvc/incubator/ode/branches/bart/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java?view=diff&rev=550637&r1=550636&r2=550637 ============================================================================== --- incubator/ode/branches/bart/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java (original) +++ incubator/ode/branches/bart/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java Mon Jun 25 16:27:03 2007 @@ -94,6 +94,12 @@ import java.util.List; import java.util.Set; + +/** + * + * + * @author Maciej Szefler + */ class BpelRuntimeContextImpl implements BpelRuntimeContext { private static final Log __log = LogFactory.getLog(BpelRuntimeContextImpl.class); @@ -791,6 +797,15 @@ } + /** + * Invoke a partner via the Integration Layer ("IL"). + * @param partnerLink + * @param operation + * @param outgoingMessage + * @param partnerRoleChannel + * @param partnerEpr + * @param mexDao + */ private void invokeIL( PartnerLinkInstance partnerLink, Operation operation, @@ -808,12 +823,12 @@ // If RELIABLE is supported, this is easy, we just do it in-line. throw new UnsupportedOperationException(); // TODO ReliablePartnerRoleMessageExchangeImpl reliableMex = new ReliablePartnerRoleMessageExchangeImpl(); - _bpelProcess._engine._contexts.mexContext.invokePartner(reliableMex); + _bpelProcess._engine._contexts.mexContext.invokePartnerReliable(reliableMex); } else if (supportedStyles.contains(InvocationStyle.TRANSACTED)){ // If TRANSACTED is supported, this is again easy, do it in-line. throw new UnsupportedOperationException(); // TODO TransactedPartnerRoleMessageExchangeImpl transactedMex = new TransactedPartnerRoleMessageExchangeImpl(); - _bpelProcess._engine._contexts.mexContext.invokePartner(transactedMex); + _bpelProcess._engine._contexts.mexContext.invokePartnerTransacted(transactedMex); } else if (supportedStyles.contains(InvocationStyle.BLOCKING)) { // For BLOCKING invocation, we defer the call until after commit (unless idempotent). BlockingPartnerRoleMessageExchangeImpl blockingMex = new BlockingPartnerRoleMessageExchangeImpl(); @@ -824,7 +839,7 @@ _todoAsyncCalls.add(asyncMex); } else { // This really should not happen, indicates IL is screwy. - __log.error("Integration layer did not agree to any known invocation style for EPR " + DOMUtils.domToString(partnerEPR)); + __log.error("Integration Layer did not agree to any known invocation style for EPR " + DOMUtils.domToString(partnerEPR)); mexDao.setFailureType(FailureType.COMMUNICATION_ERROR.toString()); mexDao.setStatus(Status.FAILURE.toString()); mexDao.setFaultExplanation("NoMatchingStyle"); @@ -839,6 +854,14 @@ } } + /** + * Invoke a partner process directly (via the engine), bypassing the Integration Layer. Obviously this can only + * be used when an process is partners with another process hosted on the same engine. + * + * @param operation + * @param outgoingMessage + * @param mexDao + */ private void invokeP2P(Operation operation, Element outgoingMessage, MessageExchangeDAO mexDao) { if (BpelProcess.__log.isDebugEnabled()) { __log.debug("Invoking in a p2p interaction, partnerrole " + mexDao.getMessageExchangeId() + " - myrole " + myRoleMex); Modified: incubator/ode/branches/bart/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerRoleMessageExchangeImpl.java URL: http://svn.apache.org/viewvc/incubator/ode/branches/bart/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerRoleMessageExchangeImpl.java?view=diff&rev=550637&r1=550636&r2=550637 ============================================================================== --- incubator/ode/branches/bart/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerRoleMessageExchangeImpl.java (original) +++ incubator/ode/branches/bart/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerRoleMessageExchangeImpl.java Mon Jun 25 16:27:03 2007 @@ -34,13 +34,20 @@ import javax.wsdl.PortType; import javax.xml.namespace.QName; +/** + * Base-class implementation of the interface used to expose a partner invocation to the integration + * layer. + * + * @author Maciej Szefler + */ class PartnerRoleMessageExchangeImpl extends MessageExchangeImpl implements PartnerRoleMessageExchange { private static final Log LOG = LogFactory.getLog(PartnerRoleMessageExchangeImpl.class); - private final PartnerRoleChannel _channel; - private EndpointReference _myRoleEPR; - private boolean _inMem; - + protected final PartnerRoleChannel _partnerRoleChannel; + protected EndpointReference _myRoleEPR; + protected boolean _inMem; + protected String _responseChannel; + private QName _caller; PartnerRoleMessageExchangeImpl( @@ -54,7 +61,7 @@ PartnerRoleChannel channel) { super(engine, mexId); _myRoleEPR = myRoleEPR; - _channel = channel; + _partnerRoleChannel = channel; _inMem = inMem; setPortOp(portType, operation); } @@ -113,47 +120,16 @@ if (isAsync) continueAsync(); } + public QName getCaller() { + return _caller; + } - /** - * Continue from the ASYNC state. - * - */ - private void continueAsync() { - // If there is no channel waiting for us, there is nothing to do. - if (getDAO().getChannel() == null) { - if (LOG.isDebugEnabled()) { - LOG.debug("no channel on mex=" + getMessageExchangeId()); - } - return; - } - - if (LOG.isDebugEnabled()) { - LOG.debug("create work event for mex=" + getMessageExchangeId()); - } - WorkEvent we = new WorkEvent(); - we.setIID(_iid); - we.setType(Type.INVOKE_RESPONSE); - if (_inMem) - we.setInMem(true); - we.setChannel(getDAO().getChannel()); - we.setMexId(_mexId); - if (_inMem) - _contexts.scheduler.scheduleVolatileJob(true, we.getDetail()); - else - _contexts.scheduler.schedulePersistedJob(we.getDetail(), null); - } - - /** - * Check if we are in the ASYNC state. - * - * @return - */ - private boolean isAsync() { - return getStatus() == Status.ASYNC; + public PartnerRoleChannel getPartnerRoleChannel() { + return _partnerRoleChannel; } - public QName getCaller() { - return _caller; + public EndpointReference getMyRoleEndpointReference() { + return _myRoleEPR; } public String toString() { @@ -165,14 +141,6 @@ return "{PartnerRoleMex#????}"; } - } - - public PartnerRoleChannel getChannel() { - return _channel; - } - - public EndpointReference getMyRoleEndpointReference() { - return _myRoleEPR; } }