public abstract static class DriverService.Builder<DS extends DriverService,B extends DriverService.Builder>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private com.google.common.collect.ImmutableMap<java.lang.String,java.lang.String> |
environment |
private java.io.File |
exe |
private java.io.File |
logFile |
private int |
port |
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
DS |
build()
Creates a new service to manage the driver server.
|
protected abstract com.google.common.collect.ImmutableList<java.lang.String> |
createArgs() |
protected abstract DS |
createDriverService(java.io.File exe,
int port,
com.google.common.collect.ImmutableList<java.lang.String> args,
com.google.common.collect.ImmutableMap<java.lang.String,java.lang.String> environment) |
protected abstract java.io.File |
findDefaultExecutable() |
protected java.io.File |
getLogFile() |
protected int |
getPort() |
B |
usingAnyFreePort()
Configures the driver server to start on any available port.
|
B |
usingDriverExecutable(java.io.File file)
Sets which driver executable the builder will use.
|
B |
usingPort(int port)
Sets which port the driver server should be started on.
|
B |
withEnvironment(java.util.Map<java.lang.String,java.lang.String> environment)
Defines the environment for the launched driver server.
|
B |
withLogFile(java.io.File logFile)
Configures the driver server to write log to the given file.
|
private int port
private java.io.File exe
private com.google.common.collect.ImmutableMap<java.lang.String,java.lang.String> environment
private java.io.File logFile
public B usingDriverExecutable(java.io.File file)
file
- The executable to use.public B usingPort(int port)
port
- The port to use; must be non-negative.protected int getPort()
public B usingAnyFreePort()
@Beta public B withEnvironment(java.util.Map<java.lang.String,java.lang.String> environment)
environment
- A map of the environment variables to launch the
server with.public B withLogFile(java.io.File logFile)
logFile
- A file to write log to.protected java.io.File getLogFile()
public DS build()
protected abstract java.io.File findDefaultExecutable()
protected abstract com.google.common.collect.ImmutableList<java.lang.String> createArgs()
protected abstract DS createDriverService(java.io.File exe, int port, com.google.common.collect.ImmutableList<java.lang.String> args, com.google.common.collect.ImmutableMap<java.lang.String,java.lang.String> environment)