org.apache.mina.handler.chain
Class IoHandlerChain

java.lang.Object
  extended by org.apache.mina.handler.chain.IoHandlerChain
All Implemented Interfaces:
IoHandlerCommand

public class IoHandlerChain
extends Object
implements IoHandlerCommand

A chain of IoHandlerCommands.

Version:
$Rev: 671827 $, $Date: 2008-06-26 10:49:48 +0200 (jeu, 26 jun 2008) $
Author:
The Apache MINA Project (dev@mina.apache.org)

Nested Class Summary
 class IoHandlerChain.Entry
          Represents a name-command pair that an IoHandlerChain contains.
 
Nested classes/interfaces inherited from interface org.apache.mina.handler.chain.IoHandlerCommand
IoHandlerCommand.NextCommand
 
Constructor Summary
IoHandlerChain()
          Creates a new, empty chain of IoHandlerCommands.
 
Method Summary
 void addAfter(String baseName, String name, IoHandlerCommand command)
           
 void addBefore(String baseName, String name, IoHandlerCommand command)
           
 void addFirst(String name, IoHandlerCommand command)
           
 void addLast(String name, IoHandlerCommand command)
           
 void clear()
           
 boolean contains(Class<? extends IoHandlerCommand> commandType)
           
 boolean contains(IoHandlerCommand command)
           
 boolean contains(String name)
           
 void execute(IoHandlerCommand.NextCommand next, IoSession session, Object message)
          Execute a unit of processing work to be performed.
 IoHandlerCommand get(String name)
           
 List<IoHandlerChain.Entry> getAll()
           
 List<IoHandlerChain.Entry> getAllReversed()
           
 IoHandlerChain.Entry getEntry(String name)
           
 IoHandlerCommand.NextCommand getNextCommand(String name)
           
 IoHandlerCommand remove(String name)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IoHandlerChain

public IoHandlerChain()
Creates a new, empty chain of IoHandlerCommands.

Method Detail

getEntry

public IoHandlerChain.Entry getEntry(String name)

get

public IoHandlerCommand get(String name)

getNextCommand

public IoHandlerCommand.NextCommand getNextCommand(String name)

addFirst

public void addFirst(String name,
                     IoHandlerCommand command)

addLast

public void addLast(String name,
                    IoHandlerCommand command)

addBefore

public void addBefore(String baseName,
                      String name,
                      IoHandlerCommand command)

addAfter

public void addAfter(String baseName,
                     String name,
                     IoHandlerCommand command)

remove

public IoHandlerCommand remove(String name)

clear

public void clear()
           throws Exception
Throws:
Exception

execute

public void execute(IoHandlerCommand.NextCommand next,
                    IoSession session,
                    Object message)
             throws Exception
Description copied from interface: IoHandlerCommand

Execute a unit of processing work to be performed. This IoHandlerCommand may either complete the required processing and just return to stop the processing, or delegate remaining processing to the next IoHandlerCommand in a IoHandlerChain containing this IoHandlerCommand by calling IoHandlerCommand.NextCommand.execute(IoSession,Object).

Specified by:
execute in interface IoHandlerCommand
Parameters:
next - an indirect reference to the next IoHandlerCommand that provides a way to forward the request to the next IoHandlerCommand.
session - the IoSession which is associated with this request
message - the message object of this request
Throws:
Exception - general purpose exception return to indicate abnormal termination

getAll

public List<IoHandlerChain.Entry> getAll()

getAllReversed

public List<IoHandlerChain.Entry> getAllReversed()

contains

public boolean contains(String name)

contains

public boolean contains(IoHandlerCommand command)

contains

public boolean contains(Class<? extends IoHandlerCommand> commandType)

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2004-2008 Apache MINA Project. All Rights Reserved.