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.chain.DefaultMessageProcessorChainBuilder; |
18 | |
|
19 | |
public class EndpointMessageProcessorChainBuilder extends |
20 | |
DefaultMessageProcessorChainBuilder |
21 | |
{ |
22 | |
|
23 | |
protected ImmutableEndpoint endpoint; |
24 | |
|
25 | |
public EndpointMessageProcessorChainBuilder(ImmutableEndpoint endpoint, |
26 | |
FlowConstruct flowConstruct) |
27 | |
{ |
28 | 0 | super(flowConstruct); |
29 | 0 | this.endpoint = endpoint; |
30 | 0 | } |
31 | |
|
32 | |
@Override |
33 | |
protected MessageProcessor initializeMessageProcessor(Object processor) throws MuleException |
34 | |
{ |
35 | 0 | if (processor instanceof EndpointAware) |
36 | |
{ |
37 | 0 | ((EndpointAware) processor).setEndpoint(endpoint); |
38 | |
} |
39 | 0 | return super.initializeMessageProcessor(processor); |
40 | |
} |
41 | |
|
42 | |
} |