T
- The concrete standalone implementationpublic abstract class AbstractStandalone<T extends AbstractStandalone> extends AbstractConsole<T> implements Standalone<T>, Runnable
Modifier and Type | Field and Description |
---|---|
protected List<String> |
baseUrls |
protected String |
contextPath |
protected String |
host |
protected Long |
idleTimeout |
protected Integer |
port |
protected List<String> |
serverUrls |
protected String |
sslKeystorePassword |
protected URI |
sslKeystoreUri |
protected Integer |
sslPort |
protected String |
sslTruststorePassword |
protected URI |
sslTruststoreUri |
configured, externalConfigurationPath, logger, name, ninjaMode, ninjaProperties, overlayedNinjaProperties, started
DEFAULT_CONTEXT_PATH, DEFAULT_DEV_NINJA_SSL_KEYSTORE_PASSWORD, DEFAULT_DEV_NINJA_SSL_KEYSTORE_URI, DEFAULT_DEV_NINJA_SSL_TRUSTSTORE_PASSWORD, DEFAULT_DEV_NINJA_SSL_TRUSTSTORE_URI, DEFAULT_HOST, DEFAULT_IDLE_TIMEOUT, DEFAULT_PORT, DEFAULT_SSL_PORT, DEFAULT_STANDALONE_CLASS, KEY_NINJA_CONTEXT_PATH, KEY_NINJA_HOST, KEY_NINJA_IDLE_TIMEOUT, KEY_NINJA_PORT, KEY_NINJA_SSL_KEYSTORE_PASSWORD, KEY_NINJA_SSL_KEYSTORE_URI, KEY_NINJA_SSL_PORT, KEY_NINJA_SSL_TRUSTSTORE_PASSWORD, KEY_NINJA_SSL_TRUSTSTORE_URI, KEY_NINJA_STANDALONE_CLASS
Constructor and Description |
---|
AbstractStandalone(String name) |
Modifier and Type | Method and Description |
---|---|
T |
contextPath(String contextPath)
Sets the "context path" of the Ninja application.
|
protected String |
createBaseUrl(String scheme,
String host,
Integer port,
String context) |
protected List<String> |
createBaseUrls() |
protected String |
createServerUrl(String scheme,
String host,
Integer port) |
protected List<String> |
createServerUrls() |
protected SSLContext |
createSSLContext() |
protected abstract void |
doJoin() |
protected void |
doPostConfigure() |
protected void |
doPreConfigure() |
List<String> |
getBaseUrls()
Get the urls for the application that is configured to start.
|
String |
getContextPath() |
String |
getHost() |
Long |
getIdleTimeout() |
protected String |
getLoggableIdentifier() |
Integer |
getPort() |
List<String> |
getServerUrls()
Get the urls for the servers that are configured to start.
|
String |
getSslKeystorePassword() |
URI |
getSslKeystoreUri() |
Integer |
getSslPort() |
String |
getSslTruststorePassword() |
URI |
getSslTruststoreUri() |
T |
host(String host) |
T |
idleTimeout(long idleTimeout) |
boolean |
isPortEnabled()
Tests if the clear text HTTP port is enabled.
|
boolean |
isSslPortEnabled()
Tests if the SSL HTTP port is enabled.
|
T |
join()
Joins the underlying server to wait until its finished.
|
protected void |
logStarted() |
T |
port(int port) |
void |
run()
Configure, start, add shutdown hook, and join.
|
T |
sslKeystorePassword(String keystorePassword) |
T |
sslKeystoreUri(URI keystoreUri) |
T |
sslPort(int sslPort) |
T |
sslTruststorePassword(String truststorePassword) |
T |
sslTruststoreUri(URI truststoreUri) |
checkConfigured, checkNotConfigured, checkStarted, configure, doConfigure, doShutdown, doStart, externalConfigurationPath, getExternalConfigurationPath, getName, getNinjaMode, getNinjaProperties, name, ninjaMode, shutdown, start, tryToUnwrapInjectorException
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
configure, externalConfigurationPath, getExternalConfigurationPath, getInjector, getName, getNinjaMode, getNinjaProperties, name, ninjaMode, shutdown, start
protected String host
protected Integer port
protected String contextPath
protected Long idleTimeout
protected Integer sslPort
protected URI sslKeystoreUri
protected String sslKeystorePassword
protected URI sslTruststoreUri
protected String sslTruststorePassword
public AbstractStandalone(String name)
protected void doPreConfigure() throws Exception
doPreConfigure
in class AbstractConsole<T extends AbstractStandalone>
Exception
protected void doPostConfigure() throws Exception
doPostConfigure
in class AbstractConsole<T extends AbstractStandalone>
Exception
public final void run()
run
in interface Runnable
run
in interface Standalone<T extends AbstractStandalone>
public final T join() throws Exception
Standalone
join
in interface Standalone<T extends AbstractStandalone>
Exception
- Thrown if an exception occurs while waitingpublic Integer getPort()
getPort
in interface Standalone<T extends AbstractStandalone>
public T port(int port)
port
in interface Standalone<T extends AbstractStandalone>
public String getHost()
getHost
in interface Standalone<T extends AbstractStandalone>
public T host(String host)
host
in interface Standalone<T extends AbstractStandalone>
public Long getIdleTimeout()
getIdleTimeout
in interface Standalone<T extends AbstractStandalone>
public T idleTimeout(long idleTimeout)
idleTimeout
in interface Standalone<T extends AbstractStandalone>
public String getContextPath()
getContextPath
in interface Standalone<T extends AbstractStandalone>
public T contextPath(String contextPath)
Standalone
contextPath
in interface Standalone<T extends AbstractStandalone>
contextPath
- The context path such as "/mycontext"public Integer getSslPort()
getSslPort
in interface Standalone<T extends AbstractStandalone>
public T sslPort(int sslPort)
sslPort
in interface Standalone<T extends AbstractStandalone>
public URI getSslKeystoreUri()
getSslKeystoreUri
in interface Standalone<T extends AbstractStandalone>
public T sslKeystoreUri(URI keystoreUri)
sslKeystoreUri
in interface Standalone<T extends AbstractStandalone>
public String getSslKeystorePassword()
getSslKeystorePassword
in interface Standalone<T extends AbstractStandalone>
public T sslKeystorePassword(String keystorePassword)
sslKeystorePassword
in interface Standalone<T extends AbstractStandalone>
public URI getSslTruststoreUri()
getSslTruststoreUri
in interface Standalone<T extends AbstractStandalone>
public T sslTruststoreUri(URI truststoreUri)
sslTruststoreUri
in interface Standalone<T extends AbstractStandalone>
public String getSslTruststorePassword()
getSslTruststorePassword
in interface Standalone<T extends AbstractStandalone>
public T sslTruststorePassword(String truststorePassword)
sslTruststorePassword
in interface Standalone<T extends AbstractStandalone>
public List<String> getServerUrls()
Standalone
getServerUrls
in interface Standalone<T extends AbstractStandalone>
Standalone.getServerUrls()
public List<String> getBaseUrls()
Standalone
getBaseUrls
in interface Standalone<T extends AbstractStandalone>
Standalone.getBaseUrls()
public boolean isPortEnabled()
Standalone
isPortEnabled
in interface Standalone<T extends AbstractStandalone>
public boolean isSslPortEnabled()
Standalone
isSslPortEnabled
in interface Standalone<T extends AbstractStandalone>
protected String createBaseUrl(String scheme, String host, Integer port, String context)
protected String getLoggableIdentifier()
protected void logStarted()
logStarted
in class AbstractConsole<T extends AbstractStandalone>
protected SSLContext createSSLContext() throws Exception
Exception
Copyright © 2019 ninjaframework. All rights reserved.