OK.

By the way, although Emmanuel's proposal will work nicely, I don't
necessarily agree that it's the best solution. If you overload the
constructor, passing a Context, it will be harder for JNDIConfiguration to
support *setting* of properties/contexts if, somewhere in the future, this
support is written.

The reason I think it would be harder is because since Contexts are not
thread-safe, you shouldn't store the Context from the ctor in a class
member. You should re-acquire the Context before doing a "set", thus
guaranteeing thread-safety. However, if only the Context is passed to the
ctor, you won't have enough information to re-acquire the Context before
set.

-Eric
p.s. can you point me to the Jakarta page that details how to supply a
patch? I know I've seen it before, just can't remember where...also, should
I open a bugzilla ticket for this?


-----Original Message-----
From: Eric Pugh [mailto:[EMAIL PROTECTED] 
Sent: Monday, September 20, 2004 12:11 PM
To: Jakarta Commons Developers List
Subject: RE: [Configuration] why is JNDIConfiguration.getContext() private?


I agree..   Eric, why don't you supply a patch and a unit test and we can
add this..  I wrote JNDIConfiguration as my first foray into c-c many moon's
ago, so it's ncie to hear you using it!

Eric

> -----Original Message-----
> From: Jung, Eric [mailto:[EMAIL PROTECTED]
> Sent: Monday, September 20, 2004 5:45 PM
> To: 'Jakarta Commons Developers List'
> Subject: RE: [Configuration] why is JNDIConfiguration.getContext()
> private?
>
>
> Thank you!
>
>
> -----Original Message-----
> From: Emmanuel Bourg [mailto:[EMAIL PROTECTED]
> Sent: Monday, September 20, 2004 11:43 AM
> To: Jakarta Commons Developers List
> Subject: Re: [Configuration] why is
> JNDIConfiguration.getContext() private?
>
>
> Hi !
>
> Jung, Eric wrote:
>
> > Hi,
> >
> > Firstly, I love Configuration and have been using it in
> multiple projects
> at
> > multiple jobs for quite some time now.
>
> Thanks ! That's always great to hear from our users :)
>
>
> > I'd like to use JNDIConfiguration to retrieve configuration
> values from a
> > remote JNDI repository. However, I can't find a way to configure
> > JNDIConfiguration to communicate with a remote repository. Since I can't
> > rely on jndi.properties, I need a programmatic way to point
> > JNDIConfiguration to remote repository.
>
> You are right, the current implementation is too restrictive. We should
> have a set/getContext() method, and two constructors :
>
> JNDIConfiguration() : use the default context
> JNDIConfiguration(Context) : use the specified context
>
> I'm nominating this change for the 1.0 final release.
>
> Emmanuel Bourg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to