A Proxy to Preferences?

Discussion in 'Java' started by Mark, May 1, 2007.

  1. Mark

    Mark Guest

    I want to implement my own PreferencesFactory to serve requests for
    java.util.prefs.Preferences by setting -
    Djava.util.prefs.PreferencesFactory=foo.Bar, but I want to forward
    some calls in my Preferences class onto WindowsPreferences (the
    default in the Windows JRE).

    Looking in the JRE sources I see that WindowsPreferences and
    WindowsPreferencesFactory are package-private, and I can't use the
    Preference factory methods witing foo.Bar (or I will just be calling
    myself again).

    So what is the best way of accessing the default preferences factory?
    Is it as simple and ugly as temporarily resetting the relevant system
    property from "foo.Bar" to "java.util.prefs.WindowsPreferencesFactory"
    inside the methods of my new Preferences class?

    Mark
    Mark, May 1, 2007
    #1
    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. clintonG
    Replies:
    3
    Views:
    2,478
    clintonG
    Jul 3, 2004
  2. =?Utf-8?B?R3JlZw==?=

    IE printing preferences

    =?Utf-8?B?R3JlZw==?=, Jan 24, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    546
    Stefano
    Jan 24, 2005
  3. Patrick Olurotimi Ige

    Rating 1 to 3 in order of preferences Question

    Patrick Olurotimi Ige, Feb 24, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    303
    Patrick Olurotimi Ige
    Feb 24, 2005
  4. Oliver Hirschi

    java.util.prefs.Preferences

    Oliver Hirschi, Jul 16, 2003, in forum: Java
    Replies:
    8
    Views:
    8,750
    Chris Riesbeck
    Jul 16, 2003
  5. Carsten Zerbst

    webstart and java.util.Preferences ?

    Carsten Zerbst, Jul 16, 2003, in forum: Java
    Replies:
    1
    Views:
    545
    S. Balk
    Jul 16, 2003
Loading...

Share This Page