Class RemoteAirCompetency

  • All Implemented Interfaces:
    java.lang.Runnable

    public abstract class RemoteAirCompetency
    extends cmion.level2.RemoteCompetency
    This 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)
    • Field Summary

      • Fields inherited from class cmion.level2.Competency

        available, competencyName, competencyType, plan, running
      • Fields inherited from class cmion.architecture.CmionComponent

        architecture
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      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
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void initialize()
      initializes the Air Plug
      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.
      protected void sendMessage​(java.lang.String message)
      use this method to send a message to the remotely connected Psyclone framework.
      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
      • 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
      • Methods inherited from class ion.Meta.Element

        destroy, getEventFilters, getEventHandlers, getRequestFilters, getRequestHandlers, getSimulation, getUID, schedule, wasDestroyed
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 architecture
        name - the name we use to identify ourselves in the PsyClone framework
        hostName - the name of the host we want to connect to (the machine that runs the psyclone framework)
        port - the port we use for connecting
        whiteBoard - the white board we are connecting to
        sendMsgTypes - the types of the messages that we are sending
        rcvMsgTypes - 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:
        sendMessage in class cmion.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:
        initialize in class cmion.level2.Competency