org.objectweb.dsrg.sofa.deployment.launcher
Interface LauncherMBean

All Known Implementing Classes:
Launcher

public interface LauncherMBean

MBean interface for Launcher.


Field Summary
static int OUTPUT_LIMIT
          Limit for the program output read at once.
 
Method Summary
 java.lang.String[] getAllDeploymentDocks()
          Returns the list of deployment docks running on the Launcher.
 java.lang.String getConfiguration()
          Returns the configuration received from the server.
 void killProcess(int id)
          Kills the launched process with ID id.
 void launchConfiguredSofaClass(java.lang.String className)
          Launches a class in separate JVM with sofa configuration set as java properties.
 void launchConfiguredSofaClass(java.lang.String className, java.lang.String[] parameters)
          Launches a class in separate JVM with sofa configuration set as java properties.
 void launchDeploymentDock(java.lang.String dockName)
          Launches a sofa deployment dock in a separate jvm with configuration downloaded from the zeroconf server.
 void launchSofaApp(java.lang.String className, java.lang.String[] parameters)
          Launches a sofa application (e.g.
 java.lang.String[] listProcesses()
          Returns an array of all launched processes in format ID: command arg1 arg2 ...
 java.lang.String readError(int id)
          Returns the next portion of standard error of the process with ID id.
 java.lang.String readOutput(int id)
          Returns the next portion of standard output of the process with ID id.
 void setDefaultDir(java.lang.String dir)
          Sets the default working directory of new process to dir.
 void setDefaultJvm(java.lang.String jvmpath)
          Sets the default JVM path (path to java executable) to jvmpath.
 void setDefaultJvmArgs(java.lang.String[] jvmargs)
          Sets the default JVM arguments to jvmargs.
 void shutSofaApp(java.lang.String appID)
          Shuts down a launched sofa application with the given appID.
 

Field Detail

OUTPUT_LIMIT

static final int OUTPUT_LIMIT
Limit for the program output read at once.

See Also:
Constant Field Values
Method Detail

setDefaultDir

void setDefaultDir(java.lang.String dir)
Sets the default working directory of new process to dir.

Parameters:
dir - working directory for newly lauched processes, or null if the working directory should be inherited from the current process.

setDefaultJvm

void setDefaultJvm(java.lang.String jvmpath)
Sets the default JVM path (path to java executable) to jvmpath.

Parameters:
jvmpath - path to JVM which should be used to launch Java classes, or null if the JVM path of this process should be used.

setDefaultJvmArgs

void setDefaultJvmArgs(java.lang.String[] jvmargs)
Sets the default JVM arguments to jvmargs.

Parameters:
jvmargs - array of virtual machine arguments to be used when starting Java classes, or null if no JVM arguments should be used.

listProcesses

java.lang.String[] listProcesses()
Returns an array of all launched processes in format ID: command arg1 arg2 ....


readOutput

java.lang.String readOutput(int id)
                            throws java.io.IOException
Returns the next portion of standard output of the process with ID id. The returned string will be at most OUTPUT_LIMIT characters long. If no output is available right now, returns an empty string.

Throws:
java.lang.IllegalArgumentException - if id is an invalid ID.
java.io.IOException

readError

java.lang.String readError(int id)
                           throws java.io.IOException
Returns the next portion of standard error of the process with ID id. The returned string will be at most OUTPUT_LIMIT characters long. If no error output is available right now, returns an empty string.

Throws:
java.lang.IllegalArgumentException - if id is an invalid ID.
java.io.IOException

killProcess

void killProcess(int id)
Kills the launched process with ID id. After the kill, id becomes invalid.

Throws:
java.lang.IllegalArgumentException - if id is an invalid ID.

launchConfiguredSofaClass

void launchConfiguredSofaClass(java.lang.String className,
                               java.lang.String[] parameters)
                               throws java.io.IOException
Launches a class in separate JVM with sofa configuration set as java properties.

Parameters:
className - Name of the class to be launched.
parameters - The parameters to be passed to the class's main function.
Throws:
java.io.IOException

launchConfiguredSofaClass

void launchConfiguredSofaClass(java.lang.String className)
                               throws java.io.IOException
Launches a class in separate JVM with sofa configuration set as java properties.

Parameters:
className - Name of the class to be launched.
Throws:
java.io.IOException

launchDeploymentDock

void launchDeploymentDock(java.lang.String dockName)
                          throws java.io.IOException
Launches a sofa deployment dock in a separate jvm with configuration downloaded from the zeroconf server.

Parameters:
dockName - The name of the deployment dock.
Throws:
java.io.IOException

launchSofaApp

void launchSofaApp(java.lang.String className,
                   java.lang.String[] parameters)
                   throws java.io.IOException
Launches a sofa application (e.g. LogDemo) in a separate jvm with configuration downloaded from the zeroconf server.

Parameters:
className - Full name of the deployment plan to be launched (e.g. org.objectweb.dsrg.sofa.examples.logdemo.deplplan.Local).
parameters - Parameters to pass - e.g. version of the deployment plan.
Throws:
java.io.IOException

shutSofaApp

void shutSofaApp(java.lang.String appID)
                 throws java.io.IOException
Shuts down a launched sofa application with the given appID.

Parameters:
appID - Id of the running sofa application (usually outputed when
Throws:
java.io.IOException

getConfiguration

java.lang.String getConfiguration()
                                  throws java.net.SocketException,
                                         java.io.IOException
Returns the configuration received from the server.

Throws:
java.net.SocketException
java.io.IOException

getAllDeploymentDocks

java.lang.String[] getAllDeploymentDocks()
Returns the list of deployment docks running on the Launcher.