org.eclipse.jetty.io.Connection.Listener@ManagedObject
public class ConnectionLimit
extends org.eclipse.jetty.util.component.AbstractLifeCycle
implements org.eclipse.jetty.io.Connection.Listener
A Connection Listener that limits the number of Connections.
This listener applies a limit to the number of connections, which when
exceeded results in a call to AbstractConnector.setAccepting(boolean)
to prevent further connections being received. It can be applied to an
entire server or to a specific connector.
Connection.Listenerorg.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener| Constructor | Description |
|---|---|
ConnectionLimit(int maxConnections,
Connector... connectors) |
|
ConnectionLimit(int maxConnections,
Server server) |
| Modifier and Type | Method | Description |
|---|---|---|
protected void |
doStart() |
|
protected void |
doStop() |
|
int |
getConnections() |
|
int |
getMaxConnections() |
|
void |
onClosed(org.eclipse.jetty.io.Connection connection) |
|
void |
onOpened(org.eclipse.jetty.io.Connection connection) |
|
void |
setMaxConnections(int max) |
public ConnectionLimit(int maxConnections,
Server server)
public ConnectionLimit(int maxConnections,
Connector... connectors)
@ManagedAttribute("The maximum number of connections allowed")
public int getMaxConnections()
public void setMaxConnections(int max)
@ManagedAttribute("The current number of connections ")
public int getConnections()
protected void doStart()
throws java.lang.Exception
doStart in class org.eclipse.jetty.util.component.AbstractLifeCyclejava.lang.Exceptionprotected void doStop()
throws java.lang.Exception
doStop in class org.eclipse.jetty.util.component.AbstractLifeCyclejava.lang.Exceptionpublic void onOpened(org.eclipse.jetty.io.Connection connection)
onOpened in interface org.eclipse.jetty.io.Connection.Listenerpublic void onClosed(org.eclipse.jetty.io.Connection connection)
onClosed in interface org.eclipse.jetty.io.Connection.ListenerCopyright © 1995–2018 Webtide. All rights reserved.