|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
eu.semaine.components.Component
public class Component
The abstract base class for all components. Subclasses need to:
act()
and/or react(SEMAINEMessage)
to do something meaningful.
Nested Class Summary | |
---|---|
static class |
Component.State
States of components that can be reported to the system meta component. |
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
protected java.util.concurrent.BlockingQueue<Receiver> |
inputWaiting
|
protected boolean |
isInput
|
protected boolean |
isOutput
|
protected JMSLogger |
log
|
protected MetaMessenger |
meta
|
protected java.util.List<Receiver> |
receivers
|
protected java.util.List<Sender> |
senders
|
protected Component.State |
state
|
protected int |
waitingTime
|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
protected |
Component(java.lang.String componentName)
|
protected |
Component(java.lang.String componentName,
boolean isInput,
boolean isOutput)
|
Method Summary | |
---|---|
protected void |
act()
Proactive actions. |
protected void |
customStartIO()
Any custom startup code can go here. |
protected boolean |
exitRequested()
|
void |
messageAvailableFrom(Receiver source)
Method called from the corresponding receiver thread, to notify us that a message is available. |
protected void |
react(SEMAINEMessage message)
Reactions to messages. |
void |
requestExit()
Ask this component to exit as soon as possible. |
void |
run()
|
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected boolean isInput
protected boolean isOutput
protected java.util.List<Receiver> receivers
protected java.util.List<Sender> senders
protected java.util.concurrent.BlockingQueue<Receiver> inputWaiting
protected JMSLogger log
protected Component.State state
protected MetaMessenger meta
protected int waitingTime
Constructor Detail |
---|
protected Component(java.lang.String componentName) throws javax.jms.JMSException
javax.jms.JMSException
protected Component(java.lang.String componentName, boolean isInput, boolean isOutput) throws javax.jms.JMSException
javax.jms.JMSException
Method Detail |
---|
public void messageAvailableFrom(Receiver source)
messageAvailableFrom
in interface SEMAINEMessageAvailableListener
source
- the receiver that has a message available.protected void customStartIO() throws java.lang.Exception
java.lang.Exception
- if anything goes wrong in the internal processing of the component.public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
protected boolean exitRequested()
public void requestExit()
protected void act() throws java.lang.Exception
waitingTime
milliseconds if no messages arrive, and after every message processing.
This base implementation does nothing; subclasses should implement
suitable behaviour here.
javax.jms.JMSException
- if communication with the JMS server goes wrong.
java.lang.Exception
- if anything goes wrong in the internal processing of the component.protected void react(SEMAINEMessage message) throws java.lang.Exception
javax.jms.JMSException
- if communication with the JMS server goes wrong.
java.lang.Exception
- if anything goes wrong in the internal processing of the component.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |