@NotThreadSafe public abstract class InUseStateAggregator<T> extends Object
| Constructor and Description |
|---|
InUseStateAggregator() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
handleInUse()
Called when the aggregated in-use state has changed to true, which means at least one object is
in use.
|
protected abstract void |
handleNotInUse()
Called when the aggregated in-use state has changed to false, which means no object is in use.
|
boolean |
isInUse() |
void |
updateObjectInUse(T object,
boolean inUse)
Update the in-use state of an object.
|
public final void updateObjectInUse(T object, boolean inUse)
This may call into handleInUse() or handleNotInUse() when appropriate.
public final boolean isInUse()
protected abstract void handleInUse()
protected abstract void handleNotInUse()