populateMessage(exchange, exchangeProperties, inMessageProperties, content);
return sendSync(exchange);
}
public Object request(EndpointResolver resolver, Map exchangeProperties, Map inMessageProperties, Object content) throws JBIException {
InOut exchange = createInOutExchange(resolver);
populateMessage(exchange, exchangeProperties, inMessageProperties, content);
boolean answer = sendSync(exchange);
if (!answer) {
throw new JBIException("Exchange aborted");
}
Exception error = exchange.getError();
if (error != null) {
throw new JBIException(error);
}
if (exchange.getFault() != null) {
throw FaultException.newInstance(exchange);
}
NormalizedMessage outMessage = exchange.getOutMessage();
if (outMessage == null) {
throw new NoOutMessageAvailableException(exchange);
}
Object result = getMarshaler().unmarshal(exchange, outMessage);
done(exchange);