use of org.infinispan.persistence.support.NonBlockingStoreAdapter in project infinispan by infinispan.
the class TestingUtil method getFirstLoader.
public static <T extends CacheLoader<K, V>, K, V> T getFirstLoader(Cache<K, V> cache) {
PersistenceManagerImpl persistenceManager = getActualPersistenceManager(cache);
NonBlockingStore<K, V> nonBlockingStore = persistenceManager.<K, V>getAllStores(characteristics -> !characteristics.contains(NonBlockingStore.Characteristic.WRITE_ONLY)).get(0);
// noinspection unchecked
return (T) ((NonBlockingStoreAdapter<K, V>) nonBlockingStore).loader();
}
use of org.infinispan.persistence.support.NonBlockingStoreAdapter in project infinispan by infinispan.
the class TestingUtil method getFirstTxWriter.
@SuppressWarnings("unchecked")
public static <T extends CacheWriter<K, V>, K, V> T getFirstTxWriter(Cache<K, V> cache) {
PersistenceManagerImpl persistenceManager = getActualPersistenceManager(cache);
NonBlockingStore<K, V> nonBlockingStore = persistenceManager.<K, V>getAllStores(characteristics -> characteristics.contains(NonBlockingStore.Characteristic.TRANSACTIONAL)).get(0);
// TODO: Once stores convert to non blocking implementations this will change
return (T) ((NonBlockingStoreAdapter<K, V>) nonBlockingStore).transactionalStore();
}
use of org.infinispan.persistence.support.NonBlockingStoreAdapter in project infinispan by infinispan.
the class TestingUtil method getWriter.
public static <T extends CacheWriter<K, V>, K, V> T getWriter(Cache<K, V> cache, int position) {
PersistenceManagerImpl persistenceManager = getActualPersistenceManager(cache);
NonBlockingStore<K, V> nonBlockingStore = persistenceManager.<K, V>getAllStores(characteristics -> !characteristics.contains(NonBlockingStore.Characteristic.READ_ONLY)).get(position);
// TODO: Once stores convert to non blocking implementations this will change
return (T) ((NonBlockingStoreAdapter<K, V>) nonBlockingStore).writer();
}
Aggregations