org.openide
Class LifecycleManager

java.lang.Object
  extended by org.openide.LifecycleManager

public abstract class LifecycleManager
extends java.lang.Object

Manages major aspects of the NetBeans lifecycle - currently saving all objects and exiting.

Since:
3.14
Author:
Jesse Glick

Constructor Summary
protected LifecycleManager()
          Subclass constructor.
 
Method Summary
abstract  void exit()
          Exit NetBeans.
static LifecycleManager getDefault()
          Get the default lifecycle manager.
abstract  void saveAll()
          Save all opened objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LifecycleManager

protected LifecycleManager()
Subclass constructor.

Method Detail

getDefault

public static LifecycleManager getDefault()
Get the default lifecycle manager. Normally this is found in Lookup.getDefault() but if no instance is found there, a fallback instance is returned which behaves as follows:
  1. saveAll() does nothing
  2. exit() calls System.exit(int) with an exit code of 0
This is useful for unit tests and perhaps standalone library usage.

Returns:
the default instance (never null)

saveAll

public abstract void saveAll()
Save all opened objects.


exit

public abstract void exit()
Exit NetBeans. This method will return only if System.exit(int) fails, or if at least one component of the system refuses to exit (because it cannot be properly shut down).