1
2
3
4
5
6
7
8
9
10
11 package org.mule.tck.testmodels.mule;
12
13 import org.mule.api.MuleEvent;
14 import org.mule.api.MuleException;
15 import org.mule.api.NameableObject;
16 import org.mule.api.processor.MessageProcessor;
17 import org.mule.util.ObjectUtils;
18
19 public class TestMessageProcessor implements MessageProcessor, NameableObject
20 {
21
22 private String label;
23
24
25 private String name;
26
27 public TestMessageProcessor()
28 {
29
30 }
31
32 public TestMessageProcessor(String label)
33 {
34 this.label = label;
35 }
36
37 public MuleEvent process(MuleEvent event) throws MuleException
38 {
39 if (event != null && event.getMessage() != null)
40 {
41 event.getMessage().setPayload(event.getMessage().getPayload() + ":" + label);
42 }
43 return event;
44 }
45
46 public String getLabel()
47 {
48 return label;
49 }
50
51 public void setLabel(String label)
52 {
53 this.label = label;
54 }
55
56 public void setName(String name)
57 {
58 this.name = name;
59 }
60
61 public String getName()
62 {
63 return name;
64 }
65
66 @Override
67 public String toString()
68 {
69 return ObjectUtils.toString(this);
70 }
71 }
72
73