1 20 package org.apache.mina.handler.chain; 21 22 import org.apache.mina.common.IoHandler; 23 import org.apache.mina.common.IoHandlerAdapter; 24 import org.apache.mina.common.IoSession; 25 26 33 public class ChainedIoHandler extends IoHandlerAdapter { 34 private final IoHandlerChain chain; 35 36 39 public ChainedIoHandler() { 40 chain = new IoHandlerChain(); 41 } 42 43 49 public ChainedIoHandler(IoHandlerChain chain) { 50 if (chain == null) { 51 throw new NullPointerException ("chain"); 52 } 53 this.chain = chain; 54 } 55 56 60 public IoHandlerChain getChain() { 61 return chain; 62 } 63 64 69 public void messageReceived(IoSession session, Object message) 70 throws Exception { 71 chain.execute(null, session, message); 72 } 73 } 74 | Popular Tags |