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