result = super.execute(callback);
stop = System.currentTimeMillis() - start;
}
catch (RuntimeException exception) {
stop = System.currentTimeMillis() - start;
publishEvent(new OsgiServiceDependencyWaitTimedOutEvent(eventSource, dependency, stop));
throw exception;
}
// send finalization event
if (callback.isComplete(result)) {
publishEvent(new OsgiServiceDependencyWaitEndedEvent(eventSource, dependency, stop));
}
else {
publishEvent(new OsgiServiceDependencyWaitTimedOutEvent(eventSource, dependency, stop));
}
return result;
}