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 java.rmi.RemoteException;
23
24 import junit.framework.Test;
25
26 /*** Jes Implementation of CEA's results listener interface.
27 * <p>
28 * stub component - delegates message to the scheduler, where it is processed
29 * (so its entered into the task queue).
30 * @author Noel Winstanley nw@jb.man.ac.uk 01-Jul-2004
31 *
32 */
33 public class JesResultsListener implements ResultsListener, ComponentDescriptor {
34 /***
35 * Commons Logger for this class
36 */
37 private static final Log logger = LogFactory.getLog(JesResultsListener.class);
38
39 /*** Construct a new ResultListener
40 *
41 */
42 public JesResultsListener(JobScheduler scheduler) {
43 this.scheduler = scheduler;
44 }
45 protected final JobScheduler scheduler;
46
47 /***
48 * @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)
49 */
50 public void putResults(JobIdentifierType id, ResultListType resultList) throws RemoteException {
51 if (id == null) {
52 logger.info("null id object encountered");
53 return;
54 }
55 if (resultList == null) {
56 logger.info("null result list object encountered");
57 return;
58 }
59
60 logger.debug("Received results for " + id.toString());
61 try {
62 scheduler.reportResults(id,resultList);
63 } catch (Exception e) {
64
65 logger.error("Could not pass on results message",e);
66 }
67
68 }
69
70 /***
71 * @see org.astrogrid.component.descriptor.ComponentDescriptor#getName()
72 */
73 public String getName() {
74 return "JesResultListener";
75 }
76
77 /***
78 * @see org.astrogrid.component.descriptor.ComponentDescriptor#getDescription()
79 */
80 public String getDescription() {
81 return "Jes Implementation of CEA Results listener web interface";
82 }
83
84 /***
85 * @see org.astrogrid.component.descriptor.ComponentDescriptor#getInstallationTest()
86 */
87 public Test getInstallationTest() {
88 return null;
89 }
90 }
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105