The DSJ server provides a visual user interface to read and write data and configuration files which are stored on disk. All the configuration files are text files that you can edit with any text editor; however, the files are read only during startup, or when changes are made through the user interface. The files are rewritten whenever you choose OK in the corresponding dialog box.
This section describes the automated processes of the DSJ server, what it does during startup, and how it handles client connections.
When the DSJ server starts, it performs the following tasks, not necessarily in this order:
jreinfo.dsj
file, it assumes that the directory has
been processed. If not, it checks to see if that subdirectory
contains both \Bin
and \Lib
subdirectories. If so, it creates a jre.zip
file from
the content of those directories and attempts to extract the JRE
version information and write a jreinfo.dsj
file
describing the contents.
users.txt
file and
the access group files in the UserManagerDatabaseDirectory
directory are read into memory.
.app
file in the AppFileDirectory
directory is read. If the Package Dependencies tag is
missing, the package dependencies are calculated, and resulting
packages are placed in the package database. Each .app
file describes one version of an application that the server is
supposed to be able to serve.
.app
file read, any extension files for that
application are loaded.
After completing all its startup tasks, the DSJ server opens the port designated by the Port property and waits for DSJ client connection requests.
When the server receives a request for a new connection, it checks if it has exceeded its maximum allowed connections (see LimitConnections and MaximumConnections). If so, it sends a message back to the client, denying the connection; otherwise, the connection is allowed.
There are two types of connections: short-term and long-term. A client will first attempt a short-term connection, and then a long-term one, not necessarily with the same server. The server handles each connection type differently.
When a DSJ client completes a short-term connection, it transmits an identification packet that contains:
The server digests this information, and then:
When a client gets verified access to an application, a list of servers that are supposed to serve the application (see Available Servers) are sent to the client. The client then attempts to contact the first server on the list for a long-term connection. If the first server on the list is the same server the client is already connected to, the attempt succeeds immediately and automatically.
When a DSJ client completes a long-term connection, it transmits an identification packet that contains:
The server digests this information and then:
If the connection fails for any reason, the client will try the next server on its list. If it cannot connect with any of the listed servers, an error message is displayed by the client, and the client session ends.
Once it is verified that the DSJ client is running a version that matches the server, and it is running the right JRE for the application if necessary, the process of serving the application commences. First, a list of servers that are supposed to serve the application are sent to the client, in case the server goes down. Second, the package dependencies list for the application is used to create a lookup table of the packages to be scanned for resources (instead of scanning the entire package database). Third, if there are any external files required by the application (see Extra Files), they are sent to the client. Then the process of serving the Java classes begins.
If the client has chosen to preload their cache, then the server will send all the packages required by the application (see Package Dependencies) to the client before the client attempts to run the main class (see Mainclass) of the application. Otherwise, the server will send only the main class, which the client will run. From then on, whenever the client needs a class or other resource, it checks its cache first. If itÆs there, which it would be if the cache is preloaded, the cached copy is used. Otherwise, the client requests the resource from the server.