java.lang.Object
net.i2p.router.ClientMessagePool

public class ClientMessagePoolextends Object
Manage all of the inbound and outbound client messages maintained by the router. The ClientManager subsystem fetches messages from this for locally deliverable messages and adds in remotely deliverable messages. Remotely deliverable messages are picked up by interested jobs and processed and transformed into an OutNetMessage to be eventually placed in the OutNetMessagePool.
  • Field Details

    • _log

      private final Log _log
      Logger for this class.
    • _context

      private final RouterContext _context
      The router context the pool runs in.
    • _cache

      private final OutboundCache _cache
      Messages waiting for their tunnel's reply.
  • Constructor Details

    • ClientMessagePool

      public ClientMessagePool(RouterContext context)
      Create a new ClientMessagePool.
      Parameters:
      context - the router context
  • Method Details

    • getCache

      public OutboundCache getCache()
      The outbound cache for this message pool.
      Returns:
      the OutboundCache instance
    • shutdown

      public void shutdown()
      Shutdown the client message pool and clear all caches.
    • restart

      public void restart()
      Restart the client message pool.
    • add

      public void add(ClientMessage msg)
      Add a new client message to the pool. The message is either locally or remotely destined.
      Parameters:
      msg - the ClientMessage to add
    • add

      public void add(ClientMessage msg, boolean isDefinitelyRemote)
      Add a new client message with knowledge of whether it's remote.

      If we're coming from the client subsystem itself, we already know whether the target is definitely remote and as such don't need to recheck ourselves, but if we aren't certain, we want it to check for us.

      Parameters:
      msg - the ClientMessage to add
      isDefinitelyRemote - true if we know for sure that the target is not local