1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
package org.mule.tck.testmodels.services; |
8 | |
|
9 | |
import org.mule.RequestContext; |
10 | |
import org.mule.util.StringMessageUtils; |
11 | |
|
12 | |
import edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicInteger; |
13 | |
import org.apache.commons.logging.Log; |
14 | |
import org.apache.commons.logging.LogFactory; |
15 | |
|
16 | 0 | public class TestReceiver |
17 | |
{ |
18 | 0 | protected static final Log logger = LogFactory.getLog(TestComponent.class); |
19 | |
|
20 | 0 | protected AtomicInteger count = new AtomicInteger(0); |
21 | |
|
22 | |
public String receive(String message) throws Exception |
23 | |
{ |
24 | 0 | if (logger.isDebugEnabled()) |
25 | |
{ |
26 | 0 | logger.debug(StringMessageUtils.getBoilerPlate("Received: " + message + " Number: " + inc() |
27 | |
+ " in thread: " |
28 | |
+ Thread.currentThread().getName())); |
29 | 0 | logger.debug("Message ID is: " + RequestContext.getEventContext().getMessage().getCorrelationId()); |
30 | |
} |
31 | |
|
32 | 0 | return "Received: " + message; |
33 | |
} |
34 | |
|
35 | |
protected int inc() |
36 | |
{ |
37 | 0 | return count.incrementAndGet(); |
38 | |
} |
39 | |
|
40 | |
} |