Using Java With TangoJava Actions and the Java Action ServerThis appendix provides additional information on calling Java classes from Tango for use with the External action in Tango. This information is provided for those programmers who want to extend the functionality of Tango through the use of Java. Using Java Action ServerTo execute Java actions from Tango, you need to run the Java Action Server (JAS). The JAS is a Java application that accepts requests from Tango to execute Java class files, and returns the results of that execution back to Tango. The JAS can run on the same machine as Tango, or it can run on another, network-accessible (via TCP/IP) machine. When you install Tango Server components, the JAS is installed, by default, in the JAS folder within the Tango 2000 folder where Tango Editor is installed. The JAS requires that you have installed Macintosh Runtime for Java (MRJ) 2.0 or greater. MRJ is provided in your Tango 2000 package; see the Getting Started Guide for details. To use the Java Action Server |
|
By default, these files are installed in the same folder as the JAS application. |
About the JAS Test Application
To demonstrate how Tango executes Java actions, you can execute the JASTest.taf application file that is provided with Tango when you install Tango Demos and Tutorials. By default, JASTest.taf is installed in the Java folder inside the Demos folder within the Tango 2000 folder of your Web server document root. Before you execute JASTest.taf, you must follow the steps below: To run the JAS test application file
Configuring JAS
There are several parameters that can be configured in the JAS. These parameters are set in the JAS.properties file that resides in the same folder as the JAS and are case-sensitive. The parameters are:
For advanced configuration of the JAS, read the JAS Read Me file in the JAS folder within the Tango 2000 folder where Tango Editor is installed. Creating Java Action ClassesA Java class or bean that is specified in a Java action must extend the class Action and provide an implementation for the customProcessing method: public class Foo extends Action { The single String array parameter is the list of parameters that are specified in the Java action in the Tango application file. The class Action provides several methods that you would use in your action processing to provide result data to Tango. These methods are: Indicate the number of columns to be output in the class results. Start a new row in the output. Start a new column in the current row containing the given String. There are two example class files, Hello.java and Echo.java, in the folder that the JAS is in (by default, this is the JAS folder within the Tango 2000 folder of the drive where Tango Editor is installed) that illustrate using these methods.
JavaBeans are loaded from their serialized form, so not only must you provide a class file but you must also have a .ser file for that class. |
Copyright © 1999, Pervasive Software. All rights reserved.