You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by Daniel Kulp <dk...@apache.org> on 2016/12/07 15:33:58 UTC

CachedLDAPAuthorizationMap in blueprint....

While debugging an issue for a client, I discovered that the CachedLDAPAuthorizationMap isn’t working “correctly” with blueprint and would like advice on how to fix it.  Basically, in Spring, the CachedLDAPAuthorizationMap implements the InitializingBean and DisposableBean interfaces so Spring will call the afterPropertiesSet method right after creation so it can query the LDAP server and get the ACL’s.   In blueprint, however, nothing calls the afterPropertiesSet method so it’s not until the first “update” that the ACL’s are queried so any attempt to create topics or anything before then would be denied.   

I can think of a few options to fix it:
1) Least potential for impact:   add a atomic boolean flag of “queried” that is set to false at creation, set to true on first query, and any attempt to read ACL’s will call the query method if it hasn’t been called before.   

2) Add @PostContruct and @PreDestroy annotations to CachedLDAPAuthorizationMap so blueprint will call the methods.  Not sure what spring would do if an object implements the interfaces AND has the annotations though.

3) Create a separate blueprint subclass and somehow get blueprint to create the subclass version which has the annotations on it.   Not sure how to do this though.


Anyway, thoughts?

-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com