protoj.core.internal
Class JavaCommand

java.lang.Object
  extended by protoj.core.internal.JavaCommand

public final class JavaCommand
extends java.lang.Object

Used to delegate to a new vm. Since ProtoJ already provides the ability to launch a new vm then this is an ideal way of replacing an os specific command in the startup script for a project.

This class is tightly coupled to DispatchFeature since it requires special treatment to terminate the dispatch loop early. It can be thought of as the part of the DispatchFeature implementation that needs to exist in command form.

Author:
Ashley Williams

Constructor Summary
JavaCommand(DispatchFeature dispatchFeature)
           
 
Method Summary
 Command getDelegate()
           
 void startVm(java.util.List<java.lang.String> opts)
          Bootstraps to a specified java class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaCommand

public JavaCommand(DispatchFeature dispatchFeature)
Method Detail

startVm

public void startVm(java.util.List<java.lang.String> opts)
Bootstraps to a specified java class. The options parameter contains name value pairs to be applied to the underlying ant task by beans introspection, so that the vm launcher can easily be configured from the command line.

The bean being configured is the StartVmCommand instance. For example a string with the content "javaTask.classname=com.acme.MyMain" is equivalent to calling StartVmCommand.getJavaTask().setClassname("javaTask.classname=com.acme.MyMain").

Parameters:
opts -

getDelegate

public Command getDelegate()