🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #1067

java.util.prefs

#1067
From: Hernan Silberman
Date: Fri, 31 May 2002 19:08
55 lines
3300 bytes
Hi there.

I've written a custom Preferences implementation for my Java 1.4 
application which uses a relation database as a backing store.  During 
the app's startup, I make this known to the app by setting the 
appropriate sysyem property:

System.getProperties().
setProperty("java.util.prefs.PreferencesFactory",
"com.dw.util.prefs.MyPreferencesFactory");

I noticed that if my app attempted to bring up any UI before this system 
property is set, the default (linux or windows) preferences 
implementation would beat mine to the punch.  My system preference gets 
set, but it's too late, another preferences implementation has beat mine 
to the punch because some other entity requested a preference node.

The real problem is that I need to identify and authenticate my user 
before I can build the "user root" Preferences node.  To do this, I 
bring up a login dialog.  For some reason, bringing up the dialog 
results in a call PreferencesFactory.userRoot().  I don't understand 
this--why would AWT want to have anything with java.util.prefs?

This stack trace tells the story.  I'm simply trying to show a splash 
screen and sun.awt.im.ExecutableInputMethodManager makes a getUserRoot() 
call before I'm ready for it:

at java.util.prefs.Preferences.userRoot(Preferences.java:341)
at 
sun.awt.im.ExecutableInputMethodManager$2.run(InputMethodManager.java:785)
at java.security.AccessController.doPrivileged(Native Method)
at 
sun.awt.im.ExecutableInputMethodManager.getUserRoot(InputMethodManager.java:783)
at 
sun.awt.im.ExecutableInputMethodManager.<init>(InputMethodManager.java:274)
at sun.awt.im.InputMethodManager.getInstance(InputMethodManager.java:138)
at sun.awt.windows.WFramePeer.<init>(WFramePeer.java:148)
at sun.awt.windows.WToolkit.createFrame(WToolkit.java:331)
at java.awt.Frame.addNotify(Frame.java:469)
at java.awt.Window.addNotify(Window.java:390)
at java.awt.Window.show(Window.java:433)
at java.awt.Component.show(Component.java:1128)
at java.awt.Component.setVisible(Component.java:1083)
at com.dw.nile.app.ui.SplashWindow.<init>(SplashWindow.java:90)
at com.dw.nile.app.ui.SplashWindow.<init>(SplashWindow.java:26)
at com.dw.nile.app.NileClientApp.appInit(NileClientApp.java:78)


Any insight is much appreciated.

thanks...
hernan

-- 
think globally, code locally
Technical Details
Message-ID: <3CF7CA1C.3010803@pdi.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!supernews.com!isdnet!fu-berlin.de!news.rhrz.uni-bonn.de!RRZ.Uni-Koeln.DE!nntp.cs.uni-magdeburg.de!PeerFeed.KWeb.on.ca!dnews

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1089d0,fc0a371a6415b94a,start
X-Google-Attributes: gid1089d0,public
X-Google-ArrivalTime: 2002-05-31 12:37:50 PST
Message-ID: <3CF7CA1C.3010803@pdi.com>
Date: Fri, 31 May 2002 12:08:12 -0700
From: Hernan Silberman <hsilberm@pdi.com>
Organization: PDI/Dreamworks
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.4.1) Gecko/20020314 Netscape6/6.2.2
X-Accept-Language: en-us
MIME-Version: 1.0
Newsgroups: borland.public.jbuilder.java.api
Subject: java.util.prefs
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 209.213.214.4
X-Trace: dnews 1022872181 209.213.214.4 (31 May 2002 12:09:41 -0700)
Lines: 56
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!supernews.com!isdnet!fu-berlin.de!news.rhrz.uni-bonn.de!RRZ.Uni-Koeln.DE!nntp.cs.uni-magdeburg.de!PeerFeed.KWeb.on.ca!dnews