All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ants.InChannel

java.lang.Object
   |
   +----ants.Entity
           |
           +----ants.ManagedObject
                   |
                   +----ants.InChannel

public class InChannel
extends ManagedObject
implements Runnable
The InChannel is responsible for decoding and processing all packets stemming from an incoming flow, denoted by a flow handle.

THIS IS THE UNIT OF RESOURCE CONSUMPTION. One InChannel per protocol is created. InChannels can be instantiated for both locally installed protocols and those loaded on demand.

An InChannel is associated with a flow handle that is its source of packets to decode and process. Each InChannel will instantiate incoming Capsules in a separate name space. This is done by providing a separate class loader.

In ANTS 1.2, this used to be ChannelThread. I'm not really happy with the name "InChannel", however. A better name might be "ProtocolProcessor".


Constructor Index

 o InChannel(Node, boolean)
constructor for protocols instantiated due to a remote request
 o InChannel(Node, Protocol, String, boolean)
constructor for locally instantiated protocols; protocol and name are known.

Method Index

 o decode(Buffer)
decode ANTS packets.
 o getFlowHandle()
 o receive()
extract the next capsule from the flow
 o run()
Main loop for an InChannel.
 o start()
a one-time start of the channel only

Constructors

 o InChannel
 public InChannel(Node node,
                  Protocol p,
                  String name,
                  boolean replenish)
constructor for locally instantiated protocols; protocol and name are known.

Parameters:
p - The Protocol whose packets should be handled by this InChannel
 o InChannel
 public InChannel(Node node,
                  boolean replenish)
constructor for protocols instantiated due to a remote request

Methods

 o decode
 protected Capsule decode(Buffer buf) throws Exception
decode ANTS packets.

 o receive
 public Capsule receive() throws Exception
extract the next capsule from the flow

 o start
 public void start()
a one-time start of the channel only

Overrides:
start in class Entity
 o getFlowHandle
 public FlowHandle getFlowHandle()
Returns:
the flow handle associated with that InChannel
 o run
 public void run()
Main loop for an InChannel. This used to be the main loop of ChannelThread.


All Packages  Class Hierarchy  This Package  Previous  Next  Index