Class AbstractEnvironmentSpace
- java.lang.Object
-
- jadex.commons.SimplePropertyObject
-
- jadex.commons.meta.TypedPropertyObject
-
- jadex.extension.envsupport.environment.SynchronizedPropertyObject
-
- jadex.extension.envsupport.environment.AbstractEnvironmentSpace
-
- All Implemented Interfaces:
jadex.application.IExtensionInstance
,IPropertyObject
,ITypedPropertyObject
,IEnvironmentSpace
public abstract class AbstractEnvironmentSpace extends SynchronizedPropertyObject implements IEnvironmentSpace
Abstract base class for environment space.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
AbstractEnvironmentSpace.AtomicCounter
Synchronized counter class
-
Field Summary
Fields Modifier and Type Field Description protected ComponentActionList
actionlist
The list of scheduled component actions.protected java.util.Map
actions
Available component actions.protected MultiCollection<java.lang.String,AvatarMapping>
avatarmappings
Avatar mappings.protected java.lang.ClassLoader
classloader
The class loader.protected MEnvSpaceInstance
config
protected java.util.Map
dataconsumers
The data consumers.protected java.util.Map
dataproviders
The data providers (name -> provider).protected MultiCollection<java.lang.String,java.util.Map>
dataviewmappings
Data view mappings.protected IExternalAccess
exta
The context.protected SimpleValueFetcher
fetcher
The fetcher.protected IInternalAccess
ia
protected java.util.Map
initialavatars
Initial avatar settings (cid -> [type, props]).protected java.util.List
listeners
The environment listeners.protected AbstractEnvironmentSpace.AtomicCounter
objectidcounter
Object id counter for new ids.protected java.util.Map
objecttypes
The space object types.protected java.util.Map
objecttypesMeta
The space object meta dataprotected java.util.List
observercenters
The observers.protected java.util.Map
perceptgenerators
The percept generators.protected PerceptList
perceptlist
The list of scheduled percepts.protected MultiCollection<java.lang.String,java.lang.Object[]>
perceptprocessors
The percept processors.protected java.util.Map
percepttypes
The percepttypes.protected IValueFetcher
pfetcher
protected java.util.Map
processes
The environment processes.protected java.util.Map
processtypes
The space process types.protected java.util.Map
spaceobjects
Long/ObjectIDs (keys) and environment objects (values).protected java.util.Map
spaceobjectsbyowner
Space objects by owner.protected java.util.Map
spaceobjectsbytype
Types of EnvironmentObjects and lists of EnvironmentObjects of that type (typed view).protected AbstractEnvironmentSpace.AtomicCounter
taskidcounter
Task id counter for new ids.protected java.util.Map
tasktypes
The object task types.protected java.util.Map
views
Available viewsprotected java.util.Map
zombieobjects
The zombie objects.-
Fields inherited from class jadex.extension.envsupport.environment.SynchronizedPropertyObject
monitor
-
Fields inherited from class jadex.commons.SimplePropertyObject
pcs, properties
-
-
Constructor Summary
Constructors Constructor Description AbstractEnvironmentSpace()
Create an environment space
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAvatarMappings(AvatarMapping mapping)
Adds an avatar mapping.void
addDataConsumer(java.lang.String name, ITableDataConsumer consumer)
Add a new data consumer.void
addDataProvider(java.lang.String name, ITableDataProvider provider)
Add a new data provider.void
addDataView(java.lang.String name, IDataView view)
Adds a view to the space.void
addDataViewMapping(java.lang.String objecttype, java.util.Map view)
Add a mapping from object type to data viewvoid
addEnvironmentListener(IEnvironmentListener listener)
Add an environment listener.void
addInitialAvatar(IComponentIdentifier ownerid, java.lang.String type, java.util.Map props)
Initial settings for the avatar of a specific component.void
addObjectTaskType(java.lang.String typename, java.lang.Class clazz, java.util.List properties)
Add a object task type.void
addPerceptGenerator(java.lang.Object id, IPerceptGenerator gen)
Adds a percept generator.void
addPerceptProcessor(java.lang.String componenttype, java.util.Set percepttypes, IPerceptProcessor proc)
Add a percept processor.void
addPerceptType(PerceptType percepttype)
Add a space percept type.void
addSpaceAction(java.lang.String id, ISpaceAction action)
Adds an space action.void
addSpaceObjectType(java.lang.String typename, IPropertyMetaDataSet mobjecttype)
Add a space type.void
addSpaceProcessType(java.lang.String typename, java.lang.Class clazz, java.util.List properties)
Add a space process type.void
addTaskListener(java.lang.Object taskid, java.lang.Object objectid, IResultListener listener)
Add a result listener to an object task.void
cancelSpaceAction(int id)
Cancel a queued space action.void
componentAdded(IComponentDescription owner)
Called when an component was added.void
componentRemoved(IComponentDescription desc)
Called when an component was removed.protected ISpaceObject
createAvatar(IComponentDescription owner, java.lang.String fullname, boolean zombie)
Create an avatar.java.lang.Object
createObjectTask(java.lang.String typename, java.util.Map properties, java.lang.Object objectid)
Creates an object task.void
createPercept(java.lang.String typename, java.lang.Object data, IComponentDescription comp, ISpaceObject avatar)
Create a percept for the given component.ISpaceObject
createSpaceObject(java.lang.String typename, java.util.Map properties, java.util.List tasks)
Creates an object in this space.ISpaceObject
createSpaceObjectZombie(java.lang.String typename, java.util.Map properties, java.util.List tasks)
Creates a zombie object in this space.void
createSpaceProcess(java.lang.String typename, java.util.Map properties)
Creates a space process.void
destroySpaceObject(java.lang.Object id)
Destroys an object in this space.protected void
fireEnvironmentEvent(EnvironmentEvent event)
Fire an environment event.protected void
fireObjectEvent(SpaceObject object, java.lang.String property, java.lang.Object value)
Fire an object event.ISpaceObject
getAvatar(IComponentDescription owner)
Get the avatar object.ISpaceObject
getAvatar(IComponentDescription owner, java.lang.String fullname)
Get the avatar object.protected AvatarMapping
getAvatarMapping(java.lang.String componenttype, java.lang.String avatartype)
Get the avatar mapping for an component avatar combination.ISpaceObject[]
getAvatars(IComponentDescription owner)
Get the avatar objects.java.lang.ClassLoader
getClassLoader()
Get the class loader.ComponentActionList
getComponentActionList()
Get the list of scheduled component actionsIComponentDescription[]
getComponents()
Get the avatar objects.protected IFuture
getComponentType(IComponentIdentifier cid)
ITableDataConsumer
getDataConsumer(java.lang.String name)
Get a data consumer.java.util.Collection
getDataConsumers()
Get the data consumers.ITableDataProvider
getDataProvider(java.lang.String name)
Get a data provider.IDataView
getDataView(java.lang.String name)
Gets a specific view.java.util.Map
getDataViews()
Get all available dataviews in this space.IExternalAccess
getExternalAccess()
Get the context.SimpleValueFetcher
getFetcher()
Get the value fetcher.IComponentDescription
getOwner(java.lang.Object id)
Get the owner of an object.PerceptList
getPerceptList()
Get the list of scheduled percepts.PerceptType
getPerceptType(java.lang.String percepttype)
Get a space percept type.java.util.Collection
getProcesses()
Get the processes.java.lang.Object
getProperty(java.lang.String name)
Returns a property.ISpaceAction
getSpaceAction(java.lang.String id)
Adds an space action.ISpaceObject
getSpaceObject(java.lang.Object id)
Returns an object in this space.ISpaceObject
getSpaceObject0(java.lang.Object id)
Returns an object in this space.ISpaceObject[]
getSpaceObjectsByType(java.lang.String type)
Get all space object of a specific type.java.util.Collection
getSpaceObjectsCollection()
Get the space objects.MObjectType
getSpaceObjectType(java.lang.String type)
Get the object type.ISpaceProcess
getSpaceProcess(java.lang.Object id)
Returns a space process.java.util.Set
getSpaceProcessNames()
Returns then names of the space processes.java.util.Collection
getViews()
Get the views.IFuture<java.lang.Void>
init()
Initialize the extension.IFuture<java.lang.Void>
initSpace()
Create a space.void
initSpaceObject(ISpaceObject ret)
Creates an object in this space.protected java.util.Map
mergeProperties(IPropertyMetaDataSet mObjectType, java.util.Map properties)
Add type properties to runtime properties.protected java.util.Map
mergeProperties(java.util.Collection typeprops, java.util.Map properties)
Add type properties to runtime properties.java.lang.Object
performSpaceAction(java.lang.String id, java.util.Map parameters)
Performs a space action.int
performSpaceAction(java.lang.String id, java.util.Map parameters, IResultListener listener)
Schedules an space action.void
removeAvatarMappings(AvatarMapping mapping)
Remove an avatar mapping.void
removeDataView(java.lang.String name)
Removes a view from the space.void
removeEnvironmentListener(IEnvironmentListener listener)
Remove an environment listener.void
removeObjectTask(java.lang.Object taskid, java.lang.Object objectid)
Remove an object task.void
removeObjectTaskType(java.lang.String typename)
Remove an object task type.void
removePerceptGenerator(java.lang.Object id)
Remove a percept generator.void
removePerceptProcessor(java.lang.String componenttype, IPerceptProcessor proc)
remove a percept processor.void
removePerceptType(java.lang.String typename)
Remove a space process type.void
removeSpaceAction(java.lang.String id)
Removes an space action.void
removeSpaceObjectType(java.lang.String typename)
Remove a space object type.void
removeSpaceProcess(java.lang.Object id)
Removes a space process.void
removeSpaceProcessType(java.lang.String typename)
Remove a space process type.void
removeTaskListener(java.lang.Object taskid, java.lang.Object objectid, IResultListener listener)
Remove a result listener from an object task.void
setFetcher(SimpleValueFetcher fetcher)
Set the fetcher.void
setInitData(IInternalAccess ia, MEnvSpaceInstance config, IValueFetcher pfetcher)
void
setOwner(java.lang.Object id, IComponentDescription owner)
Set the owner of an object.IFuture<java.lang.Void>
terminate()
Terminate the extension.IFuture<java.lang.Void>
waitForTask(java.lang.Object taskid, java.lang.Object objectid)
Add a result listener to an object task.-
Methods inherited from class jadex.extension.envsupport.environment.SynchronizedPropertyObject
addPropertyChangeListener, getMonitor, getPropertyNames, hasProperty, removePropertyChangeListener, setProperty
-
Methods inherited from class jadex.commons.meta.TypedPropertyObject
getMetaData, getMetaDatas
-
Methods inherited from class jadex.commons.SimplePropertyObject
getProperties, setProperties, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jadex.commons.IPropertyObject
getPropertyNames, hasProperty, setProperty
-
-
-
-
Field Detail
-
exta
protected IExternalAccess exta
The context.
-
objecttypes
protected java.util.Map objecttypes
The space object types.
-
objecttypesMeta
protected java.util.Map objecttypesMeta
The space object meta data
-
tasktypes
protected java.util.Map tasktypes
The object task types.
-
processtypes
protected java.util.Map processtypes
The space process types.
-
percepttypes
protected java.util.Map percepttypes
The percepttypes.
-
actions
protected java.util.Map actions
Available component actions.
-
perceptgenerators
protected java.util.Map perceptgenerators
The percept generators.
-
perceptprocessors
protected MultiCollection<java.lang.String,java.lang.Object[]> perceptprocessors
The percept processors.
-
avatarmappings
protected MultiCollection<java.lang.String,AvatarMapping> avatarmappings
Avatar mappings.
-
initialavatars
protected java.util.Map initialavatars
Initial avatar settings (cid -> [type, props]).
-
dataviewmappings
protected MultiCollection<java.lang.String,java.util.Map> dataviewmappings
Data view mappings.
-
processes
protected java.util.Map processes
The environment processes.
-
spaceobjects
protected java.util.Map spaceobjects
Long/ObjectIDs (keys) and environment objects (values).
-
spaceobjectsbytype
protected java.util.Map spaceobjectsbytype
Types of EnvironmentObjects and lists of EnvironmentObjects of that type (typed view).
-
spaceobjectsbyowner
protected java.util.Map spaceobjectsbyowner
Space objects by owner.
-
objectidcounter
protected AbstractEnvironmentSpace.AtomicCounter objectidcounter
Object id counter for new ids.
-
taskidcounter
protected AbstractEnvironmentSpace.AtomicCounter taskidcounter
Task id counter for new ids.
-
actionlist
protected ComponentActionList actionlist
The list of scheduled component actions.
-
perceptlist
protected PerceptList perceptlist
The list of scheduled percepts.
-
views
protected java.util.Map views
Available views
-
listeners
protected java.util.List listeners
The environment listeners.
-
fetcher
protected SimpleValueFetcher fetcher
The fetcher.
-
dataproviders
protected java.util.Map dataproviders
The data providers (name -> provider).
-
dataconsumers
protected java.util.Map dataconsumers
The data consumers.
-
zombieobjects
protected java.util.Map zombieobjects
The zombie objects.
-
observercenters
protected java.util.List observercenters
The observers.
-
classloader
protected java.lang.ClassLoader classloader
The class loader.
-
ia
protected IInternalAccess ia
-
config
protected MEnvSpaceInstance config
-
pfetcher
protected IValueFetcher pfetcher
-
-
Method Detail
-
setInitData
public void setInitData(IInternalAccess ia, MEnvSpaceInstance config, IValueFetcher pfetcher)
-
initSpace
public IFuture<java.lang.Void> initSpace()
Create a space.
-
addSpaceObjectType
public void addSpaceObjectType(java.lang.String typename, IPropertyMetaDataSet mobjecttype)
Add a space type.- Specified by:
addSpaceObjectType
in interfaceIEnvironmentSpace
- Parameters:
typename
- The type name.initproperties
- The MobjectType.
-
removeSpaceObjectType
public void removeSpaceObjectType(java.lang.String typename)
Remove a space object type.- Specified by:
removeSpaceObjectType
in interfaceIEnvironmentSpace
- Parameters:
typename
- The type name.
-
addSpaceProcessType
public void addSpaceProcessType(java.lang.String typename, java.lang.Class clazz, java.util.List properties)
Add a space process type.- Specified by:
addSpaceProcessType
in interfaceIEnvironmentSpace
- Parameters:
typename
- The type name.properties
- The properties.
-
removeSpaceProcessType
public void removeSpaceProcessType(java.lang.String typename)
Remove a space process type.- Specified by:
removeSpaceProcessType
in interfaceIEnvironmentSpace
- Parameters:
typename
- The type name.
-
createSpaceProcess
public void createSpaceProcess(java.lang.String typename, java.util.Map properties)
Creates a space process.- Specified by:
createSpaceProcess
in interfaceIEnvironmentSpace
- Parameters:
typename
- The type name.properties
- The properties.
-
addObjectTaskType
public void addObjectTaskType(java.lang.String typename, java.lang.Class clazz, java.util.List properties)
Add a object task type.- Specified by:
addObjectTaskType
in interfaceIEnvironmentSpace
- Parameters:
typename
- The type name.properties
- The properties.
-
removeObjectTaskType
public void removeObjectTaskType(java.lang.String typename)
Remove an object task type.- Specified by:
removeObjectTaskType
in interfaceIEnvironmentSpace
- Parameters:
typename
- The type name.
-
createObjectTask
public java.lang.Object createObjectTask(java.lang.String typename, java.util.Map properties, java.lang.Object objectid)
Creates an object task.- Specified by:
createObjectTask
in interfaceIEnvironmentSpace
- Parameters:
typename
- The type name.properties
- The properties.- Returns:
- The task id.
-
removeObjectTask
public void removeObjectTask(java.lang.Object taskid, java.lang.Object objectid)
Remove an object task.- Specified by:
removeObjectTask
in interfaceIEnvironmentSpace
- Parameters:
typename
- The type name.initproperties
- The properties.
-
addTaskListener
public void addTaskListener(java.lang.Object taskid, java.lang.Object objectid, IResultListener listener)
Add a result listener to an object task. The listener result will be the task id. If the task is already finished, the listener will be notified.- Specified by:
addTaskListener
in interfaceIEnvironmentSpace
-
removeTaskListener
public void removeTaskListener(java.lang.Object taskid, java.lang.Object objectid, IResultListener listener)
Remove a result listener from an object task.- Specified by:
removeTaskListener
in interfaceIEnvironmentSpace
-
waitForTask
public IFuture<java.lang.Void> waitForTask(java.lang.Object taskid, java.lang.Object objectid)
Add a result listener to an object task. The listener result will be the task id. If the task is already finished, the listener will be notified.- Specified by:
waitForTask
in interfaceIEnvironmentSpace
-
getSpaceProcessNames
public java.util.Set getSpaceProcessNames()
Returns then names of the space processes.- Returns:
- the names of the space processes
-
getSpaceProcess
public ISpaceProcess getSpaceProcess(java.lang.Object id)
Returns a space process.- Specified by:
getSpaceProcess
in interfaceIEnvironmentSpace
- Parameters:
id
- ID of the space process- Returns:
- the space process or null if not found
-
removeSpaceProcess
public void removeSpaceProcess(java.lang.Object id)
Removes a space process.- Specified by:
removeSpaceProcess
in interfaceIEnvironmentSpace
- Parameters:
id
- ID of the space process
-
createSpaceObject
public final ISpaceObject createSpaceObject(java.lang.String typename, java.util.Map properties, java.util.List tasks)
Creates an object in this space.- Specified by:
createSpaceObject
in interfaceIEnvironmentSpace
- Parameters:
type
- the object's typeproperties
- initial properties (may be null)tasks
- initial task list (may be null)- Returns:
- the object's ID
-
createSpaceObjectZombie
public ISpaceObject createSpaceObjectZombie(java.lang.String typename, java.util.Map properties, java.util.List tasks)
Creates a zombie object in this space. Zombies are not (yet) visible in the space and must be inited separately.- Parameters:
type
- the object's typeproperties
- initial properties (may be null)tasks
- initial task list (may be null)- Returns:
- the object's ID
-
initSpaceObject
public void initSpaceObject(ISpaceObject ret)
Creates an object in this space.- Parameters:
type
- the object's typeinitproperties
- initial properties (may be null)tasks
- initial task list (may be null)listeners
- initial listeners (may be null)
-
mergeProperties
protected java.util.Map mergeProperties(java.util.Collection typeprops, java.util.Map properties)
Add type properties to runtime properties. Runtime properties have precedence if specified.- Parameters:
typeprops
- The type properties (if any).properties
- The runtime properties or null.- Returns:
- The merged runtime properties.
-
mergeProperties
protected java.util.Map mergeProperties(IPropertyMetaDataSet mObjectType, java.util.Map properties)
Add type properties to runtime properties. Runtime properties have precedence if specified.- Parameters:
typeprops
- The typeproperties
- The runtime properties or null.- Returns:
- The merged runtime properties.
-
destroySpaceObject
public void destroySpaceObject(java.lang.Object id)
Destroys an object in this space.- Specified by:
destroySpaceObject
in interfaceIEnvironmentSpace
- Parameters:
id
- the object's ID
-
getSpaceObject
public ISpaceObject getSpaceObject(java.lang.Object id)
Returns an object in this space.- Specified by:
getSpaceObject
in interfaceIEnvironmentSpace
- Parameters:
id
- the object's ID- Returns:
- the object in this space
-
getSpaceObject0
public ISpaceObject getSpaceObject0(java.lang.Object id)
Returns an object in this space.- Parameters:
id
- the object's ID- Returns:
- the object in this space
-
getSpaceObjectsByType
public ISpaceObject[] getSpaceObjectsByType(java.lang.String type)
Get all space object of a specific type.- Specified by:
getSpaceObjectsByType
in interfaceIEnvironmentSpace
- Parameters:
type
- The space object type.- Returns:
- The space objects of the desired type.
-
addAvatarMappings
public void addAvatarMappings(AvatarMapping mapping)
Adds an avatar mapping.- Parameters:
componenttype
- The component type.objecttype
- The object type to represent the component.
-
removeAvatarMappings
public void removeAvatarMappings(AvatarMapping mapping)
Remove an avatar mapping.- Parameters:
componenttype
- The component type.objecttype
- The object type to represent the component.
-
addSpaceAction
public void addSpaceAction(java.lang.String id, ISpaceAction action)
Adds an space action.- Specified by:
addSpaceAction
in interfaceIEnvironmentSpace
- Parameters:
actionId
- the action IDaction
- the action
-
getSpaceAction
public ISpaceAction getSpaceAction(java.lang.String id)
Adds an space action.- Parameters:
actionId
- the action IDaction
- the action
-
removeSpaceAction
public void removeSpaceAction(java.lang.String id)
Removes an space action.- Specified by:
removeSpaceAction
in interfaceIEnvironmentSpace
- Parameters:
actionId
- the action ID
-
performSpaceAction
public int performSpaceAction(java.lang.String id, java.util.Map parameters, IResultListener listener)
Schedules an space action.- Specified by:
performSpaceAction
in interfaceIEnvironmentSpace
- Parameters:
id
- Id of the actionparameters
- parameters for the action (may be null)listener
- the result listener- Returns:
- The id of the action instance for later access.
-
cancelSpaceAction
public void cancelSpaceAction(int id)
Cancel a queued space action.- Specified by:
cancelSpaceAction
in interfaceIEnvironmentSpace
-
performSpaceAction
public java.lang.Object performSpaceAction(java.lang.String id, java.util.Map parameters)
Performs a space action.- Parameters:
id
- Id of the actionparameters
- parameters for the action (may be null)- Returns:
- return value of the action
-
createPercept
public void createPercept(java.lang.String typename, java.lang.Object data, IComponentDescription comp, ISpaceObject avatar)
Create a percept for the given component.- Parameters:
typename
- The percept type.data
- The content of the percept (if any).cid
- The component that should receive the percept.
-
getOwner
public IComponentDescription getOwner(java.lang.Object id)
Get the owner of an object.- Parameters:
id
- The id.- Returns:
- The owner.
-
setOwner
public void setOwner(java.lang.Object id, IComponentDescription owner)
Set the owner of an object.- Specified by:
setOwner
in interfaceIEnvironmentSpace
- Parameters:
id
- The object id.pos
- The object owner.
-
getAvatars
public ISpaceObject[] getAvatars(IComponentDescription owner)
Get the avatar objects.- Specified by:
getAvatars
in interfaceIEnvironmentSpace
- Returns:
- The avatar objects.
-
getComponents
public IComponentDescription[] getComponents()
Get the avatar objects.- Returns:
- The avatar objects.
-
getAvatar
public ISpaceObject getAvatar(IComponentDescription owner)
Get the avatar object.- Specified by:
getAvatar
in interfaceIEnvironmentSpace
- Returns:
- The avatar object.
-
getAvatar
public ISpaceObject getAvatar(IComponentDescription owner, java.lang.String fullname)
Get the avatar object.- Returns:
- The avatar object.
-
createAvatar
protected ISpaceObject createAvatar(IComponentDescription owner, java.lang.String fullname, boolean zombie)
Create an avatar.
-
addDataView
public void addDataView(java.lang.String name, IDataView view)
Adds a view to the space.- Specified by:
addDataView
in interfaceIEnvironmentSpace
- Parameters:
name
- name of the viewview
- the view
-
removeDataView
public void removeDataView(java.lang.String name)
Removes a view from the space.- Specified by:
removeDataView
in interfaceIEnvironmentSpace
- Parameters:
name
- name of the view
-
getDataView
public IDataView getDataView(java.lang.String name)
Gets a specific view.- Specified by:
getDataView
in interfaceIEnvironmentSpace
- Parameters:
name
- name of the view- Returns:
- the view
-
getDataViews
public java.util.Map getDataViews()
Get all available dataviews in this space.- Specified by:
getDataViews
in interfaceIEnvironmentSpace
- Returns:
- all available dataviews
-
addDataViewMapping
public void addDataViewMapping(java.lang.String objecttype, java.util.Map view)
Add a mapping from object type to data view- Parameters:
objecttype
- The object type.view
- Settings for view creation.
-
addEnvironmentListener
public void addEnvironmentListener(IEnvironmentListener listener)
Add an environment listener.- Specified by:
addEnvironmentListener
in interfaceIEnvironmentSpace
- Parameters:
listener
- The environment listener.
-
removeEnvironmentListener
public void removeEnvironmentListener(IEnvironmentListener listener)
Remove an environment listener.- Specified by:
removeEnvironmentListener
in interfaceIEnvironmentSpace
- Parameters:
listener
- The environment listener.
-
addPerceptGenerator
public void addPerceptGenerator(java.lang.Object id, IPerceptGenerator gen)
Adds a percept generator.- Specified by:
addPerceptGenerator
in interfaceIEnvironmentSpace
- Parameters:
id
- The percept generator id.gen
- The percept generator.
-
removePerceptGenerator
public void removePerceptGenerator(java.lang.Object id)
Remove a percept generator.- Specified by:
removePerceptGenerator
in interfaceIEnvironmentSpace
- Parameters:
id
- The percept generator id.
-
addPerceptProcessor
public void addPerceptProcessor(java.lang.String componenttype, java.util.Set percepttypes, IPerceptProcessor proc)
Add a percept processor.- Parameters:
componenttype
- The component type.proc
- The percept processor.
-
removePerceptProcessor
public void removePerceptProcessor(java.lang.String componenttype, IPerceptProcessor proc)
remove a percept processor.- Parameters:
componenttype
- The component type.proc
- The percept processor.
-
addPerceptType
public void addPerceptType(PerceptType percepttype)
Add a space percept type.- Specified by:
addPerceptType
in interfaceIEnvironmentSpace
- Parameters:
typename
- The percept name.objecttypes
- The objecttypes.componenttypes
- The componenttypes.
-
removePerceptType
public void removePerceptType(java.lang.String typename)
Remove a space process type.- Specified by:
removePerceptType
in interfaceIEnvironmentSpace
- Parameters:
typename
- The type name.
-
getPerceptType
public PerceptType getPerceptType(java.lang.String percepttype)
Get a space percept type.- Specified by:
getPerceptType
in interfaceIEnvironmentSpace
- Parameters:
percepttype
- The name of the percept type.- Returns:
- The percept type.
-
componentAdded
public void componentAdded(IComponentDescription owner)
Called when an component was added.
-
componentRemoved
public void componentRemoved(IComponentDescription desc)
Called when an component was removed.
-
getComponentType
protected IFuture getComponentType(IComponentIdentifier cid)
-
getExternalAccess
public IExternalAccess getExternalAccess()
Get the context.- Specified by:
getExternalAccess
in interfaceIEnvironmentSpace
- Returns:
- The context.
-
getProperty
public java.lang.Object getProperty(java.lang.String name)
Returns a property.- Specified by:
getProperty
in interfaceIPropertyObject
- Overrides:
getProperty
in classSynchronizedPropertyObject
- Parameters:
name
- name of the property- Returns:
- the property
-
getFetcher
public SimpleValueFetcher getFetcher()
Get the value fetcher.- Returns:
- The fetcher.
-
setFetcher
public void setFetcher(SimpleValueFetcher fetcher)
Set the fetcher.- Parameters:
fetcher
- The fetcher to set.
-
getSpaceObjectsCollection
public java.util.Collection getSpaceObjectsCollection()
Get the space objects.
-
getProcesses
public java.util.Collection getProcesses()
Get the processes.
-
getComponentActionList
public ComponentActionList getComponentActionList()
Get the list of scheduled component actions
-
getPerceptList
public PerceptList getPerceptList()
Get the list of scheduled percepts.
-
getViews
public java.util.Collection getViews()
Get the views.
-
fireEnvironmentEvent
protected void fireEnvironmentEvent(EnvironmentEvent event)
Fire an environment event.- Parameters:
event
- The event.
-
fireObjectEvent
protected void fireObjectEvent(SpaceObject object, java.lang.String property, java.lang.Object value)
Fire an object event.- Parameters:
object
- The object.property
- The changed property.value
- The new property value.
-
addInitialAvatar
public void addInitialAvatar(IComponentIdentifier ownerid, java.lang.String type, java.util.Map props)
Initial settings for the avatar of a specific component.- Parameters:
ownerid
- The component id.type
- The object type.props
- The properties for the object (if any).
-
getAvatarMapping
protected AvatarMapping getAvatarMapping(java.lang.String componenttype, java.lang.String avatartype)
Get the avatar mapping for an component avatar combination.
-
addDataProvider
public void addDataProvider(java.lang.String name, ITableDataProvider provider)
Add a new data provider.- Parameters:
name
- The name.provider
- The provider.
-
getDataProvider
public ITableDataProvider getDataProvider(java.lang.String name)
Get a data provider.- Parameters:
name
- The name.- Returns:
- The provider.
-
addDataConsumer
public void addDataConsumer(java.lang.String name, ITableDataConsumer consumer)
Add a new data consumer.- Parameters:
consumer
- The consumer.
-
getDataConsumer
public ITableDataConsumer getDataConsumer(java.lang.String name)
Get a data consumer.- Parameters:
name
- The name.- Returns:
- The consumer.
-
getDataConsumers
public java.util.Collection getDataConsumers()
Get the data consumers.- Returns:
- The data consumers.
-
init
public IFuture<java.lang.Void> init()
Initialize the extension. Called once, when the extension is created.- Specified by:
init
in interfacejadex.application.IExtensionInstance
-
terminate
public IFuture<java.lang.Void> terminate()
Terminate the extension. Called once, when the extension is terminated.- Specified by:
terminate
in interfacejadex.application.IExtensionInstance
-
getClassLoader
public java.lang.ClassLoader getClassLoader()
Get the class loader.
-
getSpaceObjectType
public MObjectType getSpaceObjectType(java.lang.String type)
Get the object type.
-
-