Package rife.engine
Class Server
java.lang.Object
rife.engine.Server
Embedded Jetty server that can directly start from a RIFE2 site.
- Since:
- 1.0
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionenabledVirtualThreads
(boolean enable) Sets whether virtual threads are used.Configures the host the server will be listening on.idleTimeout
(int idleTimeout) Configures the maximum thread idle time in ms.maxThreads
(int maxThreads) Configures the maximum number of threads to use.minThreads
(int minThreads) Configures the minimum number of threads to use.port
(int port) Configures the HTTP port the server will be listening to.Retrieves the hierarchical properties for this server instance.sslCertAlias
(String alias) Sets the SSL certificate alias.sslKeyStorePassword
(String password) Sets the password for the SSL key store.sslKeyStorePath
(String path) Sets the file system path to the SSL key store.sslNeedClientAuth
(boolean auth) Sets whether the SSL client certificate needs to be authenticated.sslTrustStorePassword
(String password) Sets the password for the SSL trust store.sslTrustStorePath
(String path) Sets the path to the SSL trust store.sslWantClientAuth
(boolean auth) Sets whether the server wants SSL client certificate to be authenticated.Start the embedded server for a particular site.staticResourceBase
(String base) Configures the base path where static resources will be looked up.Configures the base directory where static resources will be looked up from.void
stop()
Stop running the embedded server.
-
Field Details
-
DEFAULT_PORT
public static final int DEFAULT_PORT- See Also:
-
DEFAULT_HOST
-
DEFAULT_STATIC_RESOURCE_BASE
-
DEFAULT_MIN_THREADS
public static final int DEFAULT_MIN_THREADS- See Also:
-
DEFAULT_MAX_THREADS
public static final int DEFAULT_MAX_THREADS- See Also:
-
DEFAULT_IDLE_TIMEOUT_MS
public static final int DEFAULT_IDLE_TIMEOUT_MS- See Also:
-
sslKeyStorePath_
-
sslKeyStorePassword_
-
sslCertAlias_
-
sslTrustStorePath_
-
sslTrustStorePassword_
-
sslNeedClientAuth_
protected boolean sslNeedClientAuth_ -
sslWantClientAuth_
protected boolean sslWantClientAuth_ -
enableVirtualThreads_
protected boolean enableVirtualThreads_
-
-
Constructor Details
-
Server
public Server()Instantiates a new embedded Jetty server.- Since:
- 1.0
-
-
Method Details
-
port
Configures the HTTP port the server will be listening to.- Parameters:
port
- a port number (defaults to 8080)- Returns:
- the instance of the server that's being configured
- Since:
- 1.0
-
host
Configures the host the server will be listening on.- Parameters:
host
- the hostname to listen on- Returns:
- the instance of the server that's being configured
- Since:
- 1.1
-
staticResourceBase
Configures the base path where static resources will be looked up.- Parameters:
base
- the base path for static resources- Returns:
- the instance of the server that's being configured
- Since:
- 1.0
-
staticUberJarResourceBase
Configures the base directory where static resources will be looked up from.This will be relative to the classpath root of an Uber Jar that contains your web application as well as the RIFE2 framework classes and everything else required to run your web application.
- Parameters:
base
- the base directory for static resources- Returns:
- the instance of the server that's being configured
- Since:
- 1.1
-
minThreads
Configures the minimum number of threads to use.Defaults to
8
.- Parameters:
minThreads
- the minimum number of threads to use- Returns:
- the instance of the server that's being configured
- Since:
- 1.1
-
maxThreads
Configures the maximum number of threads to use.Defaults to
200
.- Parameters:
maxThreads
- the maximum number of threads to use- Returns:
- the instance of the server that's being configured
- Since:
- 1.1
-
idleTimeout
Configures the maximum thread idle time in ms.Defaults to
60000
.- Parameters:
idleTimeout
- the maximum thread idle time in ms- Returns:
- the instance of the server that's being configured
- Since:
- 1.1
-
sslKeyStorePath
Sets the file system path to the SSL key store.When this is provided, the embedded server will switch from http to https. Other SSL parameters have no effect unless the key store path is configured.
- Parameters:
path
- the SSL key store path- Returns:
- the instance of the server that's being configured
- Since:
- 1.1
-
sslKeyStorePassword
Sets the password for the SSL key store.- Parameters:
password
- the SSL key store password- Returns:
- the instance of the server that's being configured
- Since:
- 1.1
-
sslCertAlias
Sets the SSL certificate alias.- Parameters:
alias
- the SSL certificate alias- Returns:
- the instance of the server that's being configured
- Since:
- 1.1
-
sslTrustStorePath
Sets the path to the SSL trust store.- Parameters:
path
- the SSL trust store path- Returns:
- the instance of the server that's being configured
- Since:
- 1.1
-
sslTrustStorePassword
Sets the password for the SSL trust store.- Parameters:
password
- the SSL trust store password- Returns:
- the instance of the server that's being configured
- Since:
- 1.1
-
sslNeedClientAuth
Sets whether the SSL client certificate needs to be authenticated.- Parameters:
auth
-true
if the client certificate needs to be authenticated; orfalse
otherwise- Returns:
- the instance of the server that's being configured
- Since:
- 1.1
-
sslWantClientAuth
Sets whether the server wants SSL client certificate to be authenticated.- Parameters:
auth
-true
of server wants the client certificate to be authenticated; orfalse
otherwise- Returns:
- the instance of the server that's being configured
- Since:
- 1.1
-
enabledVirtualThreads
Sets whether virtual threads are used.When virtual threads are available, RIFE2's embedded server will automatically switch to using them. Use this method to explicitly disable virtual threads.
- Parameters:
enable
-true
if virtual threads should be used when a suitable JDK is present; orfalse
if virtual threads should never be used- Returns:
- the instance of the server that's being configured
-
properties
Retrieves the hierarchical properties for this server instance.- Returns:
- this server's collection of hierarchical properties
- Since:
- 1.0
-
start
Start the embedded server for a particular site.- Parameters:
site
- theSite
instance that the server will be set up for- Returns:
- the instance of the server that's being started
- Since:
- 1.0
- See Also:
-
stop
public void stop()Stop running the embedded server.- Since:
- 1.0
-