private void dispose(final GSSContext context) {
        if (null != context) {
            try {
                SpnegoHttpURLConnection.LOCK.lock();
                try {
                    context.dispose();
                } finally {
                    SpnegoHttpURLConnection.LOCK.unlock();
                }
            } catch (GSSException gsse) {
                LOGGER.log(Level.WARNING, "call to dispose context failed.", gsse);
            }
        }
        
        if (null != this.credential && this.autoDisposeCreds) {
            try {
                this.credential.dispose();
            } catch (final GSSException gsse) {
                LOGGER.log(Level.WARNING, "call to dispose credential failed.", gsse);
            }
        }
        
        if (null != this.loginContext) {
            try {
                this.loginContext.logout();
            } catch (final LoginException le) {
                LOGGER.log(Level.WARNING, "call to logout context failed.", le);
            }
        }
    }