/* * JBoss, Home of Professional Open Source. * Copyright 2000 - 2008, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.cache.loader; import org.jboss.cache.CacheSPI; import org.jboss.cache.Fqn; import org.jboss.cache.Modification; import org.jboss.cache.RegionManager; import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.util.List; import java.util.Map; import java.util.Set; /** * AbstractDelegatingCacheLoader provides standard functionality for a cache loader that simply delegates each * operation defined in the cache loader interface to the underlying cache loader, basically acting as a proxy to the * real cache loader. *
* Any cache loader implementation that extends this class would be required to override any of the methods in * order to provide a different or added behaviour. * * @author Galder Zamarreno */ public abstract class AbstractDelegatingCacheLoader extends AbstractCacheLoader { private CacheLoader cacheLoader; public AbstractDelegatingCacheLoader(CacheLoader cl) { cacheLoader = cl; } public CacheLoader getCacheLoader() { return cacheLoader; } public void setCacheLoader(CacheLoader cacheLoader) { this.cacheLoader = cacheLoader; } public void setConfig(IndividualCacheLoaderConfig config) { cacheLoader.setConfig(config); } public IndividualCacheLoaderConfig getConfig() { return cacheLoader.getConfig(); } @Override public void setCache(CacheSPI c) { super.setCache(c); cacheLoader.setCache(c); } public Set getChildrenNames(Fqn fqn) throws Exception { return cacheLoader.getChildrenNames(fqn); } public Map get(Fqn name) throws Exception { return cacheLoader.get(name); } public boolean exists(Fqn name) throws Exception { return cacheLoader.exists(name); } public Object put(Fqn name, Object key, Object value) throws Exception { return cacheLoader.put(name, key, value); } public void put(Fqn name, Map attributes) throws Exception { cacheLoader.put(name, attributes); } @Override public void put(List