1 20 package org.apache.mina.common; 21 22 import org.apache.mina.util.SessionLog; 23 import org.apache.mina.util.SessionUtil; 24 25 33 public class IoHandlerAdapter implements IoHandler { 34 public void sessionCreated(IoSession session) throws Exception { 35 SessionUtil.initialize(session); 36 } 37 38 public void sessionOpened(IoSession session) throws Exception { 39 } 40 41 public void sessionClosed(IoSession session) throws Exception { 42 } 43 44 public void sessionIdle(IoSession session, IdleStatus status) 45 throws Exception { 46 } 47 48 public void exceptionCaught(IoSession session, Throwable cause) 49 throws Exception { 50 if (SessionLog.isWarnEnabled(session)) { 51 SessionLog.warn(session, "EXCEPTION, please implement " 52 + getClass().getName() 53 + ".exceptionCaught() for proper handling:", cause); 54 } 55 } 56 57 public void messageReceived(IoSession session, Object message) 58 throws Exception { 59 } 60 61 public void messageSent(IoSession session, Object message) throws Exception { 62 } 63 } | Popular Tags |