Class XmlDocumentBundleTracker<T>

  • Type Parameters:
    T - the result type of the conversion
    All Implemented Interfaces:

    public class XmlDocumentBundleTracker<@NonNull T>
    extends org.osgi.util.tracker.BundleTracker<org.osgi.framework.Bundle>
    The XmlDocumentBundleTracker tracks files in the specified XML folder of modules and tries to parse them as XML file with the specified XmlDocumentReader. Any converted XML files are assigned to its according bundle and added to an XmlDocumentProvider for further processing. For each module an own XmlDocumentProvider is created by using the specified XmlDocumentProviderFactory.
    Michael Grammling - Initial contribution, Benedikt Niehues - Changed resource handling so that resources can be patched by fragments., Simon Kaufmann - Tracking of remaining bundles, Markus Rathgeb - Harden the usage
    • Constructor Detail

      • XmlDocumentBundleTracker

        public XmlDocumentBundleTracker​(org.osgi.framework.BundleContext bundleContext,
                                        String xmlDirectory,
                                        XmlDocumentReader<@NonNull T> xmlDocumentTypeReader,
                                        XmlDocumentProviderFactory<@NonNull T> xmlDocumentProviderFactory,
                                        String readyMarkerKey,
                                        ReadyService readyService)
                                 throws IllegalArgumentException
        Creates a new instance of this class with the specified parameters.
        bundleContext - the bundle context to be used for tracking bundles (must not be null)
        xmlDirectory - the directory to search for XML files (must neither be null, nor empty)
        xmlDocumentTypeReader - the XML converter to be used (must not be null)
        xmlDocumentProviderFactory - the result object processor to be used (must not be null)
        readyMarkerKey - the key to use for registering ReadyMarkers
        IllegalArgumentException - if any of the arguments is null
    • Method Detail

      • open

        public final void open()
        open in class org.osgi.util.tracker.BundleTracker<org.osgi.framework.Bundle>
      • close

        public final void close()
        close in class org.osgi.util.tracker.BundleTracker<org.osgi.framework.Bundle>
      • addingBundle

        public final org.osgi.framework.Bundle addingBundle​(@NonNullByDefault({})
                                                            org.osgi.framework.Bundle bundle,
                                                            org.osgi.framework.BundleEvent event)
        Specified by:
        addingBundle in interface org.osgi.util.tracker.BundleTrackerCustomizer<T>
        addingBundle in class org.osgi.util.tracker.BundleTracker<org.osgi.framework.Bundle>
      • removedBundle

        public final void removedBundle​(@NonNullByDefault({})
                                        org.osgi.framework.Bundle bundle,
                                        org.osgi.framework.BundleEvent event,
                                        org.osgi.framework.Bundle object)
        Specified by:
        removedBundle in interface org.osgi.util.tracker.BundleTrackerCustomizer<T>
        removedBundle in class org.osgi.util.tracker.BundleTracker<org.osgi.framework.Bundle>