How to define property in module?

I’m creating a module that needs a property of its own. I know I can manually define a property through the server manager, but I would like to create the property automatically from the module.

How can I do that?

EDIT:

Oh, and is there a length limit for string properties?

Hi,

Take a look at WMSProperties in the Server API docs.

You can add or modify a property by using getProperties().setProperty(name, value); There is a getProperties() method for most high level objects in Wowza.

To access your property, use one of the getProperty*(name, defaultValue); methods. If the value is not a simple object then you will need to type cast the call. e.g.

MyObject myObject = new MyObject();
appInstance.getProperties().setProperty("myObject", myObject);
. . . 
MyObject myObject = (MyObject) appInstance.getProperties().get("myObject");
. . .

WMSProperties extends Map so you can use any Map as well.

Roger.

You can get and set Property values in your application module, as Roger shows above, but a Property set that way does not alter the xml or show up in the manager. If you alter the xml it should show up in the manager, and if you add a Property through the manager it will be written to xml and be available in your application module.

Richard

Thanks for the response, Roger!

But I tried this, and while the property is saved and loaded, it is still not visible from the mananger interface and cannot be edited from there.

If I add a property in the XML conf of the application, like this:

<Property>
	<Name>myProperty</Name>
	<Value>myValue</Value>
</Property>

… then I can see/edit it in the manager interface. Is there a way to replicate this from a module without altering the XML?

Any answer please?

Also, there is no size limit on a string stored in WMSProperties.

Roger.