Server Guide

Making applications headless

When creating headless applications, you should include a System exit in your application. You can use the System exit either in the application itself or in the Application Entry Point startup code. The System exit lets the runtime environment know that the user application is finished processing.

Because only headless applications can run in the native server environments, you must make or modify your server applications so they contain no Smalltalk code or VisualAge visual parts which provide a UI.

This means that your server applications cannot have UI applications as prerequisites. Examples of UI applications are AbtRunViewsApp and CommonWidgets.

When you create an application in the VisualAge Organizer, it will name AbtViewApplication as a prerequisite. If you intend to package this application with the Server Workbench feature, you must change the prerequisite to AbtRunPartsApp. By doing so, you can only create nonvisual parts, Smalltalk classes, and Smalltalk extensions in your application. Attempting to use visual parts will result in messages to the Transcript indicating undefined references to applications outside the prerequisite chain.

Tip icon
Surprisingly, you can use AbtPromptersApp as a prerequisite because it can adapt itself to a headless environment.

This also means that your server applications cannot contain code that provides a UI.

Obtaining user input

Because your server applications must be headless, the applications must obtain any input from users through means such as the following:

Generally, your applications will obtain user input from client code. To obtain such input, your applications must provide interfaces that let client applications supply any needed information to your server applications.

Externalizing strings for translation

If you intend to translate your server applications, you must also externalize strings in your applications. To do this, follow the steps outlined in materials on National Language Support (NLS) in the VisualAge Smalltalk User's Guide. The steps explain how to add methods such as abtExternalizedStringBuildingInfo to an application class, build message and pool repository (.mpr) files, and bind image strings using menu choices available from the NLS menu choice of the Transcript's Tools menu.

When packaging server applications which use .mpr files, you will need to remove externalized strings from the .mpr files and include them in the packaged image. To do this, when at the Modify Instructions step during packaging, select the Dumper policy type from the Policies panel. For more information on packaging, see Packaging a Smalltalk image.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]