Package org.eclipse.jetty.server
Class Server
- java.lang.Object
-
- All Implemented Interfaces:
Handler
,HandlerContainer
,Attributes
,Container
,Destroyable
,Dumpable
,Dumpable.DumpableContainer
,LifeCycle
@ManagedObject("Jetty HTTP Servlet server") @Deprecated(since="2021-05-27") public class Server extends HandlerWrapper implements Attributes
Deprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.Jetty HTTP Servlet Server. This class is the main class for the Jetty HTTP Servlet server. It aggregates Connectors (HTTP request receivers) and request Handlers. The server is itself a handler and a ThreadPool. Connectors use the ThreadPool methods to run jobs that will eventually call the handle method.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.jetty.server.handler.AbstractHandler
AbstractHandler.ErrorDispatchHandler
-
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.Attributes
Attributes.Wrapper
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
Container.InheritedListener, Container.Listener
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainer
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener
-
-
Constructor Summary
Constructors Constructor Description Server()
Deprecated.Server(int port)
Deprecated.Convenience constructor Creates server and aServerConnector
at the passed port.Server(java.net.InetSocketAddress addr)
Deprecated.Convenience constructorServer(ThreadPool pool)
Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addBeanToAllConnectors(java.lang.Object bean)
Deprecated.Add a bean to all connectors on the server.void
addConnector(Connector connector)
Deprecated.void
clearAttributes()
Deprecated.void
dump(java.lang.Appendable out, java.lang.String indent)
Deprecated.Dump this object (and children) into an Appendable using the provided indent after any new lines.java.lang.Object
getAttribute(java.lang.String name)
Deprecated.java.util.Enumeration<java.lang.String>
getAttributeNames()
Deprecated.java.util.Set<java.lang.String>
getAttributeNameSet()
Deprecated.Connector[]
getConnectors()
Deprecated.HttpField
getDateField()
Deprecated.ErrorHandler
getErrorHandler()
Deprecated.RequestLog
getRequestLog()
Deprecated.SessionIdManager
getSessionIdManager()
Deprecated.boolean
getStopAtShutdown()
Deprecated.ThreadPool
getThreadPool()
Deprecated.java.net.URI
getURI()
Deprecated.static java.lang.String
getVersion()
Deprecated.void
handle(HttpChannel channel)
Deprecated.void
handleAsync(HttpChannel channel)
Deprecated.boolean
isDumpAfterStart()
Deprecated.boolean
isDumpBeforeStop()
Deprecated.void
join()
Deprecated.static void
main(java.lang.String... args)
Deprecated.void
removeAttribute(java.lang.String name)
Deprecated.void
removeConnector(Connector connector)
Deprecated.Convenience method which callsgetConnectors()
andsetConnectors(Connector[])
to remove a connector.void
setAttribute(java.lang.String name, java.lang.Object attribute)
Deprecated.void
setConnectors(Connector[] connectors)
Deprecated.Set the connectors for this server.void
setDumpAfterStart(boolean dumpAfterStart)
Deprecated.void
setDumpBeforeStop(boolean dumpBeforeStop)
Deprecated.void
setErrorHandler(ErrorHandler errorHandler)
Deprecated.void
setRequestLog(RequestLog requestLog)
Deprecated.void
setSessionIdManager(SessionIdManager sessionIdManager)
Deprecated.void
setStopAtShutdown(boolean stop)
Deprecated.Set stop server at shutdown behaviour.void
setStopTimeout(long stopTimeout)
Deprecated.Set a graceful stop time.java.lang.String
toString()
Deprecated.-
Methods inherited from class org.eclipse.jetty.server.handler.HandlerWrapper
destroy, getHandler, getHandlers, handle, insertHandler, setHandler
-
Methods inherited from class org.eclipse.jetty.server.handler.AbstractHandlerContainer
findContainerOf, getChildHandlerByClass, getChildHandlers, getChildHandlersByClass, setServer
-
Methods inherited from class org.eclipse.jetty.server.handler.AbstractHandler
getServer
-
Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, dump, dump, dump, dump, dumpObject, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, unmanage, updateBean, updateBean, updateBeans
-
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpable
-
Methods inherited from interface org.eclipse.jetty.util.component.LifeCycle
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
-
-
-
-
Constructor Detail
-
Server
public Server()
Deprecated.
-
Server
public Server(@Name("port") int port)
Deprecated.Convenience constructor Creates server and aServerConnector
at the passed port.- Parameters:
port
- The port of a network HTTP connector (or 0 for a randomly allocated port).- See Also:
NetworkConnector.getLocalPort()
-
Server
public Server(@Name("address") java.net.InetSocketAddress addr)
Deprecated.Convenience constructorCreates server and a
ServerConnector
at the passed address.- Parameters:
addr
- the inet socket address to create the connector from
-
Server
public Server(@Name("threadpool") ThreadPool pool)
Deprecated.
-
-
Method Detail
-
getRequestLog
public RequestLog getRequestLog()
Deprecated.
-
getErrorHandler
public ErrorHandler getErrorHandler()
Deprecated.
-
setRequestLog
public void setRequestLog(RequestLog requestLog)
Deprecated.
-
setErrorHandler
public void setErrorHandler(ErrorHandler errorHandler)
Deprecated.
-
getVersion
@ManagedAttribute("version of this server") public static java.lang.String getVersion()
Deprecated.
-
getStopAtShutdown
public boolean getStopAtShutdown()
Deprecated.
-
setStopTimeout
public void setStopTimeout(long stopTimeout)
Deprecated.Set a graceful stop time. TheStatisticsHandler
must be configured so that open connections can be tracked for a graceful shutdown.- Overrides:
setStopTimeout
in classContainerLifeCycle
- See Also:
ContainerLifeCycle.setStopTimeout(long)
-
setStopAtShutdown
public void setStopAtShutdown(boolean stop)
Deprecated.Set stop server at shutdown behaviour.- Parameters:
stop
- If true, this server instance will be explicitly stopped when the JVM is shutdown. Otherwise the JVM is stopped with the server running.- See Also:
Runtime.addShutdownHook(Thread)
,ShutdownThread
-
getConnectors
@ManagedAttribute(value="connectors for this server", readonly=true) public Connector[] getConnectors()
Deprecated.- Returns:
- Returns the connectors.
-
addConnector
public void addConnector(Connector connector)
Deprecated.
-
removeConnector
public void removeConnector(Connector connector)
Deprecated.Convenience method which callsgetConnectors()
andsetConnectors(Connector[])
to remove a connector.- Parameters:
connector
- The connector to remove.
-
setConnectors
public void setConnectors(Connector[] connectors)
Deprecated.Set the connectors for this server. Each connector has this server set as it's ThreadPool and its Handler.- Parameters:
connectors
- The connectors to set.
-
addBeanToAllConnectors
public void addBeanToAllConnectors(java.lang.Object bean)
Deprecated.Add a bean to all connectors on the server. If the bean is an instance ofConnection.Listener
it will also be registered as a listener on all connections accepted by the connectors.- Parameters:
bean
- the bean to be added.
-
getThreadPool
@ManagedAttribute("the server thread pool") public ThreadPool getThreadPool()
Deprecated.- Returns:
- Returns the threadPool.
-
isDumpAfterStart
@ManagedAttribute("dump state to stderr after start") public boolean isDumpAfterStart()
Deprecated.- Returns:
- true if
ContainerLifeCycle.dumpStdErr()
is called after starting
-
setDumpAfterStart
public void setDumpAfterStart(boolean dumpAfterStart)
Deprecated.- Parameters:
dumpAfterStart
- true ifContainerLifeCycle.dumpStdErr()
is called after starting
-
isDumpBeforeStop
@ManagedAttribute("dump state to stderr before stop") public boolean isDumpBeforeStop()
Deprecated.- Returns:
- true if
ContainerLifeCycle.dumpStdErr()
is called before stopping
-
setDumpBeforeStop
public void setDumpBeforeStop(boolean dumpBeforeStop)
Deprecated.- Parameters:
dumpBeforeStop
- true ifContainerLifeCycle.dumpStdErr()
is called before stopping
-
getDateField
public HttpField getDateField()
Deprecated.
-
handle
public void handle(HttpChannel channel) throws java.io.IOException, ServletException
Deprecated.- Throws:
java.io.IOException
ServletException
-
handleAsync
public void handleAsync(HttpChannel channel) throws java.io.IOException, ServletException
Deprecated.- Throws:
java.io.IOException
ServletException
-
join
public void join() throws java.lang.InterruptedException
Deprecated.- Throws:
java.lang.InterruptedException
-
getSessionIdManager
public SessionIdManager getSessionIdManager()
Deprecated.- Returns:
- Returns the sessionIdManager.
-
setSessionIdManager
public void setSessionIdManager(SessionIdManager sessionIdManager)
Deprecated.- Parameters:
sessionIdManager
- The sessionIdManager to set.
-
clearAttributes
public void clearAttributes()
Deprecated.- Specified by:
clearAttributes
in interfaceAttributes
-
getAttribute
public java.lang.Object getAttribute(java.lang.String name)
Deprecated.- Specified by:
getAttribute
in interfaceAttributes
-
getAttributeNames
public java.util.Enumeration<java.lang.String> getAttributeNames()
Deprecated.- Specified by:
getAttributeNames
in interfaceAttributes
-
getAttributeNameSet
public java.util.Set<java.lang.String> getAttributeNameSet()
Deprecated.- Specified by:
getAttributeNameSet
in interfaceAttributes
-
removeAttribute
public void removeAttribute(java.lang.String name)
Deprecated.- Specified by:
removeAttribute
in interfaceAttributes
-
setAttribute
public void setAttribute(java.lang.String name, java.lang.Object attribute)
Deprecated.- Specified by:
setAttribute
in interfaceAttributes
-
getURI
public java.net.URI getURI()
Deprecated.- Returns:
- The URI of the first
NetworkConnector
and firstContextHandler
, or null
-
toString
public java.lang.String toString()
Deprecated.- Overrides:
toString
in classAbstractLifeCycle
-
dump
public void dump(java.lang.Appendable out, java.lang.String indent) throws java.io.IOException
Deprecated.Description copied from interface:Dumpable
Dump this object (and children) into an Appendable using the provided indent after any new lines. The indent should not be applied to the first object dumped.- Specified by:
dump
in interfaceDumpable
- Overrides:
dump
in classContainerLifeCycle
- Parameters:
out
- The appendable to dump toindent
- The indent to apply after any new lines.- Throws:
java.io.IOException
- if unable to write to Appendable
-
main
public static void main(java.lang.String... args) throws java.lang.Exception
Deprecated.- Throws:
java.lang.Exception
-
-