public abstract class AbstractServer extends Object implements Server, LifecycleManager
| Modifier and Type | Field and Description |
|---|---|
protected Endpoint[] |
_endpoints
Server listening endpoints
|
protected Filter[] |
_filters
Filters for HTTP requests and responses
|
protected LifecycleManager |
_lifecycleManager
Common lifecycle for all server components
|
protected static org.slf4j.Logger |
_logger
Logger
|
protected ServerConfigurator |
_serverConfig |
protected Service[] |
_services
Services to handle HTTP requests
|
static int |
DEFAULT_PORT |
protected static Filter[] |
NO_FILTERS |
protected static Service[] |
NO_SERVICES |
| Constructor and Description |
|---|
AbstractServer() |
| Modifier and Type | Method and Description |
|---|---|
void |
addLifecycleListener(LifecycleListener lifecycleListener)
Add single life
LifecycleListener to the end of the
LifecycleListener listeners list. |
protected void |
applyServerConfigurator() |
protected String[] |
getDisabledSSLCiphers()
Returns an array with supported disabled cipher suites.
|
protected String[] |
getEnabledSSLCiphers()
Returns an array with supported enabled cipher suites.
|
protected abstract Service |
prepareDefaultServlet(StaticContentService staticSrv)
Prepares default servlet for serving static content.
|
protected void |
prepareStaticContentServices() |
void |
setEnabledSSLCiphers(String[] enabledCiphers)
Configures the enabled SSL ciphers.
|
void |
setEndpoints(Endpoint[] endpoints)
Specify the HTTP listening endpoints.
|
void |
setFilters(Filter[] filters)
Set the filter chain.
|
void |
setLifecycleListeners(List<LifecycleListener> lifecycleListeners)
Sets a
List of LifecycleListener listener items that
should be managed. |
void |
setServerConfigurator(ServerConfigurator serverConfig)
Set a server configurator class that allows a server add a custom
configuration
|
void |
setServices(Service[] services) |
void |
shutdown()
Shutdown the task.
|
void |
shutdownNow()
Initiate ungraceful shutdown.
|
protected static void |
validateArray(Object[] array) |
protected static final org.slf4j.Logger _logger
protected static final Service[] NO_SERVICES
protected static final Filter[] NO_FILTERS
public static final int DEFAULT_PORT
protected Endpoint[] _endpoints
protected Service[] _services
protected Filter[] _filters
protected final LifecycleManager _lifecycleManager
protected ServerConfigurator _serverConfig
protected abstract Service prepareDefaultServlet(StaticContentService staticSrv)
staticSrv - a static content service definitionpublic void setEndpoints(Endpoint[] endpoints)
ServersetEndpoints in interface Serverendpoints - The server will listen for requests on these
endpoints.public void setServices(Service[] services)
setServices in interface Serverpublic void setFilters(Filter[] filters)
ServersetFilters in interface Serverfilters - list of filters.public void setServerConfigurator(ServerConfigurator serverConfig)
ServersetServerConfigurator in interface ServerserverConfig - a ServerConfigurator to add custom configuration to
the serverprotected static void validateArray(Object[] array)
protected void prepareStaticContentServices()
protected void applyServerConfigurator()
public void addLifecycleListener(LifecycleListener lifecycleListener)
LifecycleManagerLifecycleListener to the end of the
LifecycleListener listeners list.addLifecycleListener in interface LifecycleManagerlifecycleListener - LifecycleListener item to be added.public void setLifecycleListeners(List<LifecycleListener> lifecycleListeners)
LifecycleManagerList of LifecycleListener listener items that
should be managed. The order that the items will be managed is the same as
they are passed. If there are already added items with
LifecycleManager.addLifecycleListener(LifecycleListener) they
are removed from the list.setLifecycleListeners in interface LifecycleManagerlifecycleListeners - list of LifecycleListener items.public void shutdown()
LifecycleListenerLifecycleListener that is already shutdown or in
the process of shutting down should have no effect.shutdown in interface LifecycleListenerpublic void shutdownNow()
LifecycleListenerLifecycleListener that is already shutdown or in
the process of shutting down should have no effect.shutdownNow in interface LifecycleListenerpublic void setEnabledSSLCiphers(String[] enabledCiphers)
enabledCiphers - the enabled SSL ciphers.NullPointerException - if enabledCiphers is null or empty.protected String[] getDisabledSSLCiphers()
protected String[] getEnabledSSLCiphers()
Copyright © 2023. All rights reserved.