> On Mar 16, 2016, at 7:53 AM, Chris Pike <[email protected]> wrote:
> 
> The real issue is that exceptions thrown in static initialization cause 
> unrecoverable problems with the classloader. The static block in Config would 
> be changed into an init() method that gets called by the constructor. So the 
> getInstance() method would fail until a connection could be established. See 
> the link below for an example of the modified Config class.
> 
> https://github.com/PennState/directory-fortress-core-1/blob/feature/modifyBootstrapSingleton/src/main/java/org/apache/directory/fortress/core/util/Config.java#L75
> 
> Any class using Config would need modified to call getInstance first and not 
> call it in a static context.

Sounds good.  

A few more questions:

1. How do you propose coding the connection retry logic?
2. The config object is used throughout the code, in static blocks, static 
variable initializations and such.
3. There is a complex interaction between the ApacheDsDataProvider and the 
Config objects.  The static block of the former is where the ldap connection 
pools are initialized.  That is kicked off by the latter.  Have you considered 
how to recode these classes?

Thanks

Shawn 

Reply via email to