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 getCodebase method returns the codebase for the application. This will typically be the URL<br />

specified in the codebase attribute in the jnlp element. However, if the JNLP file does not specify this<br />

attribute, then the codebase is defined to be the URL of the JAR file containing the class with the main<br />

method.<br />

The isOffline method returns true if the application is running without access to the network. An<br />

application can use this method to adjust its behavior to work properly in an offline environment. The<br />

method provides a hint from the JNLP Client. The network might be unavailable, even though the JNLP<br />

Client indicated that it was, and vice-versa.<br />

The showDocument method displays the given URL in a Web browser. This may be the default browser<br />

on the platform, or it may be chosen by the JNLP Client some other way. This method returns false if the<br />

request failed, or the operation is not supported.<br />

Some platforms might not support a browser, or the JNLP Client might not be configured to use a<br />

browser. The isWebBrowserSupported method will return true if a Web browser is supported,<br />

otherwise false.<br />

7.2 THE DOWNLOADSERVICE SERVICE<br />

The javax.jnlp.DownloadService service allows an application to control how its own resources<br />

are cached.<br />

The service allows an application to determine which of its resources are currently cached, to force<br />

resources to be cached, and to remove resources from the cache.<br />

The following three query methods return true if a given resource, a given part, or a given part of a<br />

given extension is currently cached, respectively. The methods must always return false for resources<br />

that do not belong to the current application, i.e., are not mentioned in the JNLP file for the application.<br />

isResourceCached<br />

isPartCached<br />

isExtensionPartCached<br />

The following three methods instruct the JNLP Client to download a given resource, a given part, or a<br />

given part of a given extension, respectively. The methods block until the download is completed or an<br />

error occurs. The methods must always fail for resources that do not belong to the current application, i.e.,<br />

are not mentioned in the JNLP file for the application.<br />

loadResource<br />

loadPart<br />

loadExtensionPart<br />

The following three methods instruct the JNLP Client to remove a given resource, a given part, or a given<br />

part of a given extension from the cache, respectively. The remove request is a hint to the JNLP Client<br />

that the given resource is no longer needed. The methods must do nothing if a resource not belonging to<br />

the given application is requested to be removed.<br />

removeResource<br />

removePart<br />

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

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

Saved successfully!

Ooh no, something went wrong!