|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.desy.acop.launcher.Launcher
public class Launcher
Launcher
is a utility class which can launch an application
according to its type and supplied parameters.
Field Summary | |
---|---|
static java.lang.String |
CAMNAME
|
Constructor Summary | |
---|---|
Launcher()
|
Method Summary | ||
---|---|---|
static
|
launch(java.lang.Class<T> applicationClass,
java.lang.String[] args)
Launches an application using the input arguments. |
|
static
|
launch(java.lang.Class<T> applicationClass,
java.lang.String[] args,
boolean shouldExitOnClose)
Launches an application defined by the applicationClass. |
|
static void |
main(java.lang.String[] args)
|
|
static void |
runCommand(java.lang.String command,
java.io.OutputStream outputStream,
java.io.OutputStream errorOutput,
boolean waitForCompletion)
Runs the specified command. |
|
static void |
runWebstartApplication(java.lang.String completeJNLP_URL,
boolean waitForCompletion)
Method will start a webstart application. |
|
static void |
runWebstartApplication(java.lang.String completeJNLP_URL,
java.io.OutputStream outputStream,
java.io.OutputStream errorOutput,
boolean waitForCompletion)
Method will start a webstart application. |
|
static void |
runWebstartApplication(java.lang.String jnlpURL,
java.lang.String[] jvmParameters,
boolean waitForCompletion)
Method will start a webstart application. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String CAMNAME
Constructor Detail |
---|
public Launcher()
Method Detail |
---|
public static void runWebstartApplication(java.lang.String jnlpURL, java.lang.String[] jvmParameters, boolean waitForCompletion) throws java.io.IOException
runWebstartApplication(String, boolean)
.
jnlpURL
- the url of the jnlp file to be startedjvmParameters
- the virtual machine parameters (without the -D)waitForCompletion
- the flag indicating if the calling thread
should be blocked until the execution is completed
java.io.IOException
- if execution of the command failedpublic static void runWebstartApplication(java.lang.String completeJNLP_URL, boolean waitForCompletion) throws java.io.IOException
runWebstartApplication(String, OutputStream, OutputStream, boolean)
where the streams are null.
completeJNLP_URL
- the url which will be loaded using the java
webstart command (javaws)waitForCompletion
- the flag indicating if the calling thread
should be blocked until the execution is completed
java.io.IOException
- if execution of the command failedrunCommand(String, OutputStream, OutputStream, boolean)
public static void runWebstartApplication(java.lang.String completeJNLP_URL, java.io.OutputStream outputStream, java.io.OutputStream errorOutput, boolean waitForCompletion) throws java.io.IOException
completeJNLP_URL
- the url which will be loaded using the java
webstart command (javaws)outputStream
- the output stream where all the output from the
input stream of the executed process will be forwardederrorOutput
- the output stream where all the output from the
error stream of the executed process will be forwardedwaitForCompletion
- the flag indicating if the calling thread
should be blocked until the execution is completed
java.io.IOException
- if execution of the command failedrunCommand(String, OutputStream, OutputStream, boolean)
public static void runCommand(java.lang.String command, java.io.OutputStream outputStream, java.io.OutputStream errorOutput, boolean waitForCompletion) throws java.io.IOException
Runtime.exec(String)
,
where the provided string parameters is the command. The output generated by
the execution of this command is forwarded to the provided OutputStream
s.
If any of these stream are null the output from that part of execution will
be skipped.
The invoker has the possibility to block the current thread until the process created by this method is completed. The lifecycle of the process is specified by the command itself and the process which will be executed by that command.
command
- the command to be executedoutputStream
- the output stream where all the data from the Process
's
input stream will be forwarded (null is allowed)errorOutput
- the output stream where all the data from the Process
's
error stream will be forwarded (null is allowed)waitForCompletion
- a flag indicating if the calling thread should be blocked
until the process is completed
java.io.IOException
- if execution of the command failedpublic static void main(java.lang.String[] args) throws java.io.IOException
java.io.IOException
public static <T> T launch(java.lang.Class<T> applicationClass, java.lang.String[] args)
launch(Class, String[], boolean)
, where shouldExitOnClose is false.
T
- the object which should be constructed and returnedapplicationClass
- the class decribing that objectargs
- program arguments
public static <T> T launch(java.lang.Class<T> applicationClass, java.lang.String[] args, boolean shouldExitOnClose)
If the application is not a window type but it is at least a Component
,
a JFrame will be created and the component will be added to that frame.
DefaultCloseOperation for the frame is EXIT or DISPOSE and it depends
on the shouldExitOnClose parameter.
This method is not thread safe and will block the current thread until the application is loaded. One should take of appropriate multithreading to avoid GUI freezing.
T
- the object which should be constructed and returnedapplicationClass
- the class describing that objectargs
- the program argumentsshouldExitOnClose
- if true the frame will have EXIT_ON_CLOSE defaultCloseOperation
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |