@Override public void invalidateCache() { if (userCache.isValid()) { // User must be updated before style bindings updated. userCache.invalidateCache(); performLoginStatusChangeActions(userCache.getUser()); } }
@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); } } }); }
@Override public boolean isUserCacheValid() { return userCache.isValid(); }
@Override public void setCachedUser(final User user) { // User must be updated before style bindings updated. userCache.setUser(user); performLoginStatusChangeActions(user); }
@Override public User getCachedUser() { return userCache.getUser(); }
@Override public boolean hasCachedUser() { return userCache.hasUser(); }