1
2
3
4
5
6
7
8
9
10
11 package org.mule.providers.quartz;
12
13 import org.mule.providers.NullPayload;
14 import org.mule.umo.UMOEventContext;
15 import org.mule.umo.lifecycle.Callable;
16
17 import edu.emory.mathcs.backport.java.util.concurrent.CountDownLatch;
18
19 public class TestComponent implements Callable
20 {
21 protected static final CountDownLatch QUARTZ_COUNTER = new CountDownLatch(4);
22
23 public Object onCall(UMOEventContext eventContext) throws Exception
24 {
25 if (eventContext.getMessageAsString().equals("quartz test") ||
26 (eventContext.getMessage().getPayload() instanceof NullPayload ))
27 {
28 if (QUARTZ_COUNTER != null)
29 {
30 QUARTZ_COUNTER.countDown();
31 }
32 else
33 {
34 throw new IllegalStateException("QuartzCounter is null!");
35 }
36 }
37 else
38 {
39 throw new IllegalArgumentException("Unrecognised event payload");
40 }
41 return null;
42 }
43
44 }