[jboss-cvs] JBossAS SVN: r65272 - in trunk/ejb3/src/main/org/jboss: ejb3/stateful and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Sep 10 05:26:17 EDT 2007
Author: wolfc
Date: 2007-09-10 05:26:17 -0400 (Mon, 10 Sep 2007)
New Revision: 65272
Modified:
trunk/ejb3/src/main/org/jboss/annotation/ejb/cache/Cache.java
trunk/ejb3/src/main/org/jboss/annotation/ejb/cache/CacheImpl.java
trunk/ejb3/src/main/org/jboss/ejb3/stateful/StatefulContainer.java
Log:
EJBTHREE-1016: value constraint on cache annotation
Modified: trunk/ejb3/src/main/org/jboss/annotation/ejb/cache/Cache.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/annotation/ejb/cache/Cache.java 2007-09-10 08:51:57 UTC (rev 65271)
+++ trunk/ejb3/src/main/org/jboss/annotation/ejb/cache/Cache.java 2007-09-10 09:26:17 UTC (rev 65272)
@@ -26,6 +26,9 @@
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+import org.jboss.ejb3.cache.StatefulCache;
+import org.jboss.ejb3.stateful.StatefulBeanContext;
+
/**
* Annotation for specifying the class used to provide the caching mechanism for a bean
*
@@ -36,5 +39,5 @@
@Target({ElementType.TYPE})
public @interface Cache
{
- Class value();
+ Class<? extends StatefulCache> value();
}
Modified: trunk/ejb3/src/main/org/jboss/annotation/ejb/cache/CacheImpl.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/annotation/ejb/cache/CacheImpl.java 2007-09-10 08:51:57 UTC (rev 65271)
+++ trunk/ejb3/src/main/org/jboss/annotation/ejb/cache/CacheImpl.java 2007-09-10 09:26:17 UTC (rev 65272)
@@ -23,6 +23,8 @@
import java.lang.annotation.Annotation;
+import org.jboss.ejb3.cache.StatefulCache;
+
/**
* Comment
*
@@ -31,14 +33,14 @@
*/
public class CacheImpl implements Cache
{
- private Class val;
+ private Class<? extends StatefulCache> val;
- public CacheImpl(Class val)
+ public CacheImpl(Class<? extends StatefulCache> val)
{
this.val = val;
}
- public Class value() { return val; }
+ public Class<? extends StatefulCache> value() { return val; }
public Class<? extends Annotation> annotationType()
{
Modified: trunk/ejb3/src/main/org/jboss/ejb3/stateful/StatefulContainer.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/stateful/StatefulContainer.java 2007-09-10 08:51:57 UTC (rev 65271)
+++ trunk/ejb3/src/main/org/jboss/ejb3/stateful/StatefulContainer.java 2007-09-10 09:26:17 UTC (rev 65272)
@@ -132,8 +132,8 @@
try
{
super.start();
- Cache cacheConfig = (Cache) resolveAnnotation(Cache.class);
- cache = (StatefulCache) cacheConfig.value().newInstance();
+ Cache cacheConfig = getAnnotation(Cache.class);
+ cache = cacheConfig.value().newInstance();
cache.initialize(this);
cache.start();
}
@@ -343,7 +343,7 @@
{
if (si.getId() == null)
{
- StatefulBeanContext ctx = getCache().create();
+ StatefulBeanContext ctx = getCache().create(null, null);
newId = ctx.getId();
}
else
@@ -836,7 +836,7 @@
if (initParameterTypes.length > 0)
ctx = getCache().create(initParameterTypes, initParameterValues);
else
- ctx = getCache().create();
+ ctx = getCache().create(null, null);
Object newId = ctx.getId();
newStatefulInvocation = new StatefulContainerInvocation(info, newId);
@@ -855,7 +855,7 @@
Object newId = null;
if (statefulInvocation.getId() == null)
{
- StatefulBeanContext ctx = getCache().create();
+ StatefulBeanContext ctx = getCache().create(null, null);
newId = ctx.getId();
newStatefulInvocation = new StatefulContainerInvocation(info, newId);
}
More information about the jboss-cvs-commits
mailing list