JWAVE System Introduction


NOTE: HTTP and socket connection methods can be used simultaneously by multiple JWAVE client applications; the JWAVE server can respond to several client applications at the same time.

TIP: In general, you must be a Java developer to develop client-side JWAVE applications or applets. If your Java experience is limited, you can still create useful JWAVE applications using the generic JWAVE applet described in
Chapter 2, The Generic JWAVE Applet.
Figure 1-1 JWAVE client-server configuration. Java applets (or applications) communicate with a JWAVE server through HTTP connections. In this model, the client contacts a CGI program running on a Web server. The CGI then starts the JWAVE Manager. You can use this type of connection simultaneously with a direct socket connection, shown in Figure 1-2.
Figure 1-2 JWAVE client-server configuration. Java applets (or applications) communicate with a JWAVE server via direct socket connections. You can use this type of connection simultaneously with an HTTP connection, shown in Figure 1-1.
Figure 1-3 Java applets (or applications) communicate directly with the JWAVE Web server. The JWAVE Web Server includes the JWAVE Manager, therefore, the client can connect to the JWAVE Manager directly with a URL address.
Figure 1-4 Java applets (or applications) communicate with a Web server using the JWAVE Servlet. The JWAVE Servlet plugs into any Web server that accepts servlets. Once the JWAVE Servlet is configured properly, clients can connect to the JWAVE Manager directly with a URL address.

The Client Side


NOTE: A Java applet is run within another application, usually a Web browser. A Java application runs on its own, without the need for another controlling program. The distinction is usually irrelevant for JWAVE (with the exception of applet security restrictions), as the applet/application decision depends on how the users access the program, rather than on what the program does.
Figure 1-5 JWAVE client applet. A JWAVE applet requires JWAVE Java classes (in the JAR file) and configuration information. The browser uses an HTML page to load the applet.

TIP: If you want to use an IDE for JavaBeans application development, see
Chapter 7, Using JWAVE Beans.

The Server Side

Figure 1-6 The server side of a JWAVE system. The JWAVE Manager application listens for client connections and takes appropriate actions, such as starting a PV-WAVE session.

The JWAVE Manager

Figure 1-7 JWAVE Manager handles activity on the JWAVE server

PV-WAVE Sessions

JWAVE Wrappers


TIP: These functions are called "wrappers" because they "wrap" a PV-WAVE application with JWAVE-specific routines (such as GETPARAM).

PV-WAVE Applications


NOTE: The regular PV-WAVE functions that JWAVE wrappers cannot use mainly include the user interface features, such as WAVE Widgets and VDA Tools.

A Simple Example

The Client Java Application


TIP: You can find the code for this function in:
(UNIX)VNI_DIR/classes/jwave_demos/doc_examples/Simple.java

(Windows)VNI_DIR\classes\jwave_demos\doc_examples\Simple.java

Example 1-1 Client-side Java code, simple.java

The JWAVE Wrapper Function

Example 1-2 JWAVE wrapper function, simple.pro


JAVA Data Types Corresponding PV-WAVE Data Types
Byte BYTE
Short INTEGER
Integer LONG
Float FLOAT
Double DOUBLE
String STRING

NOTE: You can use either numeric objects or primitives (for example, java.lang.Short or short).
Figure 1-8 Parameters and data are passed between the Java client and the JWAVE wrapper. Java methods and special PV-WAVE functions are used to package and extract the data and parameters.

Running the Application

  1. Start the JWAVE Manager. For instructions, see Starting the JWAVE Manager.
  2. Move to the following directory:
    (UNIX)VNI_DIR/classes/jwave_demos/doc_examples

    (Windows)VNI_DIR\classes\jwave_demos/doc_examples

  3. Run the program by typing the following command:

NOTE: To run this application, the following items must be included in your CLASSPATH:

Sample Output

Summary





Copyright © 1999, Visual Numerics, Inc. All rights reserved.