I am new to jboss cache and would like some help with threading issues. I want to use jboss cache to drive a gui for displaying real-time data. Is there any way to force all replicated updates coming to the cache to be on a thread or executor of my choice (ie the swing event dispatch thread). It seems to me that if the updates happen on one thread and and the data is read on another thread then the result will be indeterminate.
As an example imagine a table model connected to an arraylist maintained by jbosscache. In the edt(event dispatch thread) the row count is determined from the model(1), then the values are accessed for each element using the index of the row to access the list(2). If a delete happens on another thread removing the last n rows between (1) and (2) then a null pointer will occur. To remove this problem one could force all access to the cache on a single thread.
Can i force access to the cache to be single threaded? or have I missed something that will prevent this from being an issue.
One other question - how does jbosscache scale - can I connect 100's or 1000's of caches - where 95% are read only and only 5% write data infrequently.