[jboss-dev-forums] [Design of JBossCache] - Re: Last minute 2.0 API suggestions

genman do-not-reply at jboss.com
Mon Jan 22 13:55:08 EST 2007


The Collection interface has a "boolean remove(Object k)", and it's nice (when writing adaptors, see that other thread) to see if the remove operation actually worked.

One good thing about the Collection interfaces is that they always return information. This suggests that all Node methods should return something. Some thoughts:


  | NodeSPI -
  | void setVersion(DataVersion version); - Return replaced version?
  | void removeChildrenDirect(); - Return count of children removed?
  | void removeChildDirect(Fqn fqn); - boolean true if removed?
  | void removeChildDirect(Object childName); - ""
  | Cache -
  | void removeNode(Fqn fqn); - boolean true if removed
  | void evict(Fqn fqn, boolean recursive); - ""
  | 

I also wonder if Cache.getVersion() shouldn't return a Version (not String) object instead? Version might implement a "before" method as well. It'd be nice for people writing something like this:

Cache c;
if (c.getVersion().before(Version.XYZ))
  throw new Exception("Cache not >= Version XYZ");

I'm not sure how often this use case comes up, though.

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

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



More information about the jboss-dev-forums mailing list