| CODENOTIFIER | HelpYou are not signed inSign in |
Project: Seam
Revision: 8913
Author: pete.muir@jboss.org
Date: 04 Sep 2008 18:34:17
Changes:JBSEAM-3382, and a couple of minor bits, thanks to Przemyslaw Jaskierski
Files:| ... | ...@@ -1,7 +1,7 @@ | |
| 1 | 1 | package org.jboss.seam.cache; |
| 2 | 2 | |
| 3 | 3 | import static org.jboss.seam.annotations.Install.BUILT_IN; |
| 4 | import static org.jboss.seam.ScopeType.STATELESS; | |
| 4 | import static org.jboss.seam.ScopeType.APPLICATION; | |
| 5 | 5 | import net.sf.ehcache.Cache; |
| 6 | 6 | import net.sf.ehcache.CacheManager; |
| 7 | 7 | import net.sf.ehcache.Element; |
| ... | ...@@ -24,7 +24,7 @@ | |
| 24 | 24 | * @author Pete Muir |
| 25 | 25 | */ |
| 26 | 26 | @Name("org.jboss.seam.cache.cacheProvider") |
| 27 | @Scope(STATELESS) | |
| 27 | @Scope(APPLICATION) | |
| 28 | 28 | @BypassInterceptors |
| 29 | 29 | @Install(value = false, precedence = BUILT_IN, classDependencies="net.sf.ehcache.Cache") |
| 30 | 30 | @AutoCreate |
| ... | ...@@ -84,7 +84,10 @@ | |
| 84 | 84 | Cache result = cacheManager.getCache(regionName); |
| 85 | 85 | if (result == null) |
| 86 | 86 | { |
| 87 | throw new IllegalArgumentException("Cache region not found"); | |
| 87 | log.warn("Could not find configuration for region [" + regionName + "]; using defaults."); | |
| 88 | cacheManager.addCache(regionName); | |
| 89 | result = cacheManager.getCache(regionName); | |
| 90 | log.debug("EHCache region created: " + regionName); | |
| 88 | 91 | } |
| 89 | 92 | return result; |
| 90 | 93 | } |
| ... | ...@@ -100,7 +103,6 @@ | |
| 100 | 103 | public void create() |
| 101 | 104 | { |
| 102 | 105 | log.debug("Starting EhCacheProvider cache"); |
| 103 | // TODO validate if there is any common approach to load resources in Seam | |
| 104 | 106 | try |
| 105 | 107 | { |
| 106 | 108 | if (getConfiguration() != null) |
| ... | ...@@ -1,7 +1,7 @@ | |
| 1 | 1 | package org.jboss.seam.cache; |
| 2 | 2 | |
| 3 | 3 | import static org.jboss.seam.ScopeType.APPLICATION; |
| 4 | import static org.jboss.seam.annotations.Install.FRAMEWORK; | |
| 4 | import static org.jboss.seam.annotations.Install.BUILT_IN; | |
| 5 | 5 | |
| 6 | 6 | import org.jboss.cache.CacheException; |
| 7 | 7 | import org.jboss.cache.Node; |
| ... | ...@@ -27,7 +27,7 @@ | |
| 27 | 27 | @Name("org.jboss.seam.cache.cacheProvider") |
| 28 | 28 | @Scope(APPLICATION) |
| 29 | 29 | @BypassInterceptors |
| 30 | @Install(precedence = FRAMEWORK, classDependencies={"org.jboss.cache.TreeCache", "org.jgroups.MembershipListener"}) | |
| 30 | @Install(precedence = BUILT_IN, classDependencies={"org.jboss.cache.TreeCache", "org.jgroups.MembershipListener"}) | |
| 31 | 31 | @AutoCreate |
| 32 | 32 | public class JbossCacheProvider extends AbstractJBossCacheProvider<TreeCache> |
| 33 | 33 | { |