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 java.lang.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 java.lang.String exec(java.lang.String mainClass, java.io.File[] classpath, java.lang.String[] jvmargs, java.lang.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 java.lang.String exec(java.lang.String mainClass,
                                    java.io.File[] classpath,
                                    java.lang.String[] jvmargs,
                                    java.lang.String[] lines,
                                    long timeout)
                             throws java.io.IOException,
                                    java.lang.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:
java.io.IOException - If any I/O exception occurs when launching or reading response from program
java.lang.InterruptedException - If waiting for process termination fails


Copyright © 2010 OW2 Consortium. All Rights Reserved.