[jboss-dev-forums] [Design of JBossCache] - Re: Need to make enhacements to CacheListener API
jason.greene@jboss.com
do-not-reply at jboss.com
Fri Jun 15 10:35:47 EDT 2007
"manik.surtani at jboss.com" wrote : 1. Even with using a thread pool, notifications for each call or transaction are performed by the same thread (see Notifier.invokeQueuedNotifications()) - a single Runnable is used to loop thru all registered listeners, for all registered notification events. So you will get pre and post events in order, and not concurrently.
|
Yes, but the listener instances are shared across all threads, so there could be two runnables running at the same time (unless the pool size is 1). Alternatively the pre and post phase could be combined to one method call with the before and after data.
anonymous wrote :
| 2. Hmm, this could be a useful callback - txStarted, txCommitted, txROlledBack (with a Transaction object passed in? Is this useful?) Can't help but feel we're reinventing something here though.
|
Well currently events are only delivered on commit, so rollback wouldn't be useful, although start and commit would be.
-Jason
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4054779#4054779
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4054779
More information about the jboss-dev-forums
mailing list