BBjServices Overview

BBjServices is a mechanism for improving the performance of BBj by running the various components of BBj within a single process. To understand BBjServices, an understanding of the relationship between the various components of BBj is necessary.

Consider the following configuration in which a user is running Thin Client on machine A, which connects to an AppServer running on machine B, which in turn is accessing all data through a Data Server running on machine C.

In this configuration when a user starts the Thin Client, the Thin Client makes a socket connection to the AppServer requesting that the AppServer run a specified program. After checking license availability, the AppServer starts an Interpreter that will execute the requested program on behalf of the Thin Client. The AppServer also establishes a socket connection to the Data Server that provides a dedicated connection between the Interpreter and the Data Server on Machine C. While the Interpreter is running, it uses two sockets; one to access the data through the Data Server on machine C and a second to manipulate the display on machine A.

If the Data Server, the AppServer and the Thin Client are all running on the same machine each in its own process, then the communications are still the same; a socket connection between the Data Server and the AppServer and a second socket between the AppServer and the Thin Client.

BBjServices is a process that offers the services of a Data Server (i.e. it listens on a given port for Data Server connection requests) and also offers the services of an AppServer (i.e. listens on a different port for AppServer connection requests). When a request is received on the AppServer port, BBjServices starts an Interpreter to process the request, but because the Interpreter and the Data Server are running in the same process they are able to communicate directly rather than across a socket. This provides a significant performance advantage over the configuration in which the Data Server and the AppServer are running in separate processes.

Once BBjServices is running, a user may access the services that are being offered in the same way that they would access the services of Data Server and AppServer if they had been started in separate processes. Although these services can be accessed in a manner that is 'pure Java', the most common access is by typing 'BBj' at a command prompt.

Typing BBj at the prompt invokes a platform specific executable. The behavior of that executable is slightly different on Windows platforms than on UNIX platforms.

On UNIX platforms, the executable has the same affect as having typed "java com.basis.bbj.comm.ThinClient." For example, typing BBj actually starts a Thin Client within a JVM.

In a Windows environment, BBj.exe makes a connection to BBjServices on a separate port and requests that BBjServices run a program within its own process space. Once this request has been made, BBjServices starts an Interpreter within its own process space that executes the requested BBj program and the BBj.exe terminates. In this case, the Interpreter, the display and the Data Server all run in the same JVM and there is no socket communication involved. This is the configuration in which BBj execution is fastest.

In a UNIX environment, the display can not be run in the same JVM as BBjServices because BBjServices may have a display that is different from the one desired by the user. In the UNIX environment, the BBj executable will start a Thin Client that has the correct display and all communication between the Interpreter (running in the BBjServices process space) and the Thin Client will be across a socket.

A process named “bbjnative” calls functions that Java cannot and is installed on most operating systems, with the exception of Windows. Multiple occurrences of bbjnative may run at one time and will stop once BBjServices stops.


Copyright BASIS International Ltd. BBj®, Visual PRO/5®, PRO/5®, and BBx® are registered trademarks.