@Override public XAResource[] getXAResources() { return new XAResource[] { this.cache.getAdvancedCache().getXAResource() }; }
@Override public ModelNode execute(ExpressionResolver expressionResolver, ModelNode operation, AdvancedCache<?, ?> cache) { cache.setAvailability(AvailabilityMode.AVAILABLE); return null; } },
public InfinispanBatcher(Cache<?, ?> cache) { this(cache.getAdvancedCache().getTransactionManager()); }
@SuppressWarnings("unchecked") public InfinispanSessionMetaDataFactory(Cache<? extends Key<String>, ?> cache, CacheProperties properties) { this.creationMetaDataCache = (Cache<SessionCreationMetaDataKey, SessionCreationMetaDataEntry<L>>) cache; this.findCreationMetaDataCache = properties.isLockOnRead() ? this.creationMetaDataCache.getAdvancedCache().withFlags(Flag.FORCE_WRITE_LOCK) : this.creationMetaDataCache; this.accessMetaDataCache = (Cache<SessionAccessMetaDataKey, SessionAccessMetaData>) cache; this.properties = properties; }
@Override public boolean remove(String id) { this.cache.getAdvancedCache().withFlags(Flag.IGNORE_RETURN_VALUES).remove(new SessionAttributesKey(id)); return true; }
@Override public void mutate() { // We only ever have to perform a replace once within a batch if ((this.mutated == null) || this.mutated.compareAndSet(false, true)) { // Use FAIL_SILENTLY to prevent mutation from failing locally due to remote exceptions this.cache.getAdvancedCache().withFlags(Flag.IGNORE_RETURN_VALUES, Flag.FAIL_SILENTLY).put(this.id, this.value); } } }
@Override public BeanGroupEntry<I, T> tryValue(I id) { return this.findCache.getAdvancedCache().withFlags(Flag.ZERO_LOCK_ACQUISITION_TIMEOUT, Flag.FAIL_SILENTLY).get(this.createKey(id)); }
@Override public int getActiveCount() { try (Stream<Map.Entry<BeanKey<I>, BeanEntry<I>>> entries = this.cache.getAdvancedCache().withFlags(Flag.CACHE_MODE_LOCAL, Flag.SKIP_CACHE_LOAD).entrySet().stream()) { return (int) entries.filter(this.filter).count(); } }
@Override public XSiteAdminOperations getOperations() { return cache.getAdvancedCache().getComponentRegistry().getComponent(XSiteAdminOperations.class); } };
@Override public boolean remove(String id) { return this.cache.getAdvancedCache().remove(new CoarseSessionsKey(id)) != null; } }
static <T extends AsyncInterceptor> T findInterceptor(Cache<?, ?> cache, Class<T> interceptorClass) { return cache.getAdvancedCache().getAsyncInterceptorChain().findInterceptorExtending(interceptorClass); } }
@Override public Set<T> getServices() { return this.cache.keySet(); }
@Override public void accept(Cache<K, V> cache) { cache.stop(); }
@Override public void close() { this.cache.removeListener(this); }
public InfinispanBeanFactory(String beanName, BeanGroupFactory<I, T> groupFactory, Cache<BeanKey<I>, BeanEntry<I>> cache, CacheProperties properties, Duration timeout, PassivationListener<T> listener) { this.beanName = beanName; this.groupFactory = groupFactory; this.cache = cache; this.findCache = properties.isLockOnRead() ? this.cache.getAdvancedCache().withFlags(Flag.FORCE_WRITE_LOCK) : this.cache; this.timeout = timeout; this.listener = listener; }
@Override public boolean remove(I id) { this.cache.getAdvancedCache().withFlags(Flag.IGNORE_RETURN_VALUES).remove(this.createKey(id)); return true; }
@Override public BeanEntry<I> tryValue(I id) { return this.findCache.getAdvancedCache().withFlags(Flag.ZERO_LOCK_ACQUISITION_TIMEOUT, Flag.FAIL_SILENTLY).get(this.createKey(id)); }
public InfinispanSSOFactory(Cache<AuthenticationKey, AuthenticationEntry<AV, L>> cache, CacheProperties properties, Marshaller<A, AV> marshaller, LocalContextFactory<L> localContextFactory, SessionsFactory<SV, D, S> sessionsFactory) { this.cache = cache; this.findCache = properties.isLockOnRead() ? cache.getAdvancedCache().withFlags(Flag.FORCE_WRITE_LOCK) : cache; this.marshaller = marshaller; this.localContextFactory = localContextFactory; this.sessionsFactory = sessionsFactory; }
@Override public boolean purge(String id) { return this.remove(id, this.creationMetaDataCache.getAdvancedCache().withFlags(Flag.SKIP_LISTENER_NOTIFICATION)); }
@Override public InfinispanSessionMetaData<L> tryValue(String id) { return this.getValue(id, this.findCreationMetaDataCache.getAdvancedCache().withFlags(Flag.ZERO_LOCK_ACQUISITION_TIMEOUT, Flag.FAIL_SILENTLY)); }