Package cmion.level2

Class RemoteCompetency

java.lang.Object
ion.Meta.Element
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
RemoteTCPCompetency

public abstract class RemoteCompetency extends Competency
an abstract class describing a competency, whose main execution is performed remotely, in a different executable (possibly on a different machine) and that we communicate with over the network. This should not be subclassed directly by a competency implementation, but by another abstract class that adds the details of a certain network communication technology (e.g. TCP).
  • Constructor Details

    • RemoteCompetency

      protected RemoteCompetency(IArchitecture architecture)
      call this constructor from subclasses
  • Method Details

    • competencyCode

      protected final boolean competencyCode(HashMap<String,String> parameters)
      the code that is executed when the competency is started
      Specified by:
      competencyCode in class Competency
      Parameters:
      parameters - a map including running parameters and their values
      Returns:
      the return value of this method should indicate, whether the competency execution was a success (true) or failure (false)
    • startExecution

      protected abstract void startExecution(HashMap<String,String> parameters)
      this method will be called when execution of the competency is invoked, in here a command should be sent over the socket, starting the competency remotely
    • processMessage

      protected abstract void processMessage(String message)
      this method will be called whenever a message is received from the remote competency, if the message gives an indication about failure or success of the remote competency than returnSuccess or returnFailure should be called at the end of this method
    • sendMessage

      protected abstract void sendMessage(String message)
      this method should not be implemented by a competency but by a direct subclass e.g. Remote TCPClient competency
    • returnSuccess

      protected final void returnSuccess()
      this should be called from the processMessage function whenever the competency has returned successfully
    • returnFailure

      protected final void returnFailure()
      this should be called from the processMessage function whenever the competency has returned unsuccessfully