-
Notifications
You must be signed in to change notification settings - Fork 1
/
TODO
47 lines (39 loc) · 1.26 KB
/
TODO
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
Some personal notes about what can be improved
==============================================
* Gui: try single jvm launching?
* Gui: try toplevel frame slurping?
* Applet: use downloader?
* Jar: verify signatures/auto accept signatures?
* standalone AppletViewer using Properties file?
* GitHub releases? Proper java version selector?
====
// Running JNLP without launching external
public class ExitPreventedException extends SecurityException {
protected int status = 0;
public ExitPreventedException setStatus(int code) {
status = code;
return this;
}
public int getStatus() { return status; }
}
public class PreventExitSecurityManager extends SecurityManager {
private SecurityManager parent;
PreventExitSecurityManager(SecurityManager _parent) {
parent = _parent;
}
PreventExitSecurityManager() {
this(System.getSecurityManager());
}
@Override
public void checkPermission(java.security.Permission perm) {
String name = perm.getName();
if (name.startsWith("exitVM.")) {
int code = -1;
try {
code = Integer.parseInt(name.substring("exitVM.".length()));
} catch (Exception e) {}
throw new ExitPreventedException().setStatus(code);
}
parent.checkPermission(perm);
}
}