Class PluginRegistryImpl

  • All Implemented Interfaces:
    PluginRegistry

    public final class PluginRegistryImpl
    extends java.lang.Object
    implements PluginRegistry
    This is an implementation of plug-in registry of XML syntax plug-in manifests. Manifests should be prepared according to plug-in DTD.

    Configuration parameters

    This registry implementation supports following configuration parameters:

    isValidating
    Regulates is registry should use validating parser when loading plug-in manifests. The default parameter value is true.
    stopOnError
    Regulates is registry should stop and throw RuntimeException if an error occurred while registering or un-registering plug-ins. If this is false, the registration errors will be stored in the internal report that is available with PluginRegistry.checkIntegrity(PathResolver) method. The default parameter value is false.
    Version:
    $Id: PluginRegistryImpl.java,v 1.6 2007/05/13 16:10:51 ddimon Exp $
    See Also:
    ObjectFactory.createRegistry()
    • Constructor Summary

      Constructors 
      Constructor Description
      PluginRegistryImpl()
      Creates plug-in registry object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      IntegrityCheckReport checkIntegrity​(PathResolver pathResolver)
      Performs integrity check of all registered plug-ins and generates result as a collection of standard report items.
      IntegrityCheckReport checkIntegrity​(PathResolver pathResolver, boolean includeRegistrationReport)
      Performs integrity check of all registered plug-ins and generates result as a collection of standard report items.
      void configure​(ExtendedProperties config)
      Configures this registry instance.
      java.lang.String extractId​(java.lang.String uniqueId)
      Extracts plug-in element ID from some unique identifier.
      java.lang.String extractPluginId​(java.lang.String uniqueId)
      Extracts plug-in ID from some unique identifier.
      Version extractVersion​(java.lang.String uniqueId)
      Extracts plug-in version identifier from some unique identifier (plug-in or plug-in fragment).
      java.util.Collection<PluginDescriptor> getDependingPlugins​(PluginDescriptor descr)
      Utility method that recursively collects all plug-ins that depends on the given plug-in.
      ExtensionPoint getExtensionPoint​(java.lang.String uniqueId)
      Looks for extension point.
      ExtensionPoint getExtensionPoint​(java.lang.String pluginId, java.lang.String pointId)
      Looks for extension point.
      PluginDescriptor getPluginDescriptor​(java.lang.String pluginId)
      Returns descriptor of plug-in with given ID.
      java.util.Collection<PluginDescriptor> getPluginDescriptors()
      Returns collection of descriptors of all plug-ins that was successfully populated by this registry.
      java.util.Collection<PluginFragment> getPluginFragments()
      Returns collection of descriptors of all plug-in fragments that was successfully populated by this registry.
      IntegrityCheckReport getRegistrationReport()  
      boolean isExtensionPointAvailable​(java.lang.String uniqueId)
      Checks if extension point exists and is in valid state.
      boolean isExtensionPointAvailable​(java.lang.String pluginId, java.lang.String pointId)
      Checks if extension point exists and is in valid state.
      boolean isPluginDescriptorAvailable​(java.lang.String pluginId)
      Checks if plug-in exists and is in valid state.
      java.lang.String makeUniqueId​(java.lang.String pluginId, java.lang.String id)
      Constructs unique identifier for some plug-in element from it's ID.
      java.lang.String makeUniqueId​(java.lang.String pluginId, Version version)
      Constructs unique identifier for plug-in with given ID.
      ManifestInfo readManifestInfo​(java.net.URL url)
      Reads basic information from a plug-in or plug-in fragment manifest.
      java.util.Map<java.lang.String,​Identity> register​(java.net.URL[] manifests)
      General algorithm: Collect all currently registered extension points. Parse given URL's as XML content files and separate them on plug-in and plug-in fragment descriptors. Process new plug-in descriptors first: Instantiate new PluginDescriptorImpl object. Handle versions correctly - register new descriptor as most recent version or as an old version. If other versions of the same plug-in already registered, take their fragments and register them with this version. Process new plug-in fragments next: Instantiate new PluginFragmentImpl object. Check if older version of the same fragment already registered.
      void registerListener​(PluginRegistry.RegistryChangeListener listener)
      Registers plug-in registry change event listener.
      java.util.Collection<java.lang.String> unregister​(java.lang.String[] ids)
      Unregisters plug-ins and plug-in fragments with given ID's (including depending plug-ins and plug-in fragments).
      void unregisterListener​(PluginRegistry.RegistryChangeListener listener)
      Unregisters registry change event listener.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait