public Object run() throws ClassNotFoundException, InstantiationException, IllegalAccessException { return Class.forName (finalClass, true, getClassLoader()).newInstance(); } });
public Object run() throws ClassNotFoundException, InstantiationException, IllegalAccessException { return Class.forName (finalClass, true, getClassLoader()).newInstance(); } });
/** * get a custom config file parser * * XXX custom file that can be used in place of [domain|sun-acc].xml */ private static ConfigParser loadParser(String className) throws IOException { try { final String finalClassName = className; final ClassLoader finalLoader = AuthConfig.getClassLoader(); return (ConfigParser)java.security.AccessController.doPrivileged (new java.security.PrivilegedExceptionAction() { public Object run() throws Exception { Class c = Class.forName(finalClassName,true,finalLoader); return c.newInstance(); } }); } catch (java.security.PrivilegedActionException pae) { IOException iex = new IOException(pae.getException().toString()); iex.initCause(pae.getException()); throw iex; } }
/** * get a custom config file parser * * XXX custom file that can be used in place of [domain|sun-acc].xml */ private static ConfigParser loadParser(String className) throws IOException { try { final String finalClassName = className; final ClassLoader finalLoader = AuthConfig.getClassLoader(); return (ConfigParser)java.security.AccessController.doPrivileged (new java.security.PrivilegedExceptionAction() { public Object run() throws Exception { Class c = Class.forName(finalClassName,true,finalLoader); return c.newInstance(); } }); } catch (java.security.PrivilegedActionException pae) { IOException iex = new IOException(pae.getException().toString()); iex.initCause(pae.getException()); throw iex; } }
/** * get the default callback handler */ private static CallbackHandler loadDefaultCallbackHandler() throws AuthException { // get the default handler class try { final ClassLoader finalLoader = AuthConfig.getClassLoader(); return (CallbackHandler) java.security.AccessController.doPrivileged (new java.security.PrivilegedExceptionAction() { public Object run() throws Exception { String className = DEFAULT_HANDLER_CLASS; Class c = Class.forName(className, true, finalLoader); return c.newInstance(); } }); } catch (java.security.PrivilegedActionException pae) { AuthException aex = new AuthException(pae.getException().toString()); aex.initCause(pae.getException()); throw aex; } }
/** * get the default callback handler */ private static CallbackHandler loadDefaultCallbackHandler() throws AuthException { // get the default handler class try { final ClassLoader finalLoader = AuthConfig.getClassLoader(); return (CallbackHandler) java.security.AccessController.doPrivileged (new java.security.PrivilegedExceptionAction() { public Object run() throws Exception { String className = DEFAULT_HANDLER_CLASS; Class c = Class.forName(className, true, finalLoader); return c.newInstance(); } }); } catch (java.security.PrivilegedActionException pae) { AuthException aex = new AuthException(pae.getException().toString()); aex.initCause(pae.getException()); throw aex; } }
/** * Return a new instance of the module contained in this entry. * * <p> The default implementation of this method attempts * to invoke the default no-args constructor of the module class. * This method may be overridden if a different constructor * should be invoked. * * @return a new instance of the module contained in this entry. * * @exception AuthException if the instantiation failed. */ Object newInstance() throws AuthException { try { final ClassLoader finalLoader= AuthConfig.getClassLoader(); String clazz = getLoginModuleName(); Class c = Class.forName(clazz, true, finalLoader); java.lang.reflect.Constructor constructor = c.getConstructor(PARAMS); return constructor.newInstance(ARGS); } catch (Exception e) { AuthException ae = new AuthException(); ae.initCause(e); throw ae; } } }
/** * Return a new instance of the module contained in this entry. * * <p> The default implementation of this method attempts * to invoke the default no-args constructor of the module class. * This method may be overridden if a different constructor * should be invoked. * * @return a new instance of the module contained in this entry. * * @exception AuthException if the instantiation failed. */ Object newInstance() throws AuthException { try { final ClassLoader finalLoader= AuthConfig.getClassLoader(); String clazz = getLoginModuleName(); Class c = Class.forName(clazz, true, finalLoader); java.lang.reflect.Constructor constructor = c.getConstructor(PARAMS); return constructor.newInstance(ARGS); } catch (Exception e) { AuthException ae = new AuthException(); ae.initCause(e); throw ae; } } }