2 * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.vpnservice.utils.cache;
10 import java.util.concurrent.ConcurrentHashMap;
11 import java.util.concurrent.ConcurrentMap;
13 public class CacheUtil {
14 private static final ConcurrentMap<String, ConcurrentMap<?, ?>> m_mapCache =
15 new ConcurrentHashMap<String, ConcurrentMap<?, ?>>();
17 public static ConcurrentMap<?, ?> getCache(String sCacheName) {
18 return m_mapCache.get(sCacheName);
21 public static void createCache(String sCacheName) {
22 if (m_mapCache.get(sCacheName) == null)
23 m_mapCache.put(sCacheName, new ConcurrentHashMap<Object, Object>());
26 public static void destroyCache(String sCacheName) {
27 m_mapCache.remove(sCacheName);