|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthkontrol.core.AbstractAction
public abstract class AbstractAction
AbstractAction is the base class for any action that can be executed by a HKontrol rule.
To implement a new action (named MyAction in module mymodule)
hkontrol.module.mymodule.action,hkontrol.module.mymodule.action.MyAction
derived from AbstractAction,execute method.getConfig for details on its
configuration.
| Constructor Summary | |
|---|---|
protected |
AbstractAction()
The default constructor actually does NOT initialize the object. |
| Method Summary | |
|---|---|
void |
construct(Configuration.Entry config)
Replaces the empty default constructor and must be called immediately after object instantiation. |
abstract void |
execute(ImmutableState state)
Gets called if the action is triggered by a matching rule. |
protected Configuration.Entry |
getConfig()
|
protected HKConnection |
getConnection()
returns a HKConnection object if a connection is
associated with the calling module instance. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected AbstractAction()
contruct method must be called after instantiation.
Doing it that way, the derived actions are not being enforced to implement
a constructor.
| Method Detail |
|---|
public final void construct(Configuration.Entry config)
construct is final and
the creation of action objects take place in the HKontrol core, the
derived actions do not need to know anything about the instantiation
details.
config - the configuration element referring to the instantiated
action.protected Configuration.Entry getConfig()
public abstract void execute(ImmutableState state)
protected HKConnection getConnection()
throws ModuleException
HKConnection object if a connection is
associated with the calling module instance.
null if no connection
is configured
ModuleException - if connection could not be established
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||