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.
-
JThread.stream.ShutdownManager. MainThread
-
-
JThread.stream.ShutdownManager(String[])
- Construct a new ShutdownManager object.
-
addWaitThread(Object, Thread)
- Add a thread to an object's wait set.
-
checkDirty(Object)
- Check whether an object is in an inconsistent state due to shutdown.
-
checkStop()
- Checks the stop flag and starts to shut down if set.
-
getRestartBarrier()
- Get the restart barrier.
-
lock(Object, Thread)
- This method is called only after shutdown occurs.
-
removeWaitThread(Object, Thread)
- Remove a thread from an object's wait set.
-
retrieveLog(String)
- Get the thread's execution record from the saved log.
-
run()
- Starts the program.
-
saveState(String, ShutdownException)
- Save a thread's run-time state.
-
setStop()
- Set the stop flag to indicate shutdown.
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
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
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
checkStop
public static void checkStop() throws ShutdownException
- Checks the stop flag and starts to shut down if set.
- Throws: ShutdownException
- - throws when shutdown occurs
getRestartBarrier
public static JThread.stream.Barrier getRestartBarrier()
- Get the restart barrier.
This method is only used by the classfile processor.
- Returns:
- The restart barrier
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
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
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
run
public void run()
- Starts the program. Saves the program threads if shutdown
occurs.
- Overrides:
- run in class Thread
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
setStop
synchronized void setStop()
- Set the stop flag to indicate shutdown.
All Packages Class Hierarchy This Package Previous Next Index