Class ProcessExecutorServer

  • All Implemented Interfaces:
    RemoteProcessExecutor, java.rmi.Remote

    public final class ProcessExecutorServer
    extends java.lang.Object
    implements RemoteProcessExecutor
    ProcessExecutor implementation 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 int DEFAULT_PORT
      The default port to use (if no other port was specified.
      static java.lang.String LOOPBACK_CONFIG_KEY
      The Loopback address to connect to the localhost only.
      static java.lang.String START_CONFIRMATION
      Message printed to System.out to 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
      int execute​(RemoteProcessContext context)
      Synchronously executes the process as specified in the passed context.
      static void main​(java.lang.String[] args)
      Main method starting a ProcessExecutorServer and registering the RMI services.
      void quit()
      Shutdown the remote process executor.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 to System.out to 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: RemoteProcessExecutor
        Synchronously executes the process as specified in the passed context.
        Specified by:
        execute in interface RemoteProcessExecutor
        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.IOException
        Description copied from interface: RemoteProcessExecutor
        Shutdown the remote process executor.
        Specified by:
        quit in interface RemoteProcessExecutor
        Throws:
        java.io.IOException - on any error (e.g. communication failed).
      • main

        public static void main​(java.lang.String[] args)
        Main method starting a ProcessExecutorServer and 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.