Package cmion.level2
Class RemoteCompetency
java.lang.Object
ion.Meta.Element
cmion.architecture.CmionComponent
cmion.level2.Competency
cmion.level2.RemoteCompetency
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
RemoteTCPCompetency
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, runningFields inherited from class cmion.architecture.CmionComponent
architecture -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedRemoteCompetency(IArchitecture architecture) call this constructor from subclasses -
Method Summary
Modifier and TypeMethodDescriptionprotected final booleancompetencyCode(HashMap<String, String> parameters) the code that is executed when the competency is startedprotected abstract voidprocessMessage(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 final voidthis should be called from the processMessage function whenever the competency has returned unsuccessfullyprotected final voidthis should be called from the processMessage function whenever the competency has returned successfullyprotected abstract voidsendMessage(String message) this method should not be implemented by a competency but by a direct subclass e.g.protected abstract voidstartExecution(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 remotelyMethods inherited from class cmion.level2.Competency
cancel, getCompetencyName, getCompetencyType, initialize, isAvailable, isRunning, registerHandlers, requestStartCompetency, run, runsInBackground, setAdditionalDataMethods inherited from class cmion.architecture.CmionComponent
getArchitecture, isConnected, onDestroy, raiseMethods inherited from class ion.Meta.Element
destroy, getEventFilters, getEventHandlers, getRequestFilters, getRequestHandlers, getSimulation, getUID, schedule, wasDestroyed
-
Constructor Details
-
RemoteCompetency
call this constructor from subclasses
-
-
Method Details
-
competencyCode
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
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
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
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
-