[JNDI] Abstracting away JNDI providers
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Apache Server configuration support > Apache Directory Project > [JNDI] Abstracting away JNDI providers




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    [JNDI] Abstracting away JNDI providers  
Alex Karasulu


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-26-07 12:11 AM

Hi studio team,

I was wondering if you guys have a means to abstract the JNDI context
factory used in
connections depending on the JVM being used.  I have a similar need to get
the JNDI
context factory name based on the JVM that the server is running on so I
thought I might
ask if you already have something in place.

As you know the over the wire JNDI provider's InitialContextFactory class is
JVM specific.
Did you guys encapsulate this so studio uses the proper one when running on
different JVMs?

Thanks,
Alex






[ Post a follow-up to this message ]



    Re: [JNDI] Abstracting away JNDI providers  
Stefan Seelmann


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-26-07 12:11 AM

Hi Alex,

no, we use "com.sun.jndi.ldap.LdapCtxFactory" and it is hardcoded. We
already have an Jira about that, see
https://issues.apache.org/jira/browse/DIRSTUDIO-182

However, it works fine with Sun, IBM and JRockit JVMs, because they all
come with this class. I don't know if they just re-license the libraries
from Sun. I haven't tested with Harmony, but I guess it won't work (do
they have a LDAP provider yet?).

Some auto-detection depending on the JVM would be cool. Perhaps a simple
property file that maps from java.vendor or java.vm.vendor to the
factory class would be enough. Or we could have a list of well-known
factory classes and use reflection to test which class exists.

Regards,
Stefan


Alex Karasulu schrieb:
> Hi studio team,
>
> I was wondering if you guys have a means to abstract the JNDI context
> factory used in
> connections depending on the JVM being used.  I have a similar need to
> get the JNDI
> context factory name based on the JVM that the server is running on so I
> thought I might
> ask if you already have something in place.
>
> As you know the over the wire JNDI provider's InitialContextFactory
> class is JVM specific.
> Did you guys encapsulate this so studio uses the proper one when running
> on different JVMs?
>
> Thanks,
> Alex







[ Post a follow-up to this message ]



    Re: [JNDI] Abstracting away JNDI providers  
Alex Karasulu


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-26-07 12:11 AM

On 9/25/07, Stefan Seelmann <seelmann-1oDqGaOF3Lkdnm+yROfE0A@public.gmane.org> wrote:
>
> Hi Alex,
>
> no, we use "com.sun.jndi.ldap.LdapCtxFactory" and it is hardcoded. We
> already have an Jira about that, see
> https://issues.apache.org/jira/browse/DIRSTUDIO-182


NP it's easy to fix this.  I was thinking of writing a UniversalCtxFactory
that just delegates.

However, it works fine with Sun, IBM and JRockit JVMs, because they all
> come with this class.


Really I thought that the IBM one was different.  It's com.ibm ... I hope I
am wrong.
Cound not find a JNDI provider for jrocket tho but I'm pretty sure about
IBM's.

I don't know if they just re-license the libraries
> from Sun. I haven't tested with Harmony, but I guess it won't work (do
> they have a LDAP provider yet?).


I think they're just looking into it now.

Some auto-detection depending on the JVM would be cool. Perhaps a simple
> property file that maps from java.vendor or java.vm.vendor to the
> factory class would be enough. Or we could have a list of well-known
> factory classes and use reflection to test which class exists.
>

Yeah I just created a wrapper that detects based on the java.vm.vendorproper
ty.
I'm adding this to a shared/ldap-jndi so we can reuse it along with some of
the other
utilities around JNDI I want to put in there.  BTW I want to implement that
pattern
that the Spring LDAP guys are using and put it here as well so we can share
it.

If you're interested in putting shared LDAP JNDI handling code in there too
all the better.

Alex






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 08:59 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register