All Packages  This Package  Class Hierarchy  Class Search  Index

Class edu.utah.janos.nodeos.pj_InChannel
java.lang.Object
   |
   +----edu.utah.janos.nodeos.pj_InChannel

  Summary

class  pj_InChannel
     extends java.lang.Object
{
          // Fields 7
     final pj_DemultiplexKey classifier;
     private final DeliverFunc deliverFunc;
     final pj_Flow flow;
     private pj_BufferHandle freeBufferQ;
     private final Object freeBufferQLock;
     private pj_InChannelDispatcher handler;
     private final pj_ThreadPool threadPool;

          // Constructors 1
     pj_InChannel(pj_Flow, pj_DemultiplexKey, String, String, DeliverFunc) throws IOException, PacketAddressFormatException, ProtocolSpecFormatException;

          // Methods 6
     void destroy();
     protected void finalize();
     boolean handle(pj_BufferHandle, int, int);
     void native_addBuffer(pj_BufferHandle);
     pj_BufferHandle native_remBuffer();
     public String toString();
}

Pure Java implementation of a NodeOS InChannel.

Author:
Janos Ministry of Development

See Also: InChannel, OutChannel, pj_OutChannel


  Cross Reference

Extended By:
InChannel

Returned By:
InChannel.getNativeInChan()





  Fields

· flow

Summary  |  Top
   final pj_Flow flow

The flow this receive channel is associated with. XXX what is this used for?


· classifier

Summary  |  Top
   final pj_DemultiplexKey classifier

The demultiplex key associated with this channel.


· handler

Summary  |  Top
   private pj_InChannelDispatcher handler

Need the handler so the pj_InChannel can remove itself when it is destroyed.

XXX is this necessary?


· deliverFunc

Summary  |  Top
   private final DeliverFunc deliverFunc

The callback for delivery.


· freeBufferQ

Summary  |  Top
   private pj_BufferHandle freeBufferQ

Queue of free packet buffers for this pj_InChannel. Queue is circular, doubly-linked list. freeBufferQ points to the "head", freeBufferQ.prev points to the tail.


· threadPool

Summary  |  Top
   private final pj_ThreadPool threadPool


· freeBufferQLock

Summary  |  Top
   private final Object freeBufferQLock

Lock for protecting the free packet buffer queue.


  Constructors

· pj_InChannel

Summary  |  Top

   pj_InChannel(pj_Flow flow, 
                pj_DemultiplexKey classifier, 
                String protocolSpec, 
                String addrSpec, 
                DeliverFunc deliverFunc)  throws IOException, PacketAddressFormatException, ProtocolSpecFormatException


  Methods

· handle

Summary  |  Top
   boolean handle(pj_BufferHandle systembh, 
                  int packetStart, 
                  int payloadStart) 

Dispatch an incoming packet for this in channel.

If the channel has available buffers then its

This is operating in "interrupt context", that is this is all system time up to this point.

Parameter Description
systembh the incoming buffer
packetStart the "start" of the packet as seen by the receiver.
payloadStart the start of the payload (i.e., skipping matched header bytes).

Returns:
returns true if the swap happened.


· native_addBuffer

Summary  |  Top
   void native_addBuffer(pj_BufferHandle bufh) 

Add a buffer to the set of buffers available for buffering incoming packets to this pj_InChannel.

This is run as a LIFO queue to maximize locality.



· native_remBuffer

Summary  |  Top
   pj_BufferHandle native_remBuffer() 

Remove a buffer from the queue of free buffers on this pj_InChannel. Returns null if there are no free buffers on this pj_InChannel.

This is run as a LIFO queue to maximize locality.



· toString

Summary  |  Top
   public String toString() 
Overrides:
toString in class Object


· destroy

Summary  |  Top
   void destroy() 


· finalize

Summary  |  Top
   protected void finalize() 
Overrides:
finalize in class Object


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