|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjadex.commons.SimplePropertyObject
jadex.commons.meta.TypedPropertyObject
jadex.application.space.envsupport.environment.SynchronizedPropertyObject
jadex.application.space.envsupport.environment.AbstractEnvironmentSpace
public abstract class AbstractEnvironmentSpace
Abstract base class for environment space.
| Field Summary | |
|---|---|
protected ComponentActionList |
actionlist
The list of scheduled component actions. |
protected Map |
actions
Available component actions. |
protected IApplication |
application
The context. |
protected MultiCollection |
avatarmappings
Avatar mappings. |
protected Map |
dataconsumers
The data consumers. |
protected Map |
dataproviders
The data providers (name -> provider). |
protected MultiCollection |
dataviewmappings
Data view mappings. |
protected SimpleValueFetcher |
fetcher
The fetcher. |
protected Map |
initialavatars
Initial avatar settings (aid -> [type, props]). |
protected List |
listeners
The environment listeners. |
protected String |
name
The space name. |
protected jadex.application.space.envsupport.environment.AbstractEnvironmentSpace.AtomicCounter |
objectidcounter
Object id counter for new ids. |
protected Map |
objecttypes
The space object types. |
protected Map |
objecttypesMeta
The space object meta data |
protected Map |
perceptgenerators
The percept generators. |
protected PerceptList |
perceptlist
The list of scheduled percepts. |
protected MultiCollection |
perceptprocessors
The percept processors. |
protected Map |
percepttypes
The percepttypes. |
protected Map |
processes
The environment processes. |
protected Map |
processtypes
The space process types. |
protected Map |
spaceobjects
Long/ObjectIDs (keys) and environment objects (values). |
protected Map |
spaceobjectsbyowner
|
protected Map |
spaceobjectsbytype
Types of EnvironmentObjects and lists of EnvironmentObjects of that type (typed view). |
protected jadex.application.space.envsupport.environment.AbstractEnvironmentSpace.AtomicCounter |
taskidcounter
Task id counter for new ids. |
protected Map |
tasktypes
The object task types. |
protected Map |
views
Available views |
protected Map |
zombieobjects
The zombie objects. |
| Fields inherited from class jadex.application.space.envsupport.environment.SynchronizedPropertyObject |
|---|
monitor |
| Fields inherited from class jadex.commons.SimplePropertyObject |
|---|
pcs, properties |
| Constructor Summary | |
|---|---|
AbstractEnvironmentSpace()
Create an environment space |
|
| Method Summary | |
|---|---|
void |
addAvatarMappings(AvatarMapping mapping)
Adds an avatar mapping. |
void |
addDataConsumer(String name,
ITableDataConsumer consumer)
Add a new data consumer. |
void |
addDataProvider(String name,
ITableDataProvider provider)
Add a new data provider. |
void |
addDataView(String name,
IDataView view)
Adds a view to the space. |
void |
addDataViewMapping(String objecttype,
Map view)
Add a mapping from object type to data view |
void |
addEnvironmentListener(IEnvironmentListener listener)
Add an environment listener. |
void |
addInitialAvatar(IComponentIdentifier ownerid,
String type,
Map props)
Initial settings for the avatar of a specific component. |
void |
addObjectTaskType(String typename,
Class clazz,
List properties)
Add a object task type. |
void |
addPerceptGenerator(Object id,
IPerceptGenerator gen)
Adds a percept generator. |
void |
addPerceptProcessor(String componenttype,
Set percepttypes,
IPerceptProcessor proc)
Add a percept processor. |
void |
addPerceptType(PerceptType percepttype)
Add a space percept type. |
void |
addSpaceAction(String id,
ISpaceAction action)
Adds an space action. |
void |
addSpaceObjectType(String typename,
IPropertyMetaDataSet mobjecttype)
Add a space type. |
void |
addSpaceProcessType(String typename,
Class clazz,
List properties)
Add a space process type. |
void |
addTaskListener(Object taskid,
Object objectid,
IResultListener listener)
Add a result listener to an object task. |
void |
componentAdded(IComponentIdentifier aid)
Called when an component was added. |
void |
componentRemoved(IComponentIdentifier aid)
Called when an component was removed. |
protected ISpaceObject |
createAvatar(IComponentIdentifier owner,
String fullname,
boolean zombie)
Create an avatar. |
Object |
createObjectTask(String typename,
Map properties,
Object objectid)
Creates an object task. |
void |
createPercept(String typename,
Object data,
IComponentIdentifier component,
ISpaceObject avatar)
Create a percept for the given component. |
ISpaceObject |
createSpaceObject(String typename,
Map properties,
List tasks)
Creates an object in this space. |
ISpaceObject |
createSpaceObjectZombie(String typename,
Map properties,
List tasks)
Creates a zombie object in this space. |
void |
createSpaceProcess(String typename,
Map properties)
Creates a space process. |
void |
destroySpaceObject(Object id)
Destroys an object in this space. |
protected void |
fireEnvironmentEvent(EnvironmentEvent event)
Fire an environment event. |
protected void |
fireObjectEvent(SpaceObject object,
String property,
Object value)
Fire an object event. |
ISpaceObject |
getAvatar(IComponentIdentifier owner)
Get the avatar object. |
ISpaceObject |
getAvatar(IComponentIdentifier owner,
String fullname)
Get the avatar object. |
protected AvatarMapping |
getAvatarMapping(String componenttype,
String avatartype)
Get the avatar mapping for an component avatar combination. |
ISpaceObject[] |
getAvatars(IComponentIdentifier owner)
Get the avatar objects. |
ComponentActionList |
getComponentActionList()
Get the list of scheduled component actions |
IComponentIdentifier[] |
getComponents()
Get the avatar objects. |
IApplication |
getContext()
Get the context. |
ITableDataConsumer |
getDataConsumer(String name)
Get a data consumer. |
Collection |
getDataConsumers()
Get the data consumers. |
ITableDataProvider |
getDataProvider(String name)
Get a data provider. |
IDataView |
getDataView(String name)
Gets a specific view. |
Map |
getDataViews()
Get all available dataviews in this space. |
SimpleValueFetcher |
getFetcher()
Get the value fetcher. |
IComponentIdentifier |
getOwner(Object id)
Get the owner of an object. |
PerceptList |
getPerceptList()
Get the list of scheduled percepts. |
PerceptType |
getPerceptType(String percepttype)
Get a space percept type. |
Collection |
getProcesses()
Get the processes. |
Object |
getProperty(String name)
Returns a property. |
ISpaceAction |
getSpaceAction(String id)
Adds an space action. |
ISpaceObject |
getSpaceObject(Object id)
Returns an object in this space. |
ISpaceObject |
getSpaceObject0(Object id)
Returns an object in this space. |
ISpaceObject[] |
getSpaceObjectsByType(String type)
Get all space object of a specific type. |
Collection |
getSpaceObjectsCollection()
Get the space objects. |
ISpaceProcess |
getSpaceProcess(Object id)
Returns a space process. |
Set |
getSpaceProcessNames()
Returns then names of the space processes. |
Collection |
getViews()
Get the views. |
void |
initSpace(IApplication context,
MSpaceInstance config,
IValueFetcher pfetcher)
Create a space. |
void |
initSpaceObject(ISpaceObject ret)
Creates an object in this space. |
protected Map |
mergeProperties(Collection typeprops,
Map properties)
Add type properties to runtime properties. |
protected Map |
mergeProperties(IPropertyMetaDataSet mObjectType,
Map properties)
Add type properties to runtime properties. |
Object |
performSpaceAction(String id,
Map parameters)
Performs a space action. |
void |
performSpaceAction(String id,
Map parameters,
IResultListener listener)
Schedules an space action. |
void |
removeAvatarMappings(AvatarMapping mapping)
Remove an avatar mapping. |
void |
removeDataView(String name)
Removes a view from the space. |
void |
removeEnvironmentListener(IEnvironmentListener listener)
Remove an environment listener. |
void |
removeObjectTask(Object taskid,
Object objectid)
Remove an object task. |
void |
removeObjectTaskType(String typename)
Remove an object task type. |
void |
removePerceptGenerator(Object id)
Remove a percept generator. |
void |
removePerceptProcessor(String componenttype,
IPerceptProcessor proc)
remove a percept processor. |
void |
removePerceptType(String typename)
Remove a space process type. |
void |
removeSpaceAction(String id)
Removes an space action. |
void |
removeSpaceObjectType(String typename)
Remove a space object type. |
void |
removeSpaceProcess(Object id)
Removes a space process. |
void |
removeSpaceProcessType(String typename)
Remove a space process type. |
void |
removeTaskListener(Object taskid,
Object objectid,
IResultListener listener)
Remove a result listener from an object task. |
void |
setFetcher(SimpleValueFetcher fetcher)
Set the fetcher. |
void |
setOwner(Object id,
IComponentIdentifier owner)
Set the owner of an object. |
void |
terminate()
Terminate the space. |
| Methods inherited from class jadex.application.space.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 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface jadex.commons.IPropertyObject |
|---|
getPropertyNames, hasProperty, setProperty |
| Field Detail |
|---|
protected String name
protected IApplication application
protected Map objecttypes
protected Map objecttypesMeta
protected Map tasktypes
protected Map processtypes
protected Map percepttypes
protected Map actions
protected Map perceptgenerators
protected MultiCollection perceptprocessors
protected MultiCollection avatarmappings
protected Map initialavatars
protected MultiCollection dataviewmappings
protected Map processes
protected Map spaceobjects
protected Map spaceobjectsbytype
protected Map spaceobjectsbyowner
protected jadex.application.space.envsupport.environment.AbstractEnvironmentSpace.AtomicCounter objectidcounter
protected jadex.application.space.envsupport.environment.AbstractEnvironmentSpace.AtomicCounter taskidcounter
protected ComponentActionList actionlist
protected PerceptList perceptlist
protected Map views
protected List listeners
protected SimpleValueFetcher fetcher
protected Map dataproviders
protected Map dataconsumers
protected Map zombieobjects
| Constructor Detail |
|---|
public AbstractEnvironmentSpace()
| Method Detail |
|---|
public void initSpace(IApplication context,
MSpaceInstance config,
IValueFetcher pfetcher)
throws Exception
initSpace in interface ISpaceException
public void addSpaceObjectType(String typename,
IPropertyMetaDataSet mobjecttype)
addSpaceObjectType in interface IEnvironmentSpacetypename - The type name.properties - The MobjectType.public void removeSpaceObjectType(String typename)
removeSpaceObjectType in interface IEnvironmentSpacetypename - The type name.
public void addSpaceProcessType(String typename,
Class clazz,
List properties)
addSpaceProcessType in interface IEnvironmentSpacetypename - The type name.properties - The properties.public void removeSpaceProcessType(String typename)
removeSpaceProcessType in interface IEnvironmentSpacetypename - The type name.
public void createSpaceProcess(String typename,
Map properties)
createSpaceProcess in interface IEnvironmentSpacetypename - The type name.properties - The properties.
public void addObjectTaskType(String typename,
Class clazz,
List properties)
addObjectTaskType in interface IEnvironmentSpacetypename - The type name.properties - The properties.public void removeObjectTaskType(String typename)
removeObjectTaskType in interface IEnvironmentSpacetypename - The type name.
public Object createObjectTask(String typename,
Map properties,
Object objectid)
createObjectTask in interface IEnvironmentSpacetypename - The type name.properties - The properties.
public void removeObjectTask(Object taskid,
Object objectid)
removeObjectTask in interface IEnvironmentSpacetypename - The type name.properties - The properties.
public void addTaskListener(Object taskid,
Object objectid,
IResultListener listener)
addTaskListener in interface IEnvironmentSpace
public void removeTaskListener(Object taskid,
Object objectid,
IResultListener listener)
removeTaskListener in interface IEnvironmentSpacepublic Set getSpaceProcessNames()
public ISpaceProcess getSpaceProcess(Object id)
getSpaceProcess in interface IEnvironmentSpaceid - ID of the space process
public void removeSpaceProcess(Object id)
removeSpaceProcess in interface IEnvironmentSpaceid - ID of the space process
public final ISpaceObject createSpaceObject(String typename,
Map properties,
List tasks)
createSpaceObject in interface IEnvironmentSpacetype - the object's typeproperties - initial properties (may be null)tasks - initial task list (may be null)
public ISpaceObject createSpaceObjectZombie(String typename,
Map properties,
List tasks)
type - the object's typeproperties - initial properties (may be null)tasks - initial task list (may be null)
public void initSpaceObject(ISpaceObject ret)
type - the object's typeproperties - initial properties (may be null)tasks - initial task list (may be null)listeners - initial listeners (may be null)
protected Map mergeProperties(Collection typeprops,
Map properties)
typeprops - The type properties (if any).properties - The runtime properties or null.
protected Map mergeProperties(IPropertyMetaDataSet mObjectType,
Map properties)
typeprops - The typeproperties - The runtime properties or null.
public void destroySpaceObject(Object id)
destroySpaceObject in interface IEnvironmentSpaceid - the object's IDpublic ISpaceObject getSpaceObject(Object id)
getSpaceObject in interface IEnvironmentSpaceid - the object's ID
public ISpaceObject getSpaceObject0(Object id)
id - the object's ID
public ISpaceObject[] getSpaceObjectsByType(String type)
getSpaceObjectsByType in interface IEnvironmentSpacetype - The space object type.
public void addAvatarMappings(AvatarMapping mapping)
componenttype - The component type.objecttype - The object type to represent the component.public void removeAvatarMappings(AvatarMapping mapping)
componenttype - The component type.objecttype - The object type to represent the component.
public void addSpaceAction(String id,
ISpaceAction action)
addSpaceAction in interface IEnvironmentSpaceactionId - the action IDaction - the actionpublic ISpaceAction getSpaceAction(String id)
actionId - the action IDaction - the actionpublic void removeSpaceAction(String id)
removeSpaceAction in interface IEnvironmentSpaceactionId - the action ID
public void performSpaceAction(String id,
Map parameters,
IResultListener listener)
performSpaceAction in interface IEnvironmentSpaceid - Id of the actionparameters - parameters for the action (may be null)listener - the result listener
public Object performSpaceAction(String id,
Map parameters)
performSpaceAction in interface IEnvironmentSpaceid - Id of the actionparameters - parameters for the action (may be null)
public void createPercept(String typename,
Object data,
IComponentIdentifier component,
ISpaceObject avatar)
typename - The percept type.data - The content of the percept (if any).component - The component that should receive the percept.public IComponentIdentifier getOwner(Object id)
id - The id.
public void setOwner(Object id,
IComponentIdentifier owner)
setOwner in interface IEnvironmentSpaceid - The object id.pos - The object owner.public ISpaceObject[] getAvatars(IComponentIdentifier owner)
getAvatars in interface IEnvironmentSpacepublic IComponentIdentifier[] getComponents()
public ISpaceObject getAvatar(IComponentIdentifier owner)
getAvatar in interface IEnvironmentSpace
public ISpaceObject getAvatar(IComponentIdentifier owner,
String fullname)
protected ISpaceObject createAvatar(IComponentIdentifier owner,
String fullname,
boolean zombie)
public void addDataView(String name,
IDataView view)
addDataView in interface IEnvironmentSpacename - name of the viewview - the viewpublic void removeDataView(String name)
removeDataView in interface IEnvironmentSpacename - name of the viewpublic IDataView getDataView(String name)
getDataView in interface IEnvironmentSpacename - name of the view
public Map getDataViews()
getDataViews in interface IEnvironmentSpace
public void addDataViewMapping(String objecttype,
Map view)
objecttype - The object type.view - Settings for view creation.public void addEnvironmentListener(IEnvironmentListener listener)
addEnvironmentListener in interface IEnvironmentSpacelistener - The environment listener.public void removeEnvironmentListener(IEnvironmentListener listener)
removeEnvironmentListener in interface IEnvironmentSpacelistener - The environment listener.
public void addPerceptGenerator(Object id,
IPerceptGenerator gen)
addPerceptGenerator in interface IEnvironmentSpaceid - The percept generator id.gen - The percept generator.public void removePerceptGenerator(Object id)
removePerceptGenerator in interface IEnvironmentSpaceid - The percept generator id.
public void addPerceptProcessor(String componenttype,
Set percepttypes,
IPerceptProcessor proc)
componenttype - The component type.proc - The percept processor.
public void removePerceptProcessor(String componenttype,
IPerceptProcessor proc)
componenttype - The component type.proc - The percept processor.public void addPerceptType(PerceptType percepttype)
addPerceptType in interface IEnvironmentSpacetypename - The percept name.objecttypes - The objecttypes.componenttypes - The componenttypes.public void removePerceptType(String typename)
removePerceptType in interface IEnvironmentSpacetypename - The type name.public PerceptType getPerceptType(String percepttype)
getPerceptType in interface IEnvironmentSpacepercepttype - The name of the percept type.
public void componentAdded(IComponentIdentifier aid)
componentAdded in interface ISpaceaid - The id of the added component.public void componentRemoved(IComponentIdentifier aid)
componentRemoved in interface ISpaceaid - The id of the removed component.public IApplication getContext()
getContext in interface IEnvironmentSpacepublic void terminate()
terminate in interface ISpacepublic Object getProperty(String name)
getProperty in interface IPropertyObjectgetProperty in class SynchronizedPropertyObjectname - name of the property
public SimpleValueFetcher getFetcher()
public void setFetcher(SimpleValueFetcher fetcher)
fetcher - The fetcher to set.public Collection getSpaceObjectsCollection()
public Collection getProcesses()
public ComponentActionList getComponentActionList()
public PerceptList getPerceptList()
public Collection getViews()
protected void fireEnvironmentEvent(EnvironmentEvent event)
event - The event.
protected void fireObjectEvent(SpaceObject object,
String property,
Object value)
object - The object.property - The changed property.value - The new property value.
public void addInitialAvatar(IComponentIdentifier ownerid,
String type,
Map props)
ownerid - The component id.type - The object type.props - The properties for the object (if any).
protected AvatarMapping getAvatarMapping(String componenttype,
String avatartype)
public void addDataProvider(String name,
ITableDataProvider provider)
name - The name.provider - The provider.public ITableDataProvider getDataProvider(String name)
name - The name.
public void addDataConsumer(String name,
ITableDataConsumer consumer)
consumer - The consumer.public ITableDataConsumer getDataConsumer(String name)
name - The name.
public Collection getDataConsumers()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||