public interface IStatefulObject<T,E extends Throwable>
IStatefulObject interface.
| Modifier and Type | Method and Description |
|---|---|
void |
addStateListener(StateListener<T> listener)
Add on-event listener.
|
void |
addStateNotifiable(StateListener<T> notifiable)
Add post-event notification listener.
|
E |
getError()
Get error state or null.
|
T |
getState()
getState.
|
void |
removeStateListener(StateListener<T> listener)
removeStateListener.
|
void |
removeStateNotifiable(StateListener<T> notifiable)
removeStateNotifiable.
|
T |
waitForState(Set<T> set)
Wait until state changes to one of the given states.
|
T |
waitForState(Set<T> set,
long timeout,
TimeUnit unit)
Wait until state changes to one of the given states or until time out occurs.
|
T |
waitForStateUninterruptibly(Set<T> set)
Wait until state changes to one of the given states.
|
void addStateListener(StateListener<T> listener)
listener - a StateListener object.void addStateNotifiable(StateListener<T> notifiable)
notifiable - a StateListener object.E getError()
T getState()
getState.
void removeStateListener(StateListener<T> listener)
removeStateListener.
listener - a StateListener object.void removeStateNotifiable(StateListener<T> notifiable)
removeStateNotifiable.
notifiable - a StateListener object.T waitForState(Set<T> set) throws InterruptedException, E extends Throwable
set - states that ends waitingInterruptedException - if any.E - if any.E extends ThrowableT waitForState(Set<T> set, long timeout, TimeUnit unit) throws InterruptedException, TimeoutException, E extends Throwable
set - a Set object.timeout - a long.unit - a TimeUnit object.InterruptedException - thread was interruptedTimeoutException - timeout occuredE - if any.E extends ThrowableCopyright © 2026. All rights reserved.