# Monitor and control connections made via MediaCaster with the Wowza Streaming Engine Java API

Updated on 07/16/2026 8:47 am PDT

The **ModuleMediaCasterNotifyExample** module for the Wowza Streaming Engine™ Java API adds an event listener to MediaCaster requests, providing an opportunity to monitor and control connections made via the MediaCaster system.

## Code example [Copy to clipboard](/content/docs/imediacasternotify2-example\#code-example "Copy to clipboard"/index.html)

* * *

Copy

```
package com.wowza.wms.example.module;

import com.wowza.wms.application.*;
import com.wowza.wms.mediacaster.IMediaCaster;
import com.wowza.wms.mediacaster.IMediaCasterNotify2;
import com.wowza.wms.module.*;
import com.wowza.wms.stream.IMediaStream;
import com.wowza.wms.stream.IMediaStreamPlay;

public class ModuleMediaCasterNotifyExample extends ModuleBase {

public void onAppStart(IApplicationInstance appInstance) {
		String fullname = appInstance.getApplication().getName() + "/"
				+ appInstance.getName();
		getLogger().info("onAppStart: " + fullname);
		appInstance.addMediaCasterListener(new mediacasterNotify());
	}

public void onAppStop(IApplicationInstance appInstance) {
		String fullname = appInstance.getApplication().getName() + "/"
				+ appInstance.getName();
		getLogger().info("onAppStop: " + fullname);
	}

class mediacasterNotify implements  IMediaCasterNotify2
	{

public void onConnectFailure(IMediaCaster mediaCaster) {

getLogger().info("onConnectFailure");
		}

public void onConnectStart(IMediaCaster mediaCaster) {

getLogger().info("onConnectStart");

}

public void onConnectSuccess(IMediaCaster mediaCaster) {

getLogger().info("onConnectSuccess");
		}

public void onStreamStart(IMediaCaster mediaCaster) {

getLogger().info("onStreamStart");
		}

public void onStreamStop(IMediaCaster mediaCaster) {

getLogger().info("onStreamStop");
		}

public void onMediaCasterCreate(IMediaCaster mediaCaster) {

getLogger().info("onMediaCasterCreate");
		}

public void onMediaCasterDestroy(IMediaCaster mediaCaster) {

getLogger().info("onMediaCasterDestroy");
		}

public void onRegisterPlayer(IMediaCaster mediaCaster,
				IMediaStreamPlay player) {

getLogger().info("onRegisterPlayer");
		}

public void onSetSourceStream(IMediaCaster mediaCaster,
				IMediaStream stream) {

getLogger().info("onSetSourceStream");
		}

public void onUnRegisterPlayer(IMediaCaster mediaCaster,
				IMediaStreamPlay player) {

getLogger().info("onUnRegisterPlayer");
		}

}

}
```

## Use the module [Copy to clipboard](/content/docs/imediacasternotify2-example\#use-the-module "Copy to clipboard"/index.html)

* * *

Use the ModuleMediaCasterNotifyExample module with an application named **testlive**. To install and configure the module, do the following:

1. Compile the above code and then copy the .jar file to the **\[install-dir\]/lib/** folder.
2. Open **\[install-dir\]/conf/testlive/Application.xml** in a text editor then specify the **StreamType** as **live**.
3. Add the following module definition as the last entry in the **<Modules>** list:

Copy

```
<Module>
        <Name>ModuleMediaCasterNotifyExample</Name>
        <Description>ModuleMediaCasterNotifyExample</Description>
        <Class>com.wowza.wms.example.module.ModuleMediaCasterNotifyExample</Class>
</Module>
```

4. Restart Wowza Streaming Engine if it was running.

Was this article helpful?

[Helpful](/content/docs/imediacasternotify2-example# "Helpful"/index.html)

Thank you for your feedback!

300 characters remaining

Name

Email

reCAPTCHA

Recaptcha requires verification.

I'm not a robot

reCAPTCHA

[Submit](/content/docs/imediacasternotify2-example# "Submit comment"/index.html)

Thank you for providing feedback to help us improve our documentation!

##### Popular Video Topics [Copy to clipboard](/content/docs/imediacasternotify2-example\#popular-video-topics "Copy to clipboard"/index.html)

- [The Future of Video Tech](/content/blog/future-of-video-technology/index.html)
- [Streaming Starter Guide](/content/blog/complete-guide-to-live-streaming/index.html)
- [Live Event Streaming Guide](/content/blog/live-event-streaming-guide/index.html)
- [Interactive Streaming Guide](/content/blog/low-latency-streaming-technologies-the-key-to-interactive-video/index.html)
- [Streaming Protocols](/content/blog/streaming-protocols/index.html)
- [Transcoding](/content/blog/what-is-transcoding-and-why-its-critical-for-streaming/index.html)
- [Low Latency](/content/blog/what-is-low-latency/index.html)
- [Security](/content/blog/secure-video-streaming/index.html)

##### Video Resources [Copy to clipboard](/content/docs/imediacasternotify2-example\#video-resources "Copy to clipboard"/index.html)

- [APIs & SDKs](/content/docs/wowza-developer-apis-and-sdks/index.html)
- [Developer IDE](/content/docs/how-to-extend-wowza-streaming-engine-using-the-wowza-ide/index.html)
- [Test Players](/content/testplayers/index.html)
- [Wowza System Status](https://status.wowza.com/)

##### Partners [Copy to clipboard](/content/docs/imediacasternotify2-example\#partners "Copy to clipboard"/index.html)

- [Partners Overview](/content/partners/index.html)
- [Find a Partner](/content/partners/preferred-international-resellers/index.html)
- [Channel Program](/content/partners/channel-partner-program/index.html)
- [OEM Program](/content/partners/oem/index.html)
- [Partner Portal](/content/partners/resources/index.html)

##### Company [Copy to clipboard](/content/docs/imediacasternotify2-example\#company "Copy to clipboard"/index.html)

- [About Us](/content/company/index.html)
- [Blog](/content/blog/category/blog/index.html)
- [News](/content/news/index.html)
- [Events & Webinars](/content/company/events/index.html)
- [Careers](/content/careers/index.html)
- [Customers](/content/customers/index.html)
- [Contact Us](/content/contact/index.html)

##### Stay Connected [Copy to clipboard](/content/docs/imediacasternotify2-example\#stay-connected "Copy to clipboard"/index.html)

##### Stay Up to Date with the Blog [Copy to clipboard](/content/docs/imediacasternotify2-example\#stay-up-to-date-with-the-blog "Copy to clipboard"/index.html)

Email

X - Form Filled Type

© 2007–2025 Wowza Media Systems™, LLC. All rights reserved.   [Security & Privacy Policy](/content/legal/privacy/index.html) \| [Legal](/content/legal/index.html) \| [System Status](https://status.wowza.com/)

reCAPTCHA
