org.ow2.jasmine.jadort.service.action.launchers
Class JavaLauncher

java.lang.Object
  extended by org.ow2.jasmine.jadort.service.action.launchers.JavaLauncher

public class JavaLauncher
extends Object

Launches a Java program.

JaDOrT needs this class since some IIOP implementations (WebLogic's private IIOPS, T3 implementations but also WebSphere's private IIOP implementation) seem not to interoperate well with JOnAS' IIOP implementation.

Author:
Malek Chahine, Remy Bresson, S. Ali Tokmen

Constructor Summary
JavaLauncher()
           
 
Method Summary
static String exec(String mainClass, File[] classpath, String[] jvmargs, String[] lines, long timeout)
          Launch a java program.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaLauncher

public JavaLauncher()
Method Detail

exec

public static String exec(String mainClass,
                          File[] classpath,
                          String[] jvmargs,
                          String[] lines,
                          long timeout)
                   throws IOException,
                          InterruptedException
Launch a java program.

Parameters:
mainClass - Java class with main method
classpath - Files in Classpath, cannot be null
jvmargs - VM arguments, may be null
lines - Lines to pass to the program, may be null
timeout - Number of milliseconds the program is allowed to run
Returns:
Whatever the program has output into the stdio
Throws:
IOException - If any I/O exception occurs when launching or reading response from program
InterruptedException - If waiting for process termination fails


Copyright © 2012 OW2 Consortium. All Rights Reserved.