org.objectweb.proactive.core.process
Class JVMProcessImpl

java.lang.Object
  |
  +--org.objectweb.proactive.core.process.AbstractUniversalProcess
        |
        +--org.objectweb.proactive.core.process.AbstractExternalProcess
              |
              +--org.objectweb.proactive.core.process.JVMProcessImpl
All Implemented Interfaces:
ExternalProcess, JVMProcess, java.io.Serializable, UniversalProcess
Direct Known Subclasses:
JVMNodeProcess

public class JVMProcessImpl
extends AbstractExternalProcess
implements JVMProcess, java.io.Serializable

The JVMProcess class is able to start localy any class of the ProActive library by creating a Java Virtual Machine.

For instance:

 .............
 JVMProcessImpl process = new JVMProcessImpl(new StandardOutputMessageLogger());
 process.setClassname("org.objectweb.proactive.StartNode");
 process.setParameters("nodeName");
 process.startProcess();
 .............
 

This piece of code launches the ProActive java class org.objectweb.proactive.StartNode with nodeName as parameter.

Since:
ProActive 0.9.4
Version:
1.0, 2002/09/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
protected  java.lang.String bootClasspath
           
protected  java.lang.String classname
           
protected  java.lang.String classpath
           
static java.lang.String DEFAULT_CLASSNAME
           
static java.lang.String DEFAULT_CLASSPATH
           
static java.lang.String DEFAULT_JAVAPATH
           
static java.lang.String DEFAULT_JVMPARAMETERS
           
static java.lang.String DEFAULT_LOG4J_FILE
           
static java.lang.String DEFAULT_POLICY_FILE
           
protected  java.lang.String javaPath
           
protected  java.lang.StringBuffer jvmParameters
           
protected  java.lang.String log4jFile
           
protected static org.apache.log4j.Logger logger
           
protected  java.lang.StringBuffer parameters
           
protected  java.lang.String policyFile
           
 
Fields inherited from class org.objectweb.proactive.core.process.AbstractExternalProcess
clogger, errorMessageLogger, externalProcess, inputMessageLogger, IS_WINDOWS_SYSTEM, outputMessageSink
 
Fields inherited from class org.objectweb.proactive.core.process.AbstractUniversalProcess
certificateLocation, command, DEFAULT_HOSTNAME, DEFAULT_USERNAME, environment, hostname, isFinished, isStarted, LOCALHOST, privateKeyLocation, securityFile, username
 
Constructor Summary
JVMProcessImpl()
          Creates a new JVMProcess Used with XML Descriptor
JVMProcessImpl(MessageLogger messageLogger)
          Creates a new JVMProcess
JVMProcessImpl(MessageLogger inputMessageLogger, MessageLogger errorMessageLogger)
          Creates a new JVMProcess
 
Method Summary
protected  java.lang.String buildCommand()
           
protected  java.lang.String buildJavaCommand()
           
 java.lang.String getBootClasspath()
          Returns the boot classpath associated to this process
 java.lang.String getClassname()
          Returns the class name that this process is about to start
 java.lang.String getClasspath()
          Returns the classpath associated to this process
 java.lang.String getJavaPath()
          Returns the java path associated to this process.
 java.lang.String getLog4jFile()
          Returns the location of the log4j property file.
 java.lang.String getParameters()
          Returns parameters associated to the class that this process is going to start
 java.lang.String getPolicyFile()
          Returns the location (path) to the policy file
static void main(java.lang.String[] args)
           
 void setBootClasspath(java.lang.String bootClasspath)
          Sets the boot classpath associated to this process
 void setClassname(java.lang.String classname)
          Sets the value of the class to start for this process
 void setClasspath(java.lang.String classpath)
          Sets the classpath for this process
 void setJavaPath(java.lang.String javaPath)
          Sets the java path for this process
 void setJvmOptions(java.lang.String string)
          Sets the options of the jvm to start For instance: jvmProcess.set JvmOptions("-verbose -Xms300M -Xmx300m");
 void setLog4jFile(java.lang.String log4jFile)
          Sets the location of the log4j property file.
 void setParameters(java.lang.String parameters)
          Sets the parameters of the class to start with the given value
 void setPolicyFile(java.lang.String policyFile)
          Sets the location of the policy file
 
Methods inherited from class org.objectweb.proactive.core.process.AbstractExternalProcess
buildEnvironmentCommand, buildUnixEnvironmentCommand, buildWindowsEnvironmentCommand, getErrorMessageLogger, getInputMessageLogger, getOutputMessageSink, handleError, handleInput, handleOutput, handleProcess, internalStartProcess, internalStopProcess, internalWaitFor, setErrorMessageLogger, setInputMessageLogger, setOutputMessageSink
 
Methods inherited from class org.objectweb.proactive.core.process.AbstractUniversalProcess
checkStarted, getCertificateLocation, getCommand, getEnvironment, getHostname, getPrivateKeyLocation, getSecurityFile, getUsername, isFinished, isStarted, setCertificateLocation, setEnvironment, setHostname, setPrivateKeyLocation, setSecurityFile, setUsername, 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.ExternalProcess
getErrorMessageLogger, getInputMessageLogger, getOutputMessageSink, setErrorMessageLogger, setInputMessageLogger, setOutputMessageSink
 
Methods inherited from interface org.objectweb.proactive.core.process.UniversalProcess
getCertificateLocation, getCommand, getEnvironment, getHostname, getPrivateKeyLocation, getSecurityFile, getUsername, isFinished, isStarted, setCertificateLocation, setEnvironment, setHostname, setPrivateKeyLocation, setSecurityFile, setUsername, startProcess, stopProcess, waitFor
 

Field Detail

logger

protected static org.apache.log4j.Logger logger

DEFAULT_CLASSPATH

public static final java.lang.String DEFAULT_CLASSPATH

DEFAULT_JAVAPATH

public static final java.lang.String DEFAULT_JAVAPATH

DEFAULT_POLICY_FILE

public static java.lang.String DEFAULT_POLICY_FILE

DEFAULT_LOG4J_FILE

public static java.lang.String DEFAULT_LOG4J_FILE

DEFAULT_CLASSNAME

public static final java.lang.String DEFAULT_CLASSNAME
See Also:
Constant Field Values

DEFAULT_JVMPARAMETERS

public static final java.lang.String DEFAULT_JVMPARAMETERS
See Also:
Constant Field Values

classpath

protected java.lang.String classpath

bootClasspath

protected java.lang.String bootClasspath

javaPath

protected java.lang.String javaPath

policyFile

protected java.lang.String policyFile

log4jFile

protected java.lang.String log4jFile

classname

protected java.lang.String classname

parameters

protected java.lang.StringBuffer parameters

jvmParameters

protected java.lang.StringBuffer jvmParameters
Constructor Detail

JVMProcessImpl

public JVMProcessImpl()
Creates a new JVMProcess Used with XML Descriptor


JVMProcessImpl

public JVMProcessImpl(MessageLogger messageLogger)
Creates a new JVMProcess

Parameters:
messageLogger - The logger that handles input and error stream of this process

JVMProcessImpl

public JVMProcessImpl(MessageLogger inputMessageLogger,
                      MessageLogger errorMessageLogger)
Creates a new JVMProcess

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

main

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

getClasspath

public java.lang.String getClasspath()
Description copied from interface: JVMProcess
Returns the classpath associated to this process

Specified by:
getClasspath in interface JVMProcess
Returns:
String

setClasspath

public void setClasspath(java.lang.String classpath)
Description copied from interface: JVMProcess
Sets the classpath for this process

Specified by:
setClasspath in interface JVMProcess
Parameters:
classpath - The value of the classpath environment variable

setBootClasspath

public void setBootClasspath(java.lang.String bootClasspath)
Description copied from interface: JVMProcess
Sets the boot classpath associated to this process

Specified by:
setBootClasspath in interface JVMProcess
Parameters:
bootClasspath - The boot classpath of the java command

getBootClasspath

public java.lang.String getBootClasspath()
Description copied from interface: JVMProcess
Returns the boot classpath associated to this process

Specified by:
getBootClasspath in interface JVMProcess
Returns:
String the boot classpath of the java command

getJavaPath

public java.lang.String getJavaPath()
Description copied from interface: JVMProcess
Returns the java path associated to this process.

Specified by:
getJavaPath in interface JVMProcess
Returns:
String The path to the java command

setJavaPath

public void setJavaPath(java.lang.String javaPath)
Description copied from interface: JVMProcess
Sets the java path for this process

Specified by:
setJavaPath in interface JVMProcess
Parameters:
javaPath - The value of the path to execute 'java' command

getPolicyFile

public java.lang.String getPolicyFile()
Description copied from interface: JVMProcess
Returns the location (path) to the policy file

Specified by:
getPolicyFile in interface JVMProcess
Returns:
String The path to the policy file

setPolicyFile

public void setPolicyFile(java.lang.String policyFile)
Description copied from interface: JVMProcess
Sets the location of the policy file

Specified by:
setPolicyFile in interface JVMProcess
Parameters:
policyFile - The value of the path to the policy file

getLog4jFile

public java.lang.String getLog4jFile()
Description copied from interface: JVMProcess
Returns the location of the log4j property file.

Specified by:
getLog4jFile in interface JVMProcess
Returns:
String the location of the log4j property file

setLog4jFile

public void setLog4jFile(java.lang.String log4jFile)
Description copied from interface: JVMProcess
Sets the location of the log4j property file.

Specified by:
setLog4jFile in interface JVMProcess

getClassname

public java.lang.String getClassname()
Description copied from interface: JVMProcess
Returns the class name that this process is about to start

Specified by:
getClassname in interface JVMProcess
Returns:
String The value of the class that this process is going to start

setClassname

public void setClassname(java.lang.String classname)
Description copied from interface: JVMProcess
Sets the value of the class to start for this process

Specified by:
setClassname in interface JVMProcess
Parameters:
classname - The name of the class to start

getParameters

public java.lang.String getParameters()
Description copied from interface: JVMProcess
Returns parameters associated to the class that this process is going to start

Specified by:
getParameters in interface JVMProcess
Returns:
String The value of the parameters of the class

setParameters

public void setParameters(java.lang.String parameters)
Description copied from interface: JVMProcess
Sets the parameters of the class to start with the given value

Specified by:
setParameters in interface JVMProcess
Parameters:
parameters - Paramaters to be given in order to start the class

setJvmOptions

public void setJvmOptions(java.lang.String string)
Description copied from interface: JVMProcess
Sets the options of the jvm to start

For instance:

 jvmProcess.set JvmOptions("-verbose -Xms300M -Xmx300m");
 

Specified by:
setJvmOptions in interface JVMProcess
Parameters:
string - Options to be given in order to start the jvm

buildCommand

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

buildJavaCommand

protected java.lang.String buildJavaCommand()


Copyright © April 2004 INRIA All Rights Reserved.