This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 27303 - Provide JNDI settings context for Data Objects
Summary: Provide JNDI settings context for Data Objects
Status: CLOSED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 3.x
Hardware: PC Windows 3.1/NT
: P2 blocker (vote)
Assignee: Jan Pokorsky
URL:
Keywords: API
Depends on:
Blocks: 27305
  Show dependency tree
 
Reported: 2002-09-13 12:46 UTC by Pavel Buzek
Modified: 2008-12-22 19:38 UTC (History)
3 users (show)

See Also:
Issue Type: TASK
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Buzek 2002-09-13 12:46:02 UTC
New projects define a new framework for settings in which every DataObject will have a 
"settings context" where it can store its setting. With projects module installed, these settings 
will be stored in the project file. It is suggested that all modules use this new way to store 
their settings so that when a DataObject is added into a project, its settings are stored in the 
project. So this new storage for settings will supercede filesystems attributes.

The question is what to do if the projects module is not present. It is not practical for modules 
to test presence of the projects module and then decide whether to store their settings in fs 
attributes or in project settings context.

The proposal is to make the settings accessible thru a settings context in both cases. So a 
DataObject would just get its settings context and store its settings into it. Without the 
projects module, this settings context would be provided by core and it would be persisted in 
filesystem attributes. With projects module enabled, the settings context would be provided by 
projects module and would be persisted in project. DataObject would get the settings context 
from an environment provider registered in lookup.
Comment 1 Jan Pokorsky 2002-10-09 13:01:11 UTC
In order to accomplish this proposal it would be useful to introduce a
new method unifying the access to the JNDI context. A suitable place
seems to be org.openide.loaders.Environment:

/** Finds a JNDI context for a given data object.
 * @param obj the data object
 * @return the JNDI context for this data object
 */
public static javax.naming.Context findSettingsContext(DataObject obj);

There will be a default context implementation in openide and modules
like projects will be able to plug own impl in by registering
Environment.Provider in the system Lookup.
Comment 2 Jan Pokorsky 2002-10-11 19:06:30 UTC
Implemented in

http://openide.netbeans.org/source/browse/openide/src/org/openide/loaders/Environment.java.diff?r1=1.7&r2=1.8
http://openide.netbeans.org/source/browse/openide/src/org/openide/loaders/DefaultSettingsContext.java?rev=1.1&content-type=text/x-cvsweb-markup

+ xtest
http://openide.netbeans.org/source/browse/openide/test/unit/src/org/openide/loaders/DefaultSettingsContextTest.java?rev=1.1&content-type=text/x-cvsweb-markup

Later if it would be necessary then the default implementation can be
extended to support settings persisted with settings convertors.
Possible variant would be to place the support to new module
core/localfs as Jarda pointed out.
Comment 3 Pavel Buzek 2003-07-02 14:08:05 UTC
i've verified all these issues
Comment 4 Pavel Buzek 2003-07-02 14:19:09 UTC
closing all my verified issues