public abstract class AbstractEmbeddedServer<S,T extends AbstractConfiguration> extends Object implements EmbeddedServer<T>
| Modifier and Type | Field and Description |
|---|---|
protected T |
configuration
Server configuration.
|
static String |
PORT_SEPARATOR |
static String |
SCHEME_SEPARATOR |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractEmbeddedServer(T configuration)
Build default embedded server.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract int |
doGetPort()
Get port once server is started.
|
protected abstract void |
doStart()
Start embedded server.
|
protected abstract void |
doStop()
Stop embedded server.
|
T |
getConfiguration()
Return server configuration.
|
abstract S |
getDelegate()
Get internal server implementation.
|
String |
getHost()
Get the host, should be
"localhost", unless specific configuration. |
String |
getPath()
Get server context path.
|
int |
getPort()
Get port used by embedded server.
|
String |
getScheme()
Get the protocol scheme (
"http", "https"). |
String |
getUrl()
Get URL to query embedded server.
|
boolean |
isStarted()
Check if embedded server is started.
|
void |
restart()
Restart embedded server.
|
void |
start()
Start embedded server.
|
void |
stop()
Stop embedded server.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetServletContextpublic static final String SCHEME_SEPARATOR
public static final String PORT_SEPARATOR
protected final T extends AbstractConfiguration configuration
protected AbstractEmbeddedServer(T configuration)
configuration - Server configuration.public void start()
EmbeddedServerstart in interface EmbeddedServer<T extends AbstractConfiguration>public void stop()
EmbeddedServerstop in interface EmbeddedServer<T extends AbstractConfiguration>public boolean isStarted()
EmbeddedServerisStarted in interface EmbeddedServer<T extends AbstractConfiguration>true if embedded server is started, false otherwise.public void restart()
EmbeddedServerrestart in interface EmbeddedServer<T extends AbstractConfiguration>public int getPort()
EmbeddedServerNote that:
getPort in interface EmbeddedServer<T extends AbstractConfiguration>public String getPath()
EmbeddedServergetPath in interface EmbeddedServer<T extends AbstractConfiguration>public String getScheme()
EmbeddedServer"http", "https").getScheme in interface EmbeddedServer<T extends AbstractConfiguration>public String getHost()
EmbeddedServer"localhost", unless specific configuration.getHost in interface EmbeddedServer<T extends AbstractConfiguration>public String getUrl()
EmbeddedServergetUrl in interface EmbeddedServer<T extends AbstractConfiguration>public T getConfiguration()
EmbeddedServergetConfiguration in interface EmbeddedServer<T extends AbstractConfiguration>public abstract S getDelegate()
protected abstract void doStart()
protected abstract void doStop()
protected abstract int doGetPort()
Copyright © 2018. All rights reserved.