Package org.infinispan.server.test.core
Class ForkedServer
java.lang.Object
org.infinispan.server.test.core.ForkedServer
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSystemProperty(String key, Object value) longgetPid()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.getServerMonitorRunnable(InputStream outputStream) setJvmOptions(String jvmOptions) setPortsOffset(int numServer) setServerConfiguration(String serverConfiguration) start()void
-
Field Details
-
TIMEOUT_SECONDS
public static final int TIMEOUT_SECONDS -
DEFAULT_SINGLE_PORT
-
OFFSET_FACTOR
public static final int OFFSET_FACTOR- See Also:
-
-
Constructor Details
-
ForkedServer
-
-
Method Details
-
setServerConfiguration
-
setPortsOffset
-
setJvmOptions
-
start
-
getServerMonitorRunnable
-
stopInternal
public void stopInternal() -
getServerLib
-
getPid
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 employsjpsutility 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
-
addSystemProperty
-