Package org.eclipse.jetty.server
Class AcceptRateLimit
- java.lang.Object
-
- org.eclipse.jetty.util.component.AbstractLifeCycle
-
- org.eclipse.jetty.server.AcceptRateLimit
-
- All Implemented Interfaces:
java.lang.Runnable
,java.util.EventListener
,SelectorManager.AcceptListener
,LifeCycle
@ManagedObject @Deprecated(since="2021-05-27") public class AcceptRateLimit extends AbstractLifeCycle implements SelectorManager.AcceptListener, java.lang.Runnable
Deprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.A Listener that limits the rate at which new connections are accepted
If the limits are exceeded, accepting is suspended until the rate is again below the limit, so incoming connections are held in the operating system accept queue (no syn ack sent), where they may either timeout or wait for the server to resume accepting.
It can be applied to an entire server or to a specific connector by adding it via
Container.addBean(Object)
Usage:
Server server = new Server(); server.addBean(new AcceptLimit(100,5,TimeUnit.SECONDS,server)); ... server.start();
- See Also:
SelectorManager.AcceptListener
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener
-
-
Constructor Summary
Constructors Constructor Description AcceptRateLimit(int limit, long period, java.util.concurrent.TimeUnit units, Connector... connectors)
Deprecated.AcceptRateLimit(int acceptRateLimit, long period, java.util.concurrent.TimeUnit units, Server server)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description int
getAcceptRateLimit()
Deprecated.long
getMaxRate()
Deprecated.long
getPeriod()
Deprecated.int
getRate()
Deprecated.java.util.concurrent.TimeUnit
getUnits()
Deprecated.void
onAccepting(java.nio.channels.SelectableChannel channel)
Deprecated.Called immediately after a new SelectableChannel is accepted, but before it has been submitted to theSelectorManager
.void
reset()
Deprecated.void
run()
Deprecated.-
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, setStopTimeout, start, stop, toString
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.jetty.io.SelectorManager.AcceptListener
onAccepted, onAcceptFailed
-
-
-
-
Method Detail
-
getAcceptRateLimit
@ManagedAttribute("The accept rate limit") public int getAcceptRateLimit()
Deprecated.
-
getPeriod
@ManagedAttribute("The accept rate period") public long getPeriod()
Deprecated.
-
getUnits
@ManagedAttribute("The accept rate period units") public java.util.concurrent.TimeUnit getUnits()
Deprecated.
-
getRate
@ManagedAttribute("The current accept rate") public int getRate()
Deprecated.
-
getMaxRate
@ManagedAttribute("The maximum accept rate achieved") public long getMaxRate()
Deprecated.
-
reset
@ManagedOperation(value="Resets the accept rate", impact="ACTION") public void reset()
Deprecated.
-
onAccepting
public void onAccepting(java.nio.channels.SelectableChannel channel)
Deprecated.Description copied from interface:SelectorManager.AcceptListener
Called immediately after a new SelectableChannel is accepted, but before it has been submitted to theSelectorManager
.- Specified by:
onAccepting
in interfaceSelectorManager.AcceptListener
- Parameters:
channel
- the accepted channel
-
run
public void run()
Deprecated.- Specified by:
run
in interfacejava.lang.Runnable
-
-