org_scala_tools_maven_executions
Class JavaMainCallerSupport

java.lang.Object
  extended by org_scala_tools_maven_executions.JavaMainCallerSupport
All Implemented Interfaces:
JavaMainCaller
Direct Known Subclasses:
JavaMainCallerByFork, JavaMainCallerInProcess

public abstract class JavaMainCallerSupport
extends Object
implements JavaMainCaller

Abstract helper implementation for JavaMainCaller interface.

Author:
josh

Field Summary
protected  List<String> args
           
protected  List<String> env
           
protected  List<String> jvmArgs
           
protected  String mainClassName
           
protected  org.apache.maven.plugin.AbstractMojo requester
           
 
Constructor Summary
protected JavaMainCallerSupport(org.apache.maven.plugin.AbstractMojo requester, String mainClassName, String classpath, String[] jvmArgs, String[] args)
           
 
Method Summary
 void addArgs(String... args)
          Adds arguments for the process
 void addEnvVar(String key, String value)
          Adds an environemnt variable
 void addJvmArgs(String... args)
          Adds a JVM arg.
 void addOption(String key, boolean value)
          Adds the key if the value is true
 void addOption(String key, File value)
          Adds an option (key-file pair).
 void addOption(String key, String value)
          Adds option (basically two arguments)
 void addToClasspath(File entry)
           
 void run(boolean displayCmd)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org_scala_tools_maven_executions.JavaMainCaller
redirectToLog, run, spawn
 

Field Detail

requester

protected org.apache.maven.plugin.AbstractMojo requester

env

protected List<String> env

mainClassName

protected String mainClassName

jvmArgs

protected List<String> jvmArgs

args

protected List<String> args
Constructor Detail

JavaMainCallerSupport

protected JavaMainCallerSupport(org.apache.maven.plugin.AbstractMojo requester,
                                String mainClassName,
                                String classpath,
                                String[] jvmArgs,
                                String[] args)
                         throws Exception
Throws:
Exception
Method Detail

addJvmArgs

public void addJvmArgs(String... args)
Description copied from interface: JavaMainCaller
Adds a JVM arg. Note: This is not available for in-process "forks"

Specified by:
addJvmArgs in interface JavaMainCaller

addToClasspath

public void addToClasspath(File entry)
                    throws Exception
Throws:
Exception

addOption

public void addOption(String key,
                      String value)
Description copied from interface: JavaMainCaller
Adds option (basically two arguments)

Specified by:
addOption in interface JavaMainCaller

addOption

public void addOption(String key,
                      File value)
Description copied from interface: JavaMainCaller
Adds an option (key-file pair). This will pull the absolute path of the file

Specified by:
addOption in interface JavaMainCaller

addOption

public void addOption(String key,
                      boolean value)
Description copied from interface: JavaMainCaller
Adds the key if the value is true

Specified by:
addOption in interface JavaMainCaller

addArgs

public void addArgs(String... args)
Description copied from interface: JavaMainCaller
Adds arguments for the process

Specified by:
addArgs in interface JavaMainCaller

addEnvVar

public void addEnvVar(String key,
                      String value)
Description copied from interface: JavaMainCaller
Adds an environemnt variable

Specified by:
addEnvVar in interface JavaMainCaller

run

public void run(boolean displayCmd)
         throws Exception
Specified by:
run in interface JavaMainCaller
Throws:
Exception


Copyright © 2010-2011 Scala Tools. All Rights Reserved.