Class ConnectionLimit

java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.server.ConnectionLimit
All Implemented Interfaces:
EventListener, org.eclipse.jetty.io.Connection.Listener, org.eclipse.jetty.io.SelectorManager.AcceptListener, org.eclipse.jetty.io.SelectorManager.SelectorManagerListener, org.eclipse.jetty.util.component.LifeCycle

@ManagedObject public class ConnectionLimit extends org.eclipse.jetty.util.component.AbstractLifeCycle implements org.eclipse.jetty.io.Connection.Listener, org.eclipse.jetty.io.SelectorManager.AcceptListener

A 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. This listener can be applied to an entire Server or to a specific Connector by adding it via Container.addBean(Object).

When the number of connections is exceeded, the idle timeout of existing connections is changed with the value configured in this listener (typically a shorter value).

Usage:


   Server server = new Server();
   server.addBean(new ConnectionLimit(5000,server));
   ...
   server.start();
 
See Also: