Пример #1
0
    @Override
    public synchronized DistributedStore get() {
      if (store == null) {
        LocalStore localStore = injector.getInstance(localStoreKey);
        StoreConfig storeConfig = injector.getInstance(storeConfigKey);
        RemoteStore remoteStore = injector.getInstance(remoteStoreKey);

        store = new DistributedStore(name, localStore, remoteStore, storeConfig, dateTimeProvider);
        store.start();
      }

      return store;
    }
Пример #2
0
 @PreDestroy
 public synchronized void shutdown() {
   if (store != null) {
     store.shutdown();
   }
 }