Class ProcessExecutorServer
- java.lang.Object
-
- de.hybris.platform.mediaconversion.os.process.rmi.ProcessExecutorServer
-
- All Implemented Interfaces:
RemoteProcessExecutor,java.rmi.Remote
public final class ProcessExecutorServer extends java.lang.Object implements RemoteProcessExecutor
ProcessExecutorimplementation to run in a separate JVM. The communication with this ProcessExecutor is encapsulated in various RMI calls.
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_PORTThe default port to use (if no other port was specified.static java.lang.StringLOOPBACK_CONFIG_KEYThe Loopback address to connect to the localhost only.static java.lang.StringSTART_CONFIRMATIONMessage printed toSystem.outto notify a successfull startup and registration of the RMI services.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intexecute(RemoteProcessContext context)Synchronously executes the process as specified in the passed context.static voidmain(java.lang.String[] args)Main method starting aProcessExecutorServerand registering the RMI services.voidquit()Shutdown the remote process executor.
-
-
-
Field Detail
-
LOOPBACK_CONFIG_KEY
public static final java.lang.String LOOPBACK_CONFIG_KEY
The Loopback address to connect to the localhost only.- See Also:
- Constant Field Values
-
START_CONFIRMATION
public static final java.lang.String START_CONFIRMATION
Message printed toSystem.outto notify a successfull startup and registration of the RMI services.- See Also:
- Constant Field Values
-
DEFAULT_PORT
public static final int DEFAULT_PORT
The default port to use (if no other port was specified.- See Also:
- Constant Field Values
-
-
Method Detail
-
execute
public int execute(RemoteProcessContext context) throws java.io.IOException
Description copied from interface:RemoteProcessExecutorSynchronously executes the process as specified in the passed context.- Specified by:
executein interfaceRemoteProcessExecutor- Parameters:
context- the process description to execute.- Returns:
- the exit code of the process
- Throws:
java.io.IOException- on any error
-
quit
public void quit() throws java.io.IOExceptionDescription copied from interface:RemoteProcessExecutorShutdown the remote process executor.- Specified by:
quitin interfaceRemoteProcessExecutor- Throws:
java.io.IOException- on any error (e.g. communication failed).
-
main
public static void main(java.lang.String[] args)
Main method starting aProcessExecutorServerand registering the RMI services. There are two parameters passed:- a object code used to postfix the rmi service name to register. This is normally the tenant name to avoid clashes in multi-tenant systems.
- the port number of the RMI Registry service (on the localhost) to register the rmi service to.
- Parameters:
args- command line arguments as described above.
-
-