void (int state, int errorCount) { try { final AntFinishedExecutionEvent.Status status = state == AntBuildListener.ABORTED? AntFinishedExecutionEvent.Status.CANCELED : state == AntBuildListener.FAILED_TO_RUN? AntFinishedExecutionEvent.Status.FAILURE : AntFinishedExecutionEvent.Status.SUCCESS; myBuildFile.getProject().getMessageBus().syncPublisher(AntExecutionListener.TOPIC).buildFinished( new AntFinishedExecutionEvent(myBuildFile, status, errorCount) ); } finally { myDelegate.buildFinished(state, errorCount); } }