List of usage examples for org.springframework.integration.mapping MessageMappingException MessageMappingException
public MessageMappingException(Message<?> failedMessage, String description)
From source file:org.springframework.integration.ip.tcp.TcpSendingMessageHandler.java
/** * Method that actually does the write.//from www.j a v a 2 s. c o m * @param message The message to write. */ protected void doWrite(Message<?> message) { try { TcpConnection connection = getConnection(); if (connection == null) { throw new MessageMappingException(message, "Failed to create connection"); } if (logger.isDebugEnabled()) { logger.debug("Got Connection " + connection.getConnectionId()); } connection.send(message); } catch (Exception e) { String connectionId = null; if (this.connection != null) { connectionId = this.connection.getConnectionId(); } this.connection = null; if (e instanceof MessageMappingException) { throw (MessageMappingException) e; } throw new MessageMappingException(message, "Failed to map message using " + connectionId, e); } }