|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectprotoj.core.DispatchFeature
public final class DispatchFeature
Responsible for dispatching each instruction from the
InstructionChain to the matching command and executing that command.
See dispatchCommands().
| Constructor Summary | |
|---|---|
DispatchFeature(CoreProject parent)
The created instance will be configured to bootstrap to the currently running jvm. |
|
| Method Summary | |
|---|---|
void |
dispatchCommands()
Iterates over all the instructions from CoreProject.getInstructionChain() and executes each corresponding
command from CoreProject.getCommandStore(). |
java.lang.String |
getCurrentMainClass()
Calculates the name of the main() method containing class that was used to start the currently executing vm. |
long |
getElapsedHours()
The elapsed time in hours. |
long |
getElapsedMinutes()
The elapsed time in minutes. |
long |
getElapsedSeconds()
The elapsed time in seconds. |
java.lang.String |
getMainClass()
The main() method containing entry point class for the new vm. |
java.lang.String |
getMainMemory()
The maximum amount of memory that should be allocated by the new vm. |
CoreProject |
getProject()
|
ProjectReporter |
getReporter()
The helper used to report dispatch progress. |
ArgRunnable<StartVmCommand> |
getStartVmConfig()
The instance used to provide additional configuration before the vm is launched inside the startVm(String, String[], String, ArgRunnable) method. |
java.io.File |
getWeaverJar()
The jar file used for load time weaving, or null if not configured. |
void |
initBootstrap(java.lang.String mainClass,
java.lang.String mainMemory)
Call in order to be able to start to the specified project main with the specified amount of memory. |
void |
initLoadTimeWeaving(java.lang.String partialName)
ProtoJ commands are each executed in their own virtual machines. |
boolean |
isScriptVm()
Returns whether or not the current vm was started directly from the shell script or in code by using the startVm(String, String[], String, ArgRunnable) method. |
boolean |
isStatusWindow()
Returns whether or not the dispatchCommands() will exit with a
gui. |
void |
setStartVmConfig(ArgRunnable<StartVmCommand> startVmConfig)
See setStartVmConfig(ArgRunnable). |
void |
setStatusWindow(boolean statusWindow)
See isStatusWindow(). |
StartVmCommand |
startVm(java.lang.String mainClass,
java.lang.String[] args,
java.lang.String memory,
ArgRunnable<StartVmCommand> config)
Starts a forked vm with the specified parameters. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DispatchFeature(CoreProject parent)
parent - | Method Detail |
|---|
public void initBootstrap(java.lang.String mainClass,
java.lang.String mainMemory)
mainClass - mainMemory - public void initLoadTimeWeaving(java.lang.String partialName)
The lib directory will be searched for a jar file whose name contains the partial name parameter, which will be used as the javaagent jarpath. Specify null to use the default, which is "aspectjweaver.jar". If there is no match or more than one match is found then an exception is thrown
partialName - the partial name, specify null to use "aspectjweaver.jar"public ProjectReporter getReporter()
public long getElapsedHours()
public long getElapsedMinutes()
public long getElapsedSeconds()
public void dispatchCommands()
CoreProject.getInstructionChain() and executes each corresponding
command from CoreProject.getCommandStore(). The instructions
usually originate from the command line but may have been specified
in-code.
Where there is no corresponding command in the command store then we assume that this code is running in the hand-compiled bootstrapping vm that contains just the bare minimum of commands. Therefore we attempt to bootstrap to the main project vm resulting in the following behavior:
public StartVmCommand startVm(java.lang.String mainClass,
java.lang.String[] args,
java.lang.String memory,
ArgRunnable<StartVmCommand> config)
This method was added to support Command.execute(Instruction),
since it needs to restart the same vm for the purpose of reconfiguring
memory.
mainClass - the class that contains the main() methodargs - the arguments to the main methodmemory - the maximum amount of memory to be assigned to the new vmconfig - the callback used to configure the vm before it is executed
public java.lang.String getCurrentMainClass()
public java.lang.String getMainClass()
public java.lang.String getMainMemory()
public boolean isScriptVm()
startVm(String, String[], String, ArgRunnable) method. Each time
startVm() is called, the SCRIPT_VM_PROPERTY is added as a jvm
arg so that we can tell the difference.
public void setStatusWindow(boolean statusWindow)
isStatusWindow().
statusWindow - public boolean isStatusWindow()
dispatchCommands() will exit with a
gui. If true then a window will be displayed with a green background
indicating no errors or a red background indicating errors. The window
will fill the screen and the application will exit when it is closed. It
is an error to set this property to true in a headless environment
resulting in an exception.
public void setStartVmConfig(ArgRunnable<StartVmCommand> startVmConfig)
setStartVmConfig(ArgRunnable).
startVmConfig - public ArgRunnable<StartVmCommand> getStartVmConfig()
startVm(String, String[], String, ArgRunnable) method.
public CoreProject getProject()
public java.io.File getWeaverJar()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||