Destination d = df.getDestination(ei);
if (d.getMessageObserver() == null)
{
// TODO is this the right Mule exception?
throw new EndpointNotFoundException(uri);
}
MessageObserver mo = d.getMessageObserver();
if (!(mo instanceof ChainInitiationObserver))
{
throw new EndpointNotFoundException(uri);
}
ChainInitiationObserver co = (ChainInitiationObserver) mo;
return co.getEndpoint();
}