protected void inOutDone(InOut inout) { _mexTimeouts.remove(inout.getExchangeId()); }
private void outFailure(final InOut jbiMex) { final PartnerRoleMessageExchange pmex = _outstandingExchanges.remove(jbiMex.getExchangeId()); if (pmex == null) { __log.warn("Received a response for unknown JBI message exchange " + jbiMex.getExchangeId()); return; } try { _ode._scheduler.execTransaction(new Callable<Boolean>() { public Boolean call() throws Exception { pmex.replyWithFailure(FailureType.OTHER, "Error: " + jbiMex.getError(), null); return null; } }); } catch (Exception ex) { __log.error("error delivering failure: ", ex); } }
public void run() { try { _outstandingExchanges.put(inout.getExchangeId(), odeMex); _mexTimeouts.put(inout.getExchangeId(), System.currentTimeMillis()+_responseTimeout); _ode.getChannel().send(inout); } catch (MessagingException e) { String errmsg = "Error sending request-only message to JBI for ODE mex " + odeMex; __log.error(errmsg, e); } } });
public void run() { try { _outstandingExchanges.put(inout.getExchangeId(), odeMex); boolean sendOk = _ode.getChannel().sendSync(inout, _responseTimeout); if (!sendOk) { __log.warn("Timeout while sending message for JBI message exchange: " + inout.getExchangeId()); } onJbiMessageExchange(inout); } catch (MessagingException e) { String errmsg = "Error sending request-response message to JBI for ODE mex " + odeMex; __log.error(errmsg, e); } } });
private void outResponse(final InOut jbiMex) { final PartnerRoleMessageExchange outstanding = _outstandingExchanges.remove(jbiMex.getExchangeId()); if (outstanding == null) { __log.warn("Received a response for unknown JBI message exchange " + jbiMex.getExchangeId()); return;
/** * Return a <code>MessageExchangeDecorator</code> for Consumer, as * <code>InOut</code>. * * @see javax.jbi.messaging.MessageExchangeFactory#createInOutExchange() * @return * the message exchange * @throws MessagingException * impossible to create the message exchange */ public InOut createInOutExchange() throws MessagingException { // Create the concrete message exchange MessageExchange meC = this.concreteMef.createInOutExchange(); // Convert into fake message exchange InOut meF = (InOut) Convert. convertConcreteMessageExchangeToFakeMessageExchange(meC, Convert.IN_OUT_PATTERN); ((org.objectweb.petals.tools.rmi.common.serializable. MessageExchange) meF).setRole(meC.getRole()); // Store the messages this.messages.put(meF.getExchangeId(), meC); return meF; }
/** * Used by POJOs acting as a consumer * @param uri * @param message * @return */ public Future<NormalizedMessage> send(String uri, NormalizedMessage message) { try { InOut me = getExchangeFactory().createInOutExchange(); URIResolver.configureExchange(me, getServiceUnit().getComponent().getComponentContext(), uri); MessageUtil.transferTo(message, me, "in"); final Holder h = new Holder(); getOrCreateCurrentRequest(me).addExchange(me); exchanges.put(me.getExchangeId(), h); BeanEndpoint.this.send(me); return h; } catch (Exception e) { throw new RuntimeException(e); } }