package net.milanaleksic.winlauncher;

import java.nio.channels.FileLock;

public abstract class ApplicationLogic {

    private FileLock lock = null;

    private final WinLauncherConfig config;

    public ApplicationLogic() {
        this.config = new WinLauncherConfig();
    }

    public ApplicationLogic(WinLauncherConfig config) {
        this.config = config;
    }

    public abstract void run() ;

    public abstract void couldNotRun(Exception e) ;

    void setFileLock(FileLock lock) {
        this.lock = lock;
    }

    public void restartApplication() {
        WinLauncherUtil.closeSingletonApplicationFileLock(lock);
        WinLauncherUtil.restartApplication(config);
    }

}

@@ -452,24 +452,129 @@
 ption e) ;%0A%0A
+    // this method is package-visible to allow only WinLauncherUtil to set the file lock member variable%0A
     void set

comment describing package-visibility of net.milanaleksic.winlauncher.ApplicationLogic.setFileLock(FileLock lock)