java.lang.RunnableExampleCompetency, Migration, RemoteCompetency, TestCompetency1, TestCompetency2, TestCompetency3, TestCompetency4, TestCompetency5, TestCompetency6, TestCompetency7, TestCompetency8public abstract class Competency extends CmionComponent implements java.lang.Runnable
| Modifier and Type | Field | Description |
|---|---|---|
protected boolean |
available |
this boolean indicates whether the competency is available or not
|
protected java.lang.String |
competencyName |
the name of the competency, what is it called
|
protected java.lang.String |
competencyType |
the type of the competency, what does it do (competency Execution plans refer
to the type not the name)
|
protected CompetencyExecutionPlan |
plan |
the competency execution plan as part of which this competency was started
|
protected boolean |
running |
this boolean indicates whether the competency is running or not
|
architecture| Constructor | Description |
|---|---|
Competency(IArchitecture architecture) |
create a competency object
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
cancel() |
Competencies can (and should) override this method to allow the execution
system to cancel them.
|
protected abstract boolean |
competencyCode(java.util.HashMap<java.lang.String,java.lang.String> parameters) |
every competency sub class must implement this method and in it perform
the competency code.
|
java.lang.String |
getCompetencyName() |
returns the name of the competency
|
java.lang.String |
getCompetencyType() |
returns the type of the competency
|
abstract void |
initialize() |
custom competency initialisation code should go in here
|
boolean |
isAvailable() |
returns whether the competency is available (i.e.
|
boolean |
isRunning() |
returns whether the competency is currently running or not
|
void |
registerHandlers() |
registers request and event handlers of the competency execution system,
if overridden, remember to call super.registerHandlers(); from within
|
void |
requestStartCompetency(java.util.HashMap<java.lang.String,java.lang.String> parameters,
CompetencyExecutionPlan cep,
long executionID) |
convenience method to schedule a request for starting this competency
|
void |
run() |
this is the thread main method, do not call it directly
|
abstract boolean |
runsInBackground() |
every competency must provide information of whether it will run in the background
permanently (returns true) or whether it will be invoked through the competency
execution system (returns false)
|
void |
setAdditionalData(java.lang.Object data) |
a convenience function (i.e.
|
getArchitecture, isConnected, onDestroy, raiseprotected java.lang.String competencyName
protected java.lang.String competencyType
protected boolean running
protected boolean available
protected CompetencyExecutionPlan plan
public Competency(IArchitecture architecture)
public java.lang.String getCompetencyName()
public java.lang.String getCompetencyType()
public boolean isRunning()
public boolean isAvailable()
public abstract boolean runsInBackground()
protected abstract boolean competencyCode(java.util.HashMap<java.lang.String,java.lang.String> parameters)
throws CompetencyCancelledException
parameters - a map including running parameters and their valuesCompetencyCancelledExceptionpublic abstract void initialize()
public final void run()
run in interface java.lang.Runnablepublic void requestStartCompetency(java.util.HashMap<java.lang.String,java.lang.String> parameters,
CompetencyExecutionPlan cep,
long executionID)
parameters - a map including the parameters that this competence
should work withcep - the competency execution plan, as part of which this competency was started,
or null if the competency was not started by the execution systemexecutionID - public void cancel()
public void registerHandlers()
registerHandlers in class CmionComponentpublic void setAdditionalData(java.lang.Object data)