On this page

TimedSemaphore.Builder

public static class org.apache.commons.lang3.concurrent.TimedSemaphore.Builder implements Supplier<TimedSemaphore>[source]

Builds new TimedSemaphore.

Since:

3.20.0

Constructors

Builder()

Constructs a new Builder.

public Builder()[source]

Constructs a new Builder.

Methods

get()

setLimit(int)

Sets the limit.

setPeriod(long)

Sets the time period.

setService(ScheduledExecutorService)

Sets the executor service.

setTimeUnit(TimeUnit)

Sets the time unit for the period.

@Override public TimedSemaphore get()[source]
public TimedSemaphore.Builder setLimit(int limit)[source]

Sets the limit.

Parameters:

limit – The limit.

Returns:

this instance.

public TimedSemaphore.Builder setPeriod(long period)[source]

Sets the time period.

Parameters:

period – The time period.

Returns:

this instance.

public TimedSemaphore.Builder setService(ScheduledExecutorService service)[source]

Sets the executor service.

Parameters:

service – The executor service.

Returns:

this instance.

public TimedSemaphore.Builder setTimeUnit(TimeUnit timeUnit)[source]

Sets the time unit for the period.

Parameters:

timeUnit – The time unit for the period.

Returns:

this instance.