1 /*
2  * @(#) $Id: PerfTestLauncher.java,v 1.2 2003/07/08 08:13:52 pankaj Exp $
3  *
4  * Copyright (c) 2002-03 by Pankaj Kumar (http://www.pankaj-k.net). 
5  * All rights reserved.
6  *
7  * The license governing the use of this file can be found in the 
8  * root directory of the containing software.
9  */
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