|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectcz.cuni.amis.pogamut.base.communication.mediator.impl.Mediator
public class Mediator
This class should wrap the reading thread that continuously reads
IWorldChangeEvent from the IWorldChangeEventOutput
passing them to the without any delay.
Note that the mediator **NEEDS** setConsumer(IWorldChangeEventInput) called in order to be started
by the IComponentBus.
Ignores IComponentControlHelper.startPaused(), performs IComponentControlHelper.start() in both start cases.
| Field Summary | |
|---|---|
static cz.cuni.amis.utils.token.Token |
COMPONENT_ID
|
protected Object |
threadMutex
Mutex for start synchronization. |
protected cz.cuni.amis.pogamut.base.communication.mediator.impl.Mediator.Worker |
worker
Worker instance - it implements Runnable interface and is continuously reading messages from the connection object and passing them to the receiver. |
static String |
WORKER_THREAD_NAME_PREFIX
Name prefix for the worker thread and for the logs. |
protected Thread |
workerThread
Thread of the worker. |
| Constructor Summary | |
|---|---|
Mediator(IWorldChangeEventOutput producer,
IComponentBus bus,
IAgentLogger logger)
The object in passed to the constructor (IWorldEventOutput) is world event producer. |
|
| Method Summary | |
|---|---|
cz.cuni.amis.utils.token.Token |
getComponentId()
Unique identification of the component. |
LogCategory |
getLog()
|
void |
setConsumer(IWorldChangeEventInput consumer)
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final cz.cuni.amis.utils.token.Token COMPONENT_ID
public static final String WORKER_THREAD_NAME_PREFIX
protected cz.cuni.amis.pogamut.base.communication.mediator.impl.Mediator.Worker worker
protected Thread workerThread
protected Object threadMutex
| Constructor Detail |
|---|
@Inject
public Mediator(IWorldChangeEventOutput producer,
IComponentBus bus,
IAgentLogger logger)
The mediator will read events from this producer and pass them to the IWorldEventInput specified during the start() of the mediator.
Note that the mediator **NEEDS** setConsumer(IWorldChangeEventInput) called in order to be started
by the IComponentBus.
connection - messageParser - commandSerializer -
CommunicationException| Method Detail |
|---|
public cz.cuni.amis.utils.token.Token getComponentId()
IComponent
getComponentId in interface IComponentpublic LogCategory getLog()
public void setConsumer(IWorldChangeEventInput consumer)
setConsumer in interface IMediatorpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||