|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.google.inject.AbstractModule cz.cuni.amis.pogamut.base.factory.guice.GuiceAgentModule<PARAMS> cz.cuni.amis.pogamut.base.factory.guice.GuiceCommunicationModule<PARAMS>
public class GuiceCommunicationModule<PARAMS extends IAgentParameters>
Base GaviaLib Guice module that covers the simple bindings for Pogamut's communication chain.
Mapped class | Target | Description | |
---|---|---|---|
IWorldReaderProvider | -> | Reader of the world's information. | |
IWorldWriterProvider | -> | Writer that sends commands to the agent's body in the world. | |
ICommandSerializer | -> | StringCommandSerializer | Serializes commands using .toString() method. |
IWorldChangeEventOutput | -> | WorldMessageTranslator | Translator of InfoMessage s into IWorldChangeEvent s. Relies on the wrapped (world-dependent) implementation of IWorldMessageTranslator |
IMediator | -> | Mediator | Thread-wrapper, reader of IWorldChangeEventOutput that passes IWorldChangeEvent into IWorldChangeEventInput . |
IWorldChangeEventInput | -> | IWorldView | Consumer of IWorldChangeEvent s. |
To have successful module the descendant must specify these missing bindings:
Mapped class | Description |
---|---|
IAgent | Agent that should be instantiated |
IWorldConnection | Connection to the agent's world. |
IWorldMessageParser | Line oriented parser based on Yylex. |
IYylex | World message parser implementation. |
IYylexObserver | Yylex observer reporting errors. |
IWorldMessageTranslator | World-dependent implementation of InfoMessage s translator into IWorldChangeEvent that can be consumed by IWorldView . |
IWorldView | World view processing {@link IWorldChangeEvent}s into {@link IWorldEvent}s that should be consumed by {@link IAgent} implementation. |
... don't forget to call super.configureModules() in the subclasses. ;-)
If you want to bind custom (your own) class to one of the interface that is already binded (meaning you need to alter GaviaLib), do it this way:
Constructor Summary | |
---|---|
GuiceCommunicationModule()
|
Method Summary | |
---|---|
protected void |
configureModules()
Override to create new module with your own bindings adding it into GuiceAgentModule.modules using GuiceCommunicationModule#addModule(Module) . |
Methods inherited from class cz.cuni.amis.pogamut.base.factory.guice.GuiceAgentModule |
---|
addModule, configure, createAgentScope, getAgentIdProvider, getAgentParamsProvider, getAgentScope, prepareNewAgent |
Methods inherited from class com.google.inject.AbstractModule |
---|
addError, addError, addError, bind, bind, bind, bindConstant, binder, bindInterceptor, bindListener, bindScope, configure, convertToTypes, currentStage, getMembersInjector, getMembersInjector, getProvider, getProvider, install, requestInjection, requestStaticInjection, requireBinding, requireBinding |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GuiceCommunicationModule()
Method Detail |
---|
protected void configureModules()
GuiceAgentModule.modules
using GuiceCommunicationModule#addModule(Module)
.
See configureModules()
source code for the example (utilizes anonymous class, instantiating AbstractModule
).
configureModules
in class GuiceAgentModule<PARAMS extends IAgentParameters>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |