Return-Path: X-Original-To: apmail-cxf-dev-archive@www.apache.org Delivered-To: apmail-cxf-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A607F1FE7 for ; Tue, 26 Apr 2011 11:17:45 +0000 (UTC) Received: (qmail 37990 invoked by uid 500); 26 Apr 2011 11:17:45 -0000 Delivered-To: apmail-cxf-dev-archive@cxf.apache.org Received: (qmail 37936 invoked by uid 500); 26 Apr 2011 11:17:45 -0000 Mailing-List: contact dev-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 dev@cxf.apache.org Received: (qmail 37928 invoked by uid 99); 26 Apr 2011 11:17:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Apr 2011 11:17:45 +0000 X-ASF-Spam-Status: No, hits=1.8 required=5.0 tests=FREEMAIL_FROM,FREEMAIL_REPLY,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of sberyozkin@gmail.com designates 209.85.214.41 as permitted sender) Received: from [209.85.214.41] (HELO mail-bw0-f41.google.com) (209.85.214.41) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Apr 2011 11:17:40 +0000 Received: by bwz17 with SMTP id 17so517716bwz.0 for ; Tue, 26 Apr 2011 04:17:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=WH6XK9HCz8GaK/Jt/E3J4V0H0xNF02FYzPUFob161xU=; b=lgKQRnddCH5mB+7Y6abOzHRCNJHUNjgSO9YQl7nl/J8aIJMgiamkjs8duSFaD6SrHq +nxNvQZKyeeLzRp0+BY2aNnDaREFCNH7tGr9tW+JbFdGwYm/2bcN00OMmMpFfKBVNve9 tyx/ygo0uuGocu7lUeceKug1BIhCPXFl3pFHU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=ARPwqf47BRZHNQKZUc4VlxVd+IVYbMZuTSH4fwTXGK3P37DDzGj7B92rwsSDpx+0Q0 pIYONZwUxOwQW3mJa8cssmdr49v0ljS6TsEYsXRg6+KjwFeAJLEn1EYMwt4My5S/UsMW DMzzMj1qNPk+OKEuX0XNdPQHDeyxiX7qZWB1k= MIME-Version: 1.0 Received: by 10.204.32.65 with SMTP id b1mr568472bkd.73.1303816638953; Tue, 26 Apr 2011 04:17:18 -0700 (PDT) Received: by 10.204.60.73 with HTTP; Tue, 26 Apr 2011 04:17:18 -0700 (PDT) In-Reply-To: References: Date: Tue, 26 Apr 2011 12:17:18 +0100 Message-ID: Subject: =?UTF-8?Q?Re=3A_Revised_Proposal=3A_GSoC_=2D_=28CXF=2D3388=29_Expose_CXF_J?= =?UTF-8?Q?MX_MBeans_as_the_JAX=2DRS_resources=E2=80=8F?= From: Sergey Beryozkin To: Shenglin Qiu Cc: CXF Apache Foundation Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable HI Shenglin >> - What you may want to do is to update InstrumentationManagerImpl to >> be able to access the underlying MBeanServerConnection and have >> InstrumentationManagerImpl inject into your JAX-RS resource, thus >> letting the manager deal with JMS-specific configuration and >> connection management - please do it a bit later on - not critical >> right now >> > > Because InstrumentationManagerImpl has an MBServerConnectorFactory which = is > focusing on create/stop/... an mbean server, adding MBeanServerConnection > would make this class also have a client manager function, it's great! I > will strictly follow your designs, as I can see it's one of the core in > cxf-rs. Please, take all my comments with the grain of salt, doubt them, you already know more than I do about the way MBeans are dealt with in CXF :-). > >> - Note that users may use JAX-RS only, JAX-WS only, or JAX-RS and >> JAX-WS endpoints. Assume JAX-RS endpoints have only single root >> resources for now. The JAX-RS resource you are working upon should >> work either way. You can't have it added to JAX-WS endpoint, so it >> should be independent. Also I think it should be able to return the >> list of endpoints it 'manages', possibly in the form of expanded >> QNames and list all MBeans which 'belong' to a specific endpoint only. >> > > Yes, I should only focus on Jax-RS. We have to make sure CXF has a JAX-RS resource which can expose MBeans representing JAX-WS and/or JAX-RS endpoints > And further Restful returnings, I have things like this, forgot to includ= e > this at last email.: > URL: > http://localhost:8080/cxfservice/jaxrs/jmx/component/org.apache.cxf:type= =3D*,* > Return (Forgive me about the poor xml format) > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 > > org.apache.cxf:bus.id=3Dcxf2006079,port=3D"CustomerServiceImpl",service= =3D"{http://impl.service.ws.plumchoice.com/}CustomerServiceImpl",type=3DBus= .Service.Endpoint > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 org.apache.cxf > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 org.apache.cxf= :bus.id=3Dcxf2006079,type=3DBus > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 org.apache.cxf > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 > > org.apache.cxf:bus.id=3Dcxf2006079,port=3D"UserServiceImpl",service=3D"{h= ttp://impl.service.ws.plumchoice.com/}UserServiceImpl",type=3DBus.Service.E= ndpoint > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 org.apache.cxf > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 > > Looks good so far - please remove 'CXF' prefixes, and we'll also think about providing a schema. >> Not sure right now how this JAX-RS server can know about individual >> endpoints - may be it should have a Bus injected, and the list of >> expanded QNames, ex, {http://users}UserService, or >> {http://customers}CustomerService. The server will return to the >> clients this list: it will let them know it manages >> {http://users}UserService and {http://customers}CustomerService. This >> will work for JAX-RS endpoints with multiple root resources too. Next >> clients will ask for a list of MBeans 'belonging' to say >> {http://users}UserService. The server will return all MBeans which has >> something to do with it, including a Bus MBean (which can be relevant >> to other endpoints too) and Mbeans specific to/scoped by >> {http://users}UserService. Regarding this comment I made earlier, I can see from the pasted XML fragment that the canonical names of the endpoint MBeans do have expanded QNames embedded= , so indeed, we can use expanded QNames to let users query for MBeans representing individual endpoints >> > Actually, I guess there are 2 places to differentiate each of Jax-rs > services, which could satisfy the fact that individual endpoint can manag= e > its own mbeans, > First is do something in xml, but I have looked around it, and I find it = is > literally the core in cxf-rs,=C2=A0 thus very difficult to 'hack in' this > configuration. > =C2=A0=C2=A0=C2=A0 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 cxf > > service:jmx:rmi:///jndi/rmi://localhost:9914/jmxrmi > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 > =C2=A0=C2=A0=C2=A0 > > Pros are fine integration with spring and neat, Cons are about the > difficulties in implementation. > > Second is modify the service bean itself to make it looks like: > class=3D"com.plumchoice.ws.service.impl.UserServiceImpl"> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 value=3D"service:jmx:rmi:///jndi/rmi://localhost:9914/jmxrmi" /> > > This is referenced in > cxf-rt-management/src/test/resources/managed-spring.xml, and my idea is l= et > each jax-rs service bean to construct its InstrumentationManagerImpl > internally: > =C2=A0=C2=A0 class=3D"org.apache.cxf.management.jmx.InstrumentationManagerImpl"> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 value=3D"service:jmx:rmi:///jndi/rmi://localhost:9914/jmxrmi" /> > =C2=A0=C2=A0=C2=A0 > Pros: basic spring context, ease the configuration/implementation compare= d > to 1, Cons: a little amateur compared to 1? > > >> Does it make sense ? What do you think ? >> I'm a bit confused :-). Here is what I meant: