src/jdk.jpackager.runtime/share/classes/jdk/jpackager/runtime/singleton/SingleInstanceListener.java
branchJDK-8200758-branch
changeset 57028 51cc1a1f91f3
parent 57017 1b08af362a30
equal deleted inserted replaced
57027:124983f48645 57028:51cc1a1f91f3
    25 
    25 
    26 package jdk.jpackager.runtime.singleton;
    26 package jdk.jpackager.runtime.singleton;
    27 
    27 
    28 /**
    28 /**
    29  * The {@code SingleInstanceListener} interface is used for implementing
    29  * The {@code SingleInstanceListener} interface is used for implementing
    30  * Single Instance functionality for Java Packager.
    30  * Single Instance functionality for applications packaged by jpackager.
    31  *
    31  *
    32  * @since 12
    32  * @since 12
    33  */
    33  */
    34 public interface SingleInstanceListener {
    34 public interface SingleInstanceListener {
    35 
    35 
    36     /**
    36     /**
    37      * This method should be implemented by the application to
    37      * {@code newActivation()} should be implemented by the application to
    38      * handle the single instance behaviour - how should the application
    38      * handle the single instance behavior.
    39      * handle the arguments when another instance of the application is
    39      * When a single instance application is running, the launcher of a
    40      * invoked with params.
    40      * secondary instance of that application will call {@code newActivation()}
       
    41      * in the first running instance instead of launching another instance of
       
    42      * the application.
    41      *
    43      *
    42      * @param params parameters for the application main
    44      * @param args
       
    45      * Arguments from the instances of the application will be passed
       
    46      * into the {@code newActivation()} method. An application developer can
       
    47      * decide how to handle the arguments passed by implementating this method.
    43      */
    48      */
    44     public void newActivation(String... params);
    49     public void newActivation(String... args);
       
    50 
    45 }
    51 }