Quantcast
Viewing all articles
Browse latest Browse all 6251

Accessing Java Classes from JavaScript documentation... less-than helpful

 

So, here's what the VCO 4.1 developer's guide says about accessing java classes from Orchestrator's javascript...

 

h5. Accessing Java Classes from JavaScript
By default, Orchestrator restricts JavaScript access to a limited set of Java classes. If you require JavaScript
access to a wider range of Java classes, you must set an Orchestrator system property to allow this access.
By default, the Orchestrator JavaScript engine can access only the classes in the java.util.* package.
The Orchestrator administrator can allow access to other Java classes from JavaScript functions by setting a
system property. See the VMware vCenter Orchestrator Administration Guide for information about setting system
properties.
(http://vmware.ie/pdf/vco_410_developers_guide.pdf, pp. 115).

 

This is less-than helpful as it doesn't actually say how to use java classes from javascript.

 

 

After following the instructions for access java classes from javascript in the VCO administrator's guide (http://vmware.ie/pdf/vco_410_admin_guide.pdf, pp. 67) I am still unable to use standard java classes. Does anyone have any examples of how to do this? I've tried "inetAddress = java.net.InetAddress.getByName(serverAddress);" and I get the error "TypeError: getByName is not a function, it is org.mozilla.javascript.NativeJavaPackage." I've also tried using Rhino's importPackage function and it doesn't seem to be recognized.

 

 


Viewing all articles
Browse latest Browse all 6251

Trending Articles