Expiration. It will invalidate
objects based on how long ago they were allocated.
| Modifier and Type | Field and Description |
|---|---|
| private final long | |
| private final TimeUnit |
| Access | Constructor and Description |
|---|---|
| pack-priv | TimeExpiration(long
Poolables older than this, in the given unit, will
be considered expired. This value must be at least 1. maxPermittedAge, TimeUnit The unit)TimeUnit of the maximum permitted age. Never
`null`.Construct a new Expiration that will invalidate objects that are older than the provided span of time in the given unit. |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | hasExpired(SlotInfo<? extends T>
An informative representative of the slot being tested.
Never `null`. info)Implements stormpot. Poolable represented by the given
SlotInfo is older than the maximum age permitted by this
TimeExpiration.
|
| public String |
| maxPermittedAgeMillis | back to summary |
|---|---|
| private final long maxPermittedAgeMillis | |
| unit | back to summary |
|---|---|
| private final TimeUnit unit | |
| TimeExpiration | back to summary |
|---|---|
| pack-priv TimeExpiration(long maxPermittedAge, TimeUnit unit) Construct a new Expiration that will invalidate objects that are older
than the provided span of time in the given unit.
If the `maxPermittedAge` is less than one, or the `unit` is `null`, then
an | |
| hasExpired | back to summary |
|---|---|
| public boolean hasExpired(SlotInfo<? extends T> info) Implements stormpot. Returns `true` if the
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |