Class RmiProcessLauncher

java.lang.Object
com._1c.g5.v8.dt.internal.pm.connection.rmi.RmiProcessLauncher
All Implemented Interfaces:
IProcessLauncher

public class RmiProcessLauncher extends Object implements IProcessLauncher
IProcessLauncher for connection with process via RMI.
  • Field Details

    • HOST_ADDRESS

      public static final String HOST_ADDRESS
      A name of Host address field for dependency injection.
      See Also:
  • Constructor Details

    • RmiProcessLauncher

      public RmiProcessLauncher()
  • Method Details

    • launchProcess

      public Process launchProcess(ProcessBinder processBinder, IProcessConnectionListener listener) throws IOException
      Description copied from interface: IProcessLauncher
      Launches process with parameters specified in given ProcessBinder. Starts establishing connection with lauhced process. Established connection is provided to given IProcessConnectionListener during or after this method invocation.
      Specified by:
      launchProcess in interface IProcessLauncher
      Parameters:
      processBinder - given ProcessBinder (not null)
      listener - given IProcessConnectionListener, to which established connection is provided during or after this method invocation (not null)
      Returns:
      lauched process. When connection is closed, must be killed (not null)
      Throws:
      IOException - if launching process failed
    • initializeRmi

      protected void initializeRmi() throws RemoteException

      Initializes RMI if it has not been already initialized.

      Throws:
      RemoteException - if exporting processRegister or RMI binding fails
    • getPort

      protected int getPort()

      Obtain an empty port at the local machine to start an RMI registry on it

      Returns:
      an empty port at the local machine
      Throws:
      PortAllocatingException - when operation fails
    • getArgs

      protected String[] getArgs(String key)
      Returns args for process with given key.
      Parameters:
      key - given key (not null)
      Returns:
      args for process with given key (not null)