private void startTask ( final EvaluatorRuntimeProtocol . StartTaskProto startTaskProto ) throws TaskClientCodeException { synchronized ( this . contextStack ) { final ContextRuntime currentActiveContext = this . contextStack . peek ( ) ; final String expectedContextId = startTaskProto . getContextId ( ) ; if ( ! expectedContextId . equals ( currentActiveContext . getIdentifier ( ) ) ) { throw new IllegalStateException ( "Task expected context `" + expectedContextId + "` but the active context has ID `" + currentActiveContext . getIdentifier ( ) + "`" ) ; } try { final Configuration taskConfig = this . configurationSerializer . fromString ( startTaskProto . getConfiguration ( ) ) ; currentActiveContext . startTask ( taskConfig ) ; } catch ( IOException | BindException e ) { throw new RuntimeException ( "Unable to read configuration." , e ) ; } } }
Launch a Task .