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 classAbstractEnvironmentSpace.AtomicCounterSynchronized counter class
-
Field Summary
Fields Modifier and Type Field Description protected ComponentActionListactionlistThe list of scheduled component actions.protected java.util.MapactionsAvailable component actions.protected MultiCollection<java.lang.String,AvatarMapping>avatarmappingsAvatar mappings.protected java.lang.ClassLoaderclassloaderThe class loader.protected MEnvSpaceInstanceconfigprotected java.util.MapdataconsumersThe data consumers.protected java.util.MapdataprovidersThe data providers (name -> provider).protected MultiCollection<java.lang.String,java.util.Map>dataviewmappingsData view mappings.protected IExternalAccessextaThe context.protected SimpleValueFetcherfetcherThe fetcher.protected IInternalAccessiaprotected FutureBarrier<java.lang.Object>initfuturesFutures of external tasks that need waiting for during init.protected java.util.MapinitialavatarsInitial avatar settings (cid -> [type, props]).protected java.util.ListlistenersThe environment listeners.protected AbstractEnvironmentSpace.AtomicCounterobjectidcounterObject id counter for new ids.protected java.util.MapobjecttypesThe space object types.protected java.util.MapobjecttypesMetaThe space object meta dataprotected java.util.ListobservercentersThe observers.protected java.util.MapperceptgeneratorsThe percept generators.protected PerceptListperceptlistThe list of scheduled percepts.protected MultiCollection<java.lang.String,java.lang.Object[]>perceptprocessorsThe percept processors.protected java.util.MappercepttypesThe percepttypes.protected IValueFetcherpfetcherprotected java.util.MapprocessesThe environment processes.protected java.util.MapprocesstypesThe space process types.protected java.util.MapspaceobjectsLong/ObjectIDs (keys) and environment objects (values).protected java.util.MapspaceobjectsbyownerSpace objects by owner.protected java.util.MapspaceobjectsbytypeTypes of EnvironmentObjects and lists of EnvironmentObjects of that type (typed view).protected AbstractEnvironmentSpace.AtomicCountertaskidcounterTask id counter for new ids.protected java.util.MaptasktypesThe object task types.protected java.util.MapviewsAvailable viewsprotected java.util.MapzombieobjectsThe 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 voidaddAvatarMappings(AvatarMapping mapping)Adds an avatar mapping.voidaddDataConsumer(java.lang.String name, ITableDataConsumer consumer)Add a new data consumer.voidaddDataProvider(java.lang.String name, ITableDataProvider provider)Add a new data provider.voidaddDataView(java.lang.String name, IDataView view)Adds a view to the space.voidaddDataViewMapping(java.lang.String objecttype, java.util.Map view)Add a mapping from object type to data viewvoidaddEnvironmentListener(IEnvironmentListener listener)Add an environment listener.protected <T> voidaddInitFuture(IFuture<T> fut)Add a future of an asynchronous (i.e.voidaddInitialAvatar(IComponentIdentifier ownerid, java.lang.String type, java.util.Map props)Initial settings for the avatar of a specific component.voidaddObjectTaskType(java.lang.String typename, java.lang.Class clazz, java.util.List properties)Add a object task type.voidaddPerceptGenerator(java.lang.Object id, IPerceptGenerator gen)Adds a percept generator.voidaddPerceptProcessor(java.lang.String componenttype, java.util.Set percepttypes, IPerceptProcessor proc)Add a percept processor.voidaddPerceptType(PerceptType percepttype)Add a space percept type.voidaddSpaceAction(java.lang.String id, ISpaceAction action)Adds an space action.voidaddSpaceObjectType(java.lang.String typename, IPropertyMetaDataSet mobjecttype)Add a space type.voidaddSpaceProcessType(java.lang.String typename, java.lang.Class clazz, java.util.List properties)Add a space process type.voidaddTaskListener(java.lang.Object taskid, java.lang.Object objectid, IResultListener listener)Add a result listener to an object task.voidcancelSpaceAction(int id)Cancel a queued space action.voidcomponentAdded(IComponentDescription owner)Called when an component was added.voidcomponentRemoved(IComponentDescription desc)Called when an component was removed.protected ISpaceObjectcreateAvatar(IComponentDescription owner, java.lang.String fullname, boolean zombie)Create an avatar.java.lang.ObjectcreateObjectTask(java.lang.String typename, java.util.Map properties, java.lang.Object objectid)Creates an object task.voidcreatePercept(java.lang.String typename, java.lang.Object data, IComponentDescription comp, ISpaceObject avatar)Create a percept for the given component.ISpaceObjectcreateSpaceObject(java.lang.String typename, java.util.Map properties, java.util.List tasks)Creates an object in this space.ISpaceObjectcreateSpaceObjectZombie(java.lang.String typename, java.util.Map properties, java.util.List tasks)Creates a zombie object in this space.voidcreateSpaceProcess(java.lang.String typename, java.util.Map properties)Creates a space process.voiddestroySpaceObject(java.lang.Object id)Destroys an object in this space.protected voidfireEnvironmentEvent(EnvironmentEvent event)Fire an environment event.protected voidfireObjectEvent(SpaceObject object, java.lang.String property, java.lang.Object value)Fire an object event.ISpaceObjectgetAvatar(IComponentDescription owner)Get the avatar object.ISpaceObjectgetAvatar(IComponentDescription owner, java.lang.String fullname)Get the avatar object.protected AvatarMappinggetAvatarMapping(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.ClassLoadergetClassLoader()Get the class loader.ComponentActionListgetComponentActionList()Get the list of scheduled component actionsIComponentDescription[]getComponents()Get the avatar objects.protected IFuturegetComponentType(IComponentIdentifier cid)ITableDataConsumergetDataConsumer(java.lang.String name)Get a data consumer.java.util.CollectiongetDataConsumers()Get the data consumers.ITableDataProvidergetDataProvider(java.lang.String name)Get a data provider.IDataViewgetDataView(java.lang.String name)Gets a specific view.java.util.MapgetDataViews()Get all available dataviews in this space.IExternalAccessgetExternalAccess()Get the context.SimpleValueFetchergetFetcher()Get the value fetcher.IComponentDescriptiongetOwner(java.lang.Object id)Get the owner of an object.PerceptListgetPerceptList()Get the list of scheduled percepts.PerceptTypegetPerceptType(java.lang.String percepttype)Get a space percept type.java.util.CollectiongetProcesses()Get the processes.java.lang.ObjectgetProperty(java.lang.String name)Returns a property.ISpaceActiongetSpaceAction(java.lang.String id)Adds an space action.ISpaceObjectgetSpaceObject(java.lang.Object id)Returns an object in this space.ISpaceObjectgetSpaceObject0(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.CollectiongetSpaceObjectsCollection()Get the space objects.MObjectTypegetSpaceObjectType(java.lang.String type)Get the object type.ISpaceProcessgetSpaceProcess(java.lang.Object id)Returns a space process.java.util.SetgetSpaceProcessNames()Returns then names of the space processes.java.util.CollectiongetViews()Get the views.IFuture<java.lang.Void>init()Initialize the extension.IFuture<java.lang.Void>initSpace()Create a space.voidinitSpaceObject(ISpaceObject ret)Creates an object in this space.protected java.util.MapmergeProperties(IPropertyMetaDataSet mObjectType, java.util.Map properties)Add type properties to runtime properties.protected java.util.MapmergeProperties(java.util.Collection typeprops, java.util.Map properties)Add type properties to runtime properties.java.lang.ObjectperformSpaceAction(java.lang.String id, java.util.Map parameters)Performs a space action.intperformSpaceAction(java.lang.String id, java.util.Map parameters, IResultListener listener)Schedules an space action.voidremoveAvatarMappings(AvatarMapping mapping)Remove an avatar mapping.voidremoveDataView(java.lang.String name)Removes a view from the space.voidremoveEnvironmentListener(IEnvironmentListener listener)Remove an environment listener.voidremoveObjectTask(java.lang.Object taskid, java.lang.Object objectid)Remove an object task.voidremoveObjectTaskType(java.lang.String typename)Remove an object task type.voidremovePerceptGenerator(java.lang.Object id)Remove a percept generator.voidremovePerceptProcessor(java.lang.String componenttype, IPerceptProcessor proc)remove a percept processor.voidremovePerceptType(java.lang.String typename)Remove a space process type.voidremoveSpaceAction(java.lang.String id)Removes an space action.voidremoveSpaceObjectType(java.lang.String typename)Remove a space object type.voidremoveSpaceProcess(java.lang.Object id)Removes a space process.voidremoveSpaceProcessType(java.lang.String typename)Remove a space process type.voidremoveTaskListener(java.lang.Object taskid, java.lang.Object objectid, IResultListener listener)Remove a result listener from an object task.voidsetFetcher(SimpleValueFetcher fetcher)Set the fetcher.voidsetInitData(IInternalAccess ia, MEnvSpaceInstance config, IValueFetcher pfetcher)voidsetOwner(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
-
initfutures
protected FutureBarrier<java.lang.Object> initfutures
Futures of external tasks that need waiting for during init.
-
-
Method Detail
-
setInitData
public void setInitData(IInternalAccess ia, MEnvSpaceInstance config, IValueFetcher pfetcher)
-
addInitFuture
protected <T> void addInitFuture(IFuture<T> fut)
Add a future of an asynchronous (i.e. external) task during space init (e.g. a component that is created for a space object). The space init future will wait for these futures. Does nothing, when space is not in init.
-
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:
addSpaceObjectTypein interfaceIEnvironmentSpace- Parameters:
typename- The type name.initproperties- The MobjectType.
-
removeSpaceObjectType
public void removeSpaceObjectType(java.lang.String typename)
Remove a space object type.- Specified by:
removeSpaceObjectTypein 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:
addSpaceProcessTypein interfaceIEnvironmentSpace- Parameters:
typename- The type name.properties- The properties.
-
removeSpaceProcessType
public void removeSpaceProcessType(java.lang.String typename)
Remove a space process type.- Specified by:
removeSpaceProcessTypein interfaceIEnvironmentSpace- Parameters:
typename- The type name.
-
createSpaceProcess
public void createSpaceProcess(java.lang.String typename, java.util.Map properties)Creates a space process.- Specified by:
createSpaceProcessin 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:
addObjectTaskTypein interfaceIEnvironmentSpace- Parameters:
typename- The type name.properties- The properties.
-
removeObjectTaskType
public void removeObjectTaskType(java.lang.String typename)
Remove an object task type.- Specified by:
removeObjectTaskTypein 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:
createObjectTaskin 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:
removeObjectTaskin 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:
addTaskListenerin 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:
removeTaskListenerin 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:
waitForTaskin 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:
getSpaceProcessin 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:
removeSpaceProcessin 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:
createSpaceObjectin 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:
destroySpaceObjectin interfaceIEnvironmentSpace- Parameters:
id- the object's ID
-
getSpaceObject
public ISpaceObject getSpaceObject(java.lang.Object id)
Returns an object in this space.- Specified by:
getSpaceObjectin 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:
getSpaceObjectsByTypein 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:
addSpaceActionin 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:
removeSpaceActionin 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:
performSpaceActionin 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:
cancelSpaceActionin 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:
setOwnerin interfaceIEnvironmentSpace- Parameters:
id- The object id.pos- The object owner.
-
getAvatars
public ISpaceObject[] getAvatars(IComponentDescription owner)
Get the avatar objects.- Specified by:
getAvatarsin 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:
getAvatarin 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:
addDataViewin 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:
removeDataViewin interfaceIEnvironmentSpace- Parameters:
name- name of the view
-
getDataView
public IDataView getDataView(java.lang.String name)
Gets a specific view.- Specified by:
getDataViewin 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:
getDataViewsin 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:
addEnvironmentListenerin interfaceIEnvironmentSpace- Parameters:
listener- The environment listener.
-
removeEnvironmentListener
public void removeEnvironmentListener(IEnvironmentListener listener)
Remove an environment listener.- Specified by:
removeEnvironmentListenerin interfaceIEnvironmentSpace- Parameters:
listener- The environment listener.
-
addPerceptGenerator
public void addPerceptGenerator(java.lang.Object id, IPerceptGenerator gen)Adds a percept generator.- Specified by:
addPerceptGeneratorin 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:
removePerceptGeneratorin 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:
addPerceptTypein 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:
removePerceptTypein interfaceIEnvironmentSpace- Parameters:
typename- The type name.
-
getPerceptType
public PerceptType getPerceptType(java.lang.String percepttype)
Get a space percept type.- Specified by:
getPerceptTypein 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:
getExternalAccessin interfaceIEnvironmentSpace- Returns:
- The context.
-
getProperty
public java.lang.Object getProperty(java.lang.String name)
Returns a property.- Specified by:
getPropertyin interfaceIPropertyObject- Overrides:
getPropertyin 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:
initin interfacejadex.application.IExtensionInstance
-
terminate
public IFuture<java.lang.Void> terminate()
Terminate the extension. Called once, when the extension is terminated.- Specified by:
terminatein 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.
-
-