Return-Path: Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: (qmail 61729 invoked from network); 16 Nov 2007 01:16:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Nov 2007 01:16:36 -0000 Received: (qmail 30625 invoked by uid 500); 16 Nov 2007 01:16:21 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 30585 invoked by uid 500); 16 Nov 2007 01:16:21 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 30574 invoked by uid 99); 16 Nov 2007 01:16:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Nov 2007 17:16:21 -0800 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of kunapulir@gmail.com designates 72.14.202.177 as permitted sender) Received: from [72.14.202.177] (HELO ro-out-1112.google.com) (72.14.202.177) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Nov 2007 01:16:11 +0000 Received: by ro-out-1112.google.com with SMTP id p4so411667roc for ; Thu, 15 Nov 2007 17:16:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; bh=ZBjtYkAJY+f0xy2phtQfdgz52cqlnmG47UwShjbF0ZM=; b=q6HpnLF8xbCQZGL1rMlh8P4QTqQfDHuYqVj+Fe1FgxpBP3FcCjy1UuktPeycKd8tWvJwFW724JGxqgWVMPhHkNNWOQ9nPNZH4mzdXC6jgdtOzblidPbpuKTVLKj149R3yxbmJHs+U7NMQJT52SACw0hqhDfIvqNAttJOiAnl4uk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=a0RsmA4EcYKwntqCf95sEq+tP6k8tq/sqHBUwfB6aC9RQxUktb1U+HDlBICzH8elhy2bSxw/wp2n9iF551/iXaFQk9Ux1C6ShF9W9wmyoy/my2k8Cw4dZYNqKa5aYUOfApuQ9N/z4vYMhIHlrXYXS2Vi45O2YinnjMotcrgxyng= Received: by 10.114.193.1 with SMTP id q1mr13687waf.1195175762926; Thu, 15 Nov 2007 17:16:02 -0800 (PST) Received: by 10.115.23.13 with HTTP; Thu, 15 Nov 2007 17:16:02 -0800 (PST) Message-ID: <46b326240711151716l18b51441i73783ef7b6c414c9@mail.gmail.com> Date: Thu, 15 Nov 2007 17:16:02 -0800 From: "Ramakanth Kunapuli" To: "Tomcat Developers List" Subject: Re: How do I expose Catalina MBeans through Java Platform MBeanServer In-Reply-To: <22d56c4d0711141152sde79448l91d6ef5049f9be4c@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_7360_33462055.1195175762907" References: <46b326240711141120g43f670f1j36f3595dcf7d7712@mail.gmail.com> <46b326240711141146t4817161bx98d21449fd70b8b8@mail.gmail.com> <22d56c4d0711141152sde79448l91d6ef5049f9be4c@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_7360_33462055.1195175762907 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline It appears the attached jar file was stripped. Here's the java source. * import* java.util.concurrent.CountDownLatch; * import* javax.management.MBeanServer; * import* javax.management.MBeanServerBuilder; * import* javax.management.MBeanServerDelegate; * public* *class* SingletonMBeanServerBuilder *extends* MBeanServerBuilder { *private* *static* MBeanServer *theMBeanServer*; *private* *static* MBeanServerDelegate *theMBeanServerDelegate*; *private* *static* *final* CountDownLatch *mbeanServerInited* = *new*CountDownLatch(1); *private* *static* *final* CountDownLatch *mbeanServerDelegateInited* = *new * CountDownLatch(1); *public* SingletonMBeanServerBuilder() { } @Override *public* MBeanServer newMBeanServer(String defaultDomain, MBeanServer outer, MBeanServerDelegate delegate) { *return* checkAndInitMBeanServer(defaultDomain, outer, delegate); } @Override *public* MBeanServerDelegate newMBeanServerDelegate() { *return* checkAndInitMBeanServerDelegate(); } *private* MBeanServer checkAndInitMBeanServer(String defaultDomain, MBeanServer outer, MBeanServerDelegate delegate) { *synchronized* (*mbeanServerInited*) { *if* (*mbeanServerInited*.getCount() != 0) { *theMBeanServer* = *super*.newMBeanServer(defaultDomain, outer, delegate); *mbeanServerInited*.countDown(); } } *return* *theMBeanServer*; } *private* MBeanServerDelegate checkAndInitMBeanServerDelegate() { *synchronized* (*mbeanServerDelegateInited*) { *if* (*mbeanServerDelegateInited*.getCount() != 0) { *theMBeanServerDelegate* = *super*.newMBeanServerDelegate(); *mbeanServerDelegateInited*.countDown(); } } *return* *theMBeanServerDelegate*; } } On Nov 14, 2007 11:52 AM, Vamsavardhana Reddy wrote: > What does the jar do? It does not seem to contain source code. > > ++Vamsi > > On Nov 15, 2007 1:16 AM, Ramakanth Kunapuli wrote: > > > It appears that tomcat uses different MBeanServer instance from Java's > > platform MBeanServer. > > > > Here's a tech tip of making both Tomcat & Java use the same MBean Server > > instance. > > > > Drop the attached jar file under /jre/lib/ext. > > Modify the java execution command to include the following system > > property. > > * > > -Djavax.management.builder.initial=SingletonMBeanServerBuilder > > > > > > * > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org > > For additional commands, e-mail: dev-help@tomcat.apache.org > > > ------=_Part_7360_33462055.1195175762907--