org.objectweb.proactive.core.process
Class SimpleExternalProcess

java.lang.Object
  extended byorg.objectweb.proactive.core.process.AbstractUniversalProcess
      extended byorg.objectweb.proactive.core.process.AbstractExternalProcess
          extended byorg.objectweb.proactive.core.process.SimpleExternalProcess
All Implemented Interfaces:
ExternalProcess, java.io.Serializable, UniversalProcess

public class SimpleExternalProcess
extends AbstractExternalProcess

The SimpleExternalProcess class is able to start any command line

For instance

 ..............
 SimpleExternalProcess p = new SimpleExternalProcess("ls -la");
 ..............
 

The previous piece of code will run locally the command "ls -la"

Since:
ProActive 0.9.3
Version:
1.0, 2002/06/20
Author:
ProActive Team
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class org.objectweb.proactive.core.process.AbstractExternalProcess
AbstractExternalProcess.NullMessageLogger, AbstractExternalProcess.ProcessInputHandler, AbstractExternalProcess.ProcessOutputHandler, AbstractExternalProcess.SimpleMessageSink, AbstractExternalProcess.StandardOutputMessageLogger
 
Field Summary
 
Fields inherited from class org.objectweb.proactive.core.process.AbstractExternalProcess
clogger, closeStream, errorMessageLogger, externalProcess, FILE_TRANSFER_DEFAULT_PROTOCOL, fileTransferLogger, inputMessageLogger, IS_WINDOWS_SYSTEM, NO_COMPOSITION, outputMessageSink
 
Fields inherited from class org.objectweb.proactive.core.process.AbstractUniversalProcess
certificateLocation, command, command_path, DEFAULT_HOSTNAME, DEFAULT_USERNAME, environment, hostname, isFinished, isStarted, LOCALHOST, privateKeyLocation, securityFile, username
 
Fields inherited from interface org.objectweb.proactive.core.process.UniversalProcess
logger, UNKNOWN_NODE_NUMBER
 
Constructor Summary
SimpleExternalProcess(RemoteProcessMessageLogger inputMessageLogger, RemoteProcessMessageLogger errorMessageLogger, java.lang.String targetCommand)
          Creates a new SimpleExternalProcess
SimpleExternalProcess(RemoteProcessMessageLogger messageLogger, java.lang.String targetCommand)
          Creates a new SimpleExternalProcess
SimpleExternalProcess(java.lang.String targetCommand)
          Creates a new SimpleExternalProcess
 
Method Summary
protected  java.lang.String buildCommand()
           
 UniversalProcess getFinalProcess()
          Returns the last process of the chain
 int getNodeNumber()
          Returns the number of nodes targeted
 java.lang.String getProcessId()
          Returns the id of the process
static void main(java.lang.String[] args)
           
 
Methods inherited from class org.objectweb.proactive.core.process.AbstractExternalProcess
buildEnvironmentCommand, buildUnixEnvironmentCommand, buildWindowsEnvironmentCommand, closeStream, getCompositionType, getErrorMessageLogger, getFileTransferDefaultCopyProtocol, getFileTransferWorkShopDeploy, getFileTransferWorkShopRetrieve, getInputMessageLogger, getOutputMessageSink, handleError, handleInput, handleOutput, handleProcess, internalFileTransferDefaultProtocol, internalStartFileTransfer, internalStartProcess, internalStopProcess, internalWaitFor, setErrorMessageLogger, setInputMessageLogger, setOutputMessageSink
 
Methods inherited from class org.objectweb.proactive.core.process.AbstractUniversalProcess
checkStarted, getCommand, getCommandPath, getEnvironment, getHostname, getUsername, isFinished, isHierarchical, isStarted, pushProcessAttributes, setCommandPath, setEnvironment, setHostname, setUsername, startFileTransfer, startProcess, stopProcess, toString, toString, waitFor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.objectweb.proactive.core.process.UniversalProcess
getCommand, getCommandPath, getEnvironment, getHostname, getUsername, isFinished, isHierarchical, isStarted, setCommandPath, setEnvironment, setHostname, setUsername, startFileTransfer, startProcess, stopProcess, waitFor
 

Constructor Detail

SimpleExternalProcess

public SimpleExternalProcess(java.lang.String targetCommand)
Creates a new SimpleExternalProcess

Parameters:
targetCommand - The command to run

SimpleExternalProcess

public SimpleExternalProcess(RemoteProcessMessageLogger messageLogger,
                             java.lang.String targetCommand)
Creates a new SimpleExternalProcess

Parameters:
messageLogger - The logger that handles input and error stream of this process
targetCommand - The command to run

SimpleExternalProcess

public SimpleExternalProcess(RemoteProcessMessageLogger inputMessageLogger,
                             RemoteProcessMessageLogger errorMessageLogger,
                             java.lang.String targetCommand)
Creates a new SimpleExternalProcess

Parameters:
inputMessageLogger - The logger that handles input stream of this process
errorMessageLogger - The logger that handles error stream of this process
targetCommand - The command to run
Method Detail

getProcessId

public java.lang.String getProcessId()
Description copied from interface: UniversalProcess
Returns the id of the process

Returns:
the id of the process. This id is just the first letters of the process class, to be able to identify the sequence of processes used
See Also:
UniversalProcess.getProcessId()

getNodeNumber

public int getNodeNumber()
Description copied from interface: UniversalProcess
Returns the number of nodes targeted

Returns:
the number of nodes targeted. Represents the number of nodes expected to use when starting this process. If this number cannot be known, waiting for all available nodes for example, UNKNOWN_NODE_NUMBER is returned.
See Also:
UniversalProcess.getNodeNumber()

getFinalProcess

public UniversalProcess getFinalProcess()
Description copied from interface: UniversalProcess
Returns the last process of the chain

Returns:
the last process of the chain
See Also:
UniversalProcess.getFinalProcess()

main

public static void main(java.lang.String[] args)

buildCommand

protected java.lang.String buildCommand()
Specified by:
buildCommand in class AbstractExternalProcess


Copyright 2001-2005 INRIA All Rights Reserved.