@OnStop public static final class ModuleStop implements Runnable { @Override public void run() { close(); } }
@OnStop public static class OnShutdown implements Runnable { @Override public void run() { if (hasChecked) { VERSION_CHECKER.setChecked(); } } }
@OnStop public static class StopOp implements Runnable { @Override public void run() { AdapterWatcher.INSTANCE.stopMonitor(); } } }
@OnStop public static class Shutdown implements Runnable { @Override public void run() { shutdown(); } }
/** * This non-API class is public as an implementation detail. Don't use it, it may be removed anytime. */ @OnStop public static class StopOp implements Runnable { @Override public void run() { LOG.info("Stopping SNAP Desktop"); SnapApp.getDefault().onStop(); } }
@OnStop public static class Reporter implements Runnable { @Override public void run() { if (!extensionsToInclude.isEmpty()) { for (FileStatistics fileStatistics : instances.values()) { fileStatistics.report(); } } } }
@OnStop public static final class RunOnStop implements Runnable { @Override public void run() { WORKER.shutdown(); while (!WORKER.isTerminated()) { try { WORKER.awaitTermination(10, TimeUnit.SECONDS); } catch (InterruptedException ex) { Exceptions.printStackTrace(ex); } } } } }
/** * This non-API class is public as an implementation detail. Don't use it, it may be removed anytime. * <p> * NetBeans {@code @OnStop}: Annotation that can be applied to {@code Runnable} or {@code Callable<Boolean>} * subclasses with default constructor which will be invoked during shutdown sequence or when the * module is being shutdown. * <p> * First of all call {@code Callable}s are consulted to allow or deny proceeding with the shutdown. * <p> * If the shutdown is approved, all {@code Runnable}s registered are acknowledged and can perform the shutdown * cleanup. The {@code Runnable}s are invoked in parallel. It is guaranteed their execution is finished before * the shutdown sequence is over. */ @OnStop public static class MaybeStopOp implements Callable { @Override public Boolean call() { LOG.info("Request to stop SNAP Desktop"); return SnapApp.getDefault().onTryStop(); } }
@OnStop public class Installer implements Runnable {
@OnStop public static final class Stop implements Runnable {
/** * Ensures that DOM Tree window group is closed when the IDE shuts down. */ @OnStop public static class ShutdownHook implements Callable<Boolean>, WindowSystemListener { /** Determines whether the window system listener has been installed already. */ private boolean listenerInstalled; @Override public Boolean call() throws Exception { if (!listenerInstalled) { listenerInstalled = true; WindowManager.getDefault().addWindowSystemListener(this); } return Boolean.TRUE; } @Override public void beforeLoad(WindowSystemEvent event) { } @Override public void afterLoad(WindowSystemEvent event) { } @Override public void beforeSave(WindowSystemEvent event) { // Close the group before window system saves its state (during IDE shutdown) getDOMTCGroup().close(); } @Override public void afterSave(WindowSystemEvent event) { } }