Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 18CBA200BD8 for ; Wed, 7 Dec 2016 16:34:04 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 177EC160B0C; Wed, 7 Dec 2016 15:34:04 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 8750D160AF9 for ; Wed, 7 Dec 2016 16:34:03 +0100 (CET) Received: (qmail 94566 invoked by uid 500); 7 Dec 2016 15:34:02 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 94555 invoked by uid 99); 7 Dec 2016 15:34:02 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Dec 2016 15:34:02 +0000 Received: from server.dankulp.com (unknown [104.128.68.137]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id 49A161A0289 for ; Wed, 7 Dec 2016 15:34:02 +0000 (UTC) From: Daniel Kulp Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.1 \(3251\)) Subject: CachedLDAPAuthorizationMap in blueprint.... Message-Id: <50DFAE1D-437F-4775-894B-533D2817D2B4@apache.org> Date: Wed, 7 Dec 2016 10:33:58 -0500 To: dev@activemq.apache.org X-Mailer: Apple Mail (2.3251) archived-at: Wed, 07 Dec 2016 15:34:04 -0000 While debugging an issue for a client, I discovered that the = CachedLDAPAuthorizationMap isn=E2=80=99t working =E2=80=9Ccorrectly=E2=80=9D= 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=E2=80=99s. In blueprint, however, nothing calls the = afterPropertiesSet method so it=E2=80=99s not until the first = =E2=80=9Cupdate=E2=80=9D that the ACL=E2=80=99s are queried so any = attempt to create topics or anything before then would be denied. =20 I can think of a few options to fix it: 1) Least potential for impact: add a atomic boolean flag of = =E2=80=9Cqueried=E2=80=9D that is set to false at creation, set to true = on first query, and any attempt to read ACL=E2=80=99s will call the = query method if it hasn=E2=80=99t been called before. =20 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? --=20 Daniel Kulp dkulp@apache.org - http://dankulp.com/blog Talend Community Coder - http://coders.talend.com