Package org.jcsp.net.remote
Class ProcessSpawner
java.lang.Object
org.jcsp.net.remote.ProcessSpawner
- All Implemented Interfaces:
CSProcess
Launches a new JVM to run a process received by this spawner. This process will communicate with the
new JVM, routing any exceptions to the requesting host and also any information printed to the
System.err or System.out streams.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ApplicationIDThe application identifier of the caller that the child should adopt.private final NetChannelOutputFor sending data back to the calling JVM who is running theRemoteProcessproxy.private final StringThe classpath the spawned JVM should use to get the caller's classes from a networked filesystem ornullif the default classpath should be used.private final NodeFactoryThe factory the child should use to initialize its node ornullif the default initialization should take place.(package private) static final intAnExceptionfollows that was raised by the spawned process.(package private) static final intAnExceptionfollows that was raised by the spawned process on failure.(package private) static final intThe process terminated without error.(package private) static final intAStringfollows with a line of text that was forSystem.err.(package private) static final intAStringfollows with a line of text that was forSystem.out.private static final IntegerAnExceptionfollows that was raised by the spawned process.private static final IntegerAnExceptionfollows that was raised by the spawned process on failure.private static final IntegerThe process terminated without error.private static final IntegerAStringfollows with a line of text that was forSystem.err.private static final IntegerAStringfollows with a line of text that was forSystem.out.private final CSProcessThe process that needs to be started.private final SpawnerServiceThe parent service that started this one.private final StringA unique name generated by the service fo use in creating a temporary file. -
Constructor Summary
ConstructorsConstructorDescriptionProcessSpawner(SpawnerService service, CSProcess process, NetChannelOutput caller, NodeFactory factory, ApplicationID applicationID, int unique, String classPath) Constructs a new spawner. -
Method Summary
-
Field Details
-
MSG_STDOUT
static final int MSG_STDOUTAStringfollows with a line of text that was forSystem.out.- See Also:
-
MSG_STDERR
static final int MSG_STDERRAStringfollows with a line of text that was forSystem.err.- See Also:
-
MSG_EXCEPTION
static final int MSG_EXCEPTIONAnExceptionfollows that was raised by the spawned process.- See Also:
-
MSG_FAIL
static final int MSG_FAILAnExceptionfollows that was raised by the spawned process on failure.- See Also:
-
MSG_OK
static final int MSG_OKThe process terminated without error.- See Also:
-
msgSTDOUT
AStringfollows with a line of text that was forSystem.out. -
msgSTDERR
AStringfollows with a line of text that was forSystem.err. -
msgEXCEPTION
AnExceptionfollows that was raised by the spawned process. -
msgFAIL
AnExceptionfollows that was raised by the spawned process on failure. -
msgOK
The process terminated without error. -
service
The parent service that started this one. -
process
The process that needs to be started. -
caller
For sending data back to the calling JVM who is running theRemoteProcessproxy. -
factory
The factory the child should use to initialize its node ornullif the default initialization should take place. -
applicationID
The application identifier of the caller that the child should adopt. -
uniqueName
A unique name generated by the service fo use in creating a temporary file. -
classPath
The classpath the spawned JVM should use to get the caller's classes from a networked filesystem ornullif the default classpath should be used.
-
-
Constructor Details
-
ProcessSpawner
public ProcessSpawner(SpawnerService service, CSProcess process, NetChannelOutput caller, NodeFactory factory, ApplicationID applicationID, int unique, String classPath) Constructs a new spawner.- Parameters:
service- the parent service that is creating this object.process- the process that should be run.caller- for sending data back to the caller.factory- optional factory for initializing the child process' node.applicationID- caller's application ID that the child should adopt.unique- a unique number allocated by the parent service.classPath- classpath specified by the caller process for any classes available from a networked filesystem.
-
-
Method Details