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.
"Stefan Schulz" <> wrote in message
news

.. .
> On Fri, 25 Feb 2005 05:31:51 +0000, Jeff Harman wrote:
>
>> 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?
>
> --
> In pioneer days they used oxen for heavy pulling, and when one ox
> couldn't budge a log, they didn't try to grow a larger ox. We shouldn't
> be trying for bigger computers, but for more systems of computers.
> --- Rear Admiral Grace Murray Hopper
>