1
10import javax.security.auth.Subject;
11import javax.security.auth.login.LoginContext;
12import java.security.PrivilegedExceptionAction;
13
14public class PerfTestLauncher {
15 public static void main(String[] args) throws Exception {
16 LoginContext lc = new LoginContext("DF", new DFCallbackHandler());
17 lc.login();
18 final String[] args1 = new String[args.length];
19 System.arraycopy(args, 0, args1, 0, args.length);
20 PrivilegedExceptionAction action = new PrivilegedExceptionAction() {
21 public Object run() throws Exception{
22 PerfTest.main(args1);
23 return null;
24 }
25 };
26 Subject.doAs(lc.getSubject(), action);
27 }
28}
29