Skip to content

Package: MapCachingProvider

MapCachingProvider

nameinstructionbranchcomplexitylinemethod
MapCachingProvider()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
close()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
close(ClassLoader)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
close(URI, ClassLoader)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getCacheManager()
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getCacheManager(URI, ClassLoader)
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getCacheManager(URI, ClassLoader, Properties)
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getDefaultClassLoader()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getDefaultProperties()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getDefaultURI()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getInstance()
M: 17 C: 0
0%
M: 4 C: 0
0%
M: 3 C: 0
0%
M: 6 C: 0
0%
M: 1 C: 0
0%
isSupported(OptionalFeature)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2020, 2022 Eurotech and/or its affiliates and others
3: *
4: * This program and the accompanying materials are made
5: * available under the terms of the Eclipse Public License 2.0
6: * which is available at https://www.eclipse.org/legal/epl-2.0/
7: *
8: * SPDX-License-Identifier: EPL-2.0
9: *
10: * Contributors:
11: * Eurotech - initial API and implementation
12: *******************************************************************************/
13: package org.eclipse.kapua.qa.common.cache;
14:
15: import javax.cache.CacheManager;
16: import javax.cache.configuration.OptionalFeature;
17: import javax.cache.spi.CachingProvider;
18: import java.net.URI;
19: import java.util.Properties;
20:
21: public class MapCachingProvider implements CachingProvider {
22:
23: private static MapCachingProvider instance;
24:
25: public static MapCachingProvider getInstance() {
26:• if (instance == null) {
27: synchronized (MapCachingProvider.class) {
28:• if (instance == null) {
29: instance = new MapCachingProvider();
30: }
31: }
32: }
33: return instance;
34: }
35:
36: @Override
37: public CacheManager getCacheManager(URI uri, ClassLoader classLoader, Properties properties) {
38: return getCacheManager();
39: }
40:
41: @Override
42: public ClassLoader getDefaultClassLoader() {
43: throw new UnsupportedOperationException();
44: }
45:
46: @Override
47: public URI getDefaultURI() {
48: throw new UnsupportedOperationException();
49: }
50:
51: @Override
52: public Properties getDefaultProperties() {
53: throw new UnsupportedOperationException();
54: }
55:
56: @Override
57: public CacheManager getCacheManager(URI uri, ClassLoader classLoader) {
58: return getCacheManager();
59: }
60:
61: @Override
62: public CacheManager getCacheManager() {
63: return MapCacheManager.getInstance();
64: }
65:
66: @Override
67: public void close() {
68: throw new UnsupportedOperationException();
69: }
70:
71: @Override
72: public void close(ClassLoader classLoader) {
73: throw new UnsupportedOperationException();
74: }
75:
76: @Override
77: public void close(URI uri, ClassLoader classLoader) {
78: throw new UnsupportedOperationException();
79: }
80:
81: @Override
82: public boolean isSupported(OptionalFeature optionalFeature) {
83: throw new UnsupportedOperationException();
84: }
85: }