예제 #1
0
 @Override
 public void invalidateCache() {
   if (userCache.isValid()) {
     // User must be updated before style bindings updated.
     userCache.invalidateCache();
     performLoginStatusChangeActions(userCache.getUser());
   }
 }
예제 #2
0
  @PostConstruct
  private void setup() {
    performLoginStatusChangeActions(userCache.getUser());
    InitVotes.waitFor(SecurityContext.class);
    InitVotes.registerOneTimeDependencyCallback(
        ClientMessageBus.class,
        new Runnable() {

          @Override
          public void run() {
            if (((ClientMessageBusImpl) ErraiBus.get()).getState() == BusState.CONNECTED) {
              initializeCacheFromServer();
            } else {
              // Don't cause initialization to fail if remote communication is disabled
              InitVotes.voteFor(SecurityContext.class);
            }
          }
        });
  }
예제 #3
0
 @Override
 public boolean isUserCacheValid() {
   return userCache.isValid();
 }
예제 #4
0
 @Override
 public void setCachedUser(final User user) {
   // User must be updated before style bindings updated.
   userCache.setUser(user);
   performLoginStatusChangeActions(user);
 }
예제 #5
0
 @Override
 public User getCachedUser() {
   return userCache.getUser();
 }
예제 #6
0
 @Override
 public boolean hasCachedUser() {
   return userCache.hasUser();
 }