Are you looking for the internal fqn, or all referencing fqns?
As an example:
c.attach("/a", obj) c.attach("/b", obj)
Would result in something like this:
/a -> /internal/123
/b -> /internal/123
Basically at some point in time I want to detach() the object from the cache but at that point I have a reference to the object itself not the Fqn. So, I need to be able to call detach() but I would prefer not keep track of the Fqn in the object itself (separation of concerns and all that). Even a detach( Object ) API would work for my situation (if you wanted to remove all references to the object). I suppose it might get tricky if that object is attached to more than one point in the cache.
Not sure I answered your question directly but hopefully that helps clarify what I am trying to do.
Sorry for the delayed reply. I just got back from a stretch of travel, and this one fell through the cracks.
The following is scheduled:
The only problem with a super-detach method like you describe is when there is inter-object references. For example, if you have:
foo.setBar(bar); cache.attach("/foo", foo); cache.attach("/bar", bar); cache.detach(bar);
Then a successive foo.getBar() would return null. Is this the behavior you would want?
I personally don't currently have a use case where I would have two objects attached to the cache that also referred to each other. I was thinking more of the case where:
cache.attach( "/foo1", foo );
cache.attach( "/foo2", foo );
cache.detach( foo );
That would cause /foo1 and /foo2 references to go away. I wouldn't expect foo.getBar() to return null in your example. I would expect the "/bar" cache reference to go away but the object would still stay in the cache because it is referenced by another object that is still in the cache.
I have a ssimilar requirement as mentioned in the last post
Now I want to remove the object foo from the cache
for ex: cache.detach(foo);
By doing so , i want to remove the references /foo1 & /foo2 to go away. Is there any api alreaaddy existing for this?