BUG-994: improve object cache
[yangtools.git] / common / object-cache-noop / src / main / java / org / opendaylight / yangtools / objcache / impl / StaticObjectCacheBinder.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.yangtools.objcache.impl;
9
10 import org.opendaylight.yangtools.objcache.ObjectCache;
11 import org.opendaylight.yangtools.objcache.spi.AbstractObjectCacheBinder;
12 import org.opendaylight.yangtools.objcache.spi.IObjectCacheFactory;
13 import org.opendaylight.yangtools.objcache.spi.NoopObjectCache;
14
15 public final class StaticObjectCacheBinder extends AbstractObjectCacheBinder {
16     private static final StaticObjectCacheBinder INSTANCE = new StaticObjectCacheBinder();
17
18     private StaticObjectCacheBinder() {
19         super(new IObjectCacheFactory() {
20             @Override
21             public ObjectCache getObjectCache(final Class<?> objClass) {
22                 return NoopObjectCache.getInstance();
23             }
24         });
25     }
26
27     public static StaticObjectCacheBinder getInstance() {
28         return INSTANCE;
29     }
30 }