All Packages  This Package  Class Hierarchy  Class Search  Index

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

  Summary

abstract class  pj_ProtocolLayer
     extends java.lang.Object
{
          // Fields 3
     private static Hashtable layers;
     private static int maxPacketLength;
     private static pj_ProtocolLayer.PacketRecycler recycler;

          // Constructors 1
     public pj_ProtocolLayer();

          // Methods 16
     static void attachRecycler(pj_ProtocolLayer.PacketRecycler);
     static void detachRecycler(pj_ProtocolLayer.PacketRecycler);
     static pj_ProtocolLayer findLayer(String);
     static int getMaxPacketLength();
     static void installLayer(pj_ProtocolLayer);
     static void recycle(pj_BufferHandle);

     abstract void attachGenerator(pj_ProtocolLayer.PacketGenerator) throws IOException;
     abstract void attachHandler(pj_ProtocolLayer.PacketHandler) throws IOException;
     abstract AddressSpec createAddress(String) throws PacketAddressFormatException;
     abstract pj_ProtocolLayer.PacketAddressMask createAddressMask();
     abstract void detachGenerator(pj_ProtocolLayer.PacketGenerator);
     abstract void detachHandler(pj_ProtocolLayer.PacketHandler);
     abstract void generatorReady(pj_ProtocolLayer.PacketGenerator);
     abstract String getID();
     abstract int getPacketLength();
     abstract void synchronousSend(pj_ProtocolLayer.PacketGenerator, pj_BufferHandle);

          // Inner Classes 4
     static interface pj_ProtocolLayer.PacketAddressMask
     abstract static class pj_ProtocolLayer.PacketHandler
     abstract static class pj_ProtocolLayer.PacketGenerator
     static interface pj_ProtocolLayer.PacketRecycler
}

pj_ProtocolLayer is supposed to act as an abstraction for simulating transport layers. Its made up of several interfaces and classes for moving packets through the layer to their destination.

Author:
Janos Ministry of Development


  Cross Reference

Extended By:
pj_ANEPStreamLayer, pj_UDPLayer

Returned By:
pj_ProtocolLayer.findLayer()





  Fields

· maxPacketLength

Summary  |  Top
   private static int maxPacketLength

The maximum packet length for all the layers. Since packets are exchanged with users of the layers we have to make packets big enough to accomodate all the different protocol layers.


· layers

Summary  |  Top
   private static Hashtable layers

The table of all registered protocol layers.


· recycler

Summary  |  Top
   private static pj_ProtocolLayer.PacketRecycler recycler

The global packet recycler.


  Constructors

· pj_ProtocolLayer

Summary  |  Top

   public pj_ProtocolLayer() 

Default constructor



  Methods

· getMaxPacketLength

Summary  |  Top
   static int getMaxPacketLength() 

Return the current value of maxPacketLength.



· installLayer

Summary  |  Top
   static void installLayer(pj_ProtocolLayer pl) 

Install a new protocol layer, basically, this just makes the layer PACKAGEally available.



· findLayer

Summary  |  Top
   static pj_ProtocolLayer findLayer(String id) 

Find an installed protocol layer with the given name.



· attachRecycler

Summary  |  Top
   static void attachRecycler(pj_ProtocolLayer.PacketRecycler pr) 


· recycle

Summary  |  Top
   static void recycle(pj_BufferHandle pb) 


· detachRecycler

Summary  |  Top
   static void detachRecycler(pj_ProtocolLayer.PacketRecycler pr) 


· getID

Summary  |  Top
   abstract String getID() 

Return the string identifier for this protocol layer.



· getPacketLength

Summary  |  Top
   abstract int getPacketLength() 

Get the maximum packet length for this protocol layer. This is pretty much for internal use only.



· createAddress

Summary  |  Top
   abstract AddressSpec createAddress(String addr)  throws PacketAddressFormatException

Create an address object that is compatible with this protocol layer.



· createAddressMask

Summary  |  Top
   abstract pj_ProtocolLayer.PacketAddressMask createAddressMask() 

Create an address mask object that is compatible with this protocol layer.



· attachHandler

Summary  |  Top
   abstract void attachHandler(pj_ProtocolLayer.PacketHandler ph)  throws IOException

Attach a packet handler to the layer. The source mask for the handler determines what packets will be dispatched to the handler.



· detachHandler

Summary  |  Top
   abstract void detachHandler(pj_ProtocolLayer.PacketHandler ph) 

Detach a packet handler from the layer.



· attachGenerator

Summary  |  Top
   abstract void attachGenerator(pj_ProtocolLayer.PacketGenerator pg)  throws IOException

Attach a packet generator to the layer. The destination of the packet is determined by the destination address object in the packet generator object.



· generatorReady

Summary  |  Top
   abstract void generatorReady(pj_ProtocolLayer.PacketGenerator pg) 

Signal that a generator has asynchronous packets and is ready to be serviced.



· synchronousSend

Summary  |  Top
   abstract void synchronousSend(pj_ProtocolLayer.PacketGenerator pg, 
                                 pj_BufferHandle bh) 

Synchronous send a packet, blocking until the send completes.



· detachGenerator

Summary  |  Top
   abstract void detachGenerator(pj_ProtocolLayer.PacketGenerator pg) 

Detach a packet generator from the protocol layer.



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