public void run() { try { _outstandingExchanges.put(inonly.getExchangeId(), odeMex); _ode.getChannel().send(inonly); } catch (MessagingException e) { String errmsg = "Error sending request-only message to JBI for ODE mex " + odeMex; __log.error(errmsg, e); } } });
public void run() { try { boolean sendOk = _ode.getChannel().sendSync(inonly, _responseTimeout); if (!sendOk) { __log.warn("Timeout while sending message for JBI message exchange: " + inonly.getExchangeId()); } onJbiMessageExchange(inonly); } catch (MessagingException e) { String errmsg = "Error sending request-only message to JBI for ODE mex " + odeMex; __log.error(errmsg, e); } } });
protected void processFile(File file) throws Exception { InputStream stream = new BufferedInputStream(new FileInputStream(file)); InOnly exchange = getExchangeFactory().createInOnlyExchange(); configureExchangeTarget(exchange); NormalizedMessage message = exchange.createMessage(); exchange.setInMessage(message); marshaler.readMessage(exchange, message, stream, file.getCanonicalPath()); // sending the file itself along as a message property and holding on to // the stream we opened exchange.getInMessage().setProperty(FileComponent.FILE_PROPERTY, file); this.openExchanges.put(exchange.getExchangeId(), stream); send(exchange); }
/** * Return a <code>MessageExchangeDecorator</code> for Consumer, as * <code>InOnly</code>. * * @see javax.jbi.messaging.MessageExchangeFactory#createInOnlyExchange() * @return * the message exchange * @throws MessagingException * impossible to create the message exchange */ public InOnly createInOnlyExchange() throws MessagingException { // Create the concrete message exchange MessageExchange meC = this.concreteMef.createInOnlyExchange(); // Convert into fake message exchange InOnly meF = (InOnly) Convert. convertConcreteMessageExchangeToFakeMessageExchange(meC, Convert.IN_ONLY_PATTERN); ((org.objectweb.petals.tools.rmi.common.serializable. MessageExchange) meF).setRole(meC.getRole()); // Store the messages this.messages.put(meF.getExchangeId(), meC); return meF; }
protected void processFile(FTPClient ftp, String file) throws Exception { InputStream in = ftp.retrieveFileStream(file); InOnly exchange = getExchangeFactory().createInOnlyExchange(); configureExchangeTarget(exchange); NormalizedMessage message = exchange.createMessage(); exchange.setInMessage(message); if (getTargetOperation() != null) { exchange.setOperation(getTargetOperation()); } marshaler.readMessage(exchange, message, in, file); if (stateless) { exchange.setProperty(FtpData.class.getName(), new FtpData(file, ftp, in)); } else { this.openExchanges.put(exchange.getExchangeId(), new FtpData(file, ftp, in)); } send(exchange); }