01: /*
02: * All content copyright (c) 2003-2007 Terracotta, Inc., except as may otherwise be noted in a separate copyright
03: * notice. All rights reserved.
04: */
05: package com.tctest;
06:
07: public class TestState {
08: public static final int RUNNING = 0;
09: public static final int STOPPING = 1;
10: private int state;
11:
12: public TestState() {
13: state = RUNNING;
14: }
15:
16: public TestState(boolean isRunning) {
17: if (isRunning) {
18: state = RUNNING;
19: } else {
20: state = STOPPING;
21: }
22: }
23:
24: public synchronized void setTestState(int state) {
25: this .state = state;
26: }
27:
28: public synchronized boolean isRunning() {
29: return state == RUNNING;
30: }
31: }
|