Package cmion.addOns.level2
Class RemoteAirCompetency
- java.lang.Object
-
- ion.Meta.Element
-
- cmion.architecture.CmionComponent
-
- cmion.level2.Competency
-
- cmion.level2.RemoteCompetency
-
- cmion.addOns.level2.RemoteAirCompetency
-
- All Implemented Interfaces:
java.lang.Runnable
public abstract class RemoteAirCompetency extends cmion.level2.RemoteCompetencyThis class implements the base class for remote competencies that connect to their remote counterpart via the PsyClone framework (see http://www.mindmakers.org/projects/Psyclone)
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedRemoteAirCompetency(cmion.architecture.IArchitecture architecture, java.lang.String name, java.lang.String hostName, int port, java.lang.String whiteBoard, java.lang.String[] sendMsgTypes, java.lang.String[] rcvMsgTypes)Create a new air competency
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidinitialize()initializes the Air Plugprotected abstract voidprocessMessage(java.lang.String message, java.lang.String type)this method will be invoked in parallel with processMessage(String message), whenever a new message is received.protected voidsendMessage(java.lang.String message)use this method to send a message to the remotely connected Psyclone framework.protected voidsendMessage(java.lang.String message, java.lang.String msgType)use this method to send a message of a particular type to the remotely connected Psyclone framework-
Methods inherited from class cmion.level2.RemoteCompetency
competencyCode, processMessage, returnFailure, returnSuccess, startExecution
-
Methods inherited from class cmion.level2.Competency
cancel, getCompetencyName, getCompetencyType, isAvailable, isRunning, registerHandlers, requestStartCompetency, run, runsInBackground, setAdditionalData
-
Methods inherited from class cmion.architecture.CmionComponent
getArchitecture, isConnected, onDestroy, raise
-
-
-
-
Constructor Detail
-
RemoteAirCompetency
protected RemoteAirCompetency(cmion.architecture.IArchitecture architecture, java.lang.String name, java.lang.String hostName, int port, java.lang.String whiteBoard, java.lang.String[] sendMsgTypes, java.lang.String[] rcvMsgTypes)Create a new air competency- Parameters:
architecture- a reference to the architecturename- the name we use to identify ourselves in the PsyClone frameworkhostName- the name of the host we want to connect to (the machine that runs the psyclone framework)port- the port we use for connectingwhiteBoard- the white board we are connecting tosendMsgTypes- the types of the messages that we are sendingrcvMsgTypes- the types of the messages that we are receiving
-
-
Method Detail
-
sendMessage
protected void sendMessage(java.lang.String message)
use this method to send a message to the remotely connected Psyclone framework. Call it typically from the startExecution method or from an event handler Note: you should use this if this competency is only registered for one type of send messages, if it is registered for more, you should use sendMessage(String message, String msgType) to specify the type of the message. If no sendMsgTypes are registered, nothing will be sent- Specified by:
sendMessagein classcmion.level2.RemoteCompetency
-
sendMessage
protected void sendMessage(java.lang.String message, java.lang.String msgType)use this method to send a message of a particular type to the remotely connected Psyclone framework
-
processMessage
protected abstract void processMessage(java.lang.String message, java.lang.String type)this method will be invoked in parallel with processMessage(String message), whenever a new message is received. Use this version if the competency has more than one receive msg types and you need to distinguish the type of message. Both methods have to implemented, but only one the body of one of them should be programmed out
-
initialize
public void initialize()
initializes the Air Plug- Specified by:
initializein classcmion.level2.Competency
-
-