1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
package org.mule.routing.requestreply; |
8 | |
|
9 | |
import org.mule.api.MessagingException; |
10 | |
import org.mule.api.MuleEvent; |
11 | |
import org.mule.api.MuleException; |
12 | |
import org.mule.api.config.MuleProperties; |
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | 0 | public class ReplyToAsyncProcessor extends ReplyToMessageProcessor |
20 | |
|
21 | |
{ |
22 | |
|
23 | |
public MuleEvent process(MuleEvent event) throws MuleException |
24 | |
{ |
25 | 0 | if (shouldProcessEvent(event)) |
26 | |
{ |
27 | 0 | return super.process(event); |
28 | |
} |
29 | |
else |
30 | |
{ |
31 | 0 | return processNext(event); |
32 | |
} |
33 | |
} |
34 | |
|
35 | |
protected boolean shouldProcessEvent(final MuleEvent event) throws MessagingException |
36 | |
{ |
37 | 0 | Object messageProperty = event.getMessage().getInboundProperty(MuleProperties.MULE_FORCE_SYNC_PROPERTY); |
38 | 0 | boolean forceSync = Boolean.TRUE.equals(messageProperty); |
39 | |
|
40 | 0 | boolean hasResponse = event.getEndpoint().getExchangePattern().hasResponse(); |
41 | 0 | boolean isTransacted = event.getEndpoint().getTransactionConfig().isTransacted(); |
42 | |
|
43 | 0 | return !forceSync && !hasResponse && !isTransacted; |
44 | |
} |
45 | |
|
46 | |
} |