public class ModuleInstall extends SharedClassObject
OnStart
or its
dual peer OnStop
.
Specify this class in the manifest file with OpenIDE-Module-Install
.
Constructor and Description |
---|
ModuleInstall() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
clearSharedData() |
void |
close()
Called when all modules agreed with closing and NetBeans will be closed.
|
boolean |
closing()
Called when NetBeans is about to exit.
|
void |
installed()
Deprecated.
Use
ModuleInstall.restored() instead. |
void |
restored()
Called when an already-installed module is restored (during startup).
|
void |
uninstalled()
Called when the module is disabled while the application is still running.
|
void |
updated(int release,
String specVersion)
Deprecated.
Use
ModuleInstall.restored() instead. |
void |
validate()
Called when a module is being considered for loading.
|
addNotify, addPropertyChangeListener, equals, finalize, findObject, findObject, firePropertyChange, getLock, getProperty, hashCode, initialize, putProperty, putProperty, readExternal, removeNotify, removePropertyChangeListener, reset, writeExternal, writeReplace
public void validate() throws IllegalStateException
ModuleInstall.installed()
, ModuleInstall.restored()
,
or ModuleInstall.updated(int, java.lang.String)
are called.) If something is critically
wrong with the module (missing ad-hoc dependency, missing
license key, etc.) then IllegalStateException
may be thrown to prevent it from being loaded (preferably
with a localized annotation). The default implementation
does nothing. The module cannot assume much about when this
method will be called; specifically it cannot rely on layers
or manifest sections to be ready, nor for the module's classloader
to exist in the system class loader (so if loading bundles, icons,
and so on, specifically pass in the class loader of the install
class rather than relying on the default modules class loader).IllegalStateException
@Deprecated public void installed()
ModuleInstall.restored()
instead.public void restored()
Note that it is possible for module code to be run before this method is called, and that code must be ready nonetheless. For example, data loaders might be asked to recognize a file before the module is "restored". For this reason, but more importantly for general performance reasons, modules should avoid doing anything here that is not strictly necessary - often by moving initialization code into the place where the initialization is actually first required (if ever). This method should serve as a place for tasks that must be run once during every startup, and that cannot reasonably be put elsewhere.
Basic programmatic services are available to the module at this stage - for example, its class loader is ready for general use, any objects registered declaratively to lookup are ready to be queried, and so on.
OnStart
@Deprecated public void updated(int release, String specVersion)
ModuleInstall.restored()
instead.public void uninstalled()
ModuleInstall.restored()
.
Beware: in practice there is no way to ensure that this method will really be called. The module might simply be deleted or disabled while the application is not running. In fact this is always the case in NetBeans 6.0; the Plugin Manager only uninstalls or disables modules between restarts. This method will still be called if you reload a module during development.
public boolean closing()
true
.
The module may cancel the exit if it is not prepared to be shut down.true
if it is ok to exitOnStop
public void close()
OnStop
protected boolean clearSharedData()
clearSharedData
in class SharedClassObject