@ POST public void broadcast ( String message ) { AtmosphereResource r = ( AtmosphereResource ) request . getAttribute ( ApplicationConfig . ATMOSPHERE_RESOURCE ) ; if ( r != null ) { r . getBroadcaster ( ) . broadcast ( message ) ; } else { throw new IllegalStateException ( ) ; } }
Echo the chat message . Jackson can clearly be used here but for simplicity we just echo what we receive .