public void speak ( ClientObject caller , final ChatChannel channel , String message , byte mode ) { BodyObject body = _locator . forClient ( caller ) ; final UserMessage umsg = new UserMessage ( body . getVisibleName ( ) , null , message , mode ) ; // if we're hosting this channel, dispatch it directly if ( _channels . containsKey ( channel ) ) { dispatchSpeak ( channel , umsg ) ; return ; } // if we're resolving this channel, queue up our message for momentary deliver List < UserMessage > msgs = _resolving . get ( channel ) ; if ( msgs != null ) { msgs . add ( umsg ) ; return ; } // forward the speak request to the server that hosts the channel in question _peerMan . invokeNodeAction ( new ChannelAction ( channel ) { @ Override protected void execute ( ) { _channelMan . dispatchSpeak ( _channel , umsg ) ; } } , new Runnable ( ) { public void run ( ) { _resolving . put ( channel , Lists . newArrayList ( umsg ) ) ; resolveAndDispatch ( channel ) ; } } ) ; }
from interface ChannelSpeakProvider