Server Side
warning | JWAVE uses an insecure protocol without authentication. This makes JWAVE insecure to use in an Internet facing configuration and would allow an attacker to execute arbitrary code on the server. If you choose to implement JWAVE in this way, you are responsible for the security of those applications that leverage JWAVE. |
On the server side, the JWAVE Manager listens for client connections and manages individual PV-WAVE sessions.
Figure 1-6: JWAVE Basic Server Configuration shows the basic configuration of the JWAVE server components.
The JWAVE Manager application listens for client connections and takes appropriate actions, such as starting a PV-WAVE session.
JWAVE Manager
The JWAVE Manager is a program that runs on the server and listens for client connections. When a connection is made, the JWAVE Manager examines the request from the client and processes it appropriately. If the client request is for an initial contact to a PV‑WAVE session, then one is started. If the client request is for a session that is already running, then that session is contacted. The JWAVE Manager sends all parameters and data from the client to the PV‑WAVE session. When the request is completed, the reply (such as data or a plot) from PV‑WAVE is returned by the Manager to the client. If the client contacts the server with HTTP, then the connection request is routed through a CGI (Common Gateway Interface) program, which then contacts the JWAVE Manager.
The JWAVE Manager can manage multiple PV‑WAVE sessions, or a client application can make several sequential requests using the same PV‑WAVE session. This allows faster updates (as new sessions are not started for each request). This also allows data to remain with the session (in memory) for use by subsequent requests (rather than making round trips back to the client).
The JWAVE Manager also handles administrative functions, such as starting, shutting down, and configuring the JWAVE server. A script called
manager (
manager.bat on Windows) is used to control and configure the JWAVE Manager. This script is described in detail in
Chapter 8: JWAVE Server Configuration.
As shown in
Figure 1-7: JWAVE Manager, the JWAVE Manager uses configuration information from
jwave.cfg. (By default, output is sent to the terminal.) For information on using the
manager command and changing server configuration, see
"Setting Up the JWAVE Server" on page 107.
JWAVE Manager handles activity on the JWAVE server
PV-WAVE Sessions
PV‑WAVE sessions are started by the JWAVE Manager, as described previously in this section. PV‑WAVE performs the actual data analysis and generates graphics.
The individual PV‑WAVE sessions log their output, by default, to the terminal. You can change this default (send information to a log file) using the Configuration Tool. For more information, see
"Setting Up the JWAVE Server" on page 107.
JWAVE Wrappers
A JWAVE wrapper is a PV‑WAVE function that includes JWAVE-specific library function calls. These functions enable PV‑WAVE to communicate with a remote Java client. For example, the PV‑WAVE function GETPARAM retrieves and “unpacks” parameters and data sent from the client. Once unpacked, the parameters and data can be used within the wrapper function or passed to other PV‑WAVE routines. Then, when a JWAVE wrapper function returns, the JWAVE Manager automatically sends the parameters, data, and any graphics that were produced by the JWAVE wrapper function back to the client.
note | These functions are called “wrappers” because they “wrap” a PV‑WAVE application with JWAVE-specific routines (such as GETPARAM). |
For detailed information on writing JWAVE wrapper functions, see
Chapter 5: JWAVE Server Development.
Cloud Computing
JWAVE 3.6 has been updated to support cloud based computing.
Once the server has been set up with an OS and any additional software you need, you must modify the security settings to open the required ports for the JWAVE server.
Modify the following security settings:
For inbound traffic:
Open the HTTP default port (80).
Open ports 6500 (the JWAVE default port for socket connections) and 6580 (the JWAVE default HTTP port) for inbound TCP connections.
For outbound traffic:
Open all ports (0-65535) to all traffic.
Take note of the public IP address specified for your server, you need to add this to the SERVER_IP setting in the JWAVE configuration on the
Manager Properties page when running
manager config.
PV-WAVE Applications
In most cases, the JWAVE wrapper function is used as a bridge to run a PV‑WAVE application. This application can perform most of the functions of PV‑WAVE, such as:
accepting data and parameters from the wrapper
reading data from files, databases, and so on
using the extensive mathematics, statistics, and analysis capability of PV‑WAVE
producing plots, images, and other graphical representations of data
saving files
returning data
note | The regular PV‑WAVE functions that JWAVE wrappers cannot use mainly include the user interface features, such as WAVE Widgets and VDA Tools. |
Next, we will look at a simple JWAVE example where a client application sends data to the server, the server (PV‑WAVE) processes the data, and a result is returned to the client.