|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cz.cuni.amis.pogamut.base.component.bus.event.WaitForEvent
public class WaitForEvent
Allows you to wait for some event on the bus.
WARNING: if you want to stop using this object (throw away the pointer) call DESTROY(), you will usually use try{}finally{} for this.
Nested Class Summary | |
---|---|
static interface |
WaitForEvent.IEventFilter<T>
Note that only events that implements IComponentEvent may be really substitued as T. |
Constructor Summary | |
---|---|
WaitForEvent(IComponentBus bus,
WaitForEvent.IEventFilter accept)
|
Method Summary | |
---|---|
boolean |
await()
Awaits the event (forever) ... |
boolean |
await(long timeoutMillis)
Awaits the event for a specific amount of time. |
void |
destroy()
Destroys the object ... |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WaitForEvent(IComponentBus bus, WaitForEvent.IEventFilter accept)
Method Detail |
---|
public boolean await() throws PogamutInterruptedException
PogamutInterruptedException
public boolean await(long timeoutMillis) throws PogamutInterruptedException
WARNING: If the event is not received and you do not plan to use the object further - call destroy()!
timeoutMillis
-
java.lang.InterruptedException
PogamutInterruptedException
public void destroy()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |