@Test public void basicLifecycle() throws Exception { CacheManager cacheManager = underTest.get(); assertThat(cacheManager, notNullValue()); CacheManager cacheManager2 = underTest.get(); assertThat(cacheManager2, is(cacheManager)); underTest.stop(); try { underTest.get(); fail(); } catch (IllegalStateException e) { } underTest.start(); }
@Override public synchronized CacheManager get() { checkState(!isStopped(), "Cache-manager destroyed"); if (cacheManager == null) { this.cacheManager = create(configUri); } return cacheManager; }
EhCacheManagerProvider extends LifecycleSupport implements Provider<CacheManager> { @Override public synchronized CacheManager get() { checkState(!isStopped(), "Cache-manager destroyed"); if (cacheManager == null) { this.cacheManager = create(configUri); } return cacheManager; } }
EhCacheManagerProvider extends LifecycleSupport implements Provider<CacheManager> { @Override public synchronized CacheManager get() { checkState(!isStopped(), "Cache-manager destroyed"); if (cacheManager == null) { this.cacheManager = create(configUri); } return cacheManager; } @Inject  EhCacheManagerProvider(final ApplicationDirectories directories); @VisibleForTesting  EhCacheManagerProvider(@Nullable final URI uri); }
EhCacheManagerProvider extends LifecycleSupport implements Provider<CacheManager> { @Override public synchronized CacheManager get() { checkState(!isStopped(), "Cache-manager destroyed"); if (cacheManager == null) { this.cacheManager = create(configUri); } return cacheManager; } @Inject  EhCacheManagerProvider(final ApplicationDirectories directories); @VisibleForTesting  EhCacheManagerProvider(@Nullable final URI uri); @Override synchronized CacheManager get(); }
EhCacheManagerProvider extends LifecycleSupport implements Provider<CacheManager> { @Override public synchronized CacheManager get() { checkState(!isStopped(), "Cache-manager destroyed"); if (cacheManager == null) { this.cacheManager = create(configUri); } return cacheManager; } @Inject  EhCacheManagerProvider(final ApplicationDirectories directories); @VisibleForTesting  EhCacheManagerProvider(@Nullable final URI uri); @Override synchronized CacheManager get();  }