Wowza Community

How to call ServerListener method through JMX

Using this article I can call my module’s methods from JConsole. How to do the same thing with Server Listener modules? What is a path to them?


public module methods that return simple types will automatically show up in JMX under the Modules/[module-name]/Instance tab however for Server Listeners or any other custom classes, you need to add your own mbean objects.

Wowza uses org.apache.commons.modeler.Registry to add mbeans to JMX.

	Registry.getRegistry(null, null).registerComponent(Object bean, String oname, String type); is used to add mbeans to the JMX interface.
	Registry.getRegistry(null, null).unregisterComponent( String oname ); removes them.

The original Wowza Load Balancer has an example in the ServerListenerLoadBalancerListener class which is included in the download. In this example, mbeans are added for the load balancer, the redirector and each edge server as they register with the load balancer.