if (e.getType() == ExchangeType.P && !e.isSetFailure()) { answers.add(e); final Date time = e.getCreateTime().getTime(); scheduler.scheduleReplayerJob(new Callable<Void>() { public Void call() throws Exception {
public void add(Exchange e) { ServiceConfig cfg = getServiceConfig(e.getService()); if (cfg.getReplayType().isSetMock()) { String key = getAnswersKey(e.getService(), e.getOperation()); AnswersForKey v = answersMap.get(key); if (v == null) { v = new AnswersForKey(); answersMap.put(key, v); } v.answers.add(e); } }
if (answer.isSetFault()) { MessageDAO response = mexDao.createMessage(new QName("replayer", "replayer")); try { assign(response, answer.getFault()); } catch (Exception e) { throw new FaultException(new QName("replayer", "replayer"), e); mexDao.setFault(answer.getFault().getType()); mexDao.setFaultExplanation(answer.getFault().getExplanation()); mexDao.setStatus(Status.FAULT.toString()); } else if (answer.isSetOut()) { MessageDAO response = mexDao.createMessage(new QName("replayer", "replayer")); try { assign(response, answer.getOut()); } catch (Exception e) { throw new FaultException(new QName("replayer", "replayer"), e); } else if (answer.isSetFailure()) { mexDao.setFaultExplanation(answer.getFailure().getExplanation()); mexDao.setStatus(Status.FAILURE.toString()); } else {
e.setCreateTime(new XmlCalendar(mexDao.getCreateTime())); e.setOperation(mexDao.getOperation()); try { e.setIn(XmlObject.Factory.parse(mexDao.getRequest().getData())); } catch (XmlException e1) { __log.error("", e1); Status status = Status.valueOf(mexDao.getStatus()); if (status == Status.FAULT) { FaultType f = e.addNewFault(); f.setType(mexDao.getFault()); f.setExplanation(mexDao.getFaultExplanation()); e.addNewFailure().setExplanation(mexDao.getFaultExplanation()); } else { if (mexDao.getResponse() != null) { e.setOut(XmlObject.Factory.parse(mexDao.getResponse().getData())); __log.error("", e1); e.setType(ExchangeType.Enum.forString("" + mexDao.getDirection())); if (e.getType() == ExchangeType.P) { e.setService(mexDao.getPortType()); } else { e.setService(mexDao.getCallee()); result.addNewExchange().set(e);
/** * Sets ith "exchange" element */ public void setExchangeArray(int i, org.apache.ode.bpel.pmapi.CommunicationType.Exchange exchange) { synchronized (monitor()) { check_orphaned(); org.apache.ode.bpel.pmapi.CommunicationType.Exchange target = null; target = (org.apache.ode.bpel.pmapi.CommunicationType.Exchange)get_store().find_element_user(EXCHANGE$6, i); if (target == null) { throw new IndexOutOfBoundsException(); } target.set(exchange); } }
public int compare(Exchange arg0, Exchange arg1) { return arg0.getCreateTime().compareTo(arg1.getCreateTime()); } });
private void scheduleInvoke(final Exchange e, final MyRoleMessageExchangeImpl mex) { final Date time = e.getCreateTime().getTime(); scheduler.scheduleReplayerJob(new Callable<Void>() { public Void call() throws Exception { __log.debug("call " + e); mex.getDAO().setStatus(Status.ASYNC.toString()); runtimeContext.handleIncomingRequest(mex, time); return null; } }, time, runtimeContext); }
public static MyRoleMessageExchangeImpl createMyRoleMex(Exchange e, BpelEngineImpl engine) throws Exception { MyRoleMessageExchangeImpl mex = (MyRoleMessageExchangeImpl) engine.createMessageExchange(new GUID().toString(), e.getService(), e.getOperation()); mex.getDAO().setCreateTime(e.getCreateTime().getTime()); MessageImpl m2 = (MessageImpl) mex.createMessage(new QName("replayer", "replayer")); assign(m2._dao, e.getIn()); mex.getDAO().setRequest(m2._dao); mex.getDAO().setStatus(Status.REQUEST.toString()); return mex; }