Package net.i2p.router
Class InNetMessagePool
java.lang.Object
net.i2p.router.InNetMessagePool
- All Implemented Interfaces:
Service
Manage a pool of inbound InNetMessages. This pool is filled by the
Network communication system when it receives messages, and various jobs
periodically retrieve them for processing.
Actually, this doesn't 'pool' anything, since DISPATCH_DIRECT = true.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
add
(I2NPMessage messageBody, RouterIdentity fromRouter, Hash fromRouterHash) Add a new message to the pool.int
handleReplies
(I2NPMessage messageBody) registerHandlerJobBuilder
(int i2npMessageType, HandlerJobBuilder builder) void
renderStatusHTML
(Writer out) void
restart()
does nothing since we aren't threadedvoid
shutdown()
does nothing since we aren't threadedvoid
startup()
does nothing since we aren't threaded
-
Constructor Details
-
InNetMessagePool
-
-
Method Details
-
registerHandlerJobBuilder
- Returns:
- previous builder for this message type, or null
- Throws:
ArrayIndexOutOfBoundsException
- if i2npMessageType is greater than MAX_I2NP_MESSAGE_TYPE
-
add
Add a new message to the pool. If there is a HandlerJobBuilder for the inbound message type, the message is loaded into a job created by that builder and queued up for processing instead (though if the builder doesn't create a job, it is added to the pool)- Parameters:
messageBody
- non-nullfromRouter
- may be nullfromRouterHash
- may be null, calculated from fromRouter if null- Returns:
- -1 for some types of errors but not all; 0 otherwise (was queue length, long ago)
-
handleReplies
-
renderStatusHTML
- Specified by:
renderStatusHTML
in interfaceService
-
restart
public void restart()does nothing since we aren't threaded -
shutdown
public void shutdown()does nothing since we aren't threaded -
startup
public void startup()does nothing since we aren't threaded
-