Class SingleInstanceService


  • public class SingleInstanceService
    extends Object
    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.
    Since:
    10
    • Method Detail

      • registerSingleInstance

        public static void registerSingleInstance​(SingleInstanceListener slistener)
        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.
      • unregisterSingleInstance

        public static void unregisterSingleInstance​(SingleInstanceListener slistener)
        Unregisters SingleInstanceListener for current process. If the SingleInstanceListener object is not registered, or slistener is null, then the unregistration is skipped.
        Parameters:
        slistener - the listener for unregistering.