Package cmion.level2
Class RemoteCompetency
- java.lang.Object
-
- ion.Meta.Element
-
- cmion.architecture.CmionComponent
-
- cmion.level2.Competency
-
- cmion.level2.RemoteCompetency
-
- All Implemented Interfaces:
java.lang.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).
-
-
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 protectedRemoteCompetency(IArchitecture architecture)call this constructor from subclasses
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected booleancompetencyCode(java.util.HashMap<java.lang.String,java.lang.String> parameters)the code that is executed when the competency is startedprotected abstract voidprocessMessage(java.lang.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 methodprotected voidreturnFailure()this should be called from the processMessage function whenever the competency has returned unsuccessfullyprotected voidreturnSuccess()this should be called from the processMessage function whenever the competency has returned successfullyprotected abstract voidsendMessage(java.lang.String message)this method should not be implemented by a competency but by a direct subclass e.g.protected abstract voidstartExecution(java.util.HashMap<java.lang.String,java.lang.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-
Methods inherited from class cmion.level2.Competency
cancel, getCompetencyName, getCompetencyType, initialize, isAvailable, isRunning, registerHandlers, requestStartCompetency, run, runsInBackground, setAdditionalData
-
Methods inherited from class cmion.architecture.CmionComponent
getArchitecture, isConnected, onDestroy, raise
-
-
-
-
Constructor Detail
-
RemoteCompetency
protected RemoteCompetency(IArchitecture architecture)
call this constructor from subclasses
-
-
Method Detail
-
competencyCode
protected final boolean competencyCode(java.util.HashMap<java.lang.String,java.lang.String> parameters)
the code that is executed when the competency is started- Specified by:
competencyCodein classCompetency- 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(java.util.HashMap<java.lang.String,java.lang.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(java.lang.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(java.lang.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
-
-