1
14
15 package com.liferay.portal.cache.ehcache;
16
17 import com.liferay.portal.kernel.log.Log;
18 import com.liferay.portal.kernel.log.LogFactoryUtil;
19 import com.liferay.portal.kernel.util.InstanceFactory;
20 import com.liferay.portal.util.PropsValues;
21
22 import java.util.Properties;
23
24 import net.sf.ehcache.bootstrap.BootstrapCacheLoader;
25 import net.sf.ehcache.bootstrap.BootstrapCacheLoaderFactory;
26
27
33 public class LiferayBootstrapCacheLoaderFactory
34 extends BootstrapCacheLoaderFactory {
35
36 public LiferayBootstrapCacheLoaderFactory() {
37 String className = PropsValues.EHCACHE_BOOTSTRAP_CACHE_LOADER_FACTORY;
38
39 if (_log.isDebugEnabled()) {
40 _log.debug("Instantiating " + className + " " + this.hashCode());
41 }
42
43 try {
44 _bootstrapCacheLoaderFactory =
45 (BootstrapCacheLoaderFactory)InstanceFactory.newInstance(
46 className);
47 }
48 catch (Exception e) {
49 throw new RuntimeException(e);
50 }
51 }
52
53 public BootstrapCacheLoader createBootstrapCacheLoader(
54 Properties properties) {
55
56 return _bootstrapCacheLoaderFactory.createBootstrapCacheLoader(
57 properties);
58 }
59
60 private static Log _log = LogFactoryUtil.getLog(
61 LiferayBootstrapCacheLoaderFactory.class);
62
63 private BootstrapCacheLoaderFactory _bootstrapCacheLoaderFactory;
64
65 }