You can use the Chili!Beans object Construct method 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)
Notes
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.
In order to use a Java class with Chili!Soft ASP, the .class file must exist in a directory that is listed in the Java CLASSPATH environment variable, and it must be registered with Chili!Soft ASP as described in "Registering a Java Class as a COM Component on Linux and UNIX" in this chapter.
Copyright 2001 Sun Microsystems, Inc. All rights reserved. Legal Notice.