Return-Path: Delivered-To: apmail-activemq-camel-dev-archive@locus.apache.org Received: (qmail 2369 invoked from network); 9 Jan 2009 02:43:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Jan 2009 02:43:37 -0000 Received: (qmail 60966 invoked by uid 500); 9 Jan 2009 02:43:37 -0000 Delivered-To: apmail-activemq-camel-dev-archive@activemq.apache.org Received: (qmail 60948 invoked by uid 500); 9 Jan 2009 02:43:37 -0000 Mailing-List: contact camel-dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: camel-dev@activemq.apache.org Delivered-To: mailing list camel-dev@activemq.apache.org Received: (qmail 60937 invoked by uid 99); 9 Jan 2009 02:43:36 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Jan 2009 18:43:36 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of willem.jiang@gmail.com designates 209.85.142.184 as permitted sender) Received: from [209.85.142.184] (HELO ti-out-0910.google.com) (209.85.142.184) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Jan 2009 02:43:27 +0000 Received: by ti-out-0910.google.com with SMTP id a20so6298959tia.0 for ; Thu, 08 Jan 2009 18:43:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=DYv3FFEnZALSmxEKKkahNhzct3Ny/oI1Thed93a1ZXU=; b=A+popYGmfD1QAKSEYjhNTOHF/OgQFq9vdc/zVz0WFNfZuU90Hza6lXooJ4fNnryx+X XGz1A8drISgV8hVrkcxrUuN0ixlM4gPfH4VmlBThp17imyofAZX4Hs0DjP0NSPt/6fgk ahp+yf9Yssh0GFVjGMjO4B1h4CkuVA1jJgRyw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=elIJMtg8NG33S6fzACyQVPisYNUd6BfLjF+ovzSj8AQlvpj23dqcc46KjKPN3SVYLT 6kkbinByRrarfv7+fbiAlIHojpCZXnHcIlggPDBxKJqNeAR5bLKSMVOM1OyrCNj2uqHZ pKi2LeFacdOP5BtFFjpqFPvCSwaStRgQD2Ub0= Received: by 10.110.2.2 with SMTP id 2mr1575898tib.40.1231468985064; Thu, 08 Jan 2009 18:43:05 -0800 (PST) Received: from ?192.168.0.131? ([221.218.162.231]) by mx.google.com with ESMTPS id y3sm3056117tia.0.2009.01.08.18.43.03 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 08 Jan 2009 18:43:04 -0800 (PST) Message-ID: <4966B9B3.6030705@gmail.com> Date: Fri, 09 Jan 2009 10:42:59 +0800 From: Willem Jiang User-Agent: Thunderbird 2.0.0.19 (Windows/20081209) MIME-Version: 1.0 To: camel-dev@activemq.apache.org Subject: Re: Quick questions in CxfConsumer code References: In-Reply-To: X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi, Please see my comments in the mail. William Tam wrote: > In doing code cleanup in camel-cxf, I come across a question. In the > constructor of CxfConsumer, it tries to assign value to the variable > bus. The bus will be used later on to setBus on > > Bus bus = null; > this.endpoint = endpoint; > boolean isWebServiceProvider = false; > if (endpoint.getApplicationContext() != null) { > SpringBusFactory bf = new > SpringBusFactory(endpoint.getApplicationContext()); > bus = bf.createBus(); > if (CxfEndpointUtils.getSetDefaultBus(endpoint)) { > BusFactory.setDefaultBus(bus); > } > } else { > // now we just use the default bus here > bus = BusFactory.getDefaultBus(); > } > ServerFactoryBean svrBean = null; > ... > svrBean.setBus(bus); > > Questions: > 1) Is the setDefaultBus option only applied to non-Spring CxfEndpoint? BusFactory.getDefaultBus() will call set the setDefaultBus , if there is a new bus created. if (CxfEndpointUtils.getSetDefaultBus(endpoint)) { BusFactory.setDefaultBus(bus); } This code just helps other CXF components to share the bus with the Spring camel-cxf endpoint. > 2) If I add a feature to lookup a bus from the registry/application > context for non-Spring CxfEndpoint, I would set svrBean to the my bus > (from the registry) and not getting the default bus. In this case, > setDefaultBus option would make sense to non-Spring CxfEndpoint as > well, right? And, it means setting my bus as default. Yes, you may have more than one bus in the registry (which set up by spring). We should let the use to configure the bus for the no-spring endpoint. How about add a parameter like the busId in the cxf uri ? > 3) For Spring CxfEndpoint, does bf.createBus() return the same bus as > CxfEndpointBean.getBus()? I guess it may or may not. You could > define a bus just for your endpoint, right. So, would it better to > take the one from the endpoint bean? Good question, the original thought of the code is pass the spring context into the bus. But I think we could update the code to inject the Application context into the bus which is used by endpoint. > > Thanks, > William > Cheers, Willem