- java.lang.Object
-
- jdk.packager.services.singleton.SingleInstanceService
-
public class SingleInstanceService extends Object
TheSingleInstanceService
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.- Since:
- 10
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
registerSingleInstance(SingleInstanceListener slistener)
RegistersSingleInstanceListener
for current process.static void
registerSingleInstance(SingleInstanceListener slistener, boolean setFileHandler)
RegistersSingleInstanceListener
for current process.static void
unregisterSingleInstance(SingleInstanceListener slistener)
UnregistersSingleInstanceListener
for current process.
-
-
-
Method Detail
-
registerSingleInstance
public static void registerSingleInstance(SingleInstanceListener slistener)
RegistersSingleInstanceListener
for current process. If theSingleInstanceListener
object is already registered, orslistener
isnull
, then the registration is skipped.- Parameters:
slistener
- the listener to handle the single instance behaviour.
-
registerSingleInstance
public static void registerSingleInstance(SingleInstanceListener slistener, boolean setFileHandler)
RegistersSingleInstanceListener
for current process. If theSingleInstanceListener
object is already registered, orslistener
isnull
, 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)
UnregistersSingleInstanceListener
for current process. If theSingleInstanceListener
object is not registered, orslistener
isnull
, then the unregistration is skipped.- Parameters:
slistener
- the listener for unregistering.
-
-