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

TimedSemaphore

get()

TimedSemaphore.Builder

setLimit(int limit)

Sets the limit.

TimedSemaphore.Builder

setPeriod(long period)

Sets the time period.

TimedSemaphore.Builder

setService(ScheduledExecutorService service)

Sets the executor service.

TimedSemaphore.Builder

setTimeUnit(TimeUnit timeUnit)

Sets the time unit for the period.

public TimedSemaphore get()[source]
Specified by:

get in interface Supplier

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.