/[xulu]/trunk/src/appl/parallel/event/SimpleConsoleMonitor.java
ViewVC logotype

Annotation of /trunk/src/appl/parallel/event/SimpleConsoleMonitor.java

Parent Directory Parent Directory | Revision Log Revision Log


Revision 78 - (hide annotations)
Wed Feb 10 16:43:46 2010 UTC (14 years, 10 months ago) by alfonx
File size: 2019 byte(s)
Merged branch 1.8-gt2-2.6 to trunk. Now the trunk is based on GeoTools 2.6.1 and schmitzm-2.0.x
1 mojays 2 package appl.parallel.event;
2    
3     import org.apache.log4j.LogManager;
4     import org.apache.log4j.Logger;
5    
6     import appl.parallel.client.RemoteEventHandler;
7     import appl.parallel.client.RemoteExecutionController;
8     import edu.bonn.xulu.XuluModellingPlatform;
9     import edu.bonn.xulu.appl.AbstractXuluPlugin;
10     import edu.bonn.xulu.appl.XuluPlugin;
11    
12     /**
13     * A simple {@link XuluPlugin} that outputs received {@link TimeEvent}s
14     * and {@link TransferEvent}s to the console.
15     *
16     * @author Dominik Appl
17     */
18     public class SimpleConsoleMonitor extends AbstractXuluPlugin implements
19     TimeMonitor, TransferMonitor {
20    
21     protected final Logger LOG = LogManager
22     .getLogger(this.getClass().getName());
23    
24     RemoteEventHandler eventProxy;
25    
26     public SimpleConsoleMonitor() {
27     super(false);
28    
29     }
30    
31     /*
32     * (non-Javadoc)
33     *
34     * @see appl.parallel.event.TimeMonitor#receiveTimeEvent(appl.parallel.event.TimeEvent)
35     */
36     public void receiveTimeEvent(TimeEvent t) {
37     System.out.println(t);
38    
39     }
40    
41     /*
42     * (non-Javadoc)
43     *
44     * @see appl.parallel.event.TransferMonitor#receiveTransferEvent(appl.parallel.event.TransferEvent)
45     */
46     public void receiveTransferEvent(TransferEvent t) {
47     System.out.println(t);
48     }
49    
50     /*
51     * (non-Javadoc)
52     *
53     * @see edu.bonn.xulu.appl.XuluPlugin#execute(edu.bonn.xulu.XuluModellingPlatform)
54     */
55     public void execute(XuluModellingPlatform appl) {
56     super.execute(appl);
57     RemoteExecutionController controller = RemoteExecutionController
58     .getRemoteExecutionController(appl);
59     if (controller == null) {
60     LOG
61     .error("Could not find RemoteExecutionController! -> Could not start SimpleConsoleMonitor");
62     return;
63     }
64     eventProxy = controller.getEventProxy();
65     eventProxy.addTimeEventListener(this);
66     eventProxy.addTransferEventListener(this);
67     started = true;
68     }
69    
70     @Override
71     public void stop() {
72     eventProxy.removeTimeMonitor(this);
73     eventProxy.removeTransferMonitor(this);
74     // TODO Auto-generated method stub
75     super.stop();
76     }
77     }

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26