Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Calling method/object reference

Reply
Thread Tools

Calling method/object reference

 
 
Jeff Harman
Guest
Posts: n/a
 
      02-25-2005
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.


 
Reply With Quote
 
 
 
 
Stefan Schulz
Guest
Posts: n/a
 
      02-25-2005
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

 
Reply With Quote
 
 
 
 
Jeff Harman
Guest
Posts: n/a
 
      02-28-2005
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" <(E-Mail Removed)> wrote in message
news(E-Mail Removed).. .
> 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
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
c++ calling java calling c++ ... Klaus Friese C++ 7 08-15-2005 09:23 PM
calling virtual function results in calling function of base class... Andreas Lagemann C++ 8 01-10-2005 11:03 PM
calling virtual function results in calling function of base class ... tiwy C++ 0 01-09-2005 11:17 PM
Calling FormsAuthentication.SignOut() after calling Response.Flush =?Utf-8?B?TWFydGluIExlZQ==?= ASP .Net 1 09-28-2004 12:47 PM
Server Side button calling page_load before calling it's own click event. Ryan Ternier ASP .Net 4 07-29-2004 01:06 PM



Advertisments