/** @inheritDocs */ protected MuleMessage getMessagePart(MuleMessage message, OutboundEndpoint endpoint) { List payloads = (List) payloadContext.get(); for (Iterator i = payloads.iterator(); i.hasNext(); ) { Object payload = i.next(); MuleMessage result = new DefaultMuleMessage(payload, (Map) propertiesContext.get()); // If there is no filter assume that the endpoint can accept the // message. Endpoints will be processed in order to only the last // (if any) of the the endpoints may not have a filter if (endpoint.getFilter() == null || endpoint.getFilter().accept(result)) { if (logger.isDebugEnabled()) { logger.debug( "Endpoint filter matched. Routing message over: " + endpoint.getEndpointURI().toString()); } i.remove(); return result; } } return null; }