These interfaces provide the full support for the channel programming model. The channel programming model is a virtual protocol stack layer allowing flexibility and scalability for client and server transports. By implementing the interfaces included in this package, a channel can be pulled into the framework and utilize the framework and other channels in the system.

Initial questions to answer

One should answer the following questions before designing a Channel.

Terminology definitions

What needs implemented?

Each channel must have a couple elements in order to be plugged into a channel chain.

Inbound or Outbound implementations

Inbound implementations only

Sample Inbound flows

Here are some sample flows with pseudo code.
		//MyConnectorChannel gets a new connection in.  

		//Creates a VirtualConnection through the ChannelFramework
		VirtualConnectionFactory vcf = getChannel().getVirtualConnectionFactory();
		VirtualConnection vc = vcf.createConnection();

		//create a new ConnectionLink
		MyConnectionLink connLink = getChannel().getConnectionLink(vc, newSocket);

		//read some data
		connLink.initialRead();

		//fetch myChannel's discrimination process
		DiscriminationProcess dp = getChannel().getDiscriminationProcess();
	
		//track the state of the discrimination process
		//set it to initially fail
		int state = DiscriminationProcess.FAILURE;
		while (true) {
		        try {
        		    state = dp.discriminate(
				getVirtualConnection(), connLink.getData(), this);
		        } catch (Exception e) {
			    // Follow the failure logic
			    log("DiscriminationProblem", e);
			}
		       if (DiscriminationProcess.AGAIN == state) {
			    connLink.read();
			    continue;
		       }
			
		       if (DiscriminationProcess.FAILURE == state) {
			    // close the connection because nobody wants it
			    newSocket.close();
			    connLink.destroy();
                            vc.destroy();
			}
			break;
		}
		if (DiscriminationProcess.SUCCESS == state) {
        	    getApplicationCallback().ready(getVirtualConnection());
		} 
        }


	
Each channel would continue this process until the stack is created. Once the stack is created, the discrimination process will probably not occur again.