Return-Path: Delivered-To: apmail-incubator-cxf-dev-archive@locus.apache.org Received: (qmail 74960 invoked from network); 15 Dec 2006 03:25:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Dec 2006 03:25:35 -0000 Received: (qmail 19522 invoked by uid 500); 15 Dec 2006 03:25:42 -0000 Delivered-To: apmail-incubator-cxf-dev-archive@incubator.apache.org Received: (qmail 19479 invoked by uid 500); 15 Dec 2006 03:25:42 -0000 Mailing-List: contact cxf-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cxf-dev@incubator.apache.org Delivered-To: mailing list cxf-dev@incubator.apache.org Received: (qmail 19470 invoked by uid 99); 15 Dec 2006 03:25:42 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Dec 2006 19:25:42 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of jliu@iona.com designates 65.223.216.181 as permitted sender) Received: from [65.223.216.181] (HELO amereast-smg1.iona.com) (65.223.216.181) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Dec 2006 19:25:31 -0800 Received: from amer-ems1.IONAGLOBAL.COM ([10.65.6.25]) by amereast-smg1.iona.com (Switch-3.1.7/Switch-3.1.7) with ESMTP id kBF3P9lO024508 for ; Thu, 14 Dec 2006 22:25:09 -0500 (EST) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: Injecting the configuration programmatically Date: Thu, 14 Dec 2006 22:25:04 -0500 Message-ID: <9A4696F35B459043970EE4A85A317390066809@amer-ems1.IONAGLOBAL.COM> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Injecting the configuration programmatically Thread-Index: Accf7Z0VaXvIYhP9Rr6df/caDCI+SgACP31A From: "Liu, Jervis" To: X-Virus-Checked: Checked by ClamAV on apache.org Hi Alex, you do not need to provide SpringBusFactory with a config file, = by default SpringBusFactory loads its config file from = META-INF/cxf/cxf.xml within cxf-rt-core-2.0-incubator-M1-SNAPSHOT.jar. = So just use SpringBusFactory.createBus() Cheers, Jervis > -----Original Message----- > From: Alex Chen [mailto:alex.chen@iona.com] > Sent: Friday, December 15, 2006 10:06 AM > To: cxf-dev@incubator.apache.org > Subject: Re: Injecting the configuration programmatically >=20 >=20 > Hi Eoghan, >=20 > I have a task to use CXF inside Eclipse plugin, so I wonder=20 > what's the=20 > minimum configuration arguments for initializing CXF bus properly? >=20 > If I use SpringBusFactory.createBus(String cfgFile) and supply the=20 > default cxf.xml find in=20 > cxf-rt-core-2.0-incubator-M1-SNAPSHOT.jar, does=20 > that enough? >=20 > thanks, > --Alex >=20 >=20 > Glynn, Eoghan wrote: > >=20 > > Well if you just want to specify a particular configuration=20 > file programmatically, then the simplest way is to use the=20 > SpringBusFactory.createBus(String cfgFile) API. > >=20 > > If you want to *completely* replace the Spring Configurer=20 > with your own implementation, then use: > >=20 > > Bus.setExtension(Configurer.class, myConfigurer); > >=20 > > If you want to *selectively* inject property values for=20 > some particular beans (but let the other beans pick up their=20 > property values from the config file as usual), then I think=20 > there's some work to do. I'm no Spring expert, and Andrea=20 > would be really be person to comment definitively on this.=20 > However seeing as she's on vacation, I'd guess you could try=20 > down-casting the Configurer bus extension to an=20 > org.springframework.beans.factory.wiring.BeanConfigurerSupport > , then call setBeanFactory() on this to set your own fa=E7ade=20 > implementation of=20 > org.springframework.beans.factory.config.AutowireCapableBeanFa > ctory. Then in autowireBeanProperties() and=20 > applyBeanPropertyValues(), check if the bean being configured=20 > is the one you want to selectively inject specific property=20 > values into. If so, go ahead and do this. If not, delegate to=20 > the original bean factory. > >=20 > > There may well be a simpler and better way of doing this.=20 > For example to avoid getting tangled up in the Spring logic,=20 > you could just extend the=20 > org.apache.cxf.configuartion.spring.ConfigurerImpl to allow=20 > values for specific beans to be injected into say a local=20 > map, which is then checked before configureBean() delegates=20 > to the super-class implementation [i.e.=20 > org.springframework.beans.factory.wiring.BeanConfigurerSupport > .configureBean()]. > >=20 > > As always, I'm open to correction by the Spring aficionados. > >=20 > > Cheers, > > Eoghan > >=20 > >=20 > >> -----Original Message----- > >> From: Sergey Beryozkin [mailto:sergey.beryozkin@iona.com]=20 > >> Sent: 14 December 2006 09:35 > >> To: cxf-dev@incubator.apache.org > >> Subject: Injecting the configuration programmatically > >> > >> Hi > >> > >> Is there any way to inject the configuration into the CXF=20 > >> runtime programmatically ? > >> For ex, one way is to tell the runtime where the config is by=20 > >> pointing it to the cxf.xml (default name...). Is there any=20 > >> way to create a required configuration and tell the runtime=20 > >> that the configuration for a given bean name is available ? > >> > >> Thanks, Sergey=20 > >> > >> > >=20 >=20