Author: norman.richards(a)jboss.com
Date: 2009-02-24 15:14:20 -0500 (Tue, 24 Feb 2009)
New Revision: 10084
Modified:
trunk/src/main/org/jboss/seam/cache/JbossPojoCacheProvider.java
Log:
JBSEAM-3940
Modified: trunk/src/main/org/jboss/seam/cache/JbossPojoCacheProvider.java
===================================================================
--- trunk/src/main/org/jboss/seam/cache/JbossPojoCacheProvider.java 2009-02-24 12:13:21
UTC (rev 10083)
+++ trunk/src/main/org/jboss/seam/cache/JbossPojoCacheProvider.java 2009-02-24 20:14:20
UTC (rev 10084)
@@ -4,6 +4,7 @@
import static org.jboss.seam.annotations.Install.BUILT_IN;
import org.jboss.cache.CacheException;
+import org.jboss.cache.Node;
import org.jboss.cache.aop.PojoCache;
import org.jboss.seam.annotations.AutoCreate;
import org.jboss.seam.annotations.Create;
@@ -70,19 +71,21 @@
cache = null;
}
- @Override
- public Object get(String region, String key)
- {
- try
- {
- return cache.get(getFqn(key));
- }
- catch (CacheException e)
- {
- throw new IllegalStateException(String.format("Cache throw exception when
trying to get %s from region %s.", key, region), e);
- }
- }
+ @Override
+ public Object get(String region, String key) {
+ try {
+ Node node = cache.get(getFqn(region));
+ if (node != null) {
+ return node.get(key);
+ } else {
+ return null;
+ }
+ } catch (CacheException e) {
+ throw new IllegalStateException(String.format("Cache throw exception
when trying to get %s from region %s.", key,
region), e);
+ }
+ }
+
@Override
public void put(String region, String key, Object object)
{
Show replies by date