|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Shows a pool of RouteMessage, reusing any existing RouteMessage as possible.
If it is invoked a getMessage(..) method and no RouteMessage is available,
a new instance is built and returned with the specified values.
When a RouteMessage is free with the freeMessage(RouteMessage) method,
you must ensure that there are not references of the specified RouteMessage
into the current whole network.
For a correct RouteMessagePool operation, the addition of built and reused
RouteMessage should be the same as the free ones.
Method Summary | |
void |
freeMessage(RouteMessage msg)
To free a message only pushing it to be reused. |
int |
getBuiltRouteMessages()
Gets the total number of built RouteMessages. |
int |
getFreeRouteMessages()
Gets the total number of free RouteMessages. |
RouteMessage |
getMessage(java.lang.String key,
NodeHandle from,
NodeHandle to,
int type,
int mode)
Return a RouteMessage with the specified values, setting the nextHop field with the to value. |
RouteMessage |
getMessage(java.lang.String key,
NodeHandle from,
NodeHandle to,
NodeHandle nextHop,
int type,
int mode,
Message msg,
java.lang.String appId)
Builds a new instance of RouteMessage with these specified values. |
int |
getReusedRouteMessages()
Gets the total number of reused RouteMessages. |
Method Detail |
public RouteMessage getMessage(java.lang.String key, NodeHandle from, NodeHandle to, int type, int mode) throws InitializationException
key
- Identification of communication.from
- Source node.to
- Destination node.type
- Type of message.mode
- Mode of message.
InitializationException
- if occurs any error during the
building process.public RouteMessage getMessage(java.lang.String key, NodeHandle from, NodeHandle to, NodeHandle nextHop, int type, int mode, Message msg, java.lang.String appId) throws InitializationException
key
- Key of the communication.from
- Source node.to
- Destination node.nextHop
- Identifies the next hop node.type
- Type of the message.mode
- Mode of the message.msg
- Message to be send in this RouteMessage.appId
- Application that has build this msg.
InitializationException
- if cannot build a new instance
of the RouteMessage.public void freeMessage(RouteMessage msg)
msg
- The RouteMessage to be released.public int getBuiltRouteMessages()
public int getReusedRouteMessages()
public int getFreeRouteMessages()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |