net.i2p.router.transport
Class VMCommSystem

java.lang.Object
  extended by net.i2p.router.CommSystemFacade
      extended by net.i2p.router.transport.VMCommSystem
All Implemented Interfaces:
Service

public class VMCommSystem
extends CommSystemFacade

Hacked up in-VM comm system for talking between contexts. It doesn't even generate any routerAddresses, but instead tracks the peers through a singleton. Currently, the comm system doesn't even inject any lag, though it could (later). It does honor the standard transport stats though, but not the TCP specific ones.


Field Summary
 
Fields inherited from class net.i2p.router.CommSystemFacade
STATUS_DIFFERENT, STATUS_HOSED, STATUS_OK, STATUS_REJECT_UNSOLICITED, STATUS_UNKNOWN
 
Constructor Summary
VMCommSystem(RouterContext context)
           
 
Method Summary
 void processMessage(OutNetMessage msg)
          The router wants us to send the given message to the peer.
 void receive(byte[] message, Hash fromPeer)
          We send messages between comms as bytes so that we strip any router-local info.
 void renderStatusHTML(java.io.Writer out, java.lang.String urlBase, int sortFlags)
           
 void restart()
          Perform a soft restart.
 void shutdown()
          Instruct the service that the router is shutting down and that it should do whatever is necessary to go down gracefully.
 void startup()
          Instruct the service that it should start normal operation.
 
Methods inherited from class net.i2p.router.CommSystemFacade
countActivePeers, countActiveSendPeers, createAddresses, getCountry, getCountryName, getFramedAveragePeerClockSkew, getIP, getMedianPeerClockSkew, getMostRecentErrorMessages, getReachabilityStatus, haveHighOutboundCapacity, haveInboundCapacity, haveOutboundCapacity, isBacklogged, isEstablished, notifyReplaceAddress, queueLookup, recheckReachability, renderPeerHTML, renderStatusHTML, wasUnreachable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VMCommSystem

public VMCommSystem(RouterContext context)
Method Detail

processMessage

public void processMessage(OutNetMessage msg)
The router wants us to send the given message to the peer. Do so, or fire off the failing job.

Specified by:
processMessage in class CommSystemFacade

receive

public void receive(byte[] message,
                    Hash fromPeer)
We send messages between comms as bytes so that we strip any router-local info. For example, a router tags the # attempts to send through a leaseSet, what type of tunnel a tunnelId is bound to, etc.


shutdown

public void shutdown()
Description copied from interface: Service
Instruct the service that the router is shutting down and that it should do whatever is necessary to go down gracefully. It should not depend on other components at this point. This call DOES block.


startup

public void startup()
Description copied from interface: Service
Instruct the service that it should start normal operation. This call DOES block until the service is ready.


restart

public void restart()
Description copied from interface: Service
Perform a soft restart.


renderStatusHTML

public void renderStatusHTML(java.io.Writer out,
                             java.lang.String urlBase,
                             int sortFlags)
                      throws java.io.IOException
Overrides:
renderStatusHTML in class CommSystemFacade
Throws:
java.io.IOException