/** * Invoked when a message written by IoSession.write(Object) is sent out. * * <b>Warning !</b> If you are to overload this method, be aware that you * _must_ call the messageHandler in your own method, otherwise it won't * be called. */ @Override public void messageSent(IoSession session, Object message) throws Exception { MessageHandler<Object> handler = findSentMessageHandler(message.getClass()); if (handler != null) { handler.handleMessage(session, message); } else { throw new UnknownMessageTypeException( "No handler found for message type: " + message.getClass().getSimpleName()); } }
/** * Invoked when a message written by IoSession.write(Object) is sent out. * * <b>Warning !</b> If you are to overload this method, be aware that you * _must_ call the messageHandler in your own method, otherwise it won't * be called. * * {@inheritDoc} */ @Override public void messageSent(IoSession session, Object message) throws Exception { MessageHandler<Object> handler = findSentMessageHandler(message.getClass()); if (handler != null) { handler.handleMessage(session, message); } else { throw new UnknownMessageTypeException("No handler found for message type: " + message.getClass().getSimpleName()); } }
/** * Forwards the received events into the appropriate {@link MessageHandler} * which is registered by {@link #addReceivedMessageHandler(Class, MessageHandler)}. * * <b>Warning !</b> If you are to overload this method, be aware that you * _must_ call the messageHandler in your own method, otherwise it won't * be called. * * {@inheritDoc} */ @Override public void messageReceived(IoSession session, Object message) throws Exception { MessageHandler<Object> handler = findReceivedMessageHandler(message.getClass()); if (handler != null) { handler.handleMessage(session, message); } else { throw new UnknownMessageTypeException("No message handler found for message type: " + message.getClass().getSimpleName()); } }
/** * Invoked when any exception is thrown by user IoHandler implementation * or by MINA. If cause is an instance of IOException, MINA will close the * connection automatically. * * <b>Warning !</b> If you are to overload this method, be aware that you * _must_ call the messageHandler in your own method, otherwise it won't * be called. * * {@inheritDoc} */ @Override public void exceptionCaught(IoSession session, Throwable cause) throws Exception { ExceptionHandler<Throwable> handler = findExceptionHandler(cause.getClass()); if (handler != null) { handler.exceptionCaught(session, cause); } else { throw new UnknownMessageTypeException("No handler found for exception type: " + cause.getClass().getSimpleName()); } }
/** * Forwards the received events into the appropriate {@link MessageHandler} * which is registered by {@link #addReceivedMessageHandler(Class, MessageHandler)}. * * <b>Warning !</b> If you are to overload this method, be aware that you * _must_ call the messageHandler in your own method, otherwise it won't * be called. * * {@inheritDoc} */ @Override public void messageReceived(IoSession session, Object message) throws Exception { MessageHandler<Object> handler = findReceivedMessageHandler(message.getClass()); if (handler != null) { handler.handleMessage(session, message); } else { throw new UnknownMessageTypeException("No message handler found for message type: " + message.getClass().getSimpleName()); } }
/** * Invoked when any exception is thrown by user IoHandler implementation * or by MINA. If cause is an instance of IOException, MINA will close the * connection automatically. * * <b>Warning !</b> If you are to overload this method, be aware that you * _must_ call the messageHandler in your own method, otherwise it won't * be called. * * {@inheritDoc} */ @Override public void exceptionCaught(IoSession session, Throwable cause) throws Exception { ExceptionHandler<Throwable> handler = findExceptionHandler(cause.getClass()); if (handler != null) { handler.exceptionCaught(session, cause); } else { throw new UnknownMessageTypeException("No handler found for exception type: " + cause.getClass().getSimpleName()); } }
/** * Invoked when a message written by IoSession.write(Object) is sent out. * * <b>Warning !</b> If you are to overload this method, be aware that you * _must_ call the messageHandler in your own method, otherwise it won't * be called. * * {@inheritDoc} */ @Override public void messageSent(IoSession session, Object message) throws Exception { MessageHandler<Object> handler = findSentMessageHandler(message.getClass()); if (handler != null) { handler.handleMessage(session, message); } else { throw new UnknownMessageTypeException("No handler found for message type: " + message.getClass().getSimpleName()); } }
/** * Forwards the received events into the appropriate {@link MessageHandler} * which is registered by {@link #addReceivedMessageHandler(Class, MessageHandler)}. * * <b>Warning !</b> If you are to overload this method, be aware that you * _must_ call the messageHandler in your own method, otherwise it won't * be called. */ @Override public void messageReceived(IoSession session, Object message) throws Exception { MessageHandler<Object> handler = findReceivedMessageHandler(message.getClass()); if (handler != null) { handler.handleMessage(session, message); } else { throw new UnknownMessageTypeException( "No message handler found for message type: " + message.getClass().getSimpleName()); } }
/** * Invoked when any exception is thrown by user IoHandler implementation * or by MINA. If cause is an instance of IOException, MINA will close the * connection automatically. * * <b>Warning !</b> If you are to overload this method, be aware that you * _must_ call the messageHandler in your own method, otherwise it won't * be called. */ @Override public void exceptionCaught(IoSession session, Throwable cause) throws Exception { ExceptionHandler<Throwable> handler = findExceptionHandler(cause.getClass()); if (handler != null) { handler.exceptionCaught(session, cause); } else { throw new UnknownMessageTypeException( "No handler found for exception type: " + cause.getClass().getSimpleName()); } }
public void encode(IoSession session, Object message, ProtocolEncoderOutput out) throws Exception { State state = getState(session); MessageEncoder<Object> encoder = findEncoder(state, message.getClass()); if (encoder != null) { encoder.encode(session, message, out); } else { throw new UnknownMessageTypeException( "No message encoder found for message: " + message); } }
/** * {@inheritDoc} */ @Override public void encode(IoSession session, Object message, ProtocolEncoderOutput out) throws Exception { State state = getState(session); MessageEncoder<Object> encoder = findEncoder(state, message.getClass()); if (encoder != null) { encoder.encode(session, message, out); } else { throw new UnknownMessageTypeException("No message encoder found for message: " + message); } }
/** * {@inheritDoc} */ @Override public void encode(IoSession session, Object message, ProtocolEncoderOutput out) throws Exception { State state = getState(session); MessageEncoder<Object> encoder = findEncoder(state, message.getClass()); if (encoder != null) { encoder.encode(session, message, out); } else { throw new UnknownMessageTypeException("No message encoder found for message: " + message); } }