_connectionFactory = null;
}
@Override
public Message process(Exchange exchange) throws HandlerException {
Connection connection = null;
Interaction interaction = null;
try {
if (_connectionSpec != null) {
connection = _connectionFactory.getConnection(_connectionSpec);
} else {
connection = _connectionFactory.getConnection();
}
interaction = connection.createInteraction();
return _recordHandler.handle(exchange, connection, interaction);
} catch (Exception e) {
throw JCAMessages.MESSAGES.failedToProcessCCIOutboundInteraction(e);
} finally {
try {
if (interaction != null) {
interaction.close();
}
if (connection != null) {
connection.close();
}
} catch (ResourceException e) {
JCALogger.ROOT_LOGGER.failedToCloseInteractionConnection(e.getMessage());
if (_logger.isDebugEnabled()) {
e.printStackTrace();