io.sarl.sre.janus.internal.eventguard
Interface IBehaviorGuardEvaluatorRegistry
All Known Implementing Classes:
AbstractBehaviorGuardEvaluatorRegistry<REGT>, PolymorphicBehaviorGuardEvaluatorRegistry, ReflectBehaviorGuardEvaluatorRegistry
interface IBehaviorGuardEvaluatorRegistry
Registry of all IBehaviorGuardEvaluator.
Maven Group Identifier:
io.sarl.sre.janus
Maven Artifact Identifier:
janus.kernel
Since:
0.12
Action Summary
Modifier and type Action and description
abstract ConcurrentCollection<T> getBehaviorGuardEvaluatorsForDirectAccessListener(Event,Object)
Gets an iterator representing an immutable snapshot of all BehaviorGuardEvaluators of the given listener to the given event at the time this method is called.
abstract ConcurrentCollection<T> getBehaviorGuardEvaluatorsForRegisteredListeners(Event)
Gets an iterator representing an immutable snapshot of all BehaviorGuardEvaluators to the given event at the time this method is called.
abstract ConcurrentSet<T> getRegisteredEventListeners(Class<T>)
Extract the registered listeners with the given type.
abstract int getRegisteredEventListeners(Class<T>,Set<E>)
Extract the registered listeners with the given type.
abstract boolean hasRegisteredEventListener(Class<T>)
Replies if a listener with the given type is registered.
default void register(Object,[Procedure1<Param>])
Registers all PerceptGuardEvaluator methods on the given listener object.
abstract void register(Object,Function1<Param,Result>,[Procedure1<Param>])
Registers all PerceptGuardEvaluator methods on the given listener object.
abstract void unregister(Class<T>,Function1<Param,Result>)
Unregisters all BehaviorGuardEvaluators on the listener objects of the given type.
abstract void unregister(Object,Procedure1<Param>)
Unregisters all BehaviorGuardEvaluators on the given listener object.
abstract void unregisterAll(Function1<Param,Result>)
Unregisters all BehaviorGuardEvaluators on all the listener objects.
Action Details
getBehaviorGuardEvaluatorsForDirectAccessListener(Event,Object)
def getBehaviorGuardEvaluatorsForDirectAccessListener(Event,Object) : ConcurrentCollection<T>
Gets an iterator representing an immutable snapshot of all BehaviorGuardEvaluators of the given listener to the given event at the time this method is called.

Caution: This function does not apply filtering function given to register(Object, Function1, Procedure1).
Parameters:
event - -the event to process
listener - the owner of the BehaviorGuardEvaluators (never null).
Returns:
the set of guard evaluators associated to the specified event
Since:
0.5
getBehaviorGuardEvaluatorsForRegisteredListeners(Event)
def getBehaviorGuardEvaluatorsForRegisteredListeners(Event) : ConcurrentCollection<T>
Gets an iterator representing an immutable snapshot of all BehaviorGuardEvaluators to the given event at the time this method is called.
Parameters:
event - -the event to process
Returns:
the set of guard evaluators associated to the specified event
getRegisteredEventListeners(Class<T>)
def getRegisteredEventListeners(Class<T>) : ConcurrentSet<T>

with T

Extract the registered listeners with the given type.
Parameters:
<T> - the type of the listeners.
type - the type of the listeners.
Returns:
the listeners.
Since:
0.6
getRegisteredEventListeners(Class<T>,Set<E>)
def getRegisteredEventListeners(Class<T>,Set<E>) : int

with T

Extract the registered listeners with the given type.
Parameters:
<T> - the type of the listeners.
type - the type of the listeners.
collection - the collection of listeners that is filled by this function. This argument could be null.
Returns:
the number of listeners of the given type.
Since:
0.11
hasRegisteredEventListener(Class<T>)
def hasRegisteredEventListener(Class<T>) : boolean
Replies if a listener with the given type is registered.
Parameters:
type - the type of listener.
Returns:
true if a listener of the given type is registered.
Since:
0.5
register(Object,[Procedure1<Param>])
def register(Object,[Procedure1<Param>])
Registers all PerceptGuardEvaluator methods on the given listener object.
Parameters:
listener - the new BehaviorGuardEvaluator to add
callback - function which is invoked just after the first registration of the object. It could be null.
Since:
0.5
register(Object,Function1<Param,Result>,[Procedure1<Param>])
def register(Object,Function1<Param,Result>,[Procedure1<Param>])
Registers all PerceptGuardEvaluator methods on the given listener object.

If the filter is provided, it will be used for determining if the given behavior accepts a specific event. If the filter function replies true for a specific event as argument, the event is fired in the behavior context. If the filter function replies false, the event is not fired in the behavior context.
Parameters:
listener - the new BehaviorGuardEvaluator to add
filter - the filter function.
callback - function which is invoked just after the registration of the object. It could be null.
Since:
0.5
unregister(Class<T>,Function1<Param,Result>)
def unregister(Class<T>,Function1<Param,Result>)
Unregisters all BehaviorGuardEvaluators on the listener objects of the given type.
Parameters:
listenerType - the type of the BehaviorGuardEvaluator to remove
callback - function which is invoked just before the object is unregistered. It could be null. 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.
Since:
0.7
unregister(Object,Procedure1<Param>)
def unregister(Object,Procedure1<Param>)
Unregisters all BehaviorGuardEvaluators on the given listener object.
Parameters:
listener - the new BehaviorGuardEvaluator to remove
callback - function which is invoked just before the object is unregistered. It could be null.
Since:
0.5
unregisterAll(Function1<Param,Result>)
def unregisterAll(Function1<Param,Result>)
Unregisters all BehaviorGuardEvaluators on all the listener objects.
Parameters:
callback - function which is invoked just before the object is unregistered. It could be null. 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.
Since:
0.5