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 780F2200B79 for ; Tue, 23 Aug 2016 16:57:23 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 76090160AAD; Tue, 23 Aug 2016 14:57:23 +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 BCACC160ABF for ; Tue, 23 Aug 2016 16:57:22 +0200 (CEST) Received: (qmail 38788 invoked by uid 500); 23 Aug 2016 14:57:21 -0000 Mailing-List: contact issues-help@karaf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@karaf.apache.org Delivered-To: mailing list issues@karaf.apache.org Received: (qmail 38509 invoked by uid 99); 23 Aug 2016 14:57:21 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Aug 2016 14:57:21 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id AB4782C0152 for ; Tue, 23 Aug 2016 14:57:21 +0000 (UTC) Date: Tue, 23 Aug 2016 14:57:21 +0000 (UTC) From: =?utf-8?Q?Jean-Baptiste_Onofr=C3=A9_=28JIRA=29?= To: issues@karaf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (KARAF-4361) Allow dynamic config customization when embedding Karaf using the Main class MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 23 Aug 2016 14:57:23 -0000 [ https://issues.apache.org/jira/browse/KARAF-4361?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:all-tabpanel ] Jean-Baptiste Onofr=C3=A9 updated KARAF-4361: ---------------------------------------- Fix Version/s: (was: 4.0.6) 4.0.7 > Allow dynamic config customization when embedding Karaf using the Main cl= ass > -------------------------------------------------------------------------= --- > > Key: KARAF-4361 > URL: https://issues.apache.org/jira/browse/KARAF-4361 > Project: Karaf > Issue Type: Improvement > Components: karaf-core > Affects Versions: 4.1.0, 4.0.4 > Reporter: Serge Huber > Assignee: Jean-Baptiste Onofr=C3=A9 > Fix For: 4.1.0, 4.0.7 > > Attachments: KARAF_4361_Allow_dynamic_config_customization_when_e= mbedding_Karaf_using_the_Main_class.patch > > > We are using Karaf by embedding it and basically starting it like this := =20 > {code} > // code to setup System properties > main =3D new Main(new String[0]); > main.launch(); > {code} > The problem is that the ConfigProperties that are used to startup Karaf a= re directly created in the main.launch() method, like this: > {code} > public void launch() throws Exception { > config =3D new ConfigProperties(); > {code} > Ideally it would be great if we could either have a setter to provide the= config value, so that we could manipulate it before launching. In an embed= ded environment this quickly becomes a necessity. For example we would like= to make it possible to have retrieve properties coming from another framew= ork such as Spring and use those to override config.properties settings in= a dynamic way, without needing to dump them to a file at Karaf startup. I'= m aware of the ${includes} and ${optionals} but those require files to be r= ead from the disk where here I'm talking about being able to dynamically ma= nipulate the properties once loaded. > Basically something like this would be fantastic > {code} > // code to setup System properties > main =3D new Main(new String[0]); > ConfigProperties config =3D main.getConfig(); > if (config =3D=3D null) { > config =3D new ConfigProperties(); > } > // manipulate config in any way desired > main.setConfig(config) > main.launch(); > {code} > The main.launch could then simply be modified to something like this :=20 > {code} > public void launch() throws Exception { > if (config =3D=3D null) { > config =3D new ConfigProperties(); > } > {code} > Btw we are using Karaf 4.0.x so having this in both Karaf 4.1.0 and Karaf= 4.0 would be fantastic. -- This message was sent by Atlassian JIRA (v6.3.4#6332)