1
2
3
4
5
6
7
8
9
10
11 package org.mule.endpoint;
12
13 import org.mule.api.MuleException;
14 import org.mule.api.construct.FlowConstruct;
15 import org.mule.api.endpoint.ImmutableEndpoint;
16 import org.mule.api.processor.MessageProcessor;
17 import org.mule.processor.builder.InterceptingChainMessageProcessorBuilder;
18
19 public class EndpointInterceptingChainMessageProcessorBuilder extends
20 InterceptingChainMessageProcessorBuilder
21 {
22
23 protected ImmutableEndpoint endpoint;
24
25 public EndpointInterceptingChainMessageProcessorBuilder(ImmutableEndpoint endpoint,
26 FlowConstruct flowConstruct)
27 {
28 super(flowConstruct);
29 this.endpoint = endpoint;
30 }
31
32 @Override
33 protected MessageProcessor initializeMessageProcessor(Object processor) throws MuleException
34 {
35 if (processor instanceof EndpointAware)
36 {
37 ((EndpointAware) processor).setEndpoint(endpoint);
38 }
39 return super.initializeMessageProcessor(processor);
40 }
41
42 }