public interface AgentContext
Modifier and Type | Method and Description |
---|---|
<S extends Space> |
createSpace(spec : Class<? extends SpaceSpecification<S>>,
spaceUUID : UUID,
creationParams : Object*)
Create an instance of space following the given specification.
|
EventSpace |
getDefaultSpace()
Replies the default space of the context.
|
UUID |
getID()
Replies the identifier of the context.
|
default <S extends Space> |
getOrCreateSpace(spec : Class<? extends SpaceSpecification<S>>,
spaceUUID : UUID,
creationParams : Object*)
Deprecated.
|
<S extends Space> |
getOrCreateSpaceWithID(spec : Class<? extends SpaceSpecification<S>>,
spaceUUID : UUID,
creationParams : Object*)
Retrieve or create an instance of space with the given identifier.
|
default <S extends Space> |
getOrCreateSpaceWithID(spaceUUID : UUID,
spec : Class<? extends SpaceSpecification<S>>,
creationParams : Object*)
Deprecated.
|
<S extends Space> |
getOrCreateSpaceWithSpec(spec : Class<? extends SpaceSpecification<S>>,
spaceUUID : UUID,
creationParams : Object*)
Retrieve or create an instance of space which was created with the given
specification.
|
<S extends Space> |
getSpace(spaceUUID : UUID)
Retrieve, but do not create, an instance of space following the given ID.
|
ConcurrentCollection<? extends Space> |
getSpaces()
Replies all the spaces defined in this context.
|
<S extends Space> |
getSpaces(spec : Class<? extends SpaceSpecification<S>>)
Replies all the spaces that are implementing the given specification.
|
boolean |
isRootContext()
Replies if the context is a root context.
|
@Pure
def
getID() : UUID
AgentContext
@Pure
def
getDefaultSpace() : EventSpace
AgentContext
event-based space
.@Pure
def
getSpaces() : ConcurrentCollection<? extends Space>
AgentContext
@Puredef
getSpaces(spec : Class<? extends SpaceSpecification<S>>) : ConcurrentCollection<S>with
<S extends Space>
AgentContext
S
- - type of the replied space.spec
- specification of the space to retreive.def
createSpace(spec : Class<? extends SpaceSpecification<S>>, spaceUUID : UUID, creationParams : Object*) : Swith
<S extends Space>
AgentContext
null
. If you want to find an existing space prior to the creation of
a new one, you should use AgentContext.getOrCreateSpace(Class, UUID, Object...)
.S
- - type of the created space.spec
- specification of the space to create.spaceUUID
- identifier of the new space.creationParams
- parameters to pass to the space constructor.null
if the space already exists.AgentContext.getOrCreateSpace(Class, UUID, Object...)
,
AgentContext.getSpace(UUID)
@Deprecated defaultdef
getOrCreateSpace(spec : Class<? extends SpaceSpecification<S>>, spaceUUID : UUID, creationParams : Object*) : Swith
<S extends Space>
AgentContext.getOrCreateSpaceWithSpec(Class, UUID, Object...)
AgentContext
This function tries to find a space that was created with the given specification. If none was found, this function creates a new space with the given space identifier and creation parameters.
Caution #1: This function ignores the default space when
searching for a space created with an EventSpaceSpecification
or
OpenEventSpaceSpecification
. Consequently, in the case of the
spec
argument is one of the previous types, and there is no other
space in the context that was created with this specification, then the
function creates a totally new space.
Caution #2: The spaceUUID
parameter is used only if
no existing space created with the given specification was found.
S
- - type of the replied space.spec
- specification of the space to retreive/create.spaceUUID
- identifier used only when creating the space.creationParams
- parameters to pass to the space constructor.null
and never the default space.AgentContext.getOrCreateSpaceWithID(UUID, Class, Object...)
,
AgentContext.createSpace(Class, UUID, Object...)
,
AgentContext.getSpace(UUID)
def
getOrCreateSpaceWithSpec(spec : Class<? extends SpaceSpecification<S>>, spaceUUID : UUID, creationParams : Object*) : Swith
<S extends Space>
AgentContext
This function tries to find a space that was created with the given specification. If none was found, this function creates a new space with the given space identifier and creation parameters.
Caution: This function ignores the default space when
searching for a space created with an EventSpaceSpecification
or
OpenEventSpaceSpecification
. Consequently, in the case of the
spec
argument is one of the previous types, and there is no other
space in the context that was created with this specification, then the
function creates a totally new space.
Caution: The spaceUUID
parameter is used only if no
existing space created with the given specification was found.
S
- - type of the replied space.spec
- specification of the space to retrieve/create.spaceUUID
- identifier used only when creating the space.creationParams
- parameters to pass to the space constructor.null
and never the default space.AgentContext.getOrCreateSpaceWithID(UUID, Class, Object...)
,
AgentContext.createSpace(Class, UUID, Object...)
,
AgentContext.getSpace(UUID)
@Deprecated defaultdef
getOrCreateSpaceWithID(spaceUUID : UUID, spec : Class<? extends SpaceSpecification<S>>, creationParams : Object*) : Swith
<S extends Space>
AgentContext.getOrCreateSpaceWithID(Class, UUID, Object...)
AgentContext
This function tries to find a space with the given identifier. If none was found, this function creates a new space with the given specification and creation parameters.
Caution #1: The spaceUUID
parameter is given to the
specification when creating the space.
Caution #2: The spaceUUID
parameter is equal to the
identifier of the default space in this context, then the default space is
returned by this function.
S
- - type of the replied space.spaceUUID
- identifier of the space.spec
- specification of the space for creating the space.creationParams
- parameters to pass to the space constructor.null
.AgentContext.getOrCreateSpaceWithID(UUID, Class, Object...)
,
AgentContext.createSpace(Class, UUID, Object...)
,
AgentContext.getSpace(UUID)
def
getOrCreateSpaceWithID(spec : Class<? extends SpaceSpecification<S>>, spaceUUID : UUID, creationParams : Object*) : Swith
<S extends Space>
AgentContext
This function tries to find a space with the given identifier. If none was found, this function creates a new space with the given specification and creation parameters.
Caution #1: The spaceUUID
parameter is given to the
specification when creating the space.
Caution #2: The spaceUUID
parameter is equal to the
identifier of the default space in this context, then the default space is
returned by this function.
S
- - type of the replied space.spaceUUID
- identifier of the space.spec
- specification of the space for creating the space.creationParams
- parameters to pass to the space constructor.null
.AgentContext.getOrCreateSpaceWithID(UUID, Class, Object...)
,
AgentContext.createSpace(Class, UUID, Object...)
,
AgentContext.getSpace(UUID)
@Puredef
getSpace(spaceUUID : UUID) : Swith
<S extends Space>
AgentContext
null
.S
- - type of the replied space.spaceUUID
- identifier of the space.null
if there is no space found.AgentContext.createSpace(Class, UUID, Object...)
,
AgentContext.getOrCreateSpace(Class, UUID, Object...)
@Pure
def
isRootContext() : boolean
AgentContext
A root context is associated to the platform kernel agent, which is not created into memory. For example, it means that there is no parent registered into the default space.
true
if the context is a root context.Copyright © 2021 the original authors or authors.