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 aServerConnectorat 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 voidaddBeanToAllConnectors(java.lang.Object bean)Deprecated.Add a bean to all connectors on the server.voidaddConnector(Connector connector)Deprecated.voidclearAttributes()Deprecated.voiddump(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.ObjectgetAttribute(java.lang.String name)Deprecated.java.util.Enumeration<java.lang.String>getAttributeNames()Deprecated.java.util.Set<java.lang.String>getAttributeNameSet()Deprecated.Connector[]getConnectors()Deprecated.HttpFieldgetDateField()Deprecated.ErrorHandlergetErrorHandler()Deprecated.RequestLoggetRequestLog()Deprecated.SessionIdManagergetSessionIdManager()Deprecated.booleangetStopAtShutdown()Deprecated.ThreadPoolgetThreadPool()Deprecated.java.net.URIgetURI()Deprecated.static java.lang.StringgetVersion()Deprecated.voidhandle(HttpChannel channel)Deprecated.voidhandleAsync(HttpChannel channel)Deprecated.booleanisDumpAfterStart()Deprecated.booleanisDumpBeforeStop()Deprecated.voidjoin()Deprecated.static voidmain(java.lang.String... args)Deprecated.voidremoveAttribute(java.lang.String name)Deprecated.voidremoveConnector(Connector connector)Deprecated.Convenience method which callsgetConnectors()andsetConnectors(Connector[])to remove a connector.voidsetAttribute(java.lang.String name, java.lang.Object attribute)Deprecated.voidsetConnectors(Connector[] connectors)Deprecated.Set the connectors for this server.voidsetDumpAfterStart(boolean dumpAfterStart)Deprecated.voidsetDumpBeforeStop(boolean dumpBeforeStop)Deprecated.voidsetErrorHandler(ErrorHandler errorHandler)Deprecated.voidsetRequestLog(RequestLog requestLog)Deprecated.voidsetSessionIdManager(SessionIdManager sessionIdManager)Deprecated.voidsetStopAtShutdown(boolean stop)Deprecated.Set stop server at shutdown behaviour.voidsetStopTimeout(long stopTimeout)Deprecated.Set a graceful stop time.java.lang.StringtoString()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 aServerConnectorat 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
ServerConnectorat 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. TheStatisticsHandlermust be configured so that open connections can be tracked for a graceful shutdown.- Overrides:
 setStopTimeoutin 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.Listenerit 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.IOExceptionServletException
 
- 
handleAsync
public void handleAsync(HttpChannel channel) throws java.io.IOException, ServletException
Deprecated.- Throws:
 java.io.IOExceptionServletException
 
- 
join
public void join() throws java.lang.InterruptedExceptionDeprecated.- 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:
 clearAttributesin interfaceAttributes
 
- 
getAttribute
public java.lang.Object getAttribute(java.lang.String name)
Deprecated.- Specified by:
 getAttributein interfaceAttributes
 
- 
getAttributeNames
public java.util.Enumeration<java.lang.String> getAttributeNames()
Deprecated.- Specified by:
 getAttributeNamesin interfaceAttributes
 
- 
getAttributeNameSet
public java.util.Set<java.lang.String> getAttributeNameSet()
Deprecated.- Specified by:
 getAttributeNameSetin interfaceAttributes
 
- 
removeAttribute
public void removeAttribute(java.lang.String name)
Deprecated.- Specified by:
 removeAttributein interfaceAttributes
 
- 
setAttribute
public void setAttribute(java.lang.String name, java.lang.Object attribute)Deprecated.- Specified by:
 setAttributein interfaceAttributes
 
- 
getURI
public java.net.URI getURI()
Deprecated.- Returns:
 - The URI of the first 
NetworkConnectorand firstContextHandler, or null 
 
- 
toString
public java.lang.String toString()
Deprecated.- Overrides:
 toStringin classAbstractLifeCycle
 
- 
dump
public void dump(java.lang.Appendable out, java.lang.String indent) throws java.io.IOExceptionDeprecated.Description copied from interface:DumpableDump 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:
 dumpin interfaceDumpable- Overrides:
 dumpin 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.ExceptionDeprecated.- Throws:
 java.lang.Exception
 
 - 
 
 -