@Override public IgniteCacheProxy<?, ?> apply(IgniteCacheProxyImpl<?, ?> proxy) { return proxy.gatewayWrapper(); } });
/** * @return All configured public cache instances. */ public Collection<IgniteCacheProxy<?, ?>> publicCaches() { Collection<IgniteCacheProxy<?, ?>> res = new ArrayList<>(jCacheProxies.size()); for (IgniteCacheProxyImpl<?, ?> proxy : jCacheProxies.values()) { if (proxy.context().userCache()) res.add(proxy.gatewayWrapper()); } return res; }
/** * @param cacheName Cache name. * @param failIfNotStarted If {@code true} throws {@link IllegalArgumentException} if cache is not started, * otherwise returns {@code null} in this case. * @param checkThreadTx If {@code true} checks that current thread does not have active transactions. * @return Cache instance for given name. * @throws IgniteCheckedException If failed. */ @Nullable public <K, V> IgniteCacheProxy<K, V> publicJCache(String cacheName, boolean failIfNotStarted, boolean checkThreadTx) throws IgniteCheckedException { assert cacheName != null; if (log.isDebugEnabled()) log.debug("Getting public cache for name: " + cacheName); DynamicCacheDescriptor desc = cacheDescriptor(cacheName); if (desc != null && !desc.cacheType().userCache()) throw new IllegalStateException("Failed to get cache because it is a system cache: " + cacheName); IgniteCacheProxyImpl<?, ?> proxy = jcacheProxy(cacheName, true); // Try to start cache, there is no guarantee that cache will be instantiated. if (proxy == null) { dynamicStartCache(null, cacheName, null, false, failIfNotStarted, checkThreadTx).get(); proxy = jcacheProxy(cacheName, true); } return proxy != null ? (IgniteCacheProxy<K, V>)proxy.gatewayWrapper() : null; }
@Override public IgniteCacheProxy<?, ?> apply(IgniteCacheProxyImpl<?, ?> proxy) { return proxy.gatewayWrapper(); } });
/** * @return All configured public cache instances. */ public Collection<IgniteCacheProxy<?, ?>> publicCaches() { Collection<IgniteCacheProxy<?, ?>> res = new ArrayList<>(jCacheProxies.size()); for (IgniteCacheProxyImpl<?, ?> proxy : jCacheProxies.values()) { if (proxy.context().userCache()) res.add(proxy.gatewayWrapper()); } return res; }
/** * @param cacheName Cache name. * @param failIfNotStarted If {@code true} throws {@link IllegalArgumentException} if cache is not started, * otherwise returns {@code null} in this case. * @param checkThreadTx If {@code true} checks that current thread does not have active transactions. * @return Cache instance for given name. * @throws IgniteCheckedException If failed. */ @SuppressWarnings({"unchecked", "ConstantConditions"}) @Nullable public <K, V> IgniteCacheProxy<K, V> publicJCache(String cacheName, boolean failIfNotStarted, boolean checkThreadTx) throws IgniteCheckedException { assert cacheName != null; if (log.isDebugEnabled()) log.debug("Getting public cache for name: " + cacheName); DynamicCacheDescriptor desc = cacheDescriptor(cacheName); if (desc != null && !desc.cacheType().userCache()) throw new IllegalStateException("Failed to get cache because it is a system cache: " + cacheName); IgniteCacheProxyImpl<?, ?> proxy = jcacheProxy(cacheName, true); // Try to start cache, there is no guarantee that cache will be instantiated. if (proxy == null) { dynamicStartCache(null, cacheName, null, false, failIfNotStarted, checkThreadTx).get(); proxy = jcacheProxy(cacheName, true); } return proxy != null ? (IgniteCacheProxy<K, V>)proxy.gatewayWrapper() : null; }