Esempio n. 1
0
 public void refresh() {
   synchronized (getMonitor()) {
     AccessGrant accessGrant =
         serviceProvider.getOAuthOperations().refreshAccess(refreshToken, null, null);
     initAccessTokens(
         accessGrant.getAccessToken(), accessGrant.getRefreshToken(), accessGrant.getExpireTime());
     initApi();
   }
 }
Esempio n. 2
0
 @SuppressWarnings("unchecked")
 private void initApiProxy() {
   Class<?> apiType =
       GenericTypeResolver.resolveTypeArgument(serviceProvider.getClass(), ServiceProvider.class);
   if (apiType.isInterface()) {
     apiProxy =
         (A)
             Proxy.newProxyInstance(
                 apiType.getClassLoader(), new Class[] {apiType}, new ApiInvocationHandler());
   }
 }
Esempio n. 3
0
 private void initApi() {
   api = serviceProvider.getApi(accessToken);
 }