Top
Interstage Studio J Business Kit User's Guide
FUJITSU Software

2.3.14 Download status notification

This section describes the method of download status notification supported by JBK Plugin.

JBK Plugin provides an interface for reporting information about the download of JAR files to the user. You can embed a progress bar or similar item indicating the status of JAR file downloading by creating a class with this interface implemented and specifying that class with jbkplugin.properties.

Download status notification interface

Details of the JBK Plugin download status notification API are as follows.

In addition, the getPluginDownloadNotify() method has been added. This method gets a class by using the com.fujitsu.jbk.plugin.browser.PluginAppletContext interface to implement the PluginDownloadNotify interface.

The class file for the PluginDownloadNotify class is stored in the jar file for the development of the JBK plugin ("classes\jbkstd.jar" in the JBK installation folder). When compiling the class of an applet that uses the PluginAppletContext interface, check whether the jar file for the development of the JBK plugin is included in the classpath.

Specifying a download status notification class

To specify a class with download status notification implemented, code the following line in jbkplugin.properties:

jbk.plugin.interface.download_notify=<name-of-a-class-with-download-status-notification-implemented>

For <name-of-a-class-with-download-status-notification-implemented>, specify the name of a class that includes a package name.

Using download status notification

Use download status notification as follows:

  1. Create a class with the PluginDownloadNotify interface implemented.

  2. Place the class created in step 1 on the client. A class path needs to be set for the class .

    To set the class path, add it to the CLASSPATH environment variable or use jbk.plugin.vmoption of jbkplugin.properties.

  3. Add the jbk.plugin.interface.download_notify property to jbkplugin.properties to set the name of the class.

Note

When an implemented class internally uses the Class.getResource() method, it may fail to acquire resources. If such a failure occurs, edit the policy file to add the java.io.FilePermission read attribute to the class.

Example)
grant {
    java.io.FilePermission "C:\\JBKPLG\\classes\\Progress.jar", "read";
};

Note

When an implemented class generates a new thread, it may throw AccessControlException. If such a failure occurs, edit the policy file to add java.lang.RuntimePermission to the class.

Example)
grant codebase "file:/C:/JBKPLG/classes/Progress.jar" {
    java.lang.RuntimePermission "modifyThread";
    java.lang.RuntimePermission "modifyThreadGroup";
};

Alternatively, you can prevent the failure by adding the implemented class as follows to the boot class path, not to the regular class path:

  • Using the -Xbootclasspath option, specify the path to the execution class.

  • Create a classes folder under the JRE folder, then store the implemented class in the classes folder.

    (The JRE classes folder has been specified in the boot class path by default.)