|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectorg.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.AggregateLifeCycle
org.eclipse.jetty.server.handler.AbstractHandler
org.eclipse.jetty.server.handler.AbstractHandlerContainer
org.eclipse.jetty.server.handler.HandlerWrapper
org.eclipse.jetty.server.Server
public class Server
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.
| 嵌套类摘要 | |
|---|---|
static interface |
Server.Graceful
|
| 从类 org.eclipse.jetty.util.component.AbstractLifeCycle 继承的嵌套类/接口 |
|---|
AbstractLifeCycle.AbstractLifeCycleListener |
| 从接口 org.eclipse.jetty.util.component.LifeCycle 继承的嵌套类/接口 |
|---|
LifeCycle.Listener |
| 字段摘要 |
|---|
| 从类 org.eclipse.jetty.server.handler.HandlerWrapper 继承的字段 |
|---|
_handler |
| 从类 org.eclipse.jetty.util.component.AbstractLifeCycle 继承的字段 |
|---|
_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING |
| 构造方法摘要 | |
|---|---|
Server()
|
|
Server(InetSocketAddress addr)
Convenience constructor Creates server and a SelectChannelConnector at the passed address. |
|
Server(int port)
Convenience constructor Creates server and a SelectChannelConnector at the passed port. |
|
| 方法摘要 | |
|---|---|
boolean |
addBean(Object o)
Add an associated bean. |
void |
addConnector(Connector connector)
|
void |
addLifeCycle(LifeCycle c)
已过时。 Use addBean(Object) |
void |
clearAttributes()
|
protected void |
doStart()
Start the managed lifecycle beans in the order they were added. |
protected void |
doStop()
Stop the joined lifecycle beans in the reverse order they were added. |
void |
dump(Appendable out,
String indent)
|
Object |
getAttribute(String name)
|
Enumeration |
getAttributeNames()
|
Connector[] |
getConnectors()
|
Container |
getContainer()
|
int |
getGracefulShutdown()
|
int |
getMaxCookieVersion()
已过时。 |
boolean |
getSendDateHeader()
|
boolean |
getSendServerVersion()
|
SessionIdManager |
getSessionIdManager()
|
boolean |
getStopAtShutdown()
|
ThreadPool |
getThreadPool()
|
static String |
getVersion()
|
void |
handle(AbstractHttpConnection connection)
|
void |
handleAsync(AbstractHttpConnection connection)
|
boolean |
isDumpAfterStart()
|
boolean |
isDumpBeforeStop()
|
boolean |
isUncheckedPrintWriter()
|
void |
join()
|
static void |
main(String... args)
|
void |
removeAttribute(String name)
|
boolean |
removeBean(Object o)
Remove an associated bean. |
void |
removeConnector(Connector connector)
Conveniance method which calls getConnectors() and setConnectors(Connector[]) to
remove a connector. |
void |
removeLifeCycle(LifeCycle c)
已过时。 Use removeBean(Object) |
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 |
setGracefulShutdown(int timeoutMS)
Set graceful shutdown timeout. |
void |
setMaxCookieVersion(int maxCookieVersion)
已过时。 |
void |
setSendDateHeader(boolean sendDateHeader)
|
void |
setSendServerVersion(boolean sendServerVersion)
|
void |
setSessionIdManager(SessionIdManager sessionIdManager)
|
void |
setStopAtShutdown(boolean stop)
|
void |
setThreadPool(ThreadPool threadPool)
|
void |
setUncheckedPrintWriter(boolean unchecked)
|
String |
toString()
|
| 从类 org.eclipse.jetty.server.handler.HandlerWrapper 继承的方法 |
|---|
destroy, expandChildren, getHandler, getHandlers, getNestedHandlerByClass, handle, setHandler, setServer |
| 从类 org.eclipse.jetty.server.handler.AbstractHandlerContainer 继承的方法 |
|---|
expandHandler, findContainerOf, getChildHandlerByClass, getChildHandlers, getChildHandlersByClass |
| 从类 org.eclipse.jetty.server.handler.AbstractHandler 继承的方法 |
|---|
dumpThis, getServer |
| 从类 org.eclipse.jetty.util.component.AggregateLifeCycle 继承的方法 |
|---|
addBean, contains, dump, dump, dump, dump, dumpObject, dumpStdErr, getBean, getBeans, getBeans, isManaged, manage, removeBeans, unmanage |
| 从类 org.eclipse.jetty.util.component.AbstractLifeCycle 继承的方法 |
|---|
addLifeCycleListener, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| 从接口 org.eclipse.jetty.util.component.LifeCycle 继承的方法 |
|---|
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop |
| 构造方法详细信息 |
|---|
public Server()
public Server(int port)
SelectChannelConnector at the passed port.
public Server(InetSocketAddress addr)
SelectChannelConnector at the passed address.
| 方法详细信息 |
|---|
public static String getVersion()
public Container getContainer()
public boolean getStopAtShutdown()
public void setStopAtShutdown(boolean stop)
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.public ThreadPool getThreadPool()
public void setThreadPool(ThreadPool threadPool)
threadPool - The threadPool to set.public boolean isDumpAfterStart()
AggregateLifeCycle.dumpStdErr() is called after startingpublic void setDumpAfterStart(boolean dumpAfterStart)
dumpAfterStart - true if AggregateLifeCycle.dumpStdErr() is called after startingpublic boolean isDumpBeforeStop()
AggregateLifeCycle.dumpStdErr() is called before stoppingpublic void setDumpBeforeStop(boolean dumpBeforeStop)
dumpBeforeStop - true if AggregateLifeCycle.dumpStdErr() is called before stopping
protected void doStart()
throws Exception
AggregateLifeCycle 复制的描述
HandlerWrapper 中的 doStartExceptionAbstractLifeCycle.doStart()
protected void doStop()
throws Exception
AggregateLifeCycle 复制的描述
HandlerWrapper 中的 doStopExceptionAbstractLifeCycle.doStart()
public void handle(AbstractHttpConnection connection)
throws IOException,
ServletException
IOException
ServletException
public void handleAsync(AbstractHttpConnection connection)
throws IOException,
ServletException
IOException
ServletException
public void join()
throws InterruptedException
InterruptedExceptionpublic SessionIdManager getSessionIdManager()
public void setSessionIdManager(SessionIdManager sessionIdManager)
sessionIdManager - The sessionIdManager to set.public void setSendServerVersion(boolean sendServerVersion)
public boolean getSendServerVersion()
public void setSendDateHeader(boolean sendDateHeader)
sendDateHeader - public boolean getSendDateHeader()
@Deprecated public int getMaxCookieVersion()
@Deprecated public void setMaxCookieVersion(int maxCookieVersion)
@Deprecated public void addLifeCycle(LifeCycle c)
addBean(Object)
c - public boolean addBean(Object o)
Container
and if it is a LifeCycle instance, it will be
started/stopped along with the Server. Any beans that are also
Destroyable, will be destroyed with the server.
AggregateLifeCycle 中的 addBeano - the bean object to add
@Deprecated public void removeLifeCycle(LifeCycle c)
removeBean(Object)
public boolean removeBean(Object o)
AggregateLifeCycle 中的 removeBeanpublic void clearAttributes()
Attributes 中的 clearAttributespublic Object getAttribute(String name)
Attributes 中的 getAttributepublic Enumeration getAttributeNames()
Attributes 中的 getAttributeNamespublic void removeAttribute(String name)
Attributes 中的 removeAttribute
public void setAttribute(String name,
Object attribute)
Attributes 中的 setAttributepublic int getGracefulShutdown()
public void setGracefulShutdown(int timeoutMS)
doStop() method will not immediately stop the
server. Instead, all Connectors will be closed so that new connections will not be accepted
and all handlers that implement Server.Graceful will be put into the shutdown mode so that no new requests
will be accepted, but existing requests can complete. The server will then wait the configured timeout
before stopping.
timeoutMS - the milliseconds to wait for existing request to complete before stopping the server.public String toString()
Object 中的 toString
public void dump(Appendable out,
String indent)
throws IOException
Dumpable 中的 dumpAbstractHandlerContainer 中的 dumpIOExceptionpublic boolean isUncheckedPrintWriter()
public void setUncheckedPrintWriter(boolean unchecked)
public static void main(String... args)
throws Exception
Exception
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||