Package org.eclipse.jetty.server
Class Server
- 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.ErrorDispatchHandlerNested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListenerNested classes/interfaces inherited from interface org.eclipse.jetty.util.Attributes
Attributes.WrapperNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
Container.InheritedListener, Container.ListenerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener -
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionServer()Deprecated.Server(int port) Deprecated.Convenience constructor Creates server and aServerConnectorat the passed port.Server(InetSocketAddress addr) Deprecated.Convenience constructorServer(ThreadPool pool) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBeanToAllConnectors(Object bean) Deprecated.Add a bean to all connectors on the server.voidaddConnector(Connector connector) Deprecated.voidDeprecated.voiddump(Appendable out, String indent) Deprecated.Dump this object (and children) into an Appendable using the provided indent after any new lines.getAttribute(String name) Deprecated.Deprecated.Deprecated.Deprecated.Deprecated.Deprecated.Deprecated.Deprecated.booleanDeprecated.Deprecated.getURI()Deprecated.static StringDeprecated.voidhandle(HttpChannel channel) Deprecated.voidhandleAsync(HttpChannel channel) Deprecated.booleanDeprecated.booleanDeprecated.voidjoin()Deprecated.static voidDeprecated.voidremoveAttribute(String name) Deprecated.voidremoveConnector(Connector connector) Deprecated.Convenience method which callsgetConnectors()andsetConnectors(Connector[])to remove a connector.voidsetAttribute(String name, 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.toString()Deprecated.Methods inherited from class org.eclipse.jetty.server.handler.HandlerWrapper
destroy, getHandler, getHandlers, handle, insertHandler, setHandlerMethods inherited from class org.eclipse.jetty.server.handler.AbstractHandlerContainer
findContainerOf, getChildHandlerByClass, getChildHandlers, getChildHandlersByClass, setServerMethods inherited from class org.eclipse.jetty.server.handler.AbstractHandler
getServerMethods 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, updateBeansMethods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stopMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpableMethods inherited from interface org.eclipse.jetty.util.component.LifeCycle
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
-
Constructor Details
-
Server
public Server()Deprecated. -
Server
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:
-
Server
Deprecated.Convenience constructorCreates server and a
ServerConnectorat the passed address.- Parameters:
addr- the inet socket address to create the connector from
-
Server
Deprecated.
-
-
Method Details
-
getRequestLog
Deprecated. -
getErrorHandler
Deprecated. -
setRequestLog
Deprecated. -
setErrorHandler
Deprecated. -
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:
-
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:
-
getConnectors
@ManagedAttribute(value="connectors for this server", readonly=true) public Connector[] getConnectors()Deprecated.- Returns:
- Returns the connectors.
-
addConnector
Deprecated. -
removeConnector
Deprecated.Convenience method which callsgetConnectors()andsetConnectors(Connector[])to remove a connector.- Parameters:
connector- The connector to remove.
-
setConnectors
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
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
Deprecated.- Returns:
- Returns the threadPool.
-
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
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
Deprecated. -
handle
Deprecated.- Throws:
IOExceptionServletException
-
handleAsync
Deprecated.- Throws:
IOExceptionServletException
-
join
Deprecated.- Throws:
InterruptedException
-
getSessionIdManager
Deprecated.- Returns:
- Returns the sessionIdManager.
-
setSessionIdManager
Deprecated.- Parameters:
sessionIdManager- The sessionIdManager to set.
-
clearAttributes
public void clearAttributes()Deprecated.- Specified by:
clearAttributesin interfaceAttributes
-
getAttribute
Deprecated.- Specified by:
getAttributein interfaceAttributes
-
getAttributeNames
Deprecated.- Specified by:
getAttributeNamesin interfaceAttributes
-
getAttributeNameSet
Deprecated.- Specified by:
getAttributeNameSetin interfaceAttributes
-
removeAttribute
Deprecated.- Specified by:
removeAttributein interfaceAttributes
-
setAttribute
Deprecated.- Specified by:
setAttributein interfaceAttributes
-
getURI
Deprecated.- Returns:
- The URI of the first
NetworkConnectorand firstContextHandler, or null
-
toString
Deprecated.- Overrides:
toStringin classAbstractLifeCycle
-
dump
Deprecated.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:
IOException- if unable to write to Appendable
-
main
Deprecated.- Throws:
Exception
-