Return-Path: Delivered-To: apmail-incubator-cxf-dev-archive@locus.apache.org Received: (qmail 37503 invoked from network); 26 Feb 2007 18:18:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Feb 2007 18:18:37 -0000 Received: (qmail 61458 invoked by uid 500); 26 Feb 2007 18:18:46 -0000 Delivered-To: apmail-incubator-cxf-dev-archive@incubator.apache.org Received: (qmail 61426 invoked by uid 500); 26 Feb 2007 18:18:45 -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 61417 invoked by uid 99); 26 Feb 2007 18:18:45 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Feb 2007 10:18:45 -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 seumas.soltysik@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; Mon, 26 Feb 2007 10:18:34 -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 l1QII8tA019543 for ; Mon, 26 Feb 2007 13:18: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: Dynamically deploying interceptors via JMX Date: Mon, 26 Feb 2007 13:18:08 -0500 Message-ID: <05F5FDC16A447442B12B21A432878AC50518D2@amer-ems1.IONAGLOBAL.COM> In-Reply-To: <7b774c950702260932i549c62c7tb3bf30de70bcd37f@mail.gmail.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Dynamically deploying interceptors via JMX Thread-Index: AcdZzCeyM1ueKYu1QxGhf0zPc5MyawAAlDRw From: "Soltysik, Seumas" To: X-Virus-Checked: Checked by ClamAV on apache.org Hi Dan, In order to use the ApplicationContextAware mechanism, the object I am = instrumenting would have to created by Spring itself which is not = necessarily the case.=20 Here is what I would like to do: 1)Expose the Bus as an MBean. In the CXFBusImpl constructor, construct = an MBeanWrapper around the Bus and register it with the = InstrumentationManager. This BusMBeanWrapper would have a = addInterceptor(String id) method on it. It would be nice if this wrapper = had a handle to the ApplicationContext which was used to create the Bus. = However, since the Bus itself is not ApplicationContextAware, I am not = sure how to do this. 2)Users call addInterceptor(String id) on Bus MBean. This id is used to = lookup interceptor from ApplicationContext so that if this method is = called several times, the same interceptor is always used for the given = ID. For starters, users would have to define any interceptors that they = expected to use in the bean.xml file used to configure the Bus. Later on = we could make such that Interceptors beans could be specified at = runtime. Seumas -----Original Message----- From: Dan Diephouse [mailto:dan@envoisolutions.com] Sent: Monday, February 26, 2007 12:33 PM To: cxf-dev@incubator.apache.org Subject: Re: Dynamically deploying interceptors via JMX In your JMX component you could implement ApplicationContextAware which = will give you a handle on the ApplicationContext. What if the interceptor isn't previously defined in an XML file? For example, lets say I want to add a logging interceptor. I would have to = have it predefined in my beans.xml then, right? - Dan On 2/26/07, Soltysik, Seumas wrote: > > I would like to expose the various InterceptorProviders (Bus, Service, > Endpoint) as MBeans and provide methods on these MBeans to dynamically > deploy interceptors into these providers. In order to do this, I need = a > mechanism to instantiate an interceptor before adding it to the = provider. > Now I could pass in a classname to the MBean = [BusMBean.addInterceptor(classname)] > and instantiate the interceptor that way but that seems lame. A better = way > would be if I could get a handle on the Spring BeanFactory used to = create > other CXF objects and use it as a factory for creating dynamic = interceptors. > So instead of using a classname to instantiate an object, I could = simply use > a spring id to get a handle on the desired interceptor. I am think = that a > user could specify their interceptor bean in the cxf*.xml file used to > configure the bus and later reference the bean using the id. > Is it possible to get a handle on the BeanFactory used to load Bus > configuration? Is this a reasonable approach? > Regards, > Seumas > --=20 Dan Diephouse Envoi Solutions http://envoisolutions.com | http://netzooid.com/blog