12.11.2014 Views

web server - Borland Technical Publications

web server - Borland Technical Publications

web server - Borland Technical Publications

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Use of Manifest files<br />

Use of Manifest files<br />

Exception handling<br />

VisiClient container relies on the presence of a manifest file to obtain information about<br />

launching an application. The manifest file should be saved in the META-INF<br />

subdirectory of the client archive. The relevant attributes in the manifest file for the<br />

VisiClient container are:<br />

■<br />

■<br />

The main class to be launched by the container on startup. This is an application<br />

entry point which must be present in the manifest file.<br />

The classpath of the dependencies of the main class. If the client-jar is selfcontained,<br />

or if dependencies are specified using the system CLASSPATH during<br />

application launch, this attribute can be ignored.<br />

Example of a Manifest file<br />

An example of a Manifest file is shown below.<br />

Manifest-Version: 1.0<br />

Main-Class: SortClient<br />

Class-Path:<br />

This example shows the container will execute by loading the main method of the class<br />

specified in the Main-Class attribute of the Manifest file. In this example it is SortClient.<br />

The container expects to have a method with the following signature in this class:<br />

public static void main(String[ ] args) throws Exception {...}<br />

The container will report an error and exit if it doesn't find the main method. The client<br />

verify utility, which comes with VisiClient, tries to locate a main class and reports an<br />

error if it doesn't find one.<br />

Application client code is responsible for taking care of any exceptions that are<br />

generated during the program execution. Any unhandled exceptions are caught by the<br />

container which will log them and terminate the Java virtual machine process.<br />

Using resource-reference factory types<br />

The client application deployed in a client container can use the VisiTransact JDBC<br />

connection pooling and Prepared Statement re-use facilities. Refer to the Deployment,<br />

and Transaction chapters of the <strong>Borland</strong> Enterprise Server Developer's Guide for<br />

details about configuration and deployment. Client applications in <strong>Borland</strong> Enterprise<br />

Server can use JDBC 2-based datasources.<br />

Note that just like javax.sql.DataSource (which is one of the possible res-ref-types)<br />

VisiClient allows the application to use URL, JMS, and Mail factories as the resourceref<br />

types.<br />

java.net.url and java_mail.session factories are deployed in the in-process local JNDI<br />

subcontext that resides in the client container virtual machine on startup. Other res-reftypes<br />

like JMS and Mail should be configured and deployed using the relevant vendor<br />

tools for these products.<br />

104 BES Developer’s Guide

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!