KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > jnlp > BasicService


1 /*
2  * @(#)BasicService.java 1.12 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>BasicService</code> interface provides access to the codebase
13  * of the application, if an application is run in offline mode,
14  * and simple interaction with the native browser on the
15  * given platform.
16  * <p>
17  * This interface mimics loosely the <code>AppletContext</code>
18  * functionality.
19  *
20  * @since 1.0
21  */

22 public interface BasicService {
23     
24     /**
25      * Returns the codebase for the application. The codebase is either
26      * specified directly in the JNLP file, or it is the location of the JAR
27      * file containing the main class of the application.
28      *
29      * @return a URL with the codebase of the application
30      */

31     public URL getCodeBase();
32         
33     /**
34      * Determines if the system is offline. The return value represents the JNLP client's
35      * "best guess" at the online / offline state of the client system. The return value
36      * is does not have to be guaranteed to be reliable, as it is sometimes difficult to
37      * ascertain the true online / offline state of a client system.
38      *
39      * @return <code>true</code> if the system is offline, otherwise <code>false</code>
40      */

41     public boolean isOffline();
42     
43      /**
44      * Directs a browser on the client to show the given URL. This will typically
45      * replace the page currently being viewed in a browser with the given URL, or
46      * cause a browser to be launched that will show the given URL.
47      *
48      * @param url an URL giving the location of the document. A relative URL
49      * will be relative to the codebase.
50      * @return <code>true</code> if the request succeded, otherwise <code>false</code>
51      */

52     public boolean showDocument(URL url);
53
54     /**
55      * Checks if a Web browser is supported on the current platform and by the
56      * given JNLP Client. If this is <i>not</i> the case, then <code>{@link #showDocument}</code>
57      * will always return <code>false</code>.
58      *
59      * @return <code>true</code> if a Web browser is supported, otherwise <code>false</code>
60      */

61     public boolean isWebBrowserSupported();
62 }
63
64
Popular Tags