Example #1
0
  static {
    InitVotes.waitFor(MarshallerFramework.class);
    marshallerFactory = GWT.create(MarshallerFactory.class);

    ParserFactory.registerParser(
        new Parser() {
          @Override
          public EJValue parse(String input) {
            return GWTJSON.wrap(JSONParser.parseStrict(input));
          }
        });

    InitVotes.voteFor(MarshallerFramework.class);
  }
  @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);
            }
          }
        });
  }