* Refactored TraceListenerStrategy to better track current scope in case multiple connections are used
Refactored remoteServiceName resolution logic to be easier to follow
Fixed TraceQueryExecutionListener#getConnection that leaks connection by acquiring (and not closing) additional connection from a DataSource
* Fixed checkstyle issues
without this change when batch process finishes the async reporter doesn't have time to properly shutdown and send out spans to Zipkin.
with this change we're registering a shutdown hook. AsyncReporter has no option to send out spans in a blocking way, so what we need to do to flush it, then wait for the configured time for the spans to be drained from the queue and then give a chance to send the spans out over the wire.
fixes gh-2035
without this change whenever a traced executor is created (either via a proxy or directly) we create a new instance of that traced wrapper. The problem with that is such that we create a lot of objects (e.g. each getExecutor() would return a new instance of the traced version). There are projects such as Micrometer that create WeakReferences to those objects. That means that if we don't cache the traced instance then we will lose the WeakReference upon the first GC.
with this change we're introducing new static wrapper methods that cache the traced instance for a given delegate. That means that not only will we create fewer objects but also we will honour the WeakReference mechanisms.
fixes gh-2020
without this change whenever a traced executor is created (either via a proxy or directly) we create a new instance of that traced wrapper. The problem with that is such that we create a lot of objects (e.g. each getExecutor() would return a new instance of the traced version). There are projects such as Micrometer that create WeakReferences to those objects. That means that if we don't cache the traced instance then we will lose the WeakReference upon the first GC.
with this change we're introducing new static wrapper methods that cache the traced instance for a given delegate. That means that not only will we create fewer objects but also we will honour the WeakReference mechanisms.
fixes gh-2020