Is there a way to specify a cache instance as "read only"?
  
I would like to set up an environment where some processes
(where I say process, I mean different JVM) can write to
their caches and those changes are distributed to the other
caches in the group.  Likewise, some processes should not be
allowed to write to their caches.  These readonly processes
basically just want to listen to a live copy of the cached
data (by attaching a cache listener).  I'd like to prevent
the possibility of accidentally having one of these
supposedly read-only cache processes write to the cache.

The most obvious solution seems to be for me to make a
ReadOnlyCache interface, then attach it to TreeCache (via a
thin wrapper or injecting with an aspect or
something if that is possible).  Once I have the
ReadOnlyCache, I can hide away the real cache in a singleton
somewhere and just expose the ReadOnlyCache interface to the
public.  Although it makes it more difficult to screw up and
write something to the cache when you don't mean to, it
doesn't seem foolproof or elegant.

Any suggestions?

-steven

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

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


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
JBoss-Development mailing list
JBoss-Development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to