org.jikesrvm.scheduler
Class MainThread
java.lang.Object
java.lang.Thread
org.jikesrvm.scheduler.MainThread
- All Implemented Interfaces:
- Runnable
public final class MainThread
- extends Thread
Thread in which user's "main" program runs.
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
args
private final String[] args
agents
private final String[] agents
mainMethod
private RVMMethod mainMethod
launched
protected boolean launched
dbg
private static final boolean dbg
- See Also:
- Constant Field Values
MainThread
public MainThread(String[] args)
- Create "main" thread.
- Parameters:
args
- args[0]
: name of class containing "main" method;
args[1..N]
: parameters to pass to "main" method
runAgents
private void runAgents(ClassLoader cl)
runAgent
private static void runAgent(Instrumentation instrumenter,
ClassLoader cl,
String agentJar,
String agentOptions)
getMainMethod
RVMMethod getMainMethod()
run
public void run()
- Run "main" thread.
This code could be made a little shorter by relying on Reflection
to do the classloading and compilation. We intentionally do it here
to give us a chance to provide error messages that are specific to
not being able to find the main class the user wants to run.
This may be a little silly, since it results in code duplication
just to provide debug messages in a place where very little is actually
likely to go wrong, but there you have it....
- Specified by:
run
in interface Runnable
- Overrides:
run
in class Thread