16.07.2013 Views

jsr-56 - Java Community Process Program

jsr-56 - Java Community Process Program

jsr-56 - Java Community Process Program

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.

The above caching rules also apply to extension descriptors downloaded using the extension download<br />

protocol where the version attribute is specified.<br />

6.5.3 MANAGING THE CACHE<br />

The JNLP Client is responsible for managing the cache of downloaded resources. The JNLP Client must<br />

make sure that the following invariant is maintained:<br />

Resources belonging to a particular application are never removed from the cache while the<br />

application is running.<br />

This rule makes sure that the application developer can make assumptions about resources being in the<br />

cache while the application is running. In particular, all resources that are eagerly downloaded are going<br />

to be available locally in the cache during the entire program execution.<br />

The exact policy and algorithms used to manage the cache are implementation-dependent. A reasonable<br />

policy might be to first clear out resources that are marked lazy before the ones marked eager.<br />

The JNLP Client can also manage extensions in any way it sees fit. They can be uninstalled at any given<br />

point or be kept around permanently. If the extension uninstaller is invoked, then another request for the<br />

extension will require it to be downloaded again and the extension installer to be rerun.<br />

6.6 DOWNLOADING AND CACHING OF APPLICATION DESCRIPTORS<br />

Application descriptors, i.e., JNLP files, are handled specially, since they are not necessarily downloaded<br />

by the JNLP Client itself. Often, they will be downloaded by a Web browser or by other means.<br />

A JNLP file contains two attributes, the href attribute and version attribute, in the jnlp element of the<br />

JNLP file are used as the key for caching the JNLP file. These attributes are both optional. For example:<br />

<br />

If the href attribute is specified, then the JNLP file can be cached, and it also allows a JNLP Client to<br />

query the Web server for a newer version of the JNLP file, i.e., for the application. A JNLP Client can use<br />

this feature to, e.g., inform the user of updates to already-cached applications, or to automatically update<br />

applications during non-peak hours. In order to do this, a JNLP Client could keep track of the JNLP files<br />

it has downloaded, and then periodically query the Web server for new versions.<br />

A JNLP file must be downloaded with an HTTP GET request to the specified URL. The JNLP Client must<br />

use the Last-Modified header field returned by the Web Server to determine if a newer JNLP file is<br />

present on the Web server.<br />

JSR-<strong>56</strong> - Proposed Final Draft 44 of 74

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

Saved successfully!

Ooh no, something went wrong!