1
2
3
4
5
6
7
8
9
10
11 package org.astrogrid.jes.resultlistener;
12
13 import org.astrogrid.component.descriptor.ComponentDescriptor;
14 import org.astrogrid.jes.jobscheduler.JobScheduler;
15 import org.astrogrid.jes.service.v1.cearesults.ResultsListener;
16 import org.astrogrid.jes.types.v1.cea.axis.JobIdentifierType;
17 import org.astrogrid.jes.types.v1.cea.axis.ResultListType;
18
19 import org.apache.commons.logging.Log;
20 import org.apache.commons.logging.LogFactory;
21
22 import junit.framework.Test;
23
24 /*** Jes Implementation of CEA's results listener interface.
25 * <p>
26 * stub component - delegates message to the scheduler, where it is processed
27 * (so its entered into the task queue).
28 * @author Noel Winstanley nw@jb.man.ac.uk 01-Jul-2004
29 *
30 */
31 public class JesResultsListener implements ResultsListener, ComponentDescriptor {
32 /***
33 * Commons Logger for this class
34 */
35 private static final Log logger = LogFactory.getLog(JesResultsListener.class);
36
37 /*** Construct a new ResultListener
38 *
39 */
40 public JesResultsListener(JobScheduler scheduler) {
41 this.scheduler = scheduler;
42 }
43 protected final JobScheduler scheduler;
44
45 /***
46 * @see org.astrogrid.jes.service.v1.cearesults.ResultsListener#putResults(org.astrogrid.jes.types.v1.cea.axis.JobIdentifierType, org.astrogrid.jes.types.v1.cea.axis.ResultListType)
47 */
48 public void putResults(JobIdentifierType id, ResultListType resultList) {
49 if (id == null) {
50 logger.info("null id object encountered");
51 return;
52 }
53 if (resultList == null) {
54 logger.info("null result list object encountered");
55 return;
56 }
57
58 logger.debug("Received results for " + id.toString());
59 try {
60 scheduler.reportResults(id,resultList);
61 } catch (Exception e) {
62
63 logger.error("Could not pass on results message",e);
64 }
65
66 }
67
68 /***
69 * @see org.astrogrid.component.descriptor.ComponentDescriptor#getName()
70 */
71 public String getName() {
72 return "JesResultListener";
73 }
74
75 /***
76 * @see org.astrogrid.component.descriptor.ComponentDescriptor#getDescription()
77 */
78 public String getDescription() {
79 return "Jes Implementation of CEA Results listener web interface";
80 }
81
82 /***
83 * @see org.astrogrid.component.descriptor.ComponentDescriptor#getInstallationTest()
84 */
85 public Test getInstallationTest() {
86 return null;
87 }
88 }
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115