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 27390 - Useful utility methods for settings contexts
Summary: Useful utility methods for settings contexts
Status: RESOLVED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Generic Infrastructure (show other bugs)
Version: 3.x
Hardware: PC Linux
: P3 blocker (vote)
Assignee: issues@projects
URL:
Keywords: API
Depends on:
Blocks:
 
Reported: 2002-09-17 16:58 UTC by Svata Dedic
Modified: 2003-12-11 14:14 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Svata Dedic 2002-09-17 16:58:17 UTC
There could be methods useful as SPI for
ContextSettings based beans:

- create proxy/merge context (as it is done for
ProjectObject.getContext()):
public Context createContext(Context[] delegates,
Context writable);
the second argument could be useful for both
deciding where the change goes and making the
context read-only if null.

- provide an empty context (/dev/null):
public Context createEmpty()
if current ProxyContext.Empty implementation is
used, then it could just return that shared instance.

- provide a memory-implemented Context:
public Context createMemoryContext();
given that the returned Context also implements
Map interface. Alternatively one could pass a Map
to the function and the Context would be built
around the Map.
Comment 1 Vitezslav Stejskal 2002-10-03 12:43:44 UTC
The last requirement is already supported, just create ContextSettings
passing null in its constructor.
Comment 2 Vitezslav Stejskal 2002-10-16 00:54:41 UTC
An empty JNDI Context is provided by o.n.spi.projects.Contexts.EMPTY.
I've exposed it through the field instead of using factory method
because field allows checking whether some context is an EMPTY one or not.
Comment 3 Vitezslav Stejskal 2002-10-16 01:01:35 UTC
Random (posted elsewhere): ContextSettings shouldn't accept null when
constructed and provide in-memory storage, rather the
Contexts.memoryContext() factory method should exist allowing to
create in-memory implementation of JNDI Context. This will simplify
ContextSettings implementation which is now a sort of schizophreny.
Comment 4 Jan Pokorsky 2002-11-08 00:18:46 UTC
implemented a merged context helper.

projects/core/src/org/netbeans/api/projects/settings/Contexts.java;
new revision: 1.1.2.7; previous revision: 1.1.2.6
Comment 5 Pavel Buzek 2002-11-12 17:03:10 UTC
I filed the only remaining part as a separate issue: 28680 (this is getting pretty messy).
Closing this one (on behalf of implementers: Jan and Vita).