
com.hazelcast.jet.impl.ICacheDecorator Maven / Gradle / Ivy
The newest version!
/*
* Copyright (c) 2008-2024, Hazelcast, Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hazelcast.jet.impl;
import com.hazelcast.cache.CacheStatistics;
import com.hazelcast.cache.ICache;
import com.hazelcast.cache.impl.event.CachePartitionLostListener;
import com.hazelcast.jet.JetInstance;
import javax.cache.CacheManager;
import javax.cache.configuration.CacheEntryListenerConfiguration;
import javax.cache.configuration.Configuration;
import javax.cache.expiry.ExpiryPolicy;
import javax.cache.integration.CompletionListener;
import javax.cache.processor.EntryProcessor;
import javax.cache.processor.EntryProcessorException;
import javax.cache.processor.EntryProcessorResult;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.Spliterator;
import java.util.UUID;
import java.util.concurrent.CompletionStage;
import java.util.function.Consumer;
@SuppressWarnings({"checkstyle:methodcount", "deprecation"})
public class ICacheDecorator implements ICache {
private final ICache cache;
private final JetInstance instance;
public ICacheDecorator(ICache cache, JetInstance instance) {
this.cache = cache;
this.instance = instance;
}
public JetInstance getInstance() {
return instance;
}
// ICache decorated methods
@Override
public boolean setExpiryPolicy(K key, ExpiryPolicy expiryPolicy) {
return cache.setExpiryPolicy(key, expiryPolicy);
}
@Override
public void setExpiryPolicy(Set extends K> keys, ExpiryPolicy expiryPolicy) {
cache.setExpiryPolicy(keys, expiryPolicy);
}
@Override
public CompletionStage getAsync(K key) {
return cache.getAsync(key);
}
@Override
public CompletionStage getAsync(K key, ExpiryPolicy expiryPolicy) {
return cache.getAsync(key, expiryPolicy);
}
@Override
public CompletionStage putAsync(K key, V value) {
return cache.putAsync(key, value);
}
@Override
public CompletionStage putAsync(K key, V value, ExpiryPolicy expiryPolicy) {
return cache.putAsync(key, value, expiryPolicy);
}
@Override
public CompletionStage putIfAbsentAsync(K key, V value) {
return cache.putIfAbsentAsync(key, value);
}
@Override
public CompletionStage putIfAbsentAsync(K key, V value, ExpiryPolicy expiryPolicy) {
return cache.putIfAbsentAsync(key, value, expiryPolicy);
}
@Override
public CompletionStage getAndPutAsync(K key, V value) {
return cache.getAndPutAsync(key, value);
}
@Override
public CompletionStage getAndPutAsync(K key, V value, ExpiryPolicy expiryPolicy) {
return cache.getAndPutAsync(key, value, expiryPolicy);
}
@Override
public CompletionStage removeAsync(K key) {
return cache.removeAsync(key);
}
@Override
public CompletionStage removeAsync(K key, V oldValue) {
return cache.removeAsync(key, oldValue);
}
@Override
public CompletionStage getAndRemoveAsync(K key) {
return cache.getAndRemoveAsync(key);
}
@Override
public CompletionStage replaceAsync(K key, V value) {
return cache.replaceAsync(key, value);
}
@Override
public CompletionStage replaceAsync(K key, V value, ExpiryPolicy expiryPolicy) {
return cache.replaceAsync(key, value, expiryPolicy);
}
@Override
public CompletionStage replaceAsync(K key, V oldValue, V newValue) {
return cache.replaceAsync(key, oldValue, newValue);
}
@Override
public CompletionStage replaceAsync(K key, V oldValue, V newValue, ExpiryPolicy expiryPolicy) {
return cache.replaceAsync(key, oldValue, newValue, expiryPolicy);
}
@Override
public CompletionStage getAndReplaceAsync(K key, V value) {
return cache.getAndReplaceAsync(key, value);
}
@Override
public CompletionStage getAndReplaceAsync(K key, V value, ExpiryPolicy expiryPolicy) {
return cache.getAndReplaceAsync(key, value, expiryPolicy);
}
@Override
public V get(K key, ExpiryPolicy expiryPolicy) {
return cache.get(key, expiryPolicy);
}
@Override
public Map getAll(Set extends K> keys, ExpiryPolicy expiryPolicy) {
return cache.getAll(keys, expiryPolicy);
}
@Override
public void put(K key, V value, ExpiryPolicy expiryPolicy) {
cache.put(key, value, expiryPolicy);
}
@Override
public V getAndPut(K key, V value, ExpiryPolicy expiryPolicy) {
return cache.getAndPut(key, value, expiryPolicy);
}
@Override
public void putAll(Map extends K, ? extends V> map, ExpiryPolicy expiryPolicy) {
cache.putAll(map, expiryPolicy);
}
@Override
public boolean putIfAbsent(K key, V value, ExpiryPolicy expiryPolicy) {
return cache.putIfAbsent(key, value, expiryPolicy);
}
@Override
public boolean replace(K key, V oldValue, V newValue, ExpiryPolicy expiryPolicy) {
return cache.replace(key, oldValue, newValue, expiryPolicy);
}
@Override
public boolean replace(K key, V value, ExpiryPolicy expiryPolicy) {
return cache.replace(key, value, expiryPolicy);
}
@Override
public V getAndReplace(K key, V value, ExpiryPolicy expiryPolicy) {
return cache.getAndReplace(key, value, expiryPolicy);
}
@Override
public int size() {
return cache.size();
}
@Override
public void destroy() {
cache.destroy();
}
@Override
public boolean isDestroyed() {
return cache.isDestroyed();
}
@Override
public CacheStatistics getLocalCacheStatistics() {
return cache.getLocalCacheStatistics();
}
@Override
public UUID addPartitionLostListener(CachePartitionLostListener listener) {
return cache.addPartitionLostListener(listener);
}
@Override
public boolean removePartitionLostListener(UUID uuid) {
return cache.removePartitionLostListener(uuid);
}
@Override
public Iterator> iterator(int fetchSize) {
return cache.iterator(fetchSize);
}
@Override
public V get(K k) {
return cache.get(k);
}
@Override
public Map getAll(Set extends K> set) {
return cache.getAll(set);
}
@Override
public boolean containsKey(K k) {
return cache.containsKey(k);
}
@Override
public void loadAll(Set extends K> set, boolean b, CompletionListener completionListener) {
cache.loadAll(set, b, completionListener);
}
@Override
public void put(K k, V v) {
cache.put(k, v);
}
@Override
public V getAndPut(K k, V v) {
return cache.getAndPut(k, v);
}
@Override
public void putAll(Map extends K, ? extends V> map) {
cache.putAll(map);
}
@Override
public boolean putIfAbsent(K k, V v) {
return cache.putIfAbsent(k, v);
}
@Override
public boolean remove(K k) {
return cache.remove(k);
}
@Override
public boolean remove(K k, V v) {
return cache.remove(k, v);
}
@Override
public V getAndRemove(K k) {
return cache.getAndRemove(k);
}
@Override
public boolean replace(K k, V v, V v1) {
return cache.replace(k, v, v1);
}
@Override
public boolean replace(K k, V v) {
return cache.replace(k, v);
}
@Override
public V getAndReplace(K k, V v) {
return cache.getAndReplace(k, v);
}
@Override
public void removeAll(Set extends K> set) {
cache.removeAll(set);
}
@Override
public void removeAll() {
cache.removeAll();
}
@Override
public void clear() {
cache.clear();
}
@Override
public > C getConfiguration(Class aClass) {
return cache.getConfiguration(aClass);
}
@Override
public T invoke(K k, EntryProcessor entryProcessor, Object... objects) throws EntryProcessorException {
return cache.invoke(k, entryProcessor, objects);
}
@Override
public Map> invokeAll(Set extends K> set,
EntryProcessor entryProcessor,
Object... objects) {
return cache.invokeAll(set, entryProcessor, objects);
}
@Override
public String getName() {
return cache.getName();
}
@Override
public CacheManager getCacheManager() {
return cache.getCacheManager();
}
@Override
public void close() {
cache.close();
}
@Override
public boolean isClosed() {
return cache.isClosed();
}
@Override
public T unwrap(Class aClass) {
return cache.unwrap(aClass);
}
@Override
public void registerCacheEntryListener(CacheEntryListenerConfiguration cacheEntryListenerConfiguration) {
cache.registerCacheEntryListener(cacheEntryListenerConfiguration);
}
@Override
public void deregisterCacheEntryListener(CacheEntryListenerConfiguration cacheEntryListenerConfiguration) {
cache.deregisterCacheEntryListener(cacheEntryListenerConfiguration);
}
@Override
public Iterator> iterator() {
return cache.iterator();
}
@Override
public void forEach(Consumer super Entry> action) {
cache.forEach(action);
}
@Override
public Spliterator> spliterator() {
return cache.spliterator();
}
@Override
public String getPrefixedName() {
return cache.getPrefixedName();
}
@Override
public String getPartitionKey() {
return cache.getPartitionKey();
}
@Override
public String getServiceName() {
return cache.getServiceName();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy