Calling method/object reference

J

Jeff Harman

I'm working on an object caching mechanism for j2se (1.4) and am trying to
figure out how to determine either the:
Referencing (calling) method or
Calling Object

Basically I want to silently lock an object in the cache (check out) without
explicitly requiring the calling object to provide a reference.

Any ideas?

Thanks,
Jeff Harman

Remember: 1.79999x10^12 furlongs per fortnight, It is not just a good idea
it is the law.
 
S

Stefan Schulz

I'm working on an object caching mechanism for j2se (1.4) and am trying to
figure out how to determine either the:
Referencing (calling) method or
Calling Object

Basically I want to silently lock an object in the cache (check out) without
explicitly requiring the calling object to provide a reference.

Any ideas?

There is a sun.* method that does this, but as with nearly all sun.*
classes, it is something you _would_ and _should_ not use. Besides, it is
entirely undocumented. Also, i see precious little need for it. Why
include locking / unlocking with the checkout / checkin code?
 
J

Jeff Harman

The reason I want to include a reference to the locking entity, is that I am
implementing a cache that allows items to be returned to active use
(unlocked) after a specific timeout. In that case, I don't want the
original holder of the lock potentially unlocking the valid lock of another
element. The method I had intended to use would use the calling reference
to act as a lock identifier. I wanted to make this transparent to the users
of the cache, hence my original question.

I certainly do not wish to use any sun.* packages, style, support, longevity
and documentation issues aside, I am working in an IBM JVM. I doubt that
they have implemented the SUN package hierarchy.

-Jeff

Remember: 1.79999x10^12 furlongs per fortnight, It is not just a good idea
it is the law.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top