tschoergez
Leadership
Leadership

What's it about: com.vmware.scripting.javascript.allow-native-object

Hi!

When playing around with java.util.*-classes (see http://communities.vmware.com/message/1808053#1808053 ), I recognized following log entry in server.log (server set to loglevel "ALL"):

2011-08-09 12:22:35.532+0200 DEBUG [MainScriptingObject] Found 'com.vmware.scripting.javascript.allow-native-object' property to false, java class usage removed from scripting

Any ideas, what this means?

BTW: If you set it to true in vmo.properties, the log-entry changes  correspondingly, but the only change in behaviour I found when working with java.io.File-Objects.

Thanks in advance!

Regards,

Joerg

Reply
0 Kudos
iiliev
VMware Employee
VMware Employee

This property is used to filter Java classes that are visible to scripts. For more information, try googling for ClassShutter (for example, the javadoc for this interface is listed here http://www.jarvana.com/jarvana/view/rhino/js/1.6R6-candidate2/js-1.6R6-candidate2-javadoc.jar!/org/m...

Logic in our code is the following:

if (property "com.vmware.scripting.javascript.allow-native-object" is false)

{

    if (property "com.vmware.scripting.rhino-class-shutter-file" defines a valid file name) {

        load shutters from this file

    } else {

        load shutters from file 'PatternClassShutter.list' // currently, this file contains one line - java.util.*

    }

    Context.getCurrentContext().setClassShutter(shutters loaded above);

} else {

    // no shutters defined

}

Hope this helps,

Ilian

View solution in original post

tschoergez
Leadership
Leadership

Yep, this helps a lot!

Thanks for the explanation, it absolutley makes sense now...

Regards,

Joerg

Reply
0 Kudos
imtrinity94
Enthusiast
Enthusiast

The jarvana website is off-loaded now. If possible, update the link.


Mayank Goyal
vRO Engineer
https://www.linkedin.com/in/mayankgoyal1994/
https://cloudblogger.co.in/
Reply
0 Kudos