Previous PageNext Page

12.1.1 Accessing a Java Class via Chili!Beans

The Chili!Beans object has a Construct method that can be used to create instances of Chili!Beans. The first argument is the fully-qualified name of the class to be instantiated and the remaining arguments are the arguments to be passed to the desired constructor for that class. For example, if the package Database contains Table.class, the following script will create a Table object:
 

Set factory = Server.CreateObject("Chili.Beans")

set table = factory.Construct "Database/Table", "Employees", CLng(100)

This will create an object named table using the constructor whose signature is
 

constructor(String, Int)

If the class name cannot be found on the CLASSPATH or if there is no public constructor whose signature matches the arguments passed to Construct, a runtime error occurs in the client script.
 

Copyright © 2000 Chili!Soft

Previous PageTop Of PageNext Page