1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
package org.mule.processor; |
8 | |
|
9 | |
import org.mule.api.MessagingException; |
10 | |
import org.mule.api.MuleEvent; |
11 | |
import org.mule.api.config.MuleProperties; |
12 | |
import org.mule.api.config.ThreadingProfile; |
13 | |
import org.mule.api.context.WorkManagerSource; |
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | |
|
20 | |
|
21 | |
public class OptionalAsyncInterceptingMessageProcessor extends AsyncInterceptingMessageProcessor |
22 | |
{ |
23 | |
public OptionalAsyncInterceptingMessageProcessor(WorkManagerSource workManagerSource) |
24 | |
{ |
25 | 0 | super(workManagerSource); |
26 | 0 | } |
27 | |
|
28 | |
@Deprecated |
29 | |
public OptionalAsyncInterceptingMessageProcessor(WorkManagerSource workManagerSource, boolean doThreading) |
30 | |
{ |
31 | 0 | super(workManagerSource, doThreading); |
32 | 0 | } |
33 | |
|
34 | |
public OptionalAsyncInterceptingMessageProcessor(ThreadingProfile threadingProfile, |
35 | |
String name, |
36 | |
int shutdownTimeout) |
37 | |
{ |
38 | 0 | super(threadingProfile, name, shutdownTimeout); |
39 | 0 | } |
40 | |
|
41 | |
@Override |
42 | |
protected boolean isProcessAsync(MuleEvent event) throws MessagingException |
43 | |
{ |
44 | 0 | Object messageProperty = event.getMessage().getInboundProperty(MuleProperties.MULE_FORCE_SYNC_PROPERTY); |
45 | 0 | boolean forceSync = Boolean.TRUE.equals(messageProperty); |
46 | |
|
47 | 0 | boolean hasResponse = event.getEndpoint().getExchangePattern().hasResponse(); |
48 | 0 | boolean isTransacted = event.getEndpoint().getTransactionConfig().isTransacted(); |
49 | |
|
50 | 0 | return !forceSync && doThreading && !hasResponse && !isTransacted; |
51 | |
} |
52 | |
|
53 | |
} |