Non-default Preferences (how to push new conf file)

Peter Hansson <[email protected]>
Newsgroups gmane.comp.java.netbeans.modules.openide.devel
Message-ID <CAC55jYOUJ6aEj3L+i+Pnx_mZkX3a5Ghx4vX1Zq_Mz4VfU=iOLQ@mail.gmail.com>
Inside my NB Platform appl, I'm working with an external library which for
various reasons require me to use a non-default implementation of
Preferences. I do this by setting System Property
'java.util.prefs.PreferencesFactory' in my module installer class.

Unfortunately this doesn't work. The reason is long and winded but
basically comes down to the fact that the Platform uses Preferences too,
and although the Platform's implementation, NbPreferences, avoids to
install itself as the default (allowing you to use your own Preferences
implementation for the stuff not related to Platform) it nevertheless
*references* the Preferences class during startup and this is enough for
the JDK defaults to get set in stone from that point onwards. Setting that
system property later on doesn't help. (look in the source for Preferences
and you see why).

For this reason I need to set the aforementioned System Property very
early, i.e. already on startup, which would mean doing it in the
application's conf file. But this is an application already deployed to
many, many workstations. As far as I know I cannot just push out a new conf
file using the Autoupdate mechanism.

What to do?  What are my options?

Thanks

Peter
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.