All Packages  This Package  Class Hierarchy  Class Search  Index

Class edu.utah.janos.nodeos.pj_InChannelDispatcher
java.lang.Object
   |
   +----edu.utah.janos.nodeos.pj_ProtocolLayer.PacketHandler
           |
           +----edu.utah.janos.nodeos.pj_InChannelDispatcher

  Summary

class  pj_InChannelDispatcher
     extends edu.utah.janos.nodeos.pj_ProtocolLayer.PacketHandler
{
          // Fields 3
     private final Vector channels;
     private static final Hashtable dispatchers;
     private pj_ProtocolLayer protocolLayer;

          // Constructors 1
     public pj_InChannelDispatcher();

          // Methods 4
     static pj_InChannelDispatcher getDispatcher(pj_ProtocolLayer, pj_ProtocolLayer.PacketAddressMask) throws IOException;

     void addChannel(pj_InChannel);
     boolean handle(pj_BufferHandle);
     void remChannel(pj_InChannel);
}

Class that is used to dispatch packets from protocol layers to the appropriate InChannel.

Author:
Janos Ministry of Development


  Cross Reference

Returned By:
pj_InChannelDispatcher.getDispatcher()





  Fields

· dispatchers

Summary  |  Top
   private static final Hashtable dispatchers

The set of dispatchers for the system.

XXX global state?


· protocolLayer

Summary  |  Top
   private pj_ProtocolLayer protocolLayer

The protocol layer that this dispatcher is attached to


· channels

Summary  |  Top
   private final Vector channels

The set of channels that this handler can dispatch too. We only really care about their demultiplex keys since the rest of the demultiplex is done elsewhere.


  Constructors

· pj_InChannelDispatcher

Summary  |  Top

   public pj_InChannelDispatcher() 

Default constructor



  Methods

· getDispatcher

Summary  |  Top
   static pj_InChannelDispatcher getDispatcher(pj_ProtocolLayer pl, 
                                               pj_ProtocolLayer.PacketAddressMask source)  throws IOException

Get the dispatcher that matches the given source mask.

Parameter Description
pl The protocol layer were packets are coming from
source The source address mask packets are matched too



· addChannel

Summary  |  Top
   void addChannel(pj_InChannel newChan) 

Add a channel to this dispatcher. The channel is placed in the selection line by how large its key is, the larger the key the earlier it will be checked.



· remChannel

Summary  |  Top
   void remChannel(pj_InChannel deadChan) 

Remove a channel from this dispatcher.



· handle

Summary  |  Top
   boolean handle(pj_BufferHandle pb) 

Handle a packet that came in through the transport layer. Returns true if the packet was handled.

The buffer is handled only if an InChannel can be found and that InChannel has buffers available to swap with.

Parameter Description
pb The system's receive pj_BufferHandle

Returns:
the input pb, perhaps with a different underlying buffer
Overrides:
handle in class pj_ProtocolLayer.PacketHandler


All Packages  This Package  Class Hierarchy  Class Search  Index
Freshly brewed Java API Documentation automatically generated with polardoc Version 1.0.7