Пример #1
0
 public void refresh() {
   synchronized (getMonitor()) {
     AccessGrant accessGrant =
         serviceProvider.getOAuthOperations().refreshAccess(refreshToken, null, null);
     initAccessTokens(
         accessGrant.getAccessToken(), accessGrant.getRefreshToken(), accessGrant.getExpireTime());
     initApi();
   }
 }
Пример #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());
   }
 }
Пример #3
0
 private void initApi() {
   api = serviceProvider.getApi(accessToken);
 }