Migrating, MigrationAwarepublic class FAtiMAConnector extends AgentMindConnector implements Migrating, MigrationAware
architecture| Constructor | Description |
|---|---|
FAtiMAConnector(IArchitecture architecture) |
create a new FAtiMA connector that connects to an old version of
FAtiMA that cannot migrate (kept for backwards compatibility)
|
FAtiMAConnector(IArchitecture architecture,
java.lang.String options) |
create a new FAtiMA connector, with an additional options parameter
this can at the moment contain any of the following substrings in any order
- "migrating" : indicates that the fatima connecting here supports migration
(see boolean canMigrate)
- "sleeping" : immediately send this mind to sleep once it is connected, this
is useful, if this platform is awaiting incoming migration and
currently inactive
- "modular" : indicates the fatima connecting is expected to be the recent (2010+) modular version
or an older one
(see boolean modular)
- "persistent": indicates that the fatima connecting is expected to be the recent (15/11/2011+) version
that can disinguish between persistent and non persistent knowledge
(see boolean distinguishPersistent)
|
| Modifier and Type | Method | Description |
|---|---|---|
protected void |
architectureReady() |
informs the mind that the architecture is ready for the mind executing actions
|
void |
awakeMind() |
send a message to FAtiMA telling the mind to resume from a paused state
|
boolean |
distinguishesPersistent() |
returns whether the connected Fatima is expected to distinguish between persistent
and non persistent properties (true) or not (false)
|
void |
execute(MindAction mindAction) |
executes a new action sent by the mind
|
java.lang.String |
getMessageTag() |
This method returns a string that is used to identify the
state that is encoded by the implementing class and to select the
messages that will be delivered to it.
|
boolean |
isConnected() |
returns whether we have a remote mind connected through a socket
|
boolean |
isMindSleeping() |
returns whether FAtiMA is sleeping/paused or not, this function
should be called in conjunction with isConnected, because its return
value makes no sense if no mind is connected
|
void |
notifyAgentConnected(java.lang.String agentName,
java.util.HashMap<java.lang.String,java.lang.Object> properties) |
this is called once FAtiMA has established a connection
|
void |
notifyGetState(java.lang.String state) |
this message is called by the connected fatima listener, when it receives
a state from fatima
|
void |
notifySetState() |
this message is called by the connected fatima listener, when it receives
a state from fatima
|
void |
onMigrationFailure() |
|
void |
onMigrationIn() |
|
void |
onMigrationOut() |
|
void |
onMigrationSuccess() |
|
void |
parseSemanticMemory(java.lang.String msg) |
parse the xml message containing the semantic memory of the connected agent,
use it to update the world model
|
protected void |
processActionCancellation(MindAction a) |
FAtiMA is currently not receiving any cancellation feedback messages,
so we don't need to do anything in here
|
protected void |
processActionFailure(MindAction a) |
report the failure of an action to FAtiMA
|
protected void |
processActionSuccess(MindAction a) |
report the success of an action to FAtiMA
|
protected void |
processEntityAdded(java.lang.String entityName) |
informs the mind that a new entity (agent or object) has been added to the world model
|
protected void |
processEntityRemoved(java.lang.String entityName) |
informs the mind that an entity (agent or object) has been removed from the world model
|
protected void |
processPropertyChanged(java.lang.String entityName,
java.lang.String propertyName,
java.lang.String propertyValue,
boolean persistent) |
informs the mind that a property of an agent or object in the world model has changed
|
protected void |
processPropertyRemoved(java.lang.String entityName,
java.lang.String propertyName) |
informs the mind that a property of an agent or object in the world model has been removed
|
protected void |
processRawMessage(java.lang.String message) |
in this message a mind can parse raw messages containing specialised communication / perceptions / requests
|
protected void |
processRemoteAction(MindAction remoteAction) |
sends a remoteAction (an action that another agent/user has performed) to the mind
|
void |
restoreState(org.w3c.dom.Element message) |
This method parses the XML element provided and restores the
state of the object.
|
org.w3c.dom.Element |
saveState(org.w3c.dom.Document doc) |
This method encodes the current state of the object and other relevant
information in an XML element in order to be migrated.
|
void |
saveStateToDisk() |
|
void |
sendMindToSleep() |
send a message to FAtiMA telling the mind to pause
|
cancel, newAction, onDestroy, registerHandlersgetArchitecture, raisepublic FAtiMAConnector(IArchitecture architecture)
public FAtiMAConnector(IArchitecture architecture, java.lang.String options)
public void awakeMind()
awakeMind in class AgentMindConnectorpublic boolean isMindSleeping()
isMindSleeping in class AgentMindConnectorprotected void processActionFailure(MindAction a)
processActionFailure in class AgentMindConnectorprotected void processActionSuccess(MindAction a)
processActionSuccess in class AgentMindConnectorprotected void processActionCancellation(MindAction a)
processActionCancellation in class AgentMindConnectorprotected void processRemoteAction(MindAction remoteAction)
AgentMindConnectorprocessRemoteAction in class AgentMindConnectorpublic void sendMindToSleep()
sendMindToSleep in class AgentMindConnectorprotected void processEntityAdded(java.lang.String entityName)
AgentMindConnectorprocessEntityAdded in class AgentMindConnectorprotected void processEntityRemoved(java.lang.String entityName)
AgentMindConnectorprocessEntityRemoved in class AgentMindConnectorprotected void processPropertyChanged(java.lang.String entityName,
java.lang.String propertyName,
java.lang.String propertyValue,
boolean persistent)
AgentMindConnectorprocessPropertyChanged in class AgentMindConnectorprotected void processPropertyRemoved(java.lang.String entityName,
java.lang.String propertyName)
AgentMindConnectorprocessPropertyRemoved in class AgentMindConnectorpublic void notifyAgentConnected(java.lang.String agentName,
java.util.HashMap<java.lang.String,java.lang.Object> properties)
public boolean isConnected()
isConnected in class CmionComponentprotected void architectureReady()
AgentMindConnectorarchitectureReady in class AgentMindConnectorpublic java.lang.String getMessageTag()
MigratinggetMessageTag in interface Migratingpublic void onMigrationFailure()
onMigrationFailure in interface MigrationAwarepublic void onMigrationIn()
onMigrationIn in interface MigrationAwarepublic void onMigrationOut()
onMigrationOut in interface MigrationAwarepublic void onMigrationSuccess()
onMigrationSuccess in interface MigrationAwarepublic void restoreState(org.w3c.dom.Element message)
MigratingrestoreState in interface Migratingmessage - An XML element that contains the state to be parsedpublic void saveStateToDisk()
public org.w3c.dom.Element saveState(org.w3c.dom.Document doc)
Migratingpublic void notifyGetState(java.lang.String state)
public void notifySetState()
public void execute(MindAction mindAction)
public boolean distinguishesPersistent()
protected void processRawMessage(java.lang.String message)
AgentMindConnectorprocessRawMessage in class AgentMindConnectorpublic void parseSemanticMemory(java.lang.String msg)