Package org.apache.ode.bpel.iapi.MessageExchange

Examples of org.apache.ode.bpel.iapi.MessageExchange.Status


                        Message request = mex[0].createMessage(_invocation.requestType);
                        request.setMessage(_invocation.request);
                        _invocation.invokeTime = System.currentTimeMillis();
                        running[0] = mex[0].invoke(request);

                        Status status = mex[0].getStatus();
                        CorrelationStatus cstatus = mex[0].getCorrelationStatus();
                        if (_invocation.expectedStatus != null && !status.equals(_invocation.expectedStatus))
                            failure(_invocation, "Unexpected message exchange status", _invocation.expectedStatus, status);

                        if (_invocation.expectedCorrelationStatus != null && !cstatus.equals(_invocation.expectedCorrelationStatus))
                            failure(_invocation, "Unexpected correlation status", _invocation.expectedCorrelationStatus, cstatus);
                        return null;

                    } catch (Exception ex) {
                        if (_invocation.expectedInvokeException == null)
                            failure(_invocation, "Unexpected invocation exception.", ex);
                        else if (_invocation.expectedInvokeException.isAssignableFrom(ex.getClass()))
                            failure(_invocation, "Unexpected invocation exception.", _invocation.expectedInvokeException, ex.getClass());

                        return null;
                    }
                }
            });

            if (isFailed())
                return;

            try {
                running[0].get(_invocation.maximumWaitMs, TimeUnit.MILLISECONDS);
            } catch (Exception ex) {
                failure(_invocation, "Exception on future object.", ex);
                return;
            }

            long ctime = System.currentTimeMillis();
            long itime = ctime - _invocation.invokeTime;
            if (_invocation.minimumWaitMs != null && _invocation.minimumWaitMs >= itime)
                failure(_invocation, "Response received too soon.", _invocation.minimumWaitMs, itime);

            if (_invocation.maximumWaitMs <= itime)
                failure(_invocation, "Response took too long.", _invocation.maximumWaitMs, itime);

            if (isFailed())
                return;

            if (_invocation.expectedResponsePattern != null) {
                scheduler.execTransaction(new Callable<Void>() {
                    public Void call() throws Exception {
                        Status finalstat = mex[0].getStatus();
                        if (_invocation.expectedFinalStatus != null && !_invocation.expectedFinalStatus.equals(finalstat))
                            if (finalstat.equals(Status.FAULT)) {
                                failure(_invocation, "Unexpected final message exchange status", _invocation.expectedFinalStatus, "FAULT: "
                                        + mex[0].getFault() + " | " + mex[0].getFaultExplanation());
                            } else {
                                failure(_invocation, "Unexpected final message exchange status", _invocation.expectedFinalStatus, finalstat);
                            }
View Full Code Here


            // Reloading the mex in the current transaction, otherwise we can't
            // be sure we have the "freshest" one.
            mex = (MyRoleMessageExchange)odeServer.getBpelServer().getEngine().getMessageExchange(mex.getMessageExchangeId());

            if(true) {
                Status status = mex.getStatus();
                Element invocationResponse = mex.getResponse().getMessage();

                System.out.println(">>>Invocation status:" + status.name());
                System.out.println(">>>Response:\n" + DOMUtils.domToString(invocationResponse));
                System.out.println(">>>Response:\n" + DOMUtils.domToString(invocationResponse));
            }
            //process the method invocation result
            response = processResponse(mex.getResponse().getMessage());
View Full Code Here

                Message request = mex.createMessage(_invocation.requestType);
                request.setMessage(_invocation.request);
                _invocation.invokeTime = System.currentTimeMillis();
                running = mex.invoke(request);

                Status status = mex.getStatus();
                CorrelationStatus cstatus = mex.getCorrelationStatus();
                if (_invocation.expectedStatus != null && !status.equals(_invocation.expectedStatus))
                    failure(_invocation, "Unexpected message exchange status", _invocation.expectedStatus, status);

                if (_invocation.expectedCorrelationStatus != null && !cstatus.equals(_invocation.expectedCorrelationStatus))
                    failure(_invocation, "Unexpected correlation status", _invocation.expectedCorrelationStatus, cstatus);

            } catch (Exception ex) {
                if (_invocation.expectedInvokeException == null)
                    failure(_invocation, "Unexpected invocation exception.", ex);
                else if (_invocation.expectedInvokeException.isAssignableFrom(ex.getClass()))
                    failure(_invocation, "Unexpected invocation exception.", _invocation.expectedInvokeException, ex.getClass());

                return;
            } finally {
                scheduler.commit();
            }

            if (isFailed())
                return;

            Status finalstat;
            try {
                finalstat = running.get(_invocation.maximumWaitMs, TimeUnit.MILLISECONDS);
            } catch (Exception ex) {
                failure(_invocation, "Exception on future object.", ex);
                return;
View Full Code Here

  public void onAsyncReply(MyRoleMessageExchange myRoleMex)
      throws BpelEngineException {
   

    Status mStat = myRoleMex.getStatus();
   
 
    if ( mStat == Status.RESPONSE ) {
     
      currentResponse = myRoleMex.getResponse();
View Full Code Here

            txMgr.begin();
            // Reloading the mex in the current transaction, otherwise we can't
            // be sure we have the "freshest" one.
            mex = (MyRoleMessageExchange)odeServer.getBpelServer().getEngine().getMessageExchange(mex.getMessageExchangeId());

            Status status = mex.getStatus();

            switch (status) {
            case FAULT:
                if (__log.isDebugEnabled())
                    __log.debug("Fault response message: " + mex.getFault());
View Full Code Here

            // Reloading the mex in the current transaction, otherwise we can't
            // be sure we have the "freshest" one.
            mex = (MyRoleMessageExchange)odeServer.getBpelServer().getEngine().getMessageExchange(mex.getMessageExchangeId());

            if(true) {
                Status status = mex.getStatus();
                Element invocationResponse = mex.getResponse().getMessage();

                System.out.println(">>>Invocation status:" + status.name());
                System.out.println(">>>Response:\n" + DOMUtils.domToString(invocationResponse));
                System.out.println(">>>Response:\n" + DOMUtils.domToString(invocationResponse));
            }
            //process the method invocation result
            response = processResponse(mex.getResponse().getMessage());
View Full Code Here

        try {
            // The following check is mostly for sanity purposes. MexImpls should prevent this from
            // happening.
            PartnerLinkMyRoleImpl target = getMyRoleForService(mexdao.getCallee());
            constants = target._process.getProcessModel().getConstantsModel();
            Status oldstatus = mexdao.getStatus();
            if (target == null) {
                String errmsg = __msgs.msgMyRoleRoutingFailure(mexdao.getMessageExchangeId());
                __log.error(errmsg);
                MexDaoUtil.setFailed(mexdao, MessageExchange.FailureType.UNKNOWN_ENDPOINT, errmsg);
                onMyRoleMexAck(mexdao, oldstatus);
View Full Code Here

        } else {
            ackType = AckType.RESPONSE;
            evt.setAspect(ProcessMessageExchangeEvent.PROCESS_OUTPUT);
        }

        Status previousStatus = myrolemex.getStatus();
        myrolemex.setStatus(Status.ACK);
        myrolemex.setAckType(ackType);
        _bpelProcess.onMyRoleMexAck(myrolemex, previousStatus);
        sendEvent(evt);
    }
View Full Code Here

    }

    public void noreply(String mexId, FaultInfo optionalFaultData) {
        MessageExchangeDAO mexDao = _dao.getConnection().getMessageExchange(mexId);
        if (mexDao != null) {
            Status status = mexDao.getStatus();
            if (mexDao.getPattern() == MessageExchangePattern.REQUEST_ONLY) {
                mexDao.setAckType(AckType.ONEWAY);
                mexDao.setStatus(Status.COMPLETED);
                return;
            }
View Full Code Here

            // Reloading the mex in the current transaction, otherwise we can't
            // be sure we have the "freshest" one.
            mex = (MyRoleMessageExchange)odeServer.getBpelServer().getEngine().getMessageExchange(mex.getMessageExchangeId());

            if (__log.isDebugEnabled()) {
                Status status = mex.getStatus();
                Element invocationResponse = mex.getResponse().getMessage();
                __log.debug(">>>Invocation status:" + status.name());
                __log.debug(">>>Response:\n" + DOMUtils.domToString(invocationResponse));
                __log.debug(">>>Response:\n" + DOMUtils.domToString(invocationResponse));
            }
               
            //process the method invocation result
View Full Code Here

TOP

Related Classes of org.apache.ode.bpel.iapi.MessageExchange.Status

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.