public ExchangeStatus getStatus() { if (exchange.getStatus() == Status.Active) { return ExchangeStatus.ACTIVE; } else if (exchange.getStatus() == Status.Done) { return ExchangeStatus.DONE; } else if (exchange.getStatus() == Status.Error) { return ExchangeStatus.ERROR; } else { throw new IllegalStateException(); } }
public QName getOperation() { return exchange.getOperation(); }
public MessageExchange.Role getRole() { return exchange.getRole() == org.apache.servicemix.nmr.api.Role.Consumer ? MessageExchange.Role.CONSUMER : MessageExchange.Role.PROVIDER; }
public void process(Exchange exchange) { if (exchange.getProperty(ServiceEndpoint.class) == null) { exchange.setProperty(ServiceEndpoint.class, this); } try { queue.offer(exchange, Long.MAX_VALUE, TimeUnit.NANOSECONDS); } catch (InterruptedException e) { throw new ServiceMixException(e); } }
public void exchangeSent(Exchange exchange) { // Check if this is a new exchange if (exchange.getStatus() == Status.Active && exchange.getRole() == Role.Consumer && exchange.getOut(false) == null && exchange.getFault(false) == null) { if (exchange instanceof InternalExchange) { // Increment reference to the source SA InternalExchange ie = (InternalExchange) exchange; reference(ie.getSource()); if (isSync(exchange)) { pending(ie); } } } }
public void process(Exchange exchange) { if (exchange == null || exchange.getStatus() != Status.Active) { return; if (exchange.getPattern() == Pattern.InOnly || exchange.getPattern() == Pattern.RobustInOnly) { exchange.setStatus(Status.Done); getChannel().send(exchange); QName opName = exchange.getOperation(); getLogger().fine("dispatch method: " + opName); org.apache.servicemix.nmr.api.Message nm = exchange.getIn(); try {
Source content = null; org.apache.servicemix.nmr.api.Message nm = null; if (xchng.getFault(false) != null) { content = xchng.getFault().getBody(Source.class); nm = xchng.getFault(); } else { content = xchng.getOut().getBody(Source.class); nm = xchng.getOut(); xchng.setStatus(Status.Done); channel.send(xchng); } else {
org.apache.cxf.interceptor.Fault f = (org.apache.cxf.interceptor.Fault) inMessage.getContent(Exception.class); if (!f.hasDetails()) { xchng.setError(f); xchng.setError(ex); xchng.getFault().setBody(ss); } else { xchng.getOut().addAttachment(att.getId(), att .getDataHandler()); && !(ent.getValue() instanceof Map) && !(ent.getValue() instanceof Collection)) { xchng.getOut().setHeader(ent.getKey(), ent.getValue()); xchng.getOut().setSecuritySubject((Subject) outMessage.get(NMRTransportFactory.NMR_SECURITY_SUBJECT)); xchng.getOut().setBody(ss);
org.apache.servicemix.nmr.api.Message inMsg = xchng.getIn(); LOG.fine(new org.apache.cxf.common.i18n.Message("EXCHANGE.ENDPOINT", LOG).toString() + serviceName); LOG.fine("setup message contents on " + inMsg); xchng.setTarget(ref); xchng.setOperation(bop.getName()); LOG.fine("sending message"); if (message.getExchange().isSynchronous()) {
protected MessageExchange getMessageExchange(Exchange exchange) { MessageExchange me; synchronized (exchange) { me = exchange.getProperty(MessageExchange.class); if (me == null) { if (exchange.getPattern() == Pattern.InOnly) { me = new InOnlyImpl(exchange); } else if (exchange.getPattern() == Pattern.InOptionalOut) { me = new InOptionalOutImpl(exchange); } else if (exchange.getPattern() == Pattern.InOut) { me = new InOutImpl(exchange); } else if (exchange.getPattern() == Pattern.RobustInOnly) { me = new RobustInOnlyImpl(exchange); } else { throw new IllegalStateException("Unknown pattern: " + exchange.getPattern()); exchange.setProperty(MessageExchange.class, me);
public NormalizedMessage getOutMessage() { Message msg = exchange.getOut(false); if (msg == null) { return null; } else { return new NormalizedMessageImpl(msg); } }
public Fault getFault() { Message msg = exchange.getFault(false); if (msg == null) { return null; } else { return new FaultImpl(msg); } }
public static QName getService(Exchange exchange) { return exchange.getProperty(SERVICE_NAME_PROP, QName.class); } }
public String getExchangeId() { return exchange.getId(); }
public void setError(Exception e) { exchange.setError(e); }
public URI getPattern() { return MEP_URIS.get(exchange.getPattern()); }
public NormalizedMessage getInMessage() { Message msg = exchange.getIn(false); if (msg == null) { return null; } else { return new NormalizedMessageImpl(msg); } }