* @throws MessagingException
*/
protected void doRouting(MessageExchangeImpl me) throws MessagingException {
ComponentNameSpace id = me.getRole() == Role.PROVIDER ? me.getDestinationId() : me.getSourceId();
//As the MessageExchange could come from another container - ensure we get the local Component
ComponentMBeanImpl lcc = broker.getContainer().getRegistry().getComponent(id.getName());
if (lcc != null) {
if (lcc.getDeliveryChannel() != null) {
try {
lock.readLock().lock();
if (!me.getSourceId().getContainerName().equalsIgnoreCase(broker.getContainer().getName())
&& broker instanceof SecuredBroker) {
try {
((SecuredBroker)broker).checkSecurity(me);
} catch (Exception e) {
me.handleAccept();
me.setError(e);
me.handleSend(false);
broker.getContainer().sendExchange(me.getMirror());
throw new MessagingException(e);
}
}
lcc.getDeliveryChannel().processInBound(me);
} finally {
lock.readLock().unlock();
}
} else {
throw new MessagingException("Component " + id.getName() + " is shut down");