Class JThread.stream.ShutdownManager
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class JThread.stream.ShutdownManager

Object
   |
   +----Thread
           |
           +----JThread.stream.ShutdownManager

public class ShutdownManager
extends Thread
ShutdownManager manages the shutdown process.


Class Index

 o JThread.stream.ShutdownManager. MainThread

Constructor Index

 o JThread.stream.ShutdownManager(String[])
Construct a new ShutdownManager object.

Method Index

 o addWaitThread(Object, Thread)
Add a thread to an object's wait set.
 o checkDirty(Object)
Check whether an object is in an inconsistent state due to shutdown.
 o checkStop()
Checks the stop flag and starts to shut down if set.
 o getRestartBarrier()
Get the restart barrier.
 o lock(Object, Thread)
This method is called only after shutdown occurs.
 o removeWaitThread(Object, Thread)
Remove a thread from an object's wait set.
 o retrieveLog(String)
Get the thread's execution record from the saved log.
 o run()
Starts the program.
 o saveState(String, ShutdownException)
Save a thread's run-time state.
 o setStop()
Set the stop flag to indicate shutdown.

Constructors

 o ShutdownManager
public ShutdownManager(String[] args)
Construct a new ShutdownManager object.

Parameters:
args[0]: - constains the store name
args[1]: - constains the program class name
the - remaining args specifies the program parameters

Methods

 o addWaitThread
public static void addWaitThread(Object o,
                                 Thread t)
Add a thread to an object's wait set. This method is only used by the classfile processor.

Parameters:
o: - the object
t: - the thread
 o checkDirty
public static void checkDirty(Object o) throws ShutdownException
Check whether an object is in an inconsistent state due to shutdown. This method is only used by the classfile processor.

Parameters:
o: - the object
Throws: ShutdownException
throws if the object is dirty
 o checkStop
public static void checkStop() throws ShutdownException
Checks the stop flag and starts to shut down if set.

Throws: ShutdownException
- throws when shutdown occurs
 o getRestartBarrier
public static JThread.stream.Barrier getRestartBarrier()
Get the restart barrier. This method is only used by the classfile processor.

Returns:
The restart barrier
 o lock
public static void lock(Object o,
                        Thread t)
This method is called only after shutdown occurs. Saves the locking information to the synchronization state log. Interrupts the object's wait set when the thread unlocks the object the first time during shutdown process. This method is only used by the classfile processor.

Parameters:
o: - the object
t: - the thread
 o removeWaitThread
public static void removeWaitThread(Object o,
                                    Thread t)
Remove a thread from an object's wait set. This method is only used by the classfile processor.

Parameters:
o: - the object
t: - the thread
 o retrieveLog
public static JThread.stream.ShutdownException retrieveLog(String key)
Get the thread's execution record from the saved log. This method is only used by the classfile processor.

Parameters:
key: - the thread's name
 o run
public void run()
Starts the program. Saves the program threads if shutdown occurs.

Overrides:
run in class Thread
 o saveState
public static void saveState(String t,
                             ShutdownException r)
Save a thread's run-time state. This method is only used by the classfile processor.

Parameters:
t: - the thread's name
r: - the state record
 o setStop
synchronized void setStop()
Set the stop flag to indicate shutdown.


All Packages  Class Hierarchy  This Package  Previous  Next  Index