The default JDBCPersistenceAdapter has access to the BrokerService. The broker service exposes the ManagementContext that contains a getMBeanServer-method. So you get easy access to the MBean-Server. Just register your JMX-Bean there. Example:
// just to illustrate.. MyPersistenceAdapter adapter = this; MyPersietenceAdapterMBean view = this; // or make a new MPAView() MBeanServer mbeanServer = brokerService.getManagementContext().getMBeanServer(); if (mbeanServer != null) { ObjectName objectName = new ObjectName(managementContext.getJmxDomainName() + ":" + "BrokerName=" + JMXSupport.encodeObjectNamePart(getBrokerName()) + "," + "Type=ProxyConnector," + "ProxyConnectorName=" + JMXSupport.encodeObjectNamePart(connector.getName())); mbeanServer.registerMBean(view, objectName); } Mario On 8/9/07, Anthrope <[EMAIL PROTECTED]> wrote: > > Hello, > I have a custom persistence adaptor that uses Berkeley DB, and would > like to expose the message store as an MBean, since I am collecting stats > like average message size, etc. and would rather have those queried via JMX > than to log them to log4j. Any idea how I could expose either the > persistence adaptor or message store objects as MBeans? > > Thanks, > Prashanth > -- > View this message in context: > http://www.nabble.com/Persistence-Adaptor-MBean-tf4244154s2354.html#a12077446 > Sent from the ActiveMQ - User mailing list archive at Nabble.com. > >