private final class StunStack.ExpiredServerTransactionsCollector extends Object
schedule()
and cancel()
methods. Whenever expired transactions collector
is scheduled it does self reschedule with fixed delay
of StunServerTransaction.LIFETIME_MILLIS,
until StunStack.serverTransactions
is empty, in that case it self-cancel
further execution and need to be scheduled again when new item added
to StunStack.serverTransactions
container.Modifier and Type | Field and Description |
---|---|
private Runnable |
collector
Runnable which walks
StunStack.serverTransactions , check if
transaction is expired and if so - remove it
from StunStack.serverTransactions . |
private ScheduledFuture<?> |
scheduledCollectorFuture
Scheduled execution of
collector runnable. |
Modifier | Constructor and Description |
---|---|
private |
ExpiredServerTransactionsCollector() |
Modifier and Type | Method and Description |
---|---|
(package private) void |
cancel()
Cancels execution of scheduled expired transactions collector if
it is running
|
(package private) void |
schedule()
Schedules repeated collector execution in background
task executor.
|
private final Runnable collector
StunStack.serverTransactions
, check if
transaction is expired and if so - remove it
from StunStack.serverTransactions
.
Self-cancels when StunStack.serverTransactions
is emptyprivate ScheduledFuture<?> scheduledCollectorFuture
collector
runnable.
Access synchronized via StunStack.serverTransactions
.Copyright © 2018. All rights reserved.