|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cz.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 Token |
COMPONENT_ID
|
protected java.lang.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 java.lang.String |
WORKER_THREAD_NAME_PREFIX
Name prefix for the worker thread and for the logs. |
protected java.lang.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 | |
---|---|
Token |
getComponentId()
Unique identification of the component. |
LogCategory |
getLog()
|
void |
setConsumer(IWorldChangeEventInput consumer)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Token COMPONENT_ID
public static final java.lang.String WORKER_THREAD_NAME_PREFIX
protected cz.cuni.amis.pogamut.base.communication.mediator.impl.Mediator.Worker worker
protected java.lang.Thread workerThread
protected java.lang.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 Token getComponentId()
IComponent
getComponentId
in interface IComponent
public LogCategory getLog()
public void setConsumer(IWorldChangeEventInput consumer)
setConsumer
in interface IMediator
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |