|
||||||||||
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.translator.impl.WorldMessageTranslator
public class WorldMessageTranslator
Abstract class for translators between world messages (InfoObjects) and IWorldEvents. It implements IWorldEventOutput interface meaning it can be given to the mediator as the source for IWorldEvents. It is constructed with parser that should provide parsed messages (translated text messages from the world to the java object wrappers) + IWorldMessageHandler that is given those parsed messages to produce IWorldEvents. It should process those messages into IWorldEvents and return them.
Ignores IComponentControlHelper.startPaused()
, performs IComponentControlHelper.start()
in both start cases.
Field Summary | |
---|---|
static cz.cuni.amis.utils.token.Token |
COMPONENT_ID
|
protected IWorldMessageTranslator |
handler
|
protected LogCategory |
log
|
protected IWorldMessageParser |
parser
Parser of the world messages, may be used to get additional messages. |
Constructor Summary | |
---|---|
WorldMessageTranslator(IWorldMessageParser parser,
IWorldMessageTranslator messageHandler,
IComponentBus eventBus,
IAgentLogger logger)
|
Method Summary | |
---|---|
cz.cuni.amis.utils.token.Token |
getComponentId()
Unique identification of the component. |
IWorldChangeEvent |
getEvent()
Returns next event of the world. |
Logger |
getLog()
|
protected IWorldChangeEvent[] |
processMessage(InfoMessage message)
Method for translating messages into events. |
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
protected IWorldMessageParser parser
protected LogCategory log
protected IWorldMessageTranslator handler
Constructor Detail |
---|
@Inject public WorldMessageTranslator(IWorldMessageParser parser, IWorldMessageTranslator messageHandler, IComponentBus eventBus, IAgentLogger logger)
Method Detail |
---|
public cz.cuni.amis.utils.token.Token getComponentId()
IComponent
getComponentId
in interface IComponent
public Logger getLog()
protected IWorldChangeEvent[] processMessage(InfoMessage message) throws TranslatorException
message
-
WorldMessageHandlerException
TranslatorException
public IWorldChangeEvent getEvent() throws ComponentNotRunningException, ComponentPausedException
IWorldChangeEventOutput
May block.
getEvent
in interface IWorldChangeEventOutput
ComponentNotRunningException
ComponentPausedException
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |