The first step to perform when using JMX in Red5 is to get the MBeanServer. Once you have a server instance you may look up, create, register, and unregister mbeans. MBeans provide access to methods on classes which implement the associated MBean interface, most of the details about this are beyond the scope of this post. Today, we will cover the loading and unloading of a Red5 context.
MBeanServer mbs = JMXFactory.getMBeanServer();
ObjectName oName = JMXFactory.createObjectName("type", "ContextLoader");
ContextLoaderMBean contextLoader = null;
if (mbs.isRegistered(oName)) {
contextLoader = (ContextLoaderMBean) MBeanServerInvocationHandler.newProxyInstance
(mbs, oName, ContextLoaderMBean.class, true);
System.out.println("Context loader was found");
} else {
System.err.println("Context loader was not found");
}
Once you have the context loader you can load the context. The context in this case is a Red5 default context consisting of a group of web applications that have been Red5 enabled. To be Red5 enabled means that they have the proper configurations and a class extending org.red5.server.adapter.ApplicationAdapter.
if (contextLoader != null) {
contextLoader.loadContext("localhost", "c:/red5/webapps/red5-default.xml");
}
To unload the context perform this step.
if (contextLoader != null) {
contextLoader.unloadContext("localhost");
}
See how simple that is?
Please note that I do not condone the use of System.out as a substitute for proper logging
View this Post in: Chinese(S) Chinese(T) French Arabic Bulgarian Croatian Czech Danish Dutch Finnish German Greek Hindi Italian Japanese Korean Norwegian Polish Portuguese Romanian Russian Spanish Swedish
[...] Paul Gregoire at Infrared5 has just posted on using JMX in Red5.
View this Comment in: Chinese(S) Chinese(T) French Arabic Bulgarian Croatian Czech Danish Dutch Finnish German Greek Hindi Italian Japanese Korean Norwegian Polish Portuguese Romanian Russian Spanish Swedish
For you VBScript kiddies.. here is an example of VBS and JMX communication http://blogs.sun.com/jmxnetbeans/entry/vbscript_to_play_poker_with1
View this Comment in: Chinese(S) Chinese(T) French Arabic Bulgarian Croatian Czech Danish Dutch Finnish German Greek Hindi Italian Japanese Korean Norwegian Polish Portuguese Romanian Russian Spanish Swedish
Hi,
I’m trying to stream a live video but to no avail.
I have install Adobe Flash Encoder and have installed RED5 server, whats next, remember i’m looking for live video streaming!
View this Comment in: Chinese(S) Chinese(T) French Arabic Bulgarian Croatian Czech Danish Dutch Finnish German Greek Hindi Italian Japanese Korean Norwegian Polish Portuguese Romanian Russian Spanish Swedish