Skip to content

Method: DisabledCacheManager()

1: /*
2: * JOPA
3: * Copyright (C) 2024 Czech Technical University in Prague
4: *
5: * This library is free software; you can redistribute it and/or
6: * modify it under the terms of the GNU Lesser General Public
7: * License as published by the Free Software Foundation; either
8: * version 3.0 of the License, or (at your option) any later version.
9: *
10: * This library is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: * Lesser General Public License for more details.
14: *
15: * You should have received a copy of the GNU Lesser General Public
16: * License along with this library.
17: */
18: package cz.cvut.kbss.jopa.sessions.cache;
19:
20: import cz.cvut.kbss.jopa.model.descriptors.Descriptor;
21: import cz.cvut.kbss.jopa.sessions.descriptor.LoadStateDescriptor;
22:
23: import java.net.URI;
24: import java.util.Set;
25:
26: public class DisabledCacheManager implements CacheManager {
27:
28: @Override
29: public void add(Object identifier, Object entity, Descriptors descriptors) {
30: // Do nothing
31: }
32:
33: @Override
34: public <T> T get(Class<T> cls, Object identifier, Descriptor descriptor) {
35: return null;
36: }
37:
38:
39: @Override
40: public LoadStateDescriptor<?> getLoadStateDescriptor(Object instance) {
41: return null;
42: }
43:
44: @Override
45: public void evictInferredObjects() {
46: // Do nothing
47: }
48:
49: @Override
50: public void setInferredClasses(Set<Class<?>> inferredClasses) {
51: // Do nothing
52: }
53:
54: @Override
55: public void close() {
56: // Do nothing
57: }
58:
59: @Override
60: public boolean contains(Class<?> cls, Object identifier, Descriptor descriptor) {
61: return false;
62: }
63:
64: @Override
65: public void evict(Class<?> cls, Object identifier, URI context) {
66: // Do nothing
67: }
68:
69: @Override
70: public void evict(Class<?> cls) {
71: // Do nothing
72: }
73:
74: @Override
75: public void evict(URI contextUri) {
76: // Do nothing
77: }
78:
79: @Override
80: public void evictAll() {
81: // Do nothing
82: }
83: }