KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > gov > nasa > jpf > VM


1 //
2
// Copyright (C) 2005 United States Government as represented by the
3
// Administrator of the National Aeronautics and Space Administration
4
// (NASA). All Rights Reserved.
5
//
6
// This software is distributed under the NASA Open Source Agreement
7
// (NOSA), version 1.3. The NOSA has been approved by the Open Source
8
// Initiative. See the file NOSA-1.3-JPF at the top of the distribution
9
// directory tree for the complete NOSA document.
10
//
11
// THE SUBJECT SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY OF ANY
12
// KIND, EITHER EXPRESSED, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT
13
// LIMITED TO, ANY WARRANTY THAT THE SUBJECT SOFTWARE WILL CONFORM TO
14
// SPECIFICATIONS, ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR
15
// A PARTICULAR PURPOSE, OR FREEDOM FROM INFRINGEMENT, ANY WARRANTY THAT
16
// THE SUBJECT SOFTWARE WILL BE ERROR FREE, OR ANY WARRANTY THAT
17
// DOCUMENTATION, IF PROVIDED, WILL CONFORM TO THE SUBJECT SOFTWARE.
18
//
19
package gov.nasa.jpf;
20
21 import gov.nasa.jpf.Path;
22 import java.io.Writer JavaDoc;
23
24 import java.io.PrintWriter JavaDoc;
25
26
27 /**
28  * abstraction for state producers (VMs).
29  * <2do> - seems to be superfluous now that we target only JVMs, and there is a suitable
30  * base
31  */

32 public interface VM {
33   // pcm - my favourite canidate to get scrubbed
34
int getAbstractionNonDeterministicThreadCount ();
35
36   int getAliveThreadCount ();
37
38   boolean isBoringState ();
39
40   boolean isDeadlocked ();
41
42   Exception JavaDoc getException ();
43
44   // these are used for heuristic searches, should be either a generalized
45
// attribution, or scrubbed
46
boolean isInterestingState ();
47
48   Transition getLastTransition ();
49
50   Path getPath ();
51
52   int getPathLength ();
53   
54   int getRunnableThreadCount ();
55
56   /**
57    * return a object describing the current execution state of the VM. Note
58    * that history information for this state has to be explicitly requested
59    * by means of 'makeRestorable()' and 'makeForwardRestorable()' calls, because
60    * of the involved costs
61    */

62   VMState getState ();
63
64   String JavaDoc getThreadName ();
65
66   boolean initialize();
67   
68   boolean backtrack ();
69
70   boolean forward ();
71
72   boolean isNewState ();
73   
74   boolean isEndState ();
75   
76   int getStateId ();
77   
78   void printStatus ();
79   
80   void restoreState (VMState state);
81
82   void rewind (); // <?> pcm either reset or rewind, but not both
83

84   void savePath (Path path, Writer JavaDoc w);
85   
86   void addListener (VMListener listener);
87   
88   void printResults (PrintWriter JavaDoc pw);
89 }
90
Popular Tags