Java Reference
In-Depth Information
L ISTING 11.8 Continued
<jar href=”installer-signed.jar” />
<installer-desc main-class=”com.marinilli.b2.c11.InstallerExample” />
Using the JNLP API, installers may even ask a JNLP Client to reboot the computer to
finish the installation. Refer to line 39 in Listing 11.6.
In order to install a new JRE, the procedure is similar to the InstallerExample previously
discussed. However, the method setJREInfo must be called by the installer, providing the
absolute path to the java executable of the installed JRE. Likewise, when installing a native
library in a particular directory in the local file system, it is necessary to invoke the
setNativeLibraryInfo to inform the JNLP Client from where to download the native
Other Services
JNLP also offers implementations of printing and Clipboard access services, much as in the
case of file-related services. This allows untrusted applications to have a chance to access the
given services.
Accessing the System Clipboard
Untrusted applications cannot access the system Clipboard without passing through this ser-
vice. See the AnApplication class (Listing 11.10) for an example of usage of this service. In
particular, examine lines 75-86 of Listing 11.10.
Queuing Jobs to the Printer
Forprinting applications via the JNLP API (for unsigned applications as well) use the
PrintService . See Listing 11.9 for an example usage of this service.
L ISTING 11.9 An Example Of Printing with the JNLP API
package com.marinilli.b2.c11;
import com.marinilli.b2.c11.util.Utilities;
import java.awt.print.*;
Search WWH ::

Custom Search