Code example for CallbackHandler

Methods: handle

0
    public boolean login() throws LoginException { 
        loginSucceeded = true;
        if (credentialsInvalidate) {
            PasswordCallback passwordCallback = new PasswordCallback("Password: ", false);
            try { 
                 callbackHandler.handle(new Callback[]{passwordCallback});
                 if (passwordCallback.getPassword() != null) {
                     if (debug) {
                        LOG.debug("Guest login failing (credentialsInvalidate=true) on presence of a password"); 
                     } 
                     loginSucceeded = false;
                     passwordCallback.clearPassword();
                 }; 
             } catch (IOException ioe) {
             } catch (UnsupportedCallbackException uce) {
             } 
        } 
        if (debug) {
            LOG.debug("Guest login " + loginSucceeded);
        }