Java 6 runs applets in the same browser in the same vm, so a second instance will get an OverlappingFileLockException
This commit is contained in:
@@ -38,6 +38,7 @@ import java.net.URL;
|
|||||||
import java.net.URLClassLoader;
|
import java.net.URLClassLoader;
|
||||||
import java.nio.channels.FileChannel;
|
import java.nio.channels.FileChannel;
|
||||||
import java.nio.channels.FileLock;
|
import java.nio.channels.FileLock;
|
||||||
|
import java.nio.channels.OverlappingFileLockException;
|
||||||
import java.security.AllPermission;
|
import java.security.AllPermission;
|
||||||
import java.security.CodeSource;
|
import java.security.CodeSource;
|
||||||
import java.security.GeneralSecurityException;
|
import java.security.GeneralSecurityException;
|
||||||
@@ -1050,6 +1051,11 @@ public class Application
|
|||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Log.warning("Unable to create lock [message=" + e.getMessage() + "]");
|
Log.warning("Unable to create lock [message=" + e.getMessage() + "]");
|
||||||
Log.logStackTrace(e);
|
Log.logStackTrace(e);
|
||||||
|
return false;
|
||||||
|
} catch (OverlappingFileLockException e) {
|
||||||
|
Log.warning("The lock is held elsewhere in this JVM");
|
||||||
|
Log.logStackTrace(e);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
Log.info("Able to lock for updates: " + (_lock != null));
|
Log.info("Able to lock for updates: " + (_lock != null));
|
||||||
return _lock != null;
|
return _lock != null;
|
||||||
|
|||||||
Reference in New Issue
Block a user