-
public interface ExtensionInstallerService
TheExtensionInstallerService
is used by an extension installer to communicate with the JNLP Client. It provides the following type of functionality:- Access to prefered installation location, and other information about the JNLP Client
- Manipulation of the JNLP Client's download screen
- Methods for updating the JNLP Client with the installed code
The normal sequence of events for an installer is:
- Get service using
ServiceManager.lookup("javax.jnlp.ExtensionInstallerService")
. - Update status, heading, and progress as install progresses
(
setStatus
,setHeading
andupdateProgress
). - Invoke either
setJREInfo
orsetNativeLibraryInfo
depending on if a JRE or a library is installed - If successful invoke
installSucceeded
, otherwise invokeinstallFailed
.
- Since:
- 1.4.2
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description URL
getExtensionLocation()
Returns the location of the extension being installedString
getExtensionVersion()
Returns the version of the extension being installedString
getInstalledJRE(URL url, String version)
Returns the path to the executable for the given JRE.String
getInstallPath()
Returns the directory where the installer is recommended to install the extension in.void
hideProgressBar()
Hides the progress bar.void
hideStatusWindow()
Hides the status window.void
installFailed()
This should be invoked if the install fails.void
installSucceeded(boolean needsReboot)
Installers should invoke this upon a successful installation of the extension.void
setHeading(String heading)
Updates the heading text of the progress window.void
setJREInfo(String platformVersion, String jrePath)
Informs the JNLP Client of the path to the executable for the JRE, if this is an installer for a JRE, and about platform-version this JRE implements.void
setNativeLibraryInfo(String path)
Informs the JNLP Client of a directory where it should search for native libraries.void
setStatus(String status)
Updates the status text of the progress window.void
updateProgress(int value)
Updates the progress bar.
-
-
-
Method Detail
-
getInstallPath
String getInstallPath()
Returns the directory where the installer is recommended to install the extension in. It is not required that the installer install in this directory, this is merely a suggested path.- Returns:
- the directory where the installer is recommended to install the extension in
-
getExtensionVersion
String getExtensionVersion()
Returns the version of the extension being installed- Returns:
- the version of the extension being installed
-
getExtensionLocation
URL getExtensionLocation()
Returns the location of the extension being installed- Returns:
- the location of the extension being installed
-
hideProgressBar
void hideProgressBar()
Hides the progress bar. Any subsequent calls toupdateProgress
will force it to be visible.
-
hideStatusWindow
void hideStatusWindow()
Hides the status window. You should only invoke this if you are going to provide your own feedback to the user as to the progress of the install.
-
setHeading
void setHeading(String heading)
Updates the heading text of the progress window.- Parameters:
heading
- the heading text
-
setStatus
void setStatus(String status)
Updates the status text of the progress window.- Parameters:
status
- the status text
-
updateProgress
void updateProgress(int value)
Updates the progress bar.- Parameters:
value
- progress bar value - should be between 0 and 100.
-
installSucceeded
void installSucceeded(boolean needsReboot)
Installers should invoke this upon a successful installation of the extension. This will cause the JNLP Client to regain control and continue its normal operation.- Parameters:
needsReboot
- If true, a reboot is needed
-
installFailed
void installFailed()
This should be invoked if the install fails. The JNLP Client will continue its operation, and inform the user that the install has failed.
-
setJREInfo
void setJREInfo(String platformVersion, String jrePath)
Informs the JNLP Client of the path to the executable for the JRE, if this is an installer for a JRE, and about platform-version this JRE implements.- Parameters:
platformVersion
- the platform-version this JRE implementsjrePath
- the path to the executable for the JRE
-
setNativeLibraryInfo
void setNativeLibraryInfo(String path)
Informs the JNLP Client of a directory where it should search for native libraries.- Parameters:
path
- the search path for native libraries
-
getInstalledJRE
String getInstalledJRE(URL url, String version)
Returns the path to the executable for the given JRE. This method can be used by extensions that needs to find information in a given JRE, or enhance a given JRE.- Parameters:
url
- product location of the JREversion
- product version of the JRE- Returns:
- The path to the executable for the given JRE, or
null
if the JRE is not installed.
-
-