Class ForkedServer

java.lang.Object
org.infinispan.server.test.core.ForkedServer

public class ForkedServer extends Object
Forked server starts the server using batch scripts from the Infinispan Server distribution to start the server. The driver uses REST API to shutdown the server. Server log is cleaned before start and is not configurable. Appends random UUID for server process to identify the corresponding child Java process of the server. FIXME: The server.log file must be present before starting the server as the monitoring process is pointed to it - - groundwork for making the purging of the log directory optional.
Since:
11.0
Author:
Gustavo Lira <glira@redhat.com>, Radoslav Husar
  • Field Details

    • TIMEOUT_SECONDS

      public static final int TIMEOUT_SECONDS
    • DEFAULT_SINGLE_PORT

      public static final Integer DEFAULT_SINGLE_PORT
    • OFFSET_FACTOR

      public static final int OFFSET_FACTOR
      See Also:
  • Constructor Details

    • ForkedServer

      public ForkedServer(String serverHome)
  • Method Details

    • setServerConfiguration

      public ForkedServer setServerConfiguration(String serverConfiguration)
    • setPortsOffset

      public ForkedServer setPortsOffset(int numServer)
    • setJvmOptions

      public ForkedServer setJvmOptions(String jvmOptions)
    • start

      public ForkedServer start()
    • getServerMonitorRunnable

      public Runnable getServerMonitorRunnable(InputStream outputStream)
    • stopInternal

      public void stopInternal()
    • getServerLib

      public File getServerLib()
    • getPid

      public long getPid() throws IllegalStateException
      Returns the process ID (PID) of the Java process as opposed to the PID of the parent shell script which started the actual Java process. The process is matched containing the randomized UUID which was passed on server start. This employs jps utility to list Java processes and thus requires the executable to be in the system path.
      Returns:
      process ID (pid) of the server's Java process.
      Throws:
      IllegalStateException - if PID cannot be determined; e.g. because the server is no longer running or jps utility is not available
    • getServerConfiguration

      public String getServerConfiguration()
    • addSystemProperty

      public void addSystemProperty(String key, Object value)