The Web Server Interface Monitor window appears when you select Open Web Server Interface Monitor from the Options menu of the VisualAge Organizer. The WSI monitor window consists of a notebook with the following sections, each on a separate notebook tab:
The Servers page contains an entry for each WSI server process currently running. Each entry provides the following information about the server process:
In addition, you can also use this page to set up profiling of your Web Connection application using ENVY/Stats and choose to start a new server process or stop a server process that is already running.
To set up profiling using ENVY/Stats, you must first load the Envy/Stats config map from the Configuration Maps browser. After you have done this, the Profile using ENVY/Stats checkbox will be enabled. When you select Profile using ENVY/Stats, the Profiler iterations field becomes enabled. This specifies how many times you want to execute the Web Connection part being profiled. If you specify a high number, the time it takes the Web Connection part to render in the Web browser will be longer than if you do not profile or if you profile with a small number of iterations.
When the Web Connection part is processed to generated HTML, the process will be profiled using the Envy/Stats EsbSampler spyOn: method. After the part has been generated, an Envy/Stats Method Execution Trace browser is opened. This shows a tree view of the methods detected to have been executed during processing and the time spent in each method.
Note that the EsbSampler uses a timer to periodically sample which methods are executing. The results from this way of profiling may not show every method that is executed because some methods can execute between timer ticks. For a part like the EsbSampler, increasing the profiler iterations might result in more useful results. For simple Web Connection parts on fast machines, profiling the execution may show that no methods were executed. This of course is an anomaly of the sampling method. However, the profiling should show the time spent in file I/O, database transactions, and other more expensive methods of your application, thus letting you optimize your code.
In order to test your Web Connection parts, you must be linked to a Web Server. The first time you try to test a Web Connection part, you will have to specify a WSI Server process. Once you have the WSI Server process defined, you don't have to explicitly start the server. When you test a Web Connection part, VisualAge will start the server to test the part. If you are using more than one server, the one that was last used with Web Connection is the one that is started automatically. If you want to change to a different server, you can stop the current server and start another server on this page.
To stop one or more server processes, select one or more entries on the Servers page and then select Stop Selected Servers.
To start a new server, follow these steps:
This option should typically not be selected unless your TCP/IP software does not immediately clear ports. For example, if you stop a WSI server process and then immediately try to restart it on the same port, an error might result on some systems when the server tries to bind to the port. This happens when the system mistakenly believes the port is still in use. Select this option to prevent this error.
The Parts page gives you information about the transaction requests for all WSI server processes, on a per-part basis. The monitor provides the following information for each Web Connection part:
Requests for parts not found in the image are grouped under the AbtWsiNotFoundHandler part.
Select Clear Statistics to clear all of the displayed statistics and return the Parts page to its initial state.
The Info page contains a running log of informational messages for the WSI server processes, such as the times the server processes were started or stopped and which ports they use.
Select Save As to save the log information to a file. Select Clear Messages to clear all of the displayed information and return the Info page to its initial state.
The Errors page contains a running log of error messages for the WSI server processes, such as requests for unavailable parts or invalid request formats.
Select Save As to save the error information to a file. Select Clear Messages to clear all of the displayed information and return the Errors page to its initial state.
In addition to using the Web Server Interface Monitor window, you can start a Web Server Interface server without opening the Web Server Interface Monitor window. This is done by adding the showMonitor option to the WSI configuration file. For example:
#=====cut here==================== # Sample configuration file transport wsi-tcp port 8081 reuseAddr true showMonitor false wsiPassword eBusinessIBM monitorTitle Web Monitor for HR image generateWalkback false # bindToHost (defaults to all) #=====cut here====================
The configuration file is specified on the command line start up using the -wc:filename option. For example, if this file were stored as startup.txt you would start your Web connection application using:
myappl -wc:startup.txt
Note: | Even though no user interface is displayed, the VisualAge virtual machine requires that a user interface be present. |
When running without a WSI Monitor, you have to manually stop the application process to shut it down. The Web Connection feature also includes a part which displays the WSI Monitor information and allows you to reset the information or shut down the WSI server, all from your Web browser. The part is AbtWebWsiMonitorPage. Open the part in a web browser.
To shut down the server, check the Yes, I really want to shutdown checkbox, then select the Shutdown button. The WSI server will be stopped, then after a ten second delay, the image will shutdown.
Caution:
Since providing an interface that lets you shutdown your server from the web
exposes a security risk, the page is password protected. A separate
password protection page has been added. However, this page is a
sample page and has not been thoroughly tested. The password protection
framework is for demonstration purposes only, no claim is made to the security
capabilities of the framework. Since we cannot guarantee that
this password protection is secure, we recommend that for critical
applications, the WsiRemoteControl not be packaged with the
application, and that normal operating system process termination be used to
stop the server. If the password protection page is used, it is
recommended that it be accessed via a secure socket.
When you point your browser to the AbtWebWsiMonitorPage, you will be routed to a login page. You must enter a password to access the monitor page. At development time, the default password is password. At runtime, the password must be provided with the WsiPassword option in the startup options file. If it is not specified, then the password is not initialized and access to the protected page is theoretically prevented.
The password protection is implemented by storing the password in session data. When the protected page is to be accessed, the value of the session data is checked against the valid password. If the password is not valid, or the session data expires, the request is routed back to the login page.
To package the Web WSI Monitor page with your application, add a prerequisite to AbtWebWsiRemoteControlApp.