MessageExchange me = factory.createExchange(mep);
me.setInterfaceName((QName) context.getService().getProperty(JBI_INTERFACE_NAME));
me.setOperation(context.getExchange().getOperation().getQName());
me.setService((QName) context.getService().getProperty(JBI_SERVICE_NAME));
me.setEndpoint((ServiceEndpoint) context.getService().getProperty(JBI_ENDPOINT));
NormalizedMessage msg = me.createMessage();
me.setMessage(msg, "in");
if (Boolean.TRUE.equals(context.getService().getProperty(JBI_SECURITY_PROPAGATATION))) {
MessageExchange oldMe = JBIContext.getMessageExchange();
NormalizedMessage oldMsg = (oldMe != null) ? oldMe.getMessage("in") : null;
if (oldMsg != null) {
msg.setSecuritySubject(oldMsg.getSecuritySubject());
}
}
msg.setContent(getContent(context, message));
if (!channel.sendSync(me)) {
throw new XFireException("Unable to send jbi exchange: sendSync returned false");