[jboss-dev-forums] [Design of POJO Server] - Leaking annotation API
wolfc
do-not-reply at jboss.com
Fri Oct 12 14:41:50 EDT 2007
I've got a nice API leakage:
The @Cache annotation (which should be in jboss-ejb3-ext-api)
package org.jboss.annotation.ejb;
| public @interface Cache
| {
| Class<? extends StatefulCache> value();
| }
is using StatefulCache interface (deprecated until further notice),
package org.jboss.ejb3.cache;
| public interface StatefulCache extends Cache<StatefulBeanContext>
| {
| ...
| }
which extends Cache from jboss-ejb3-cache (will probably become jboss-ejb3-cache-spi), which is bound on StatefulBeanContext from the ejb3 code / module.
The @Cache annotation is used by a bean developer to specify the cache strategy:
@Cache(org.jboss.ejb3.cache.impl.NoPassivationCache)
1. I would like to keep the limit on the annotation, it is meant to detect problems compile time;
2. From ejb3 code perspective I want to use getAnnotation(Cache.class).value() without a type cast.
A. How can we prevent such a leak?
B. Where should I put NoPassivationCache? Note that there is no hard dependency from core to this class (it's configuration)..
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4094740#4094740
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4094740
More information about the jboss-dev-forums
mailing list