|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.I2PAppContext
net.i2p.router.RouterContext
public class RouterContext
Build off the core I2P context to provide a root for a router instance to coordinate its resources. Router instances themselves should be sure to have their own RouterContext, and rooting off of it will allow multiple routers to operate in the same JVM without conflict (e.g. sessionTags wont get intermingled, nor will their netDbs, jobQueues, or bandwidth limiters).
Field Summary |
---|
Fields inherited from class net.i2p.I2PAppContext |
---|
_clock, _clockInitialized, _globalAppContext, _keyRing, _keyRingInitialized, _overrideProps, _sessionKeyManager, _sessionKeyManagerInitialized, _shutdownTasks |
Constructor Summary | |
---|---|
RouterContext(Router router)
Caller MUST call initAll() after instantiation. |
|
RouterContext(Router router,
Properties envProps)
Caller MUST call initAll() after instantiation. |
Method Summary | |
---|---|
void |
addFinalShutdownTask(Runnable task)
The last thing to be called before router shutdown. |
void |
addPropertyCallback(I2PProperties.I2PPropertyCallback callback)
Add a callback, which will fire upon changes in the property given in the specific callback. |
FIFOBandwidthLimiter |
bandwidthLimiter()
Coordinate this router's bandwidth limits |
Banlist |
banlist()
who does this peer hate? |
Blocklist |
blocklist()
|
ClientAppManager |
clientAppManager()
The RouterAppManager. |
ClientManagerFacade |
clientManager()
How are we coordinating clients for the router? |
ClientMessagePool |
clientMessagePool()
Where do we toss messages for the clients (and where do we get client messages to forward on from)? |
CommSystemFacade |
commSystem()
How do we pass messages from our outNetMessagePool to another router |
GarlicMessageParser |
garlicMessageParser()
Since we only need one. |
(package private) static List<RouterContext> |
getContexts()
Same as listContexts() but package private and modifiable. |
(package private) Set<Runnable> |
getFinalShutdownTasks()
|
Properties |
getProperties()
Access the configuration attributes of this context, listing the properties provided during the context construction, as well as the ones included in System.getProperties. |
String |
getProperty(String propName)
Tie in the router's config as properties, as well as whatever the I2PAppContext says. |
int |
getProperty(String propName,
int defaultVal)
Return an int with an int default |
long |
getProperty(String propName,
long defaultVal)
Return a long with a long default |
String |
getProperty(String propName,
String defaultVal)
Tie in the router's config as properties, as well as whatever the I2PAppContext says. |
void |
initAll()
The following properties may be used to replace various parts of the context with dummy implementations for testing, by setting the property to "true": |
protected void |
initializeClock()
|
protected void |
initializeKeyRing()
|
protected void |
initializeSessionKeyManager()
As of 0.9.15, this returns a dummy SessionKeyManager in I2PAppContext. |
InNetMessagePool |
inNetMessagePool()
Where do we get network messages from (aka where does the comm system dump what it reads)? |
InternalClientManager |
internalClientManager()
Use this to connect to the router in the same JVM. |
boolean |
isRouterContext()
Use this instead of context instanceof RouterContext |
JobQueue |
jobQueue()
The actual driver of the router, where all jobs are enqueued and processed. |
KeyManager |
keyManager()
Coordinates the router's ElGamal and DSA keys, as well as any keys given to it by clients as part of a LeaseSet. |
KeyRing |
keyRing()
override to support storage in router.config |
(package private) static void |
killGlobalContext()
Kill the global I2PAppContext, so it isn't still around when we restart in the same JVM (Android). |
static List<RouterContext> |
listContexts()
Retrieve the list of router contexts currently instantiated in this JVM. |
MessageHistory |
messageHistory()
Tracker component for monitoring what messages are wrapped in what containers and how they proceed through the network. |
OutboundMessageRegistry |
messageRegistry()
The registry is used by outbound messages to wait for replies. |
MessageValidator |
messageValidator()
The router keeps track of messages it receives to prevent duplicates, as well as other criteria for "validity". |
NetworkDatabaseFacade |
netDb()
Our db cache |
OutNetMessagePool |
outNetMessagePool()
Where do we put messages that the router wants to forwards onto the network? |
PeerManagerFacade |
peerManager()
Minimal interface for selecting peers for various tasks based on given criteria. |
ProfileManager |
profileManager()
Expose a simple API for various router components to take note of particular events that a peer enacts (sends us a message, agrees to participate in a tunnel, etc). |
ProfileOrganizer |
profileOrganizer()
Organize the peers we know about into various tiers, profiling their performance and sorting them accordingly. |
(package private) void |
removeProperty(String propName)
Remove a property provided during the context construction. |
(package private) void |
removeShutdownTasks()
|
Router |
router()
what router is this context working for? |
RouterAppManager |
routerAppManager()
The RouterAppManager. |
Hash |
routerHash()
Convenience method for getting the router hash. |
RouterKeyGenerator |
routerKeyGenerator()
Determine how much do we want to mess with the keys to turn them into something we can route. |
RoutingKeyGenerator |
routingKeyGenerator()
Determine how much do we want to mess with the keys to turn them into something we can route. |
void |
setProperty(String propName,
String value)
Deprecated. Use Router.saveConfig() |
StatisticsManager |
statPublisher()
If the router is configured to, gather up some particularly tasty morsels regarding the stats managed and offer to publish them into the routerInfo. |
RouterThrottle |
throttle()
Component to coordinate our accepting/rejecting of requests under load |
String |
toString()
|
TunnelDispatcher |
tunnelDispatcher()
Handle tunnel messages, as well as coordinate the gateways |
TunnelManagerFacade |
tunnelManager()
Coordinate this router's tunnels (its pools, participation, backup, etc). |
Methods inherited from class net.i2p.I2PAppContext |
---|
addShutdownTask, aes, clock, deleteTempDir, dsa, elGamalAESEngine, elGamalEngine, getAppDir, getBaseDir, getBooleanProperty, getBooleanPropertyDefaultTrue, getConfigDir, getCurrentContext, getGlobalContext, getLogDir, getPIDDir, getProperty, getPropertyNames, getRouterDir, getShutdownTasks, getTempDir, hasWrapper, hmac, hmac256, keyGenerator, logManager, namingService, portMapper, random, sessionKeyManager, sha, simpleScheduler, simpleTimer, simpleTimer2, statManager |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public RouterContext(Router router)
public RouterContext(Router router, Properties envProps)
Method Detail |
---|
public void setProperty(String propName, String value)
propName
- The name of the property.value
- The new value for the property.void removeProperty(String propName)
propName
- The name of the property.public void addPropertyCallback(I2PProperties.I2PPropertyCallback callback)
I2PAppContext
addPropertyCallback
in class I2PAppContext
callback
- The implementation of the callback.public void initAll()
i2p.dummyClientFacade i2p.dummyNetDb i2p.dummyPeerManager i2p.dummyTunnelManager i2p.vmCommSystem (transport)
public static List<RouterContext> listContexts()
static List<RouterContext> getContexts()
static void killGlobalContext()
public Router router()
public Hash routerHash()
public ClientManagerFacade clientManager()
public ClientMessagePool clientMessagePool()
public InNetMessagePool inNetMessagePool()
public OutNetMessagePool outNetMessagePool()
public MessageHistory messageHistory()
public OutboundMessageRegistry messageRegistry()
public NetworkDatabaseFacade netDb()
public JobQueue jobQueue()
public KeyManager keyManager()
public CommSystemFacade commSystem()
public ProfileOrganizer profileOrganizer()
public PeerManagerFacade peerManager()
public ProfileManager profileManager()
public FIFOBandwidthLimiter bandwidthLimiter()
public TunnelManagerFacade tunnelManager()
public TunnelDispatcher tunnelDispatcher()
public StatisticsManager statPublisher()
public Banlist banlist()
public Blocklist blocklist()
public MessageValidator messageValidator()
public RouterThrottle throttle()
public String toString()
toString
in class Object
public String getProperty(String propName)
getProperty
in class I2PAppContext
public String getProperty(String propName, String defaultVal)
getProperty
in class I2PAppContext
public int getProperty(String propName, int defaultVal)
getProperty
in class I2PAppContext
public long getProperty(String propName, long defaultVal)
getProperty
in class I2PAppContext
public Properties getProperties()
I2PAppContext
getProperties
in class I2PAppContext
protected void initializeClock()
initializeClock
in class I2PAppContext
public KeyRing keyRing()
keyRing
in class I2PAppContext
protected void initializeKeyRing()
initializeKeyRing
in class I2PAppContext
void removeShutdownTasks()
public void addFinalShutdownTask(Runnable task)
Set<Runnable> getFinalShutdownTasks()
public boolean isRouterContext()
isRouterContext
in class I2PAppContext
public InternalClientManager internalClientManager()
internalClientManager
in class I2PAppContext
public ClientAppManager clientAppManager()
clientAppManager
in class I2PAppContext
public RouterAppManager routerAppManager()
protected void initializeSessionKeyManager()
initializeSessionKeyManager
in class I2PAppContext
public RoutingKeyGenerator routingKeyGenerator()
routingKeyGenerator
in class I2PAppContext
public RouterKeyGenerator routerKeyGenerator()
public GarlicMessageParser garlicMessageParser()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |