private synchronized void reLogin() throws LoginException {
    if (!isKrbTicket) {
      return;
    }
    if (loginContext == null) {
      throw new LoginException("Login must be done first");
    }
    if (!hasSufficientTimeElapsed()) {
      return;
    }
    log.info("Initiating logout for {}", principal);
    synchronized (KerberosLogin.class) {
      // register most recent relogin attempt
      lastLogin = currentElapsedTime();
      //clear up the kerberos state. But the tokens are not cleared! As per
      //the Java kerberos login module code, only the kerberos credentials
      //are cleared
      loginContext.logout();
      //login and also update the subject field of this instance to
      //have the new credentials (pass it to the LoginContext constructor)
      loginContext = new LoginContext(loginContextName, subject);
      log.info("Initiating re-login for {}", principal);
      loginContext.login();
    }
  }
private synchronized void reLogin() throws LoginException {
    if (!isKrbTicket) {
      return;
    }
    if (loginContext == null) {
      throw new LoginException("Login must be done first");
    }
    if (!hasSufficientTimeElapsed()) {
      return;
    }
    log.info("Initiating logout for {}", principal);
    synchronized (KerberosLogin.class) {
      
      lastLogin = currentElapsedTime();
      
      
      
      loginContext.logout();
      
      
      loginContext = new LoginContext(loginContextName, subject);
      log.info("Initiating re-login for {}", principal);
      loginContext.login();
    }
  }
private synchronized void reLogin ( ) throws LoginException { if ( ! isKrbTicket ) { return ; } if ( loginContext == null ) { throw new LoginException ( "Login must be done first" ) ; } if ( ! hasSufficientTimeElapsed ( ) ) { return ; } log . info ( "Initiating logout for {}" , principal ) ; synchronized ( KerberosLogin . class ) { // register most recent relogin attempt lastLogin = currentElapsedTime ( ) ; //clear up the kerberos state. But the tokens are not cleared! As per //the Java kerberos login module code, only the kerberos credentials //are cleared loginContext . logout ( ) ; //login and also update the subject field of this instance to //have the new credentials (pass it to the LoginContext constructor) loginContext = new LoginContext ( loginContextName , subject ) ; log . info ( "Initiating re-login for {}" , principal ) ; loginContext . login ( ) ; } }
Re-login a principal. This method assumes that {@link #login(String)} has happened already.
@throws javax.security.auth.login.LoginException on a failure
Re - login a principal . This method assumes that {