View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   
8   package org.mule.module.jca;
9   
10  import java.util.ArrayList;
11  import java.util.List;
12  
13  import javax.resource.spi.work.ExecutionContext;
14  import javax.resource.spi.work.Work;
15  import javax.resource.spi.work.WorkException;
16  import javax.resource.spi.work.WorkListener;
17  import javax.resource.spi.work.WorkManager;
18  
19  public class TestJCAWorkManager implements WorkManager
20  {
21  
22      private List doWorkList = new ArrayList();
23      private List scheduledWorkList = new ArrayList();
24      private List startWorkList = new ArrayList();
25  
26      public void doWork(Work arg0) throws WorkException
27      {
28          doWorkList.add(arg0);
29      }
30  
31      public void doWork(Work arg0, long arg1, ExecutionContext arg2, WorkListener arg3) throws WorkException
32      {
33          doWorkList.add(arg0);
34      }
35  
36      public void scheduleWork(Work arg0) throws WorkException
37      {
38          scheduledWorkList.add(arg0);
39      }
40  
41      public void scheduleWork(Work arg0, long arg1, ExecutionContext arg2, WorkListener arg3) throws WorkException
42      {
43          scheduledWorkList.add(arg0);
44      }
45  
46      public long startWork(Work arg0) throws WorkException
47      {
48          startWorkList.add(arg0);
49          return 0;
50      }
51  
52      public long startWork(Work arg0, long arg1, ExecutionContext arg2, WorkListener arg3) throws WorkException
53      {
54          startWorkList.add(arg0);
55          return 0;
56      }
57  
58      public List getDoWorkList()
59      {
60          return doWorkList;
61      }
62  
63      public List getScheduledWorkList()
64      {
65          return scheduledWorkList;
66      }
67  
68      public List getStartWorkList()
69      {
70          return startWorkList;
71      }
72  
73  }