Package javax.jbi.messaging

Examples of javax.jbi.messaging.MessagingException


        channel.send(me);
    }
   
    protected void sendSync(MessageExchange me) throws MessagingException {
        if (!channel.sendSync(me)) {
            throw new MessagingException("SendSync failed");
        }
    }
View Full Code Here


                && !(content instanceof ResourceSource)) {
            // lets avoid stream open exceptions by using a temporary format
            try {
                content = sourceTransformer.toDOMSource(from);
            } catch (TransformerException e) {
                throw new MessagingException(e);
            } catch (ParserConfigurationException e) {
                throw new MessagingException(e);
            } catch (IOException e) {
                throw new MessagingException(e);
            } catch (SAXException e) {
                throw new MessagingException(e);
            }
        }
        to.setContent(content);

        if (copyAttachments) {
View Full Code Here

                writeValue(value, out);
            } else {
                writeMessageContent(exchange, message, out, path);
            }
        } catch (IOException e) {
            throw new MessagingException(e);
        }
    }
View Full Code Here

            throw new NoMessageContentAvailableException(exchange);
        }
        try {
            getTransformer().toResult(src, new StreamResult(out));
        } catch (TransformerException e) {
            throw new MessagingException(e);
        }
    }
View Full Code Here

    public void writeMessage(MessageExchange exchange, NormalizedMessage message,
                             OutputStream out, String path) throws IOException, JBIException {
        DataHandler handler = message.getAttachment(attachment);
        if (handler == null) {
            throw new MessagingException("Could not find attachment: "
                    + attachment);
        }
        InputStream is = handler.getInputStream();
        FileUtil.copyInputStream(is, out);
    }
View Full Code Here

        // If we found a destination, or this is a reply
        if (exchange.getEndpoint() != null || exchange.getRole() == Role.CONSUMER) {
            foundRoute = true;
            Flow flow = defaultFlowChooser.chooseFlow(flows, exchange);
            if (flow == null) {
                throw new MessagingException("Unable to choose a flow for exchange: " + exchange);
            }
            flow.send(exchange);
        }

        if (exchange.getRole() == Role.PROVIDER) {
            getSubscriptionManager().dispatchToSubscribers(exchange);
        }

        if (!foundRoute) {
            boolean throwException = true;
            ActivationSpec activationSpec = exchange.getActivationSpec();
            if (activationSpec != null) {
                throwException = activationSpec.isFailIfNoDestinationEndpoint();
            }
            if (throwException) {
                throw new MessagingException("Could not find route for exchange: " + exchange + " for service: " + exchange.getService()
                                + " and interface: " + exchange.getInterfaceName());
            } else if (exchange.getMirror().getSyncState() == MessageExchangeImpl.SYNC_STATE_SYNC_SENT) {
                exchange.handleAccept();
                ComponentContextImpl ctx = (ComponentContextImpl) getSubscriptionManager().getContext();
                exchange.setDestinationId(ctx.getComponentNameSpace());
View Full Code Here

                    if (destinationResolver != null) {
                        try {
                            EndpointFilter filter = createEndpointFilter(context, exchange);
                            theEndpoint = (InternalEndpoint) destinationResolver.resolveEndpoint(context, exchange, filter);
                        } catch (JBIException e) {
                            throw new MessagingException("Failed to resolve endpoint: " + e, e);
                        }
                    }
                }
            }
        }
View Full Code Here

            // 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);
            }
        }
View Full Code Here

                variableResolver.setExchange(exchange);
                variableResolver.setMessage(message);
                return evaluateXPath(object);
            }
        } catch (TransformerException e) {
            throw new MessagingException(e);
        } catch (XPathExpressionException e) {
            throw new MessagingException(e);
        } catch (ParserConfigurationException e) {
            throw new MessagingException(e);
        } catch (IOException e) {
            throw new MessagingException(e);
        } catch (SAXException e) {
            throw new MessagingException(e);
        }
    }
View Full Code Here

        try {
            broker.sendExchangePacket(exchange);
        } catch (MessagingException e) {
            throw e;
        } catch (JBIException e) {
            throw new MessagingException(e);
        }
    }
View Full Code Here

TOP

Related Classes of javax.jbi.messaging.MessagingException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.