if (me.getEndpoint() != null && me instanceof MessageExchangeImpl) {
if (me.getEndpoint() instanceof AbstractServiceEndpoint && me instanceof MessageExchangeImpl) {
    public void exchangeSent(ExchangeEvent event) {        MessageExchange me = event.getExchange();        if (me.getEndpoint() != null &&            me instanceof MessageExchangeImpl) {            MessageExchangeImpl mei = (MessageExchangeImpl) me;            String source = (String) me.getProperty(JbiConstants.SENDER_ENDPOINT);            if (source == null) {                source = mei.getSourceId().getName();                componentsAsConsumer.add(source);            } else {                ServiceEndpoint[] ses = getContainer().getRegistry().getEndpointRegistry().getAllEndpointsForComponent(mei.getSourceId());                for (int i = 0; i < ses.length; i++) {                    if (EndpointSupport.getKey(ses[i]).equals(source)) {                        source = EndpointSupport.getUniqueKey(ses[i]);                        break;                    }                }            }            usedComponents.add(mei.getSourceId().getName());            usedComponents.add(mei.getDestinationId().getName());            String dest = EndpointSupport.getUniqueKey(mei.getEndpoint());            Map componentFlow = createSource(source);            if (componentFlow.put(dest, Boolean.TRUE) == null) {                flowLinks.add(encode(source) + " -> " + encode(dest));                viewIsDirty(mei.getEndpoint());            }        }    }