## net.i2p.router
Class OutNetMessagePool

    java.lang.Object
      net.i2p.router.OutNetMessagePool

    public class OutNetMessagePool

extends Object

Maintain a pool of OutNetMessages destined for other routers, organized by priority, expiring messages as necessary. This pool is populated by anything that wants to send a message, and the communication subsystem periodically retrieves messages for delivery.

Constructor Summary
`OutNetMessagePool(RouterContext context)`

Method Summary
`void` `add(OutNetMessage msg)` Add a new message to the pool
`void` `clearExpired()` Clear any messages that have expired, enqueuing any appropriate jobs
`void` `dumpPoolInfo()`
`int` `getCount()` Retrieve the number of messages, regardless of priority.
`int` `getCount(int priority)` Retrieve the number of messages at the given priority.
`OutNetMessage` `getNext()` Remove the highest priority message, or null if none are available.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### OutNetMessagePool

    public OutNetMessagePool(RouterContext context)

Method Detail

### getNext

    public OutNetMessage getNext()

  Remove the highest priority message, or null if none are available.

### add

    public void add(OutNetMessage msg)

  Add a new message to the pool

### clearExpired

    public void clearExpired()

  Clear any messages that have expired, enqueuing any appropriate jobs

### getCount

    public int getCount()

  Retrieve the number of messages, regardless of priority.

### getCount

    public int getCount(int priority)

  Retrieve the number of messages at the given priority. This can be used for subsystems that maintain a pool of messages to be sent whenever there is spare time, where all of these 'spare' messages are of the same priority.

### dumpPoolInfo

    public void dumpPoolInfo()