SnapshotterHandler gets service in SnapshotService in initialize.
But application can start before SnapshotService is started and null will be returned for context.getService().get() and SnapshotterHandler caches null value "forever".
The idea is that ServiceRegistry.get() is called every time when service is needed and checked for null. (Skipping a snapshot when service is not available is better than always issuing NPE). It could be a warning written into logs saying that service is not available.
SnapshotterHandler
gets service inSnapshotService
ininitialize
. But application can start before SnapshotService is started andnull
will be returned forcontext.getService().get()
and SnapshotterHandler cachesnull
value "forever".The idea is that
ServiceRegistry.get()
is called every time when service is needed and checked fornull
. (Skipping a snapshot when service is not available is better than always issuing NPE). It could be a warning written into logs saying that service is not available.