@NotThreadSafe public abstract class WebServer extends Object
Modifier and Type | Field and Description |
---|---|
protected org.eclipse.jetty.servlet.ServletContextHandler |
mServletContextHandler |
Constructor and Description |
---|
WebServer(String serviceName,
InetSocketAddress address)
Creates a new instance of
WebServer . |
Modifier and Type | Method and Description |
---|---|
void |
addHandler(org.eclipse.jetty.server.handler.AbstractHandler handler)
Adds a handler.
|
String |
getBindHost()
Gets the actual bind hostname.
|
int |
getLocalPort()
Gets the actual port that the web server is listening on.
|
org.eclipse.jetty.server.Server |
getServer() |
protected org.eclipse.jetty.server.ServerConnector |
getServerConnector() |
void |
setHandler(org.eclipse.jetty.server.handler.AbstractHandler handler) |
void |
start()
Starts the web server.
|
void |
stop()
Shuts down the web server.
|
protected final org.eclipse.jetty.servlet.ServletContextHandler mServletContextHandler
public WebServer(String serviceName, InetSocketAddress address)
WebServer
. It pairs URLs with servlets and sets the webapp
folder.serviceName
- name of the web serviceaddress
- address of the serverprotected org.eclipse.jetty.server.ServerConnector getServerConnector()
public void addHandler(org.eclipse.jetty.server.handler.AbstractHandler handler)
handler
- the handler to addpublic void setHandler(org.eclipse.jetty.server.handler.AbstractHandler handler)
handler
- to usepublic org.eclipse.jetty.server.Server getServer()
public String getBindHost()
public int getLocalPort()
public void start()
Copyright © 2023. All Rights Reserved.