@ Override public synchronized void onNext ( final ClientRuntimeProtocol . JobControlProto jobControlProto ) { if ( jobControlProto . hasSignal ( ) ) { if ( jobControlProto . getSignal ( ) == ClientRuntimeProtocol . Signal . SIG_TERMINATE ) { try { if ( jobControlProto . hasMessage ( ) ) { getClientCloseWithMessageDispatcher ( ) . onNext ( jobControlProto . getMessage ( ) . toByteArray ( ) ) ; } else { getClientCloseDispatcher ( ) . onNext ( null ) ; } } finally { this . driverStatusManager . onComplete ( ) ; } } else { LOG . log ( Level . FINEST , "Unsupported signal: " + jobControlProto . getSignal ( ) ) ; } } else if ( jobControlProto . hasMessage ( ) ) { getClientMessageDispatcher ( ) . onNext ( jobControlProto . getMessage ( ) . toByteArray ( ) ) ; } }
This method reacts to control messages passed by the client to the driver . It will forward messages related to the ClientObserver interface to the Driver . It will also initiate a shutdown if the client indicates a close message .