org.mozilla.pluglet
Interface PlugletFactory


public interface PlugletFactory

This interface includes the functions to create an instance of Pluglet, and initialize the PlugletFactory instance and shut it down when no longer required.


Method Summary
 Pluglet createPluglet(java.lang.String mimeType)
          Creates a new Pluglet instance based on a MIME type.
 void initialize(PlugletManager manager)
          Initializes the PlugletFactory instance and is called before any new Pluglet instances are created.
 void shutdown()
          Called when the browser is done with a PlugletFactory instance.
 

Method Detail

createPluglet

public Pluglet createPluglet(java.lang.String mimeType)
Creates a new Pluglet instance based on a MIME type. This allows different implementations to be created depending on the specified MIME type.

While normally there will be only one PlugletFactory implementation and one instance of it, there can be multiple implementations of Pluglet and instances of them. Given a MIME type, it is the responsibility of the createPluglet method to create an instance of the implementation of Pluglet for that MIME type. (Note: A single implementation of the Pluglet interface could handle more than one MIME type; there may also be separate implementations of the Pluglet interface for MIME types. This is up to the developer implementing the Pluglet interface.)

Parameters:
mimeType - This is the MIME type for which a new Pluglet instance is to be created.
Returns:
Returns a new Pluglet instance based on the specified MIME type passed to the method.

initialize

public void initialize(PlugletManager manager)
Initializes the PlugletFactory instance and is called before any new Pluglet instances are created.

Parameters:
manager - This is an instance of PlugletManager that is passed to this method.

shutdown

public void shutdown()
Called when the browser is done with a PlugletFactory instance. Normally there is only one PlugletFactory instance.