- java.lang.Object
-
- jdk.packager.services.singleton.SingleInstanceService
-
public class SingleInstanceService extends Object
TheSingleInstanceServiceclass 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.- Since:
- 10
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidregisterSingleInstance(SingleInstanceListener slistener)RegistersSingleInstanceListenerfor current process.static voidregisterSingleInstance(SingleInstanceListener slistener, boolean setFileHandler)RegistersSingleInstanceListenerfor current process.static voidunregisterSingleInstance(SingleInstanceListener slistener)UnregistersSingleInstanceListenerfor current process.
-
-
-
Method Detail
-
registerSingleInstance
public static void registerSingleInstance(SingleInstanceListener slistener)
RegistersSingleInstanceListenerfor current process. If theSingleInstanceListenerobject is already registered, orslistenerisnull, then the registration is skipped.- Parameters:
slistener- the listener to handle the single instance behaviour.
-
registerSingleInstance
public static void registerSingleInstance(SingleInstanceListener slistener, boolean setFileHandler)
RegistersSingleInstanceListenerfor current process. If theSingleInstanceListenerobject is already registered, orslistenerisnull, then the registration is skipped.- Parameters:
slistener- the listener to handle the single instance behaviour.setFileHandler- iftrue, the listener is notified when the application is asked to open a list of files. If OS is not MacOS, the parameter is ignored.
-
unregisterSingleInstance
public static void unregisterSingleInstance(SingleInstanceListener slistener)
UnregistersSingleInstanceListenerfor current process. If theSingleInstanceListenerobject is not registered, orslistenerisnull, then the unregistration is skipped.- Parameters:
slistener- the listener for unregistering.
-
-