2 * Copyright (c) 2014 Cisco Systems, Inc. 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.yangtools.objcache.guava;
10 import org.opendaylight.yangtools.objcache.ObjectCache;
11 import org.opendaylight.yangtools.objcache.spi.IObjectCacheFactory;
13 import com.google.common.base.FinalizableReferenceQueue;
15 public final class GuavaObjectCacheFactory implements IObjectCacheFactory {
16 private static final GuavaObjectCacheFactory INSTANCE = new GuavaObjectCacheFactory();
17 private final FinalizableReferenceQueue queue = new FinalizableReferenceQueue();
18 private final ObjectCache cache;
20 private GuavaObjectCacheFactory() {
21 // FIXME: make this more dynamic
22 this.cache = new GuavaObjectCache(queue, null);
26 public void finalize() throws Throwable {
35 public ObjectCache getObjectCache(final Class<?> objClass) {
39 public static GuavaObjectCacheFactory getInstance() {