arguments
. The argument map associates argument name strings to instances of {@link Connector.Argument}. The default argument map for a connector can be obtained through {@link Connector#defaultArguments}. Argument map values can be changed, but map entries should not be added or deleted. A target VM launched by a launching connector is not guaranteed to be stable until after the {@link com.sun.jdi.event.VMStartEvent} has beenreceived.
Important note: If a target VM is launched through this funcctions, its output and error streams must be read as it executes. These streams are available through the {@link java.lang.Process Process} object returned by{@link com.sun.jdi.VirtualMachine#process}. If the streams are not periodically read, the target VM will stop executing when the buffers for these streams are filled. @param arguments the argument map to be used in launching the VM. @return the {@link VirtualMachine} mirror of the target VM. @throws java.io.IOException when unable to launch.Specific exceptions are dependent on the Connector implementation in use. @throws IllegalConnectorArgumentsException when one of theconnector arguments is invalid. @throws VMStartException when the VM was successfully launched, butterminated with an error before a connection could be established.
This call will block until a session with the newly launched player is created.
It is the caller's responsibility to ensure that no other thread is blocking in accept()
, since that thread will gain control of this session.
Before calling launch()
, you should first call supportsLaunch()
. If supportsLaunch()
returns false, then you will have to tell the user to manually launch the Flash player.
Also, before calling launch()
, you must call startListening()
.
@param uri which will launch a Flash player under running OS. For Flash/Flex apps, this can point to either a SWF or an HTML file. For AIR apps, this must point to the application.xml file for the application.
@param airLaunchInfo If trying to launch an AIR application, this argument must be specified; it gives more information about how to do the launch. If trying to launch a regular web-based Flash or Flex application, such as one that will be in a browser or in the standalone Flash Player, this argument should be null
.
@param forDebugging if true
, then the launch is for the purposes of debugging. If false
, then the launch is simply because the user wants to run the movie but not debug it; in that case, the return value of this function will be null
.
@param waitReporter a progress monitor to allow accept() to notify its parent how long it has been waiting for the Flash player to connect to it. May be null
if the caller doesn't need to know how long it's been waiting.
@param launchNotification a notifier to notify the caller about ADL Exit Code. Main usage is for ADL Exit Code 1 (Successful invocation of an already running AIR application. ADL exits immediately). May be null
if no need to listen ADL. Will only be called if forDebugging is false. (If forDebugging is true, error conditions are handled by throwing an exception.) The callback will be called on a different thread.
@return a Session to use for debugging, or null if forDebugging==false.The return value is not used to indicate an error -- exceptions are used for that. If this function returns without throwing an exception, then the return value will always be non-null if forDebugging==true, or null if forDebugging==false.
@throws BindException if isListening()
== false
@throws FileNotFoundException if file cannot be located
@throws CommandLineException if the program that was launched exited unexpectedly. This will be returned, for example, when launching an AIR application, if adl exits with an error code. CommandLineException includes functions to return any error text that may have been sent to stdout/stderr, and the exit code of the program.
@throws IOException see Runtime.exec()
If the slave agent is launched successfully, {@link SlaveComputer#setChannel(InputStream,OutputStream,TaskListener,Channel.Listener)}should be invoked in the end to notify Hudson of the established connection. The operation could also fail, in which case there's no need to make any callback notification, (except to notify the user of the failure through {@link StreamTaskListener}.) Also note that the normal return of this method call does not necessarily signify a successful launch. If someone programmatically calls this method and wants to find out if the launch was a success, use {@link SlaveComputer#isOnline()} at the end.
This method must operate synchronously. Asynchrony is provided by {@link Computer#connect(boolean)} andits correct operation depends on this. @param listener The progress of the launch, as well as any error, should be sent to this listener. @throws IOException if the method throws an {@link IOException} or {@link InterruptedException}, the launch was considered a failure and the stack trace is reported into the listener. This handling is just so that the implementation of this method doesn't have to dilligently catch those exceptions.
This method blocks until the external program has finished.
The output from stdout
can be retrieved with {@link #getStdOut()}, the output from stderr
likewise with {@link #getStdErr()}.
0
means successful.
@throws IOException An Exception from the underlying Process.
The following steps are made:
The {@code Map} argument of the launch method contains startup argumentsfor the application. The keys used in the Map must be non-null, non-empty {@code String} objects. They can be standard or application specific.OSGi defines the {@code org.osgi.triggeringevent} key to be used to passthe triggering event to a scheduled application, however in the future it is possible that other well-known keys will be defined. To avoid unwanted clashes of keys, the following rules should be applied:
The method is synchronous, it return only when the application instance was successfully started or the attempt to start it failed.
This method never returns {@code null}. If launching an application fails, the appropriate exception is thrown. @param arguments Arguments for the newly launched application, may benull @return the registered ApplicationHandle, which represents the newlylaunched application instance. Never returns {@code null}. @throws SecurityException if the caller doesn't have "lifecycle"ApplicationAdminPermission for the application. @throws ApplicationException if starting the application failed @throws IllegalStateException if the application descriptor isunregistered @throws IllegalArgumentException if the specified {@code Map} containsinvalid keys (null objects, empty {@code String} or a key that isnot {@code String})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|