[JBossCache] - Re: CR3 Listener
by manik.surtaniï¼ jboss.com
"aditsu" wrote : Could we perhaps have an adapter (abstract listener class) with annotated callback methods, that we can extend for defining listeners with compile-time checking?
And for compile time checking to make any sense, we'd have to change the API from cache.addListener(Object) to cache.addListener(AbstractListener) which means that no one would have the flexibility of only using the annotation-based approach.
The other thing we considered was a combination interface/annotation approach, where we'd use an empty CacheListener interface instead of the class-level @CacheListener annotation, followed by method level annotations. We thought that this was a pretty pointless exercise since the interface, being empty, didn't really buy anything and would be almost as pointless as Serializable.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4066098#4066098
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4066098
18Â years, 9Â months
[JBossCache] - Re: CR3 Listener
by manik.surtaniï¼ jboss.com
"aditsu" wrote : I was going to post something along the same lines as FredrikJ, so I'm glad to see this thread.
|
| Could we perhaps have an adapter (abstract listener class) with annotated callback methods, that we can extend for defining listeners with compile-time checking?
|
Something we did consider, but such an adapter would lose some the benefits of the annotation based approach. Performance on callbacks you are not interested in. Empty impl's of callbacks still get called, but a callback isn't annotated, it doesn't.
"aditsu" wrote :
| Also, are the listener callbacks currently fired synchronously as part of the transaction, therefore blocking the transaction till they are executed? Will that change in the future?
|
Yes, they are synchronous (see updated javadocs on the annotation in CVS HEAD). I don't expect this to change in the future.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4066094#4066094
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4066094
18Â years, 9Â months