KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > jnlp > ExtensionInstallerService


1 /*
2  * @(#)ExtensionInstallerService.java 1.18 04/03/12
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package javax.jnlp;
9 import java.net.URL;
10
11 /**
12  * The <code>ExtensionInstallerService</code> is used by an extension installer
13  * to communicate with the JNLP Client. It provides the following type of
14  * functionality:
15  * <ul>
16  * <li> Access to prefered installation location, and other information about
17  * the JNLP Client
18  * <li> Manipulation of the JNLP Client's download screen
19  * <li> Methods for updating the JNLP Client with the installed code
20  * </ul>
21  * <p>
22  * The normal sequence of events for an installer is:
23  * <ol><li>Get service using <code>ServiceManager.lookup("javax.jnlp.ExtensionInstallerService")</code>.
24  * <li>Update status, heading, and progress as install progresses
25  * (<code>setStatus</code>, <code>setHeading</code> and
26  * <code>updateProgress</code>).
27  * <li>Invoke either <code>setJREInfo</code> or <code>setNativeLibraryInfo</code> depending
28  * on if a JRE or a library is installed
29  * <li>If successful invoke <code>installSucceeded</code>, otherwise invoke <code>installFailed</code>.
30  * </ol>
31  *
32  * @since 1.0
33  */

34 public interface ExtensionInstallerService {
35     
36     /**
37      * Returns the directory where the installer is recommended to
38      * install the extension in. It is not required that the installer
39      * install in this directory, this is merely a suggested path.
40      */

41     public String getInstallPath();
42     
43     /**
44      * Returns the version of the extension being installed
45      */

46     public String getExtensionVersion();
47     
48     /**
49      * Returns the location of the extension being installed
50      */

51     public URL getExtensionLocation();
52     
53     /**
54      * Hides the progress bar. Any subsequent calls to
55      * <code>updateProgress</code> will force it to be visible.
56      */

57     public void hideProgressBar();
58     
59     /**
60      * Hides the status window. You should only invoke this if you are
61      * going to provide your own feedback to the user as to the progress
62      * of the install.
63      */

64     public void hideStatusWindow();
65     
66     /**
67      * Updates the status of the installer process.
68      */

69     public void setHeading(String heading);
70     
71     
72     /**
73      * Updates the status of the installer process.
74      */

75     public void setStatus(String status);
76     
77     /**
78      * Updates the progress bar.
79      *
80      * @param value progress bar value - should be between 0 and 100.
81      */

82     public void updateProgress(int value);
83     
84     /**
85      * Installers should invoke this upon a succesful installation of
86      * the extension. This will cause the JNLP Client to regain control
87      * and continue its normal operation.
88      *
89      * @param needsReboot If true, a reboot is needed
90      */

91     public void installSucceeded(boolean needsReboot);
92     
93     /**
94      * This should be invoked if the install fails. The JNLP Client will continue
95      * its operation, and inform the user that the install has failed.
96      */

97     public void installFailed();
98     
99     /**
100      * Informs the JNLP Client of the path to the executable for the JRE, if
101      * this is an installer for a JRE, and about platform-version this JRE
102      * implements.
103      */

104     public void setJREInfo(String platformVersion, String jrePath);
105     
106     /**
107      * Informs the JNLP Client of a directory where it should search for
108      * native libraries.
109      */

110     public void setNativeLibraryInfo(String path);
111     
112     /**
113      * Returns the path to the executable for the given JRE. This method can be used
114      * by extensions that needs to find information in a given JRE, or enhance a given
115      * JRE.
116      *
117      * @param url product location of the JRE
118      * @param version product version of the JRE
119      *
120      * @return The path to the executable for the given JRE, or <code>null</code> if the
121      * JRE is not installed.
122      */

123     public String getInstalledJRE(URL url, String version);
124 }
125
126
127
128
Popular Tags