net.i2p.router.tunnel.pool
Class BuildHandler

java.lang.Object
  extended by net.i2p.router.tunnel.pool.BuildHandler
All Implemented Interfaces:
Runnable

 class BuildHandler
extends Object
implements Runnable

Handle the received tunnel build message requests and replies, including sending responsses to requests, updating the lists of our tunnels and participating tunnels, and updating stats. Replies are handled immediately on reception; requests are queued. As of 0.8.11 the request queue is handled in a separate thread, it used to be called from the BuildExecutor thread loop. Note that 10 minute tunnel expiration is hardcoded in here.


Constructor Summary
BuildHandler(RouterContext ctx, TunnelPoolManager manager, BuildExecutor exec)
           
 
Method Summary
 int getInboundBuildQueueSize()
           
(package private)  void init()
          Call the same time you start the threads
 void restart()
           
 void run()
          Thread to handle inbound requests
 void shutdown(int numThreads)
          Cannot be restarted.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BuildHandler

public BuildHandler(RouterContext ctx,
                    TunnelPoolManager manager,
                    BuildExecutor exec)
Method Detail

init

void init()
Call the same time you start the threads

Since:
0.9.18

restart

public void restart()
Since:
0.9

shutdown

public void shutdown(int numThreads)
Cannot be restarted.

Parameters:
numThreads - the number of threads to be shut down
Since:
0.9

run

public void run()
Thread to handle inbound requests

Specified by:
run in interface Runnable
Since:
0.8.11

getInboundBuildQueueSize

public int getInboundBuildQueueSize()