The Mozilla
Organization
At A Glance
Feedback
Get Involved
Newsgroups
License Terms
Newsbot
Developer Docs
Roadmap
Projects
Ports
Module Owners
Hacking
Get the Source
Build It
Testing
Download
Bugzilla
Bug Writing
Tools
View Source
Tree Status
New Checkins
Submit A Bug
FAQ
Search

Java Pluglet API

by Igor Kushnirskiy < idk@eng.sun.com>
Akhil Arora < akhil.arora@sun.com>

A Pluglet is a Plug-in that is written in the JavaTM programming language. A Pluglet is similar in concept to a Servlet, with the difference that a Servlet produces content, whereas a Pluglet consumes it. The Java Pluglet API is a close 1:1 implementation of the new C++ Plug-in API in Mozilla.

  • Why Pluglets?

  • Pluglets are part of the Blackwood project. For a Plug-in developer, choosing to extend Mozilla via a Java Pluglet brings the advantages of the Java platform to Pluglets.

    • Platform neutral

    • Writing a Plug-in in Java instantly makes it available on all platforms on which a Java Virtual Machine is available.

    • Compact

    • For a given functionality, Java bytecode is typically smaller than compiled native code, so the time needed to download a Plug-in is reduced.

  • Pluglets vs Applets

  • A frequently asked question is how are Pluglets different from Applets. There has been a discussion of this on MozillaZine. Basically there are two differences. A Pluglet is launched when a certain Content Type is encountered, whereas an Applet is launched when an <applet> tag is encountered. The other difference is that Pluglets are installed onto disk and unlike Applets, are not downloaded at each invocation.

  • How?

  • Key to enabling Pluglets is the Pluglet Engine. The Pluglet Engine appears to Mozilla like an XPCOM service. When Mozilla can not get a handler for some MIME type, the Pluglet Engine would be asked for it. It simply delegates to the appropriate Pluglet. Some JNI is involved to go from C++ to Java and back again.

  • Design Goals

  • It was a conscious design decision to have the Pluglet API resemble its C++ counterpart as much as possible, while being able to reflect all of its functionality to Java, so that Plug-in writers will not have to learn yet another API. This concern, in our opinion, outweighed other alternatives which offered a cleaner, more Java-like look. Support for other Plug-in APIs can be easily added by contributing adaptors.

Requirements

This section describes the requirements you need before building the pluglets project.
    • JDK1.2 or later
    • a current Mozilla build

Getting and Building the Code

Getting the Code

  1. You must first grab the latest Mozilla and Pluglets code. This can be found at http://www.mozilla.org/cvs.html, but instead of cvs checkout SeaMonkeyAll use cvs checkout SeaMonkeyBlackwood

Building the Code

  1. Build the Mozilla tree using the instructions found at http://www.mozilla.org/build/.

  2. Follow the steps in the mozilla/java/plugins/README.

NOTE: The build is only currently designed for NT4.0, Linux and Solaris. If you make changes to the build to get it to work on other platforms, mail them to me.

Pluglet Service Binaries

Binaries are available for the following platforms. They are provided as a convenience and are not guaranteed to work.

 
Not using OJI Using OJI
Windows Download Download
Solaris2.6 (sparc) Download N/A
Linux RH6.0 (i386) Download N/A

You need to download Pluglet module class files.

Steps to install.

  1. Unzip the archive.
  2. Place libpluglet.so or pluglet.dll into the $MOZILLA_FIVE_HOME/components directory. Place libplugletjni.so or plugletjni.dll into the $MOZILLA_FIVE_HOME directory.

  3. Follow the steps in the mozilla/java/plugins/README.

Demos and Screenshots

We have four demos available. Here is a screenshot.

Pdf viewer
Download
Rtf viewer
Download
Zip viewer
Download
Media player
Download

References


Last modified: Nov 23 1999
Copyright © 1998-2000 The Mozilla Organization.
Last modified January 12, 2000.