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 8D3E1200D48 for ; Tue, 14 Nov 2017 18:55:32 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 8BE6F160BD7; Tue, 14 Nov 2017 17:55:32 +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 D9B8E160BF4 for ; Tue, 14 Nov 2017 18:55:31 +0100 (CET) Received: (qmail 95845 invoked by uid 500); 14 Nov 2017 17:55:31 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 95829 invoked by uid 99); 14 Nov 2017 17:55:31 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Nov 2017 17:55:31 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 823DC81AC8; Tue, 14 Nov 2017 17:55:30 +0000 (UTC) Date: Tue, 14 Nov 2017 17:55:31 +0000 To: "commits@cxf.apache.org" Subject: [cxf-fediz] 01/03: DBLoaderSpring propagates caller environment MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit From: gonzalad@apache.org In-Reply-To: <151068213044.21688.9636001403956565745@gitbox.apache.org> References: <151068213044.21688.9636001403956565745@gitbox.apache.org> X-Git-Host: gitbox.apache.org X-Git-Repo: cxf-fediz X-Git-Refname: refs/heads/1.4.x-fixes X-Git-Reftype: branch X-Git-Rev: 8b81221d2f82ce9f0f7bca445aaedb86ee973633 X-Git-NotificationType: diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated Message-Id: <20171114175530.823DC81AC8@gitbox.apache.org> archived-at: Tue, 14 Nov 2017 17:55:32 -0000 This is an automated email from the ASF dual-hosted git repository. gonzalad pushed a commit to branch 1.4.x-fixes in repository https://gitbox.apache.org/repos/asf/cxf-fediz.git commit 8b81221d2f82ce9f0f7bca445aaedb86ee973633 Author: gonzalad AuthorDate: Sun Nov 12 23:58:00 2017 +0100 DBLoaderSpring propagates caller environment DBLoaderSpring now propagates the Spring environment from the calling context. --- .../cxf/fediz/service/idp/service/jpa/DBLoaderSpring.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/DBLoaderSpring.java b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/DBLoaderSpring.java index 1d58a77..4cbd5d0 100644 --- a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/DBLoaderSpring.java +++ b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/DBLoaderSpring.java @@ -25,11 +25,14 @@ import javax.persistence.PersistenceContext; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.context.EnvironmentAware; import org.springframework.context.support.GenericXmlApplicationContext; +import org.springframework.core.env.ConfigurableEnvironment; +import org.springframework.core.env.Environment; import org.springframework.transaction.annotation.Transactional; @Transactional -public class DBLoaderSpring implements DBLoader { +public class DBLoaderSpring implements DBLoader, EnvironmentAware { public static final String NAME = "SPRINGDBLOADER"; @@ -37,6 +40,7 @@ public class DBLoaderSpring implements DBLoader { private EntityManager em; private String resource; + private Environment environment; @PersistenceContext public void setEntityManager(EntityManager entityManager) { @@ -57,6 +61,11 @@ public class DBLoaderSpring implements DBLoader { } @Override + public void setEnvironment(Environment environment) { + this.environment = environment; + } + + @Override public void load() { GenericXmlApplicationContext ctx = null; @@ -67,6 +76,9 @@ public class DBLoaderSpring implements DBLoader { } ctx = new GenericXmlApplicationContext(); + if (environment instanceof ConfigurableEnvironment) { + ctx.setEnvironment((ConfigurableEnvironment) environment); + } ctx.load(resource); ctx.refresh(); ctx.start(); -- To stop receiving notification emails like this one, please contact "commits@cxf.apache.org" .