Java Code Examples for org.ehcache.Status#UNINITIALIZED

The following examples show how to use org.ehcache.Status#UNINITIALIZED . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: StatusTransitioner.java    From ehcache3 with Apache License 2.0 5 votes vote down vote up
void checkAvailable() {
  final Status status = currentStatus();
  if(status == Status.MAINTENANCE && Thread.currentThread() != maintenanceLease) {
    throw new IllegalStateException("State is " + status + ", yet you don't own it!");
  } else if(status == Status.UNINITIALIZED) {
    throw new IllegalStateException("State is " + status);
  }
}
 
Example 2
Source File: BasicClusteredCacheOpsReplicationMultiThreadedTest.java    From ehcache3 with Apache License 2.0 5 votes vote down vote up
@After
public void tearDown() throws Exception {
  List<Runnable> unprocessed = executorService.shutdownNow();
  if(!unprocessed.isEmpty()) {
    log.warn("Tearing down with {} unprocess task", unprocessed);
  }
  if(cacheManager1 != null && cacheManager1.getStatus() != Status.UNINITIALIZED) {
    cacheManager1.close();
  }
  if(cacheManager2 != null && cacheManager2.getStatus() != Status.UNINITIALIZED) {
    cacheManager2.close();
  }
}
 
Example 3
Source File: Eh107Cache.java    From ehcache3 with Apache License 2.0 4 votes vote down vote up
private boolean syncedIsClose() {
  if (ehCache.getStatus() == Status.UNINITIALIZED && !hypotheticallyClosed.get()) {
    close();
  }
  return hypotheticallyClosed.get();
}
 
Example 4
Source File: Eh107CacheManager.java    From ehcache3 with Apache License 2.0 4 votes vote down vote up
@Override
public boolean isClosed() {
  return ehCacheManager.getStatus() == Status.UNINITIALIZED;
}
 
Example 5
Source File: StatusTransitioner.java    From ehcache3 with Apache License 2.0 4 votes vote down vote up
private void validateHookRegistration() {
  if(currentStatus() != Status.UNINITIALIZED) {
    throw new IllegalStateException("Can't modify hooks when not in " + Status.UNINITIALIZED);
  }
}