public static AuthConfigProvider newConfigProvider()

in geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/impl/ConfigProviderImpl.java [138:165]


    public static AuthConfigProvider newConfigProvider(final AuthConfigFactory authConfigFactory, final ConfigProviderType configProviderType) {
        AuthConfigProvider provider;
        if (configProviderType.getClassName() == null) {
            provider = new ConfigProviderImpl(configProviderType.getClientAuthConfig(), configProviderType.getServerAuthConfig());
        } else {
            try {
                provider = java.security.AccessController
                .doPrivileged(new PrivilegedExceptionAction<AuthConfigProvider>() {
                    public AuthConfigProvider run() throws ClassNotFoundException, SecurityException, NoSuchMethodException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException {
                        Class<? extends AuthConfigProvider> cl = ProviderLocator.loadClass(configProviderType.getClassName(), getClass(), Thread.currentThread().getContextClassLoader()).asSubclass(AuthConfigProvider.class);
                        Constructor<? extends AuthConfigProvider> cnst = cl.getConstructor(Map.class, AuthConfigFactory.class);
                        return cnst.newInstance(configProviderType.getProperties(), authConfigFactory);
                    }
                });
            } catch (PrivilegedActionException e) {
                Exception inner = e.getException();
                if (inner instanceof InstantiationException) {
                    throw new SecurityException("AuthConfigFactory error:"
                                    + inner.getCause().getMessage(), inner.getCause());
                } else {
                    throw new SecurityException("AuthConfigFactory error: " + inner, inner);
                }
            } catch (Exception e) {
                throw new SecurityException("AuthConfigFactory error: " + e, e);
            }
        }
        return provider;
    }