[jboss-dev-forums] [Design of JBossCache] - Re: Binding proxy to Cache in AS JNDI

bstansberry@jboss.com do-not-reply at jboss.com
Mon Jun 4 16:02:45 EDT 2007


"manik.surtani at jboss.com" wrote : anonymous wrote : 
  |   | Say we solve the Cache issue and a remote Cache proxy is available. Any API call that requires use of a Node will fail, since the Node won't be a remote object. The only available API will be those methods that don't involve a Node.
  |   | 
  | 
  | Hmm, this may involve exposing and binding each Node, which sucks/bordering on completely ridiculous.

Oh, I'd say that's way over the ridiculous border. :)

anonymous wrote : How about mandating that if you intend to access the cache via JMX, don't use Node APIs?  Yes, this restricts some functionality, but not all, and even then only for people remotely accessing a cache bound in JMX/JNDI.

Yes, I think this is more a documentation issue, telling people what won't work.

The only thing that I commonly used in 1.4 that can't be done via the Cache API are hasChild(Fqn) and getChildrenNames(Fqn).

anonymous wrote : And for local usage, people would either create a cache instance directly, or how about binding the CacheFactory (java:/ namespace) so people can get a hold of the cache?

Ignorant question whose answer I should know. If you bind the Cache itself in the java:/ namespace, does it serialize it or just store a ref to the cache in the JNDI tree?  If not, then the user can just bind the cache in java:/ for the local clients.

anonymous wrote : Related topic - should CacheFactory always construct caches?  Should it also be able to retrieve already-constructed, named caches?  
  | 
  | E.g., 
  | 
  | 
  |   | Cache c1 = DefaultCacheFactory.createCache("MyCache", "cfg.xml"); 
  |   | Cache c2 = DefaultCacheFactory.createCache("MyCache", "cfg.xml");  
  |   | 
  |   | assertSame(c1, c2);
  |   | 
  | 
  | 

Interesting. I think the tricky bit is you have to have a cleanup API to remove the caches (or use WeakReferences). 

If the client is local and JMX is available, they can just  use CacheJmxWrapper and JMX becomes a registry. Or maybe binding the Cache in JNDI in java:/ will work.

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

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



More information about the jboss-dev-forums mailing list