The SingleInstanceService class provides public methods for using
Single Instance functionality for Java Packager. To use these methods,
the option named "-singleton" must be specified on javapackager command line.
Registers SingleInstanceListener for current process.
If the SingleInstanceListener object is already registered, or
slistener is null, then the registration is skipped.
Parameters:
slistener - the listener to handle the single instance behaviour.
registerSingleInstance
public static void registerSingleInstance(SingleInstanceListener slistener,
boolean setFileHandler)
Registers SingleInstanceListener for current process.
If the SingleInstanceListener object is already registered, or
slistener is null, then the registration is skipped.
Parameters:
slistener - the listener to handle the single instance behaviour.
setFileHandler - if true, the listener is notified when the
application is asked to open a list of files. If OS is not MacOS,
the parameter is ignored.
Unregisters SingleInstanceListener for current process.
If the SingleInstanceListener object is not registered, or
slistener is null, then the unregistration is skipped.