|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
The heart of the whole comunication system.
It takes care of handling the entities communication with each other.
The data structure offered by the Communication Thread should be used
by this plugin in order to perform the real comm stuff between the
entities.
We encourage you to write your own custom communication handlers
or even better versions of the current existing ones. (Local, Distribuited)
Written: Radu Sion
Version: 0.25
Source: CommunicationHandler.java
Visit
Smart Software
Entity,
ConnectServerThread,
CommunicationServerThread| Method Summary | |
boolean |
addNewEntity(Entity e)
Called each time inside the host's CommunicationServerThread addNewEntity() as last statement, AFTER the new entity is inserted into the Communication ServerThread's structures, BEFORE starting the entity through Entity.up() This gives the handler the oportunity to maybe change the default message handler of this entity and to perform maybe other tasks. |
boolean |
communicate()
This method is called periodically by the CommunicationServerThread inside a loop. |
boolean |
dispatchMessage(Message msg)
Tries to handle a message and to send it to it's destination. |
java.lang.String |
getCommunicationHandlerVersion()
Returns a version string of this handler. |
void |
initCommunicationHandler()
Called AFTER the host's CommunicationServerThread constructor finishes, inside that constructor, as last statement BEFORE starting the time base. |
void |
remove(Entity eid)
Called each time the CommunicationServerThread.remove() is called, BEFORE really entering the removal procedure. |
void |
setBasicVars(CommunicationServerThread c,
SimpleProperties rhash)
This is like some sort of constructor for the communication handler and gets called right after instantiating the handler. |
| Method Detail |
public java.lang.String getCommunicationHandlerVersion()
public void setBasicVars(CommunicationServerThread c,
SimpleProperties rhash)
c - Host threadrhash - SimpleProperties to use in setting internal resourcesCommunicationServerThreadpublic void initCommunicationHandler()
public boolean addNewEntity(Entity e)
throws SimpleException
e - The just added Entitypublic void remove(Entity eid)
eid - Entity going to be removedpublic boolean communicate()
public boolean dispatchMessage(Message msg)
Message - to send
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||