Package com.google.appengine.api.appidentity.AppIdentityService

Examples of com.google.appengine.api.appidentity.AppIdentityService.GetAccessTokenResult


   * continue to use the old token.
   */
  @Override
  protected String getToken() {
    verifyProdOnly();
    GetAccessTokenResult token = accessToken.get();
    if (token == null || isExpired(token)
        || (isAboutToExpire(token) && refreshInProgress.compareAndSet(false, true))) {
      lock.lock();
      try {
        token = accessToken.get();
        if (token == null || isAboutToExpire(token)) {
          token = appIdentityService.getAccessToken(oauthScopes);
          accessToken.set(token);
          cacheExpirationHeadroom.set(getNextCacheExpirationHeadroom());
        }
      } finally {
        refreshInProgress.set(false);
        lock.unlock();
      }
    }
    return token.getAccessToken();
  }
View Full Code Here

TOP

Related Classes of com.google.appengine.api.appidentity.AppIdentityService.GetAccessTokenResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.