Results 1 to 6 of 6

Thread: How to define property in module?

  1. #1
    Join Date
    Jan 2010
    Posts
    19

    Default 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?
    Last edited by khaled; 03-18-2014 at 11:57 AM.

  2. #2

    Default

    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.

  3. #3

    Default

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

    Roger.

  4. #4
    Join Date
    Jan 2010
    Posts
    19

    Default

    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?

  5. #5
    Join Date
    Jan 2010
    Posts
    19

    Default

    Any answer please?

  6. #6
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    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

Similar Threads

  1. Can't find awsAccessKeyId property
    By hdezela in forum Wowza Media Server 3 for Amazon EC2 Discussion
    Replies: 0
    Last Post: 11-09-2011, 09:52 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •