io.sarl.sre.janus.spaces
Class AbstractEventSpace
All Superinterfaces:
EventSpace, Space, SpaceWithParticipants
All Known Subclasses:
OpenLocalEventSpace
abstract class AbstractEventSpace
extends AbstractSpace
implements EventSpace, SpaceWithParticipants
Abstract implementation of an event space.
Maven Group Identifier:
io.sarl.sre.janus
Maven Artifact Identifier:
janus.kernel
Property Summary
Inherited: spaceID
Constructor Summary
Action Summary
Modifier and type Action and description
final void emit(UUID,Event,Scope<T>)
protected void emitLocally(Event,Scope<T>)
Do the emission of the event.
protected void ensureEventSource(UUID,Event)
Ensure that the given event has a source.
void forEachStrongParticipant(Procedure1<Param>)
void forEachStrongParticipant(Procedure2<P1,P2>)
void forEachWeakParticipant(Procedure1<Param>)
void forEachWeakParticipant(Procedure2<P1,P2>)
Address getAddress(UUID)
EventTransportService getEventTransportService
EventListener getListenerFromStrongParticipant(UUID)
java.util.logging.Logger getLogger
int getNumberOfStrongParticipants
int getNumberOfWeakParticipants
java.util.concurrent.ConcurrentLinkedDeque<E> getScopedParticipants(Scope<T>)
Replies the participants that matches the given scope.
SpaceParticipantListener getSpaceParticipantListener
boolean isPseudoEmpty(UUID)
protected final Address registerToSpace(EventListener,boolean)
Register the specified entity on this space
void setEventTransportService(EventTransportService)
Set the event router.
protected final Address unregisterFromSpace(EventListener)
Property Details
eventTransportService
var eventTransportService : EventTransportService

This property is an alias for the action: getEventTransportService

logger
val logger : java.util.logging.Logger

This property is an alias for the action: getLogger

numberOfStrongParticipants
val numberOfStrongParticipants : int

This property is an alias for the action: getNumberOfStrongParticipants

numberOfWeakParticipants
val numberOfWeakParticipants : int

This property is an alias for the action: getNumberOfWeakParticipants

spaceParticipantListener
val spaceParticipantListener : SpaceParticipantListener

This property is an alias for the action: getSpaceParticipantListener

Constructor Details
new(SpaceID,SpaceParticipantListener,LoggingService)
new(SpaceID,SpaceParticipantListener,LoggingService)
Constructor.
Parameters:
spaceId - identifier of the space.
participantListener - the platform listener on participant events.
logger - the logger service.
new(SpaceID,SpaceParticipantListener,LoggingService,ConcurrentMap<K,V>,ConcurrentMap<K,V>)
protected new(SpaceID,SpaceParticipantListener,LoggingService,ConcurrentMap<K,V>,ConcurrentMap<K,V>)
Constructor.
Parameters:
spaceId - identifier of the space.
participantListener - the platform listener on participant events.
loggingService - the logger service.
strongRepository - collection of strong participants to the space.
weakRepository - collection of weak participants to the space.
Action Details
emit(UUID,Event,Scope<T>)
def emit(UUID,Event,Scope<T>)
emitLocally(Event,Scope<T>)
protected def emitLocally(Event,Scope<T>)
Do the emission of the event.

This function emits the event only on the internal event bus of the listeners.

This function launch a task for each matching listener.
Parameters:
event - the event to emit.
scope - description of the scope of the event, i.e. the receivers of the event.
ensureEventSource(UUID,Event)
protected def ensureEventSource(UUID,Event)
Ensure that the given event has a source.
Parameters:
eventSource - the source of the event.
event - the event to emit.
Since:
0.6.0
forEachStrongParticipant(Procedure1<Param>)
def forEachStrongParticipant(Procedure1<Param>)
forEachStrongParticipant(Procedure2<P1,P2>)
def forEachStrongParticipant(Procedure2<P1,P2>)
forEachWeakParticipant(Procedure1<Param>)
def forEachWeakParticipant(Procedure1<Param>)
forEachWeakParticipant(Procedure2<P1,P2>)
def forEachWeakParticipant(Procedure2<P1,P2>)
getAddress(UUID)
def getAddress(UUID) : Address
getEventTransportService
def getEventTransportService : EventTransportService
getListenerFromStrongParticipant(UUID)
def getListenerFromStrongParticipant(UUID) : EventListener
getLogger
def getLogger : java.util.logging.Logger
getNumberOfStrongParticipants
def getNumberOfStrongParticipants : int
getNumberOfWeakParticipants
def getNumberOfWeakParticipants : int
getScopedParticipants(Scope<T>)
def getScopedParticipants(Scope<T>) : java.util.concurrent.ConcurrentLinkedDeque<E>
Replies the participants that matches the given scope.
Parameters:
scope - the scope.
Returns:
the matching participants.
getSpaceParticipantListener
def getSpaceParticipantListener : SpaceParticipantListener
isPseudoEmpty(UUID)
def isPseudoEmpty(UUID) : boolean
registerToSpace(EventListener,boolean)
protected def registerToSpace(EventListener,boolean) : Address
Register the specified entity on this space
Parameters:
entity - - the entity to be registered
weakParticipant - - boolean specifying if the specified entity may prevent the space from the destruction if it is the only remaining entity within this space. A Weak participant will not prevent the space from begin destroyed if it is the only one staying in it, a Strong participant will prevent it. A space containing only Weak participants will be destroyed by the SRE Kernel
setEventTransportService(EventTransportService)
def setEventTransportService(EventTransportService)
Set the event router.
Parameters:
router - the router.
Since:
0.8
unregisterFromSpace(EventListener)
protected def unregisterFromSpace(EventListener) : Address