Calling method/object reference

Discussion in 'Java' started by Jeff Harman, Feb 25, 2005.

  1. Jeff Harman

    Jeff Harman Guest

    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.
    Jeff Harman, Feb 25, 2005
    #1
    1. Advertising

  2. 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
    Stefan Schulz, Feb 25, 2005
    #2
    1. Advertising

  3. Jeff Harman

    Jeff Harman Guest

    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:p...
    > 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
    >
    Jeff Harman, Feb 28, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. robertm
    Replies:
    1
    Views:
    2,009
    robertm
    Aug 20, 2003
  2. =?UTF-8?B?UmFmYcWCIE1haiBSYWYyNTY=?=
    Replies:
    2
    Views:
    360
    =?UTF-8?B?UmFmYcWCIE1haiBSYWYyNTY=?=
    Mar 2, 2006
  3. Replies:
    1
    Views:
    458
    Mark Rae [MVP]
    Sep 20, 2007
  4. Erik
    Replies:
    11
    Views:
    629
    Peter Duniho
    Mar 29, 2008
  5. why-em-jay

    Calling a method of the calling object ...

    why-em-jay, Sep 15, 2005, in forum: Perl Misc
    Replies:
    3
    Views:
    161
    Anno Siegel
    Sep 15, 2005
Loading...

Share This Page