Java 8 Configuration - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 Configuration class.

This code example shows how to use the following methods:setConfiguration
        return auth;
    } 
 
    static void setJAASConfiguration(Configuration auth) {
        if (auth != null) {
            LOG.trace("Restoring existing JAAS Configuration {}", auth);
            try { 
                Configuration.setConfiguration(auth);
            } catch (SecurityException e) {
                LOG.trace("Cannot restore JAAS Configuration. This exception is ignored.", e);
            } 
        } else { 
            LOG.trace("No JAAS Configuration to restore"); 
        } 
    } 
 
} 
6
CodeRank
This code example shows how to use the following methods:setConfiguration
        return auth;
    } 
 
    static void setJAASConfiguration(Configuration auth) {
        if (auth != null) {
            LOG.trace("Restoring existing JAAS Configuration {}", auth);
            try { 
                Configuration.setConfiguration(auth);
            } catch (SecurityException e) {
                LOG.trace("Cannot restore JAAS Configuration. This exception is ignored.", e);
            } 
        } else { 
            LOG.trace("No JAAS Configuration to restore"); 
        } 
    } 
 
} 
6
CodeRank
This code example shows how to use the following methods:setConfiguration
     *  
     */ 
    public static void obtainTGT( Subject subject, String userName, String password ) throws LoginException
    { 
        // Use our custom configuration to avoid reliance on external config 
        Configuration.setConfiguration( new Krb5LoginConfiguration() );
 
        // Obtain TGT 
        LoginContext lc = new LoginContext( KerberosUdpITest.class.getName(), subject, new
            CallbackHandlerBean( userName, password ) );
        lc.login();
    } 
 
    private static class CallbackHandlerBean implements CallbackHandler
    { 
        private String name;
        private String password;
 
 
        /** 
3
CodeRank
This code example shows how to use the following methods:setConfiguration
        int count = counter.decrementAndGet();
        if (count == 0) {
            LogFactory.getLog(LoginConfiguration.class).trace( 
                    "uninstalled login configuration " + context.thread,
                    context.stacktrace);
            Configuration.setConfiguration(context.parent);
            context = null;
        } 
    } 
 
    /** 
     * @since 5.9.5 
     */ 
    public void cleanupThisThread() { 
        holder.remove();
    } 
 
} 
3
CodeRank
See Code Examples for Java 8 Configuration Methods: