public interface ExpiryCollection<T> extends Iterable<T>
| Modifier and Type | Method and Description |
|---|---|
void |
acquire()
Before running sequence of operations on the collection (like iterating, adding element, etc.),
it is recommended to acquire the lock so that the cleaner thread does not
run in-between the operation.
|
boolean |
add(T t,
long expiryTime) |
void |
clear() |
boolean |
contains(T t) |
boolean |
isEmpty() |
Iterator<T> |
iterator() |
void |
release()
Whenever lock is acquired, make sure to release it (preferably in finally
block).
|
void |
shutdown()
Call to this method will send a interrupt signal to the cleaner thread and
make it quit.
|
int |
size() |
boolean add(T t, long expiryTime)
void clear()
boolean contains(T t)
boolean isEmpty()
int size()
void acquire()
void release()
void shutdown()
Copyright © 2014. All rights reserved.