KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > simulator > app > MockApplication


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.app;
5
6 public class MockApplication implements Application {
7
8   public String JavaDoc globalId;
9   public long waitInterval;
10   public boolean throwException;
11   public RuntimeException JavaDoc exception;
12   public boolean result;
13
14   public void run() {
15     try {
16       Thread.sleep(waitInterval);
17     } catch (InterruptedException JavaDoc e) {
18       throw new RuntimeException JavaDoc(e);
19     }
20     if (this.throwException) { throw exception; }
21   }
22
23   public String JavaDoc getApplicationId() {
24     return this.globalId;
25   }
26
27   public boolean interpretResult(Object JavaDoc o) {
28     return result;
29   }
30 }
Popular Tags