@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; }
@PreDestroy public synchronized void shutdown() { if (store != null) { store.shutdown(); } }