|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectthings.thing.BASE
things.thing.THING
public abstract class THING
A thing.
The life cycle of a thing (with default behavior: definition -> instance(check parms) -> call ->-> RESULTS -> return -> ERROR -> trap -> RESULTS -> return -> FAULT -> trap -> RESULTS -> propagate
NOTES:
Logging is currently done with a system logger. May want to change that.
Ultimately, RESULT should be reported as Level.DATA. Only the root THING will do so automatically, rolling up the registered results of
any calls, depending on how the THINGS were implements.. A simple INFO logging of each completed THING will be done. Naturally, any THING
can explicitly report results at any time.
Version History
EPG - Initial - 26 FEB 07
Field Summary |
---|
Fields inherited from class things.thing.BASE |
---|
localProperties, localSystemLogger, mySystemInterface |
Constructor Summary | |
---|---|
THING()
|
Method Summary | |
---|---|
void |
ACCEPT_HALT()
Accept a halt. |
void |
ACCEPT_PAUSE()
Accept a pause. |
RESULT |
CALCULATE_RESULT()
Calculate the result based on the defined results and their settings. |
RESULT |
call_chain()
This is the class call point. |
RESULT |
CALL(java.lang.String thingName)
Call a THING. |
void |
CATCH_ERROR(ThingsException te)
Default ERROR trap. |
void |
CATCH_FAULT(ThingsException te)
Default FAULT trap. |
void |
CHECK_REQUIRED()
Make sure all required properties exist. |
void |
DEFINE_RESULT(java.lang.String name,
java.lang.String description,
ResultExpectation expectation)
Define a result. |
abstract void |
DEFINITION()
Definition step. |
void |
EXPRESS(RESULT theResult)
Express a result. |
RESULT |
getInterimResult()
Get the interim result, if available. |
ExpressionInterface |
getParentExpressionInterface()
Get a reference tot he parent expression interface. |
RESULT |
getResult()
Get the final result, if available. |
void |
init(SystemInterface si,
ControlInterface ci,
ExpressionInterface ei,
ExpressionInterface parent)
Initialize this THING. |
MODULE |
INSTANCE(java.lang.String moduleName)
Instantiate a module. |
MODULE |
MODULE(java.lang.String moduleName)
Get a module. |
void |
PAUSING()
The THING is about to pause. |
abstract void |
PROCESS()
The process can only be called once per instance! |
void |
REQUIRE_PROPERTY(java.lang.String name)
Require a property. |
RESULT |
RESULTS(RESULT defaultReport)
Optional result step. |
long |
RUN_TIME()
Get how long the thing has been running in milliseconds. |
RESULT |
RUN(java.lang.String thingName)
Run a THING. |
void |
SET_EXPRESSOR(java.lang.String destination)
Set an expressor. |
void |
SET_RESULT(java.lang.String name,
Data.Type resultType)
Set result based on a result type only. |
void |
SET_RESULT(java.lang.String name,
RESULT result)
Set result based on a complete RESULT. |
void |
UNPAUSING()
The THING is about to unpause. |
Methods inherited from class things.thing.BASE |
---|
CONFIG_PROPERTY_TOOLKIT, GET_LOGGER, GET_NAME, GET_UNIVERSE_ACCESSOR, GET_UNIVERSE, PROPERTY_READER_TOOLKIT, systemInit |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface things.thing.THINGInterface |
---|
GET_UNIVERSE |
Methods inherited from interface things.thing.BASEInterface |
---|
GET_LOGGER |
Constructor Detail |
---|
public THING()
Method Detail |
---|
public abstract void DEFINITION() throws UserException
UserException
public abstract void PROCESS() throws java.lang.Throwable
any
- Throwable. It's important to let InterruptedException's to escape or the system may pound your THING with interruptions.
java.lang.Throwable
public RESULT RESULTS(RESULT defaultReport) throws ThingsException
defaultReport
- the result the system calculated based on defined tests.
ThingException
ThingsException
public void CATCH_FAULT(ThingsException te) throws UserException
te
- the offending exception
UserException
public void CATCH_ERROR(ThingsException te) throws UserException
te
- the offending exception
UserException
public void PAUSING() throws UserException
UserException
public void UNPAUSING() throws UserException
UserException
public MODULE INSTANCE(java.lang.String moduleName) throws UserException, java.lang.InterruptedException
INSTANCE
in interface THINGInterface
moduleName
- the name of the module. This must match the class name for the MODULE or it will not be found and run.
UserException
- or InterruptedException. It's important to let InterruptedException out.
java.lang.InterruptedException
public RESULT CALL(java.lang.String thingName) throws UserException, java.lang.InterruptedException
CALL
in interface THINGInterface
thingName
- the name of the thing. This must match the class name for the THING or it will not be found and run.
UserException
- or InterruptedException. It's important to let InterruptedException out.
java.lang.InterruptedException
public RESULT RUN(java.lang.String thingName) throws UserException, java.lang.InterruptedException
thingName
- the name of the thing. This must match the class name for the THING or it will not be found and run.
UserException
- or InterruptedException. It's important to let InterruptedException out.
java.lang.InterruptedException
public void EXPRESS(RESULT theResult) throws UserException
EXPRESS
in interface THINGInterface
UserException
public void SET_EXPRESSOR(java.lang.String destination) throws UserException
destination
- the destination for the expressions. This is up to the implementation. It might be a universe address or a channel.
UserException
public MODULE MODULE(java.lang.String moduleName) throws UserException, java.lang.InterruptedException
moduleName
- the name of the module. This must match the class name for the MODULE or it will not be found and run.
UserException
- or InterruptedException. It's important to let InterruptedException out.
java.lang.InterruptedException
public long RUN_TIME() throws UserException
RUN_TIME
in interface THINGInterface
UserException
public void ACCEPT_PAUSE()
public void ACCEPT_HALT() throws UserException
UserException
public void DEFINE_RESULT(java.lang.String name, java.lang.String description, ResultExpectation expectation) throws UserException
name
- description
- expectation
-
UserException
public void SET_RESULT(java.lang.String name, Data.Type resultType) throws UserException
name
- the name of the resultresultType
- the result type as defined in Data
a
- UserException, usually only if the result was not defined.
UserException
Data
public void SET_RESULT(java.lang.String name, RESULT result) throws UserException
name
- the name of the resultresult
- the actual result
a
- UserException, usually only if the result was not defined.
UserException
public RESULT CALCULATE_RESULT() throws UserException
UserException
public void REQUIRE_PROPERTY(java.lang.String name) throws UserException
name
-
UserException
public void CHECK_REQUIRED() throws UserException
UserException
public void init(SystemInterface si, ControlInterface ci, ExpressionInterface ei, ExpressionInterface parent) throws UserException
si
- A system interface.ci
- Control interface.ei
- The parent expression interface. If null, nothing will express to it.
UserException
- which will always be a FAULT.public RESULT call_chain() throws UserException, ThingsException, java.lang.InterruptedException
UserException
ThingsException
java.lang.InterruptedException
public RESULT getResult()
public RESULT getInterimResult() throws ThingsException
ThingsException
- for whatever reason. It may come from the THING's RESULTS implementation.public ExpressionInterface getParentExpressionInterface()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |