001
014
015 package com.liferay.portal.cache.ehcache;
016
017 import com.liferay.portal.kernel.log.Log;
018 import com.liferay.portal.kernel.log.LogFactoryUtil;
019 import com.liferay.portal.kernel.util.InstanceFactory;
020 import com.liferay.portal.util.PropsValues;
021
022 import java.util.Properties;
023
024 import net.sf.ehcache.bootstrap.BootstrapCacheLoader;
025 import net.sf.ehcache.bootstrap.BootstrapCacheLoaderFactory;
026
027
030 public class LiferayBootstrapCacheLoaderFactory
031 extends BootstrapCacheLoaderFactory {
032
033 public LiferayBootstrapCacheLoaderFactory() {
034 String className = PropsValues.EHCACHE_BOOTSTRAP_CACHE_LOADER_FACTORY;
035
036 if (_log.isDebugEnabled()) {
037 _log.debug("Instantiating " + className + " " + this.hashCode());
038 }
039
040 try {
041 _bootstrapCacheLoaderFactory =
042 (BootstrapCacheLoaderFactory)InstanceFactory.newInstance(
043 className);
044 }
045 catch (Exception e) {
046 throw new RuntimeException(e);
047 }
048 }
049
050 public BootstrapCacheLoader createBootstrapCacheLoader(
051 Properties properties) {
052
053 return _bootstrapCacheLoaderFactory.createBootstrapCacheLoader(
054 properties);
055 }
056
057 private static Log _log = LogFactoryUtil.getLog(
058 LiferayBootstrapCacheLoaderFactory.class);
059
060 private BootstrapCacheLoaderFactory _bootstrapCacheLoaderFactory;
061
062 }