What a great Question!
you can use create your JMXBean with createMBean method from javax.management.MBeanServer
http://java.sun.com/j2se/1.5.0/docs/api/javax/management/MBeanServer.html#createMBean(java.lang.String,%20javax.management.ObjectName)
spring accomplishes this thru the org.springframework.jmx.export.annotation.* package specifically
1a)identifying each JMXBean thru ObjectName with
org.springframework.jmx.export.annotation.ManagedResource
1b)identifiying each advertised attribute of the JMXBean with
@ManagedAttribute
1c)identifying each advertised method of JMXBean with
@ManagedOperationParameter
2)once the JMXBean has been created register the JMXBean with JMXServer and add persistence
by extending the import org.springframework.jmx.export.MBeanExporter;
http://www.jroller.com/bogie14/entry/did_java_5_forget_jmx
HTH
Martin Gainty
______________________________________________
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
> Date: Thu, 6 Aug 2009 04:30:02 -0700
> From: glassfish_at_javadesktop.org
> To: users_at_glassfish.dev.java.net
> Subject: Add MBean's to Admin Console
>
> Hi,
>
> I'm using glassfish 2.1 and I have some questions that I hope you can help me out with,
>
> 1) I'd like to be able to monitor all or at least a specific OpenMQ queue from within the Admin Console. Using JConsole I can easily browse to com.sun.messaging.jms.server->Destination->Monitor->q->"my queue" for example and see all statistics. The broker is started automatically when I start the Glassfish domain.
> 2) Is it possible to deploy and instantiate a custom MBean to the Admin Console that has no default constructor?
> 3) Is it possible to automatically register a MBean (preferably using Spring) when you deploy an application (such as a web-application) so that it becomes visible in the Admin console? We have a spring-based web-app and it registers a custom MBean when it's loaded. From JConsole you get all the details from the MBean but we'd like to be able to see it from the Admin Console as well (without manually having the deploy it).
>
> Thanks
> [Message sent by forum member '77777777777' (77777777777)]
>
> http://forums.java.net/jive/thread.jspa?messageID=359191
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
_________________________________________________________________
Express your personality in color! Preview and select themes for Hotmail®.
http://www.windowslive-hotmail.com/LearnMore/personalize.aspx?ocid=PID23391::T:WLMTAGL:ON:WL:en-US:WM_HYGN_express:082009