KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > simulator > listener > MockResultsListener


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.simulator.listener;
5
6 import com.tc.simulator.app.ErrorContext;
7
8 import java.util.ArrayList JavaDoc;
9 import java.util.List JavaDoc;
10
11
12 public class MockResultsListener implements ResultsListener {
13
14   public boolean dumpErrors = false;
15   public List JavaDoc errors = new ArrayList JavaDoc();
16   public boolean notifyStartTimeoutCalled;
17   public boolean notifyExecutionTimeoutCalled;
18   public Object JavaDoc result;
19   
20   public void notifyStartTimeout() {
21     this.notifyStartTimeoutCalled = true;
22   }
23   
24   public void notifyExecutionTimeout() {
25     this.notifyExecutionTimeoutCalled = true;
26   }
27
28   public synchronized void notifyError(ErrorContext ectxt) {
29     if (dumpErrors) ectxt.dump(System.err);
30     errors.add(ectxt);
31   }
32   
33   public void notifyResult(Object JavaDoc theResult) {
34     this.result = theResult;
35   }
36
37   public void setGlobalId(long globalId) {
38     return;
39   }
40 }
Popular Tags