Package net.i2p.router.transport
Class OutboundMessageRegistry
java.lang.Object
net.i2p.router.transport.OutboundMessageRegistry
Tracks outbound messages.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetOriginalMessages
(I2NPMessage message) Retrieve all messages that are waiting for the specified message.registerPending
(MessageSelector replySelector, ReplyJob onReply, Job onTimeout) Registers a new, empty OutNetMessage, with the reply and timeout jobs specified.void
Register the message.void
renderStatusHTML
(Writer out) Deprecated.unusedvoid
restart()
void
shutdown()
Does something @since 0.8.8void
-
Constructor Details
-
OutboundMessageRegistry
-
-
Method Details
-
shutdown
public void shutdown()Does something @since 0.8.8 -
restart
public void restart()- Since:
- 0.8.8
-
getOriginalMessages
Retrieve all messages that are waiting for the specified message. In addition, those matches may include instructions to either continue or not continue waiting for further replies - if it should continue, the matched message remains in the registry, but if it shouldn't continue, the matched message is removed from the registry. This is called only by InNetMessagePool. TODO this calls isMatch() in the selectors from inside the lock, which can lead to deadlocks if the selector does too much in isMatch(). Remove the lock if possible.- Parameters:
message
- Payload received that may be a reply to something we sent- Returns:
- non-null List of OutNetMessage describing messages that were waiting for the payload
-
registerPending
public OutNetMessage registerPending(MessageSelector replySelector, ReplyJob onReply, Job onTimeout) Registers a new, empty OutNetMessage, with the reply and timeout jobs specified. The onTimeout job is called at replySelector.getExpiration() (if no reply is received by then)- Parameters:
replySelector
- non-null; The same selector may be used for more than one message.onReply
- non-nullonTimeout
- may be null- Returns:
- a dummy OutNetMessage where getMessage() is null. Use it to call unregisterPending() later if desired.
-
registerPending
Register the message. Each message must have a non-null selector at msg.getReplySelector(). The same selector may be used for more than one message.- Parameters:
msg
- msg.getMessage() and msg.getReplySelector() must be non-null
-
unregisterPending
- Parameters:
msg
- may be be null, if non-null should have a non-null selector
-
renderStatusHTML
Deprecated.unused- Throws:
IOException
-