# How to call ServerListener method through JMX

**URL:** <https://community.wowza.com/t/how-to-call-serverlistener-method-through-jmx/43674>\
**Category:** Wowza Developer Dojo\
**Tags:** wowza-streaming-server-java-api\
**Created:** [October 23, 2014, 6:26pm UTC](https://community.wowza.com/t/how-to-call-serverlistener-method-through-jmx/43674 "2014-10-23T18:26:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexander\_Ushakov](https://avatars.discourse-cdn.com/v4/letter/a/8edcca/32.png) [@Alexander\_Ushakov](https://community.wowza.com/u/Alexander_Ushakov)\
**Post date:** [October 23, 2014, 6:26pm UTC](https://community.wowza.com/t/how-to-call-serverlistener-method-through-jmx/43674/1 "2014-10-23T18:26:27Z")

</div>

Using this article [https://www.wowza.com/docs/how-to-expose-an-attribute-or-method-of-a-custom-application-module-through-jmx-jconsole](https://www.wowza.com/docs/how-to-expose-an-attribute-or-method-of-a-custom-application-module-through-jmx-jconsole) 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?

---

<div class="post-metadata">

**Author:** ![Roger\_Littin1](https://avatars.discourse-cdn.com/v4/letter/r/c89c15/32.png) [@Roger\_Littin1](https://community.wowza.com/u/Roger_Littin1)\
**Post date:** [November 4, 2014, 10:50am UTC](https://community.wowza.com/t/how-to-call-serverlistener-method-through-jmx/43674/2 "2014-11-04T10:50:47Z")

</div>

Hi,

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.

```auto
	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](https://www.wowza.com/docs/how-to-get-dynamic-load-balancing-addon#loadbalancing2) 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.

Roger.
