Headless Client

Requires Platform 4.5+

Disabling the Nexaweb Client UI

In Nexaweb 4.5, you can use the Nexaweb client as a standalone client with or without displaying its user interface. You can do this to use the Nexaweb client functionality for subscribe/unsubscribe and push messaging between a non-Nexaweb Java client application and the Nexaweb Server. Nexaweb client run as a standalone does not perform automatic updating nor does it run from local files. You can run the Nexaweb client from a command line to use it without displaying its user interface window.

The standalone client API, com.nexaweb.client.standalone.StandaloneClient, provides standalone client functionality.

You can invoke the Nexaweb client as a standalone application either:

  • From Java
  • At a command line

Invoking from Java

To invoke a standalone Nexaweb client from Java, follow these steps:

1. Add the StandaloneClient class main() method to the Java application.

2. Specify the following arguments for the StandaloneClient class main() method:

ArgumentDescription
-serverSpecifies a server address. For example, http://localhost:9090.
-initialPage

Specifies the start page of the application. For example, index.nxml.

-appcontextSpecifies the context of the application. For example, /MyApplication.
-headlessSpecifies whether the application shows a frame or any other onscreen graphics. Set to True, application does not show a frame. 

 

3. Add the StandaloneClient class start() method to the Java application to start the standalone client.  

Running From Command Line

To run the Nexaweb client as a standalone application from the command line, enter a command similar to the following:

java -cp .\;NexawebInstallClient.jar com.nexaweb.client.standalone.StandaloneClient -server http://localhost:9090 -initialPage java-index.xal -appcontext /WebappHeadlessClient 

To run the client as a standalone application, you must specify the server, intialPage and appcontext parameters. In addition, you can specify any of the parameters included in the params.js file (\WebContent\Nexaweb\JavaScript\params.js for a jRex application) at the command line. For example, to include the debug-keys-enabled parameter and its value in the command, specify it as follows:

-debug-keys-enabled true

Where you precede the parameter with a - (dash) and separate the parameter name from its value with a single space.
 

Disabling Client UI

You can run the nexaweb client as a standalone client without displaying the client UI by using the -headless true argument.

When you run the standalone client with the -headless true argument:

  • The client does not register a document plug-in handler for the UI document. This saves overhead by not creating bridges. However, it also means that you cannot run custom tags that map to a logical operation such as <printPage> that calls some print function; because the standalone client cannot invoke it. The client can still process MCOs, XUpdate, macros, and so forth; and modify the UI dom; however, nothing happens as a result.
  • The client does not start the repaint manager thread.

Viewing Standalone Client Application Messages

If you run Nexaweb client without its user interface, you can use the serverSessionListener class to display Nexaweb client application messages in a window from your application.

The serverSessionListener allows you to view the following types of Nexaweb client application messages:

  • Session failover
  • Server-side invalidated session due to timeout or session disabled
  • Rejected sessions due to Nexaweb's server's inability to start a session

 Use MessagingService and NetService to add listeners for subscribe/unsubscribe and push messaging.

Use SynchronizationService to add listeners for session-related events such as license problems, session timeout, and so forth.