io.sarl.api.core
Interface OpenEventSpace
All Superinterfaces:
EventSpace, Space
All Known Implementing Classes:
OpenLocalEventSpace
interface OpenEventSpace
implements EventSpace
Event driven interaction space where participants (agents, etc) are free register and unregister themselves. A participant should only register once in this type of space.

A participant is a software entity that is registered in order to receive the events that are emitted into the space. A participant is usually an agent, but not restricted to this type of software entity. It could be also a user-interface module.

A weak participant is participant that could be considered as not a first-order member of the space. When a participant is weak, it is not considered by functions such as #isPseudoEmpty(java.lang.UUID).
Maven Group Identifier:
io.sarl.sdk
Maven Artifact Identifier:
api.core
Property Summary
Action Summary
Modifier and type Action and description
default Address register(EventListener,[boolean])
Registers the participant inside this space.
abstract Address registerStrongParticipant(EventListener)
Registers the strong participant inside this space.
abstract Address registerWeakParticipant(EventListener)
Registers the weak participant inside this space.
abstract Address unregister(EventListener)
Unregisters the entity inside this space.
Action Details
register(EventListener,[boolean])
def register(EventListener,[boolean]) : Address

fires ParticipantJoined

Registers the participant inside this space. After registering a new participant, the Space should emit a ParticipantJoined event where the source is the address of the newly registered agent.

If the agent is already registered the address is return, but the listener is not replaced.
Parameters:
participant - the participant to register.
Returns:
the entity's address in this space
Fires SARL events:
ParticipantJoined in its enclosing Context default space.
Deprecated:
since 0.12, see registerStrongParticipant(EventListener) and registerStrongParticipant(EventListener) .
registerStrongParticipant(EventListener)
def registerStrongParticipant(EventListener) : Address

fires ParticipantJoined

Registers the strong participant inside 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 the space destruction. A space containing only Weak participants will be destroyed by the SRE Kernel. After registering a new participant, the Space should emit a ParticipantJoined event where the source is the address of the newly registered agent.

If the agent is already registered the address is return, but the listener is not replaced.
Parameters:
participant - the participant to register.
Returns:
the entity's address in this space
Fires SARL events:
ParticipantJoined in its enclosing Context default space.
Since:
0.12
registerWeakParticipant(EventListener)
def registerWeakParticipant(EventListener) : Address

fires ParticipantJoined

Registers the weak participant inside 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 the space destruction. A space containing only Weak participants will be destroyed by the SRE Kernel. After registering a new participant, the Space should emit a ParticipantJoined event where the source is the address of the newly registered agent.

If the agent is already registered the address is return, but the listener is not replaced.
Parameters:
participant - the participant to register.
Returns:
the entity's address in this space
Fires SARL events:
ParticipantJoined in its enclosing Context default space.
Since:
0.12
unregister(EventListener)
def unregister(EventListener) : Address

fires ParticipantLeft

Unregisters the entity inside this space. After unregistering an agent, the Space should emit a ParticipantLeft event where the source is the address of the unregistered agent.
Parameters:
participant - the participant to unregister.
Returns:
the former entity's address
Fires SARL events:
ParticipantJoined in its enclosing Context default space.