Code example for UnsupportedCallbackException

Methods: getCallback

      LoginException ex = new LoginException(
          "IOException logging in."); 
      throw ex;
    } catch (UnsupportedCallbackException e) {
      String className = e.getCallback().getClass().getName();
      LoginException ex = new LoginException(className
          + " is not a supported Callback."); 
      throw ex;
    // Now that the CallbackHandler has gathered the username and password, 
    // use them to authenticate the user against the expected passwords. 
    name = nameCB.getName();
    password = String.valueOf(passwordCB.getPassword());
    if ("sysadmin".equals(name) && "password".equals(password)) {
      // login in sysadmin 
      return true;