protected void send(MessageExchange me) throws MessagingException { channel.send(me); }
public MessageExchangeFactory createExchangeFactory() { return channel.createExchangeFactory(); }
public void sendMessages(int messageCount, boolean sync) throws JBIException { ComponentContext context = getContext(); for (int i = 0; i < messageCount; i++) { InOnly exchange = context.getDeliveryChannel().createExchangeFactory().createInOnlyExchange(); NormalizedMessage msg = exchange.createMessage(); ServiceEndpoint destination = null; if (resolver != null) { destination = resolver.resolveEndpoint(getContext(), exchange, NullEndpointFilter.getInstance()); } if (destination != null) { // lets explicitly specify the destination - otherwise // we'll let the container choose for us exchange.setEndpoint(destination); } exchange.setInMessage(msg); // lets set the XML as a byte[], String or DOM etc msg.setContent(new StringSource(this.message)); if (sync) { boolean result = context.getDeliveryChannel().sendSync(exchange, 1000); if (!result) { throw new MessagingException("Message delivery using sendSync has timed out"); } } else { context.getDeliveryChannel().send(exchange); } } }
protected void sendSync(MessageExchange me) throws MessagingException { if (!channel.sendSync(me)) { throw new MessagingException("SendSync failed"); } }
MessageExchangeFactory factory = channel.createExchangeFactoryForService(serviceName); LOG.info(new org.apache.cxf.common.i18n.Message("CREATE.MESSAGE.EXCHANGE", LOG).toString() + serviceName); LOG.info("sending message"); if (!isOneWay) { channel.sendSync(xchng); NormalizedMessage outMsg = ((InOut)xchng).getOutMessage(); Source content = null; channel.send(xchng); } else { channel.send(xchng);
/** * Creates a new InOnly exchange for the given service, interface and/or operation (any of which can be null). */ public InOnly createInOnlyExchange(QName service, QName interfaceName, QName operation) throws MessagingException { DeliveryChannel channel = getDeliveryChannel(); MessageExchangeFactory factory = null; if (service != null) { factory = channel.createExchangeFactoryForService(service); } else if (interfaceName != null) { factory = channel.createExchangeFactory(interfaceName); } else { factory = getExchangeFactory(); } InOnly outExchange = factory.createInOnlyExchange(); if (service != null) { outExchange.setService(service); } if (interfaceName != null) { outExchange.setInterfaceName(interfaceName); } if (operation != null) { outExchange.setOperation(operation); } return outExchange; }
/** * sends the given DOMSource as message to the given service (inOut) * * @param service * the service name to send the message to * @param source * the source to put in the in message content * @return the DOMSource of the out message or null * @throws MessagingException * on any messaging exception */ public MessageExchange sendRawInOutRequest(QName service, Source source) throws MessagingException { InOut inOut = getChannel().createExchangeFactoryForService(service).createInOutExchange(); NormalizedMessage msg = inOut.createMessage(); msg.setContent(source); inOut.setInMessage(msg); if (getChannel().sendSync(inOut)) { return inOut; } else { return null; } }
public MessageExchange accept() throws MessagingException { return delegate.accept(); }
public MessageExchangeFactory createExchangeFactoryForService(QName serviceName) { return channel.createExchangeFactoryForService(serviceName); }
public void close() throws MessagingException { delegate.close(); }
public boolean sendSync(MessageExchange exchange, long timeout) throws MessagingException { propagateSubject(exchange); return delegate.sendSync(exchange, timeout); }
MessageExchangeFactory factory = channel.createExchangeFactoryForService(serviceName); LOG.info(new org.apache.cxf.common.i18n.Message("CREATE.MESSAGE.EXCHANGE", LOG).toString() + serviceName); LOG.info("sending message"); if (!isOneWay) { channel.sendSync(xchng); NormalizedMessage outMsg = ((InOut)xchng).getOutMessage(); Source content = null; channel.send(xchng); } else { channel.send(xchng);
/** * Creates a new InOut exchange for the given service, interface and/or operation (any of which can be null). */ public InOut createInOutExchange(QName service, QName interfaceName, QName operation) throws MessagingException { DeliveryChannel channel = getDeliveryChannel(); MessageExchangeFactory factory = null; if (service != null) { factory = channel.createExchangeFactoryForService(service); } else if (interfaceName != null) { factory = channel.createExchangeFactory(interfaceName); } else { factory = getExchangeFactory(); } InOut outExchange = factory.createInOutExchange(); if (service != null) { outExchange.setService(service); } if (interfaceName != null) { outExchange.setInterfaceName(interfaceName); } if (operation != null) { outExchange.setOperation(operation); } return outExchange; }
/** * sends the given DOMSource as message to the given service (inOnly) * * @param service * the service name to send the message to * @param source * the source to put in the in message content * @return true on sucessful delivering or false on failure * @throws MessagingException * on any messaging exception */ public boolean sendMessage(QName service, Source source) throws MessagingException { InOnly inOnly = getChannel().createExchangeFactoryForService(service).createInOnlyExchange(); NormalizedMessage msg = inOnly.createMessage(); msg.setContent(source); inOnly.setInMessage(msg); if (getChannel().sendSync(inOnly)) { return inOnly.getStatus() == ExchangeStatus.DONE; } else { return false; } }
public MessageExchange accept(long timeout) throws MessagingException { return delegate.accept(timeout); }
public MessageExchangeFactory createExchangeFactoryForService(QName serviceName) { return delegate.createExchangeFactoryForService(serviceName); }
public void destroy() { try { dc.close(); } catch (MessagingException e) { logger.warn("Error when closing the delivery channel", e); } componentRegistry.getNmr().getEndpointRegistry().unregister(componentEndpoint, properties); }