Interface DestroyListener
-
@Contract @ConstrainedTo(SERVER) public interface DestroyListener
A listener contract that allows any registered implementation class to receive application destroy events.The
onDestroy()method is called when application is being destroyed and after all the pendingmonitoring statistics eventshave been dispatched and processed.The advantage of using
DestroyListenerover usingApplicationEventListenerdirectly to check for theApplicationEvent.Type.DESTROY_FINISHEDevent is, that theonDestroy()method is guaranteed to be called only AFTER all theMonitoringStatisticsListener#onStatistics()events have been dispatched and processed, as opposed to using theApplicationEventListenerdirectly, in which case some monitoring statistics events may still be concurrently fired after theDESTROY_FINISHEDevent has been dispatched (due to potential race conditions).- Since:
- 2.12
- Author:
- Miroslav Fuksa, Adam Lindenthal
- See Also:
MonitoringStatisticsListener
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidonDestroy()The method is called when application is destroyed.
-
-
-
Method Detail
-
onDestroy
void onDestroy()
The method is called when application is destroyed. Use this method release resources of the listener. This method will be called in the thread safe way (synchronously and by a single thread) according to other methods from the relatedMonitoringStatisticsListenerinterface.
-
-