1 20 package org.apache.mina.handler.multiton; 21 22 import org.apache.mina.common.IdleStatus; 23 import org.apache.mina.common.IoSession; 24 import org.apache.mina.util.SessionUtil; 25 26 34 public class SingleSessionIoHandlerAdapter implements SingleSessionIoHandler { 35 36 39 private final IoSession session; 40 41 46 public SingleSessionIoHandlerAdapter(IoSession session) { 47 if (session == null) { 48 throw new NullPointerException ("session"); 49 } 50 this.session = session; 51 } 52 53 58 protected IoSession getSession() { 59 return session; 60 } 61 62 public void exceptionCaught(Throwable th) throws Exception { 63 } 64 65 public void messageReceived(Object message) throws Exception { 66 } 67 68 public void messageSent(Object message) throws Exception { 69 } 70 71 public void sessionClosed() throws Exception { 72 } 73 74 public void sessionCreated() throws Exception { 75 SessionUtil.initialize(getSession()); 76 } 77 78 public void sessionIdle(IdleStatus status) throws Exception { 79 } 80 81 public void sessionOpened() throws Exception { 82 } 83 } 84 | Popular Tags |