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. ![]() Installing Java Action ServerTo execute Java actions from Tango, you need to install and 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, the following directory hierarchy is present in your destination folder: |
|
Refer to your Java documentation for details on modifying your class path. |
These directories have all of the files necessary to run the JAS. In order for the Java VM to find these files, you need to add this hierarchy to your Java class path. Using the Sun JDK on Windows NT, for example, you would:
![]() Configuring JASThere are several parameters that can be configured in the Java server to tune its performance. These parameters are passed on the command line, or provided in the JAS.properties file that resides in the same directory as the JASMain class file. All the parameters can be found by passing -help to JASMain, but the important ones are: Listens on port p for requests from Tango (default is 4000). Specifies the maximum number of seconds to wait for a request, after which JAS quits. Specifies the maximum number of seconds to wait for a class file to execute. Logs detailed information on server activity for debugging. ![]() Creating Java Action ClassesA Java class or JavaBean that is specified in a Java action must extend the class com.everyware.tango.jas.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 Action class 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 in the jas directory, Hello.java and Echo.java, that illustrate using these methods. The JAStest.taf application file demonstrates using these classes in Tango.
|
Copyright © 1998, Pervasive Software Inc. All rights reserved.