[jboss-dev-forums] [Design of JBossCache] - @CacheListener impl must be public?

bstansberry@jboss.com do-not-reply at jboss.com
Wed Jul 4 16:07:54 EDT 2007


Notifier.isValidListenerClass() enforces a requirement that the @CacheListener be declared public.  Is that necessary for the inspection of annotations on the methods?

In the AS codebase I have a number of inner class CacheListener impls that I'd modified to use the new API.  But use of them fails at runtime due to the requirement that the class be public.  I can of course fix this but it somewhat perturbs the object model.  For sure other people are going to stumble onto the same problem, since an inner class subclassing AbstractCacheListener was likely a very common way to use the old API.

If this requirement needs to be enforced, isValidListenerClass() should be modified to separately check it and throw an exception with a very explicit message explaining what the problem is.  Took me quite a while and a careful reading of Notifier to figure it out.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4060570#4060570

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4060570



More information about the jboss-dev-forums mailing list