}
@Override
public void poll() throws Exception
{
MuleContext muleContext = connector.getMuleContext();
if (outboundEndpoint == null)
{
// We need to create an outbound endpoint to do the polled request using
// send() as thats the only way we can customize headers and use eTags
EndpointBuilder endpointBuilder = new EndpointURIEndpointBuilder(endpoint);
// Must not use inbound endpoint processors
endpointBuilder.setMessageProcessors(Collections.<MessageProcessor>emptyList());
endpointBuilder.setResponseMessageProcessors(Collections.<MessageProcessor>emptyList());
endpointBuilder.setMessageProcessors(Collections.<MessageProcessor>emptyList());
endpointBuilder.setResponseMessageProcessors(Collections.<MessageProcessor>emptyList());
endpointBuilder.setExchangePattern(MessageExchangePattern.REQUEST_RESPONSE);
outboundEndpoint = muleContext.getEndpointFactory().getOutboundEndpoint(
endpointBuilder);
}
MuleMessage request = new DefaultMuleMessage(StringUtils.EMPTY, outboundEndpoint.getProperties(), muleContext);
if (etag != null && checkEtag)