public static void registerForCleanupOnExit()

in java/main/src/main/java/com/epam/deltix/utilities/FileJanitor.java [232:249]


    public static void registerForCleanupOnExit() {

        synchronized (_cleanupLock) {
            if (!_handlerRegistered) {
                try {
                    Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {
                        public void run() {
                            tryCleanup();
                        }
                    }));

                    _handlerRegistered = true;
                } catch (final IllegalStateException e) {
                    // Already shutting down. Can't add shutdown hook at this point.
                }
            }
        }
    }