@ Override public void messageSent ( IoSession session , Object message ) throws Exception { log . debug ( "{} --> {}" , message , session ) ; if ( this . sensorIoAdapter == null ) { log . warn ( "No SensorIoAdapter defined. Ignoring message to {}: {}" , session , message ) ; return ; } if ( message instanceof HandshakeMessage ) { log . debug ( "Handshake message sent to {}: {}" , session , message ) ; if ( this . sensorIoAdapter != null ) { this . sensorIoAdapter . handshakeMessageSent ( session , ( HandshakeMessage ) message ) ; } } else if ( message instanceof SampleMessage ) { if ( this . sensorIoAdapter != null ) { this . sensorIoAdapter . sensorSampleSent ( session , ( SampleMessage ) message ) ; } } else { log . warn ( "Unhandled message type sent to {}: {}" , session , message ) ; } }
Demultiplexes the sent message and passes it to the appropriate method of the IOAdapter .