io.sarl.sre.janus.skills.internal
Skill InternalEventBusSkill
All Superinterfaces:
Capacity, IBehaviorGuardEvaluatorReceiver, InternalEventBusCapacity
skill InternalEventBusSkill
extends Skill
implements InternalEventBusCapacity
SRE implementation of an internal skill that provides an event dispatcher to notify the different components/behaviors of an agent.
Maven Group Identifier:
io.sarl.sre.janus
Maven Artifact Identifier:
janus.kernel
Property Summary
Modifier and type Property and description
InformedEventListener associatedEventBusListener
Must be synchronized multiple thread may call it at the same time and we must ensure that only one instance of ExternalEventBusAccessor is effectively created
java.util.List<E> bufferedEvents
Replies the buffered events.
EventBus eventBus
Inherited: caller, iD, owner, referenceCount
Constructor Summary
Action Summary
Modifier and type Action and description
void fireEvent(Event)
void fireEvent(Event,Object)
void fireEventAndWait(Event,boolean)
void fireEventAndWait(Event,boolean,boolean,Object)
boolean fireEventAndWaitWithEventGathering(Event,boolean,OutParameter<T>,Procedure0,BooleanSupplier)
final InformedEventListener getAssociatedEventBusListener
Must be synchronized multiple thread may call it at the same time and we must ensure that only one instance of ExternalEventBusAccessor is effectively created
java.util.List<E> getBufferedEvents
Replies the buffered events.
EventBus getEventBus
T getEventBus(Class<T>)
ConcurrentCollection<T> getRegisteredEventBusListeners(Class<T>)
protected void install
boolean isEventBuffering
Replies if the events are buffering.
void registerEventBusListener(Object,[Function1<Param,Result>],[Procedure1<Param>])
boolean setEventBuffering(boolean)
Change the event buffering flag.
protected void toString(ToStringBuilder)
protected void uninstall
void unregisterEventBusListener(Class<T>,[Function1<Param,Result>])
Unregister the listener from the event bus.
void unregisterEventBusListener(Object,[Procedure1<Param>])
Unregister the listener from the event bus.
Capacity Use Summary
Type
Logging
Property Details
associatedEventBusListener
val associatedEventBusListener : InformedEventListener
Must be synchronized multiple thread may call it at the same time and we must ensure that only one instance of ExternalEventBusAccessor is effectively created

This property is an alias for the action: getAssociatedEventBusListener

bufferedEvents
val bufferedEvents : java.util.List<E>
Replies the buffered events.

This property is an alias for the action: getBufferedEvents

Returns:
an unmodifiable iterable of the buffered elements.
eventBus
val eventBus : EventBus

This property is an alias for the action: getEventBus

Constructor Details
new(EventBusFactory,Provider<T>,Provider<T>)
new(EventBusFactory,Provider<T>,Provider<T>)
new(EventBus,ReadWriteLock,Provider<T>,Provider<T>)
new(EventBus,ReadWriteLock,Provider<T>,Provider<T>)
Action Details
fireEvent(Event)
def fireEvent(Event)
fireEvent(Event,Object)
def fireEvent(Event,Object)
fireEventAndWait(Event,boolean)
def fireEventAndWait(Event,boolean)
fireEventAndWait(Event,boolean,boolean,Object)
def fireEventAndWait(Event,boolean,boolean,Object)
fireEventAndWaitWithEventGathering(Event,boolean,OutParameter<T>,Procedure0,BooleanSupplier)
def fireEventAndWaitWithEventGathering(Event,boolean,OutParameter<T>,Procedure0,BooleanSupplier) : boolean
getAssociatedEventBusListener
def getAssociatedEventBusListener : InformedEventListener
Must be synchronized multiple thread may call it at the same time and we must ensure that only one instance of ExternalEventBusAccessor is effectively created
getBufferedEvents
def getBufferedEvents : java.util.List<E>
Replies the buffered events.
Returns:
an unmodifiable iterable of the buffered elements.
getEventBus
def getEventBus : EventBus
getEventBus(Class<T>)
def getEventBus(Class<T>) : T

with T extends EventBus

getRegisteredEventBusListeners(Class<T>)
def getRegisteredEventBusListeners(Class<T>) : ConcurrentCollection<T>

with T

install
protected def install
isEventBuffering
def isEventBuffering : boolean
Replies if the events are buffering.
Returns:
true if the events are buffered.
registerEventBusListener(Object,[Function1<Param,Result>],[Procedure1<Param>])
def registerEventBusListener(Object,[Function1<Param,Result>],[Procedure1<Param>])
setEventBuffering(boolean)
def setEventBuffering(boolean) : boolean
Change the event buffering flag.
Parameters:
buffering - the value of the flag.
Returns:
the value of the flag before its change.
toString(ToStringBuilder)
protected def toString(ToStringBuilder)
uninstall
protected def uninstall
unregisterEventBusListener(Class<T>,[Function1<Param,Result>])
def unregisterEventBusListener(Class<T>,[Function1<Param,Result>])
Unregister the listener from the event bus.
Parameters:
listenerType - the listener to unregister.
callback - function which is invoked just before the object is unregistered. The callback functions replies true if it should be called on the next removed object. If it replies false, it will be not called anymore.
unregisterEventBusListener(Object,[Procedure1<Param>])
def unregisterEventBusListener(Object,[Procedure1<Param>])
Unregister the listener from the event bus.
Parameters:
listener - the listener to unregister.
callback - function which is invoked just before the object is unregistered.