@ManagedObject(value="Jetty HTTP Servlet server") public class Server extends HandlerWrapper implements org.eclipse.jetty.util.Attributes
org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener_handler| Constructor and Description |
|---|
Server() |
Server(InetSocketAddress addr)
Convenience constructor
Creates server and a
ServerConnector at the passed address. |
Server(int port)
Convenience constructor
Creates server and a
ServerConnector at the passed port. |
Server(org.eclipse.jetty.util.thread.ThreadPool pool) |
| Modifier and Type | Method and Description |
|---|---|
void |
addConnector(Connector connector) |
void |
clearAttributes() |
protected void |
doStart() |
protected void |
doStop() |
void |
dump(Appendable out,
String indent) |
Object |
getAttribute(String name) |
Enumeration<String> |
getAttributeNames() |
Connector[] |
getConnectors() |
HttpField |
getDateField() |
SessionIdManager |
getSessionIdManager() |
boolean |
getStopAtShutdown() |
org.eclipse.jetty.util.thread.ThreadPool |
getThreadPool() |
URI |
getURI() |
static String |
getVersion() |
void |
handle(HttpChannel<?> connection) |
void |
handleAsync(HttpChannel<?> connection) |
protected void |
handleOptions(Request request,
Response response) |
boolean |
isDumpAfterStart() |
boolean |
isDumpBeforeStop() |
void |
join() |
static void |
main(String... args) |
void |
removeAttribute(String name) |
void |
removeConnector(Connector connector)
Convenience method which calls
getConnectors() and setConnectors(Connector[]) to
remove a connector. |
void |
setAttribute(String name,
Object attribute) |
void |
setConnectors(Connector[] connectors)
Set the connectors for this server.
|
void |
setDumpAfterStart(boolean dumpAfterStart) |
void |
setDumpBeforeStop(boolean dumpBeforeStop) |
void |
setSessionIdManager(SessionIdManager sessionIdManager) |
void |
setStopAtShutdown(boolean stop)
Set stop server at shutdown behaviour.
|
void |
setStopTimeout(long stopTimeout)
Set a graceful stop time.
|
protected void |
start(org.eclipse.jetty.util.component.LifeCycle l) |
String |
toString() |
destroy, expandChildren, getHandler, getHandlers, handle, setHandler, setServerexpandHandler, findContainerOf, getChildHandlerByClass, getChildHandlers, getChildHandlersByClassdumpThis, getServeraddBean, addBean, addBean, addEventListener, addManaged, contains, dump, dump, dump, dump, dumpBeans, dumpObject, dumpStdErr, getBean, getBeans, getBeans, isManaged, manage, removeBean, removeBeans, removeEventListener, setBeans, stop, unmanage, updateBean, updateBeansaddLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stoppublic Server()
public Server(@Name(value="port")
int port)
ServerConnector at the passed port.port - The port of a network HTTP connector (or 0 for a randomly allocated port).NetworkConnector.getLocalPort()public Server(@Name(value="address")
InetSocketAddress addr)
ServerConnector at the passed address.public Server(@Name(value="threadpool")
org.eclipse.jetty.util.thread.ThreadPool pool)
@ManagedAttribute(value="version of this server") public static String getVersion()
public boolean getStopAtShutdown()
public void setStopTimeout(long stopTimeout)
StatisticsHandler must be configured so that open connections can
be tracked for a graceful shutdown.setStopTimeout in class org.eclipse.jetty.util.component.ContainerLifeCycleContainerLifeCycle.setStopTimeout(long)public void setStopAtShutdown(boolean stop)
stop - If true, this server instance will be explicitly stopped when the
JVM is shutdown. Otherwise the JVM is stopped with the server running.Runtime.addShutdownHook(Thread),
ShutdownThread@ManagedAttribute(value="connectors for this server",
readonly=true)
public Connector[] getConnectors()
public void addConnector(Connector connector)
public void removeConnector(Connector connector)
getConnectors() and setConnectors(Connector[]) to
remove a connector.connector - The connector to remove.public void setConnectors(Connector[] connectors)
connectors - The connectors to set.@ManagedAttribute(value="the server thread pool") public org.eclipse.jetty.util.thread.ThreadPool getThreadPool()
@ManagedAttribute(value="dump state to stderr after start") public boolean isDumpAfterStart()
ContainerLifeCycle.dumpStdErr() is called after startingpublic void setDumpAfterStart(boolean dumpAfterStart)
dumpAfterStart - true if ContainerLifeCycle.dumpStdErr() is called after starting@ManagedAttribute(value="dump state to stderr before stop") public boolean isDumpBeforeStop()
ContainerLifeCycle.dumpStdErr() is called before stoppingpublic void setDumpBeforeStop(boolean dumpBeforeStop)
dumpBeforeStop - true if ContainerLifeCycle.dumpStdErr() is called before stoppingpublic HttpField getDateField()
protected void doStart()
throws Exception
doStart in class AbstractHandlerExceptionprotected void start(org.eclipse.jetty.util.component.LifeCycle l)
throws Exception
start in class org.eclipse.jetty.util.component.ContainerLifeCycleExceptionprotected void doStop()
throws Exception
doStop in class AbstractHandlerExceptionpublic void handle(HttpChannel<?> connection) throws IOException, javax.servlet.ServletException
IOExceptionjavax.servlet.ServletExceptionprotected void handleOptions(Request request, Response response) throws IOException
IOExceptionpublic void handleAsync(HttpChannel<?> connection) throws IOException, javax.servlet.ServletException
IOExceptionjavax.servlet.ServletExceptionpublic void join()
throws InterruptedException
InterruptedExceptionpublic SessionIdManager getSessionIdManager()
public void setSessionIdManager(SessionIdManager sessionIdManager)
sessionIdManager - The sessionIdManager to set.public void clearAttributes()
clearAttributes in interface org.eclipse.jetty.util.Attributespublic Object getAttribute(String name)
getAttribute in interface org.eclipse.jetty.util.Attributespublic Enumeration<String> getAttributeNames()
getAttributeNames in interface org.eclipse.jetty.util.Attributespublic void removeAttribute(String name)
removeAttribute in interface org.eclipse.jetty.util.Attributespublic void setAttribute(String name, Object attribute)
setAttribute in interface org.eclipse.jetty.util.Attributespublic URI getURI()
NetworkConnector and first ContextHandler, or nullpublic void dump(Appendable out, String indent) throws IOException
dump in interface org.eclipse.jetty.util.component.Dumpabledump in class org.eclipse.jetty.util.component.ContainerLifeCycleIOExceptionCopyright © 1995-2020 Webtide. All Rights Reserved.