Every MBean should have a unique id so that we can work with it later on individually. 0, 1, 2, 3, n, represents the unique part in the otherwise same URI. When working with MBeans (when populating MBeans collections, etc) you need to associate some unique number with every MBean. Have some local AtomicInteger var, have some map there which will keep pairs like id: Mbean ref
and generate 'id' dynamically if none already exists in the map for a given MBean may be it should be Map<String, Integer> where String is a canonical name. So when later on you process something like /mbean/234 you can get 234, use it to find the canonical name (or actual JMX MBean reference), and use the latter to init an instance of MBeanResource which will deal with the request Ping me on IRC please if you have any questions Cheers, Sergey On Thu, May 19, 2011 at 4:43 PM, Shenglin Qiu <dabaip...@hotmail.com> wrote: > > Yes, Sergey, > > Should I manually give/define every mbean an indexer which is accumulated as > you mentioned? >> > http://localhost:8080/services/jmx/mbean/0 >> > http://localhost:8080/services/jmx/mbean/1 >> > http://localhost:8080/services/jmx/mbean/2 > ... >> > http://localhost:8080/services/jmx/mbean/*** > Thank you. > > Regards: > Shenglin Qiu > >> Date: Thu, 19 May 2011 15:03:03 +0100 >> Subject: Re: Expose MBeans in CXF >> From: sberyoz...@gmail.com >> To: dev@cxf.apache.org >> >> HI Shenglin >> >> On Thu, May 19, 2011 at 2:54 PM, Shenglin Qiu <dabaip...@hotmail.com> wrote: >> > >> > Yes Sergey, will have these following pattern: >> > >> > http://localhost:8080/services/jmx/mbean/0 -> CXF Bus >> > >> > http://localhost:8080/services/jmx/mbean/01 -> UserService >> > >> > http://localhost:8080/services/jmx/mbean/0123 -> CustomerService >> > >> > http://localhost:8080/services/jmx/mbean/01234 -> GreeterService (Soap) >> > >> > http://localhost:8080/services/jmx/mbean/012 -> JMXServer will be hidden >> > to user. >> > >> >> That looks better, but do you think it would make sense to avoid the >> concatenation ? >> We can get hundreds of CXF MBeans in the production environment, so >> IMHO it would be simpler >> to have /mbean/199 identifying a particular MBean, >> >> Cheers, Sergey >> >> > >> > Regards: >> > >> > Shenglin Qiu >> > >> > >> > > -- Sergey Beryozkin Application Integration Division of Talend http://sberyozkin.blogspot.com