public static final class EventQueueCollection.SynchronizationAwaitingPropertyChangeListener extends Object implements PropertyChangeListener
PropertyChangeListener
specifically designed for
reacting to a change in the synchronization status of an EventQueueCollection
as represented by the firing of its synchronized
bound
Java Beans property.Constructor and Description |
---|
SynchronizationAwaitingPropertyChangeListener()
|
Modifier and Type | Method and Description |
---|---|
void |
await()
Blocks until the conditions described in the documentation of
the
propertyChange(PropertyChangeEvent) method hold
true. |
@Blocking boolean |
await(long timeout,
TimeUnit timeUnit)
Blocks until the conditions described in the documentation of
the
propertyChange(PropertyChangeEvent) method hold
true or the indicated time has passed. |
void |
propertyChange(PropertyChangeEvent event)
If the supplied
PropertyChangeEvent is non-null , has a source that is an instance of EventQueueCollection ,
has a property name equal to synchronized and a new value equal to Boolean.TRUE , then it is guaranteed that any calls currently
blocked on the await() or await(long,
TimeUnit) methods will unblock, and subsequent invocations of
those methods will never block again. |
public SynchronizationAwaitingPropertyChangeListener()
public final void propertyChange(PropertyChangeEvent event)
PropertyChangeEvent
is non-null
, has a source that is an instance of EventQueueCollection
,
has a property name equal to synchronized
and a new value equal to Boolean.TRUE
, then it is guaranteed that any calls currently
blocked on the await()
or await(long,
TimeUnit)
methods will unblock, and subsequent invocations of
those methods will never block again.propertyChange
in interface PropertyChangeListener
event
- a PropertyChangeEvent
fired by an EventQueueCollection
; may be null
in which case no
action will be takenEventQueueCollection.addPropertyChangeListener(String,
PropertyChangeListener)
,
EventQueueCollection.isSynchronized()
@Blocking public final void await() throws InterruptedException
propertyChange(PropertyChangeEvent)
method hold
true.InterruptedException
- if the current Thread
is interrupted@Blocking public final @Blocking boolean await(long timeout, TimeUnit timeUnit) throws InterruptedException
propertyChange(PropertyChangeEvent)
method hold
true or the indicated time has passed.timeout
- the number of units of time to wait fortimeUnit
- the unit of time designated by the timeout
parameter; must not be null
false
if the waiting time elapsed before the
bound property named synchronized
changed its value to
true
; true
otherwiseInterruptedException
- if the current Thread
is interruptedNullPointerException
- if timeUnit
is null
propertyChange(PropertyChangeEvent)
Copyright © 2017–2021, microBean™. All rights reserved.