org.apache.struts2.osgi

## Interface PackageLoader

- All Known Implementing Classes:
    BundlePackageLoader

      public interface PackageLoader

  Implementations of this interface can load packages from a Bundle

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `List<PackageConfig>` | `loadPackages(org.osgi.framework.Bundle bundle, org.osgi.framework.BundleContext bundleContext, ObjectFactory objectFactory, FileManagerFactory fileManagerFactory, Map<String,PackageConfig> map)` Deprecated.
    `List<PackageConfig>` | `loadPackages(Container container, org.osgi.framework.Bundle bundle, org.osgi.framework.BundleContext bundleContext, ObjectFactory objectFactory, FileManagerFactory fileManagerFactory, Map<String,PackageConfig> map)` This method loads all of the package configurations for the specified Bundle and BundleContext.

- - ### Method Detail

    - #### loadPackages

          @Deprecated
          List<PackageConfig> loadPackages(org.osgi.framework.Bundle bundle,
                                                       org.osgi.framework.BundleContext bundleContext,
                                                       ObjectFactory objectFactory,
                                                       FileManagerFactory fileManagerFactory,
                                                       Map<String,PackageConfig> map)
                                                throws ConfigurationException

      Deprecated.
      This method loads all of the package configurations for the specified Bundle and BundleContext. This method signature is retained for ensuring backwards-compatibility Interface-wise, but is Deprecated as it cannot provide the now-necessary Container reference.
      Parameters:
        `bundle` - The OSGi bundle.
        `bundleContext` - The OSGi bundle BundleContext.
        `objectFactory` - The ObjectFactory to create object instances.
        `fileManagerFactory` - The FileManagerFactory to access files.
        `map` - The Map of PackageConfigs (by String name).
      Returns:
        A List of PackageConfigs that contains the packages loaded for the bundle.
      Throws:
        `ConfigurationException` - When the package load operation fails due to configuration errors.

    - #### loadPackages

          List<PackageConfig> loadPackages(Container container,
                                           org.osgi.framework.Bundle bundle,
                                           org.osgi.framework.BundleContext bundleContext,
                                           ObjectFactory objectFactory,
                                           FileManagerFactory fileManagerFactory,
                                           Map<String,PackageConfig> map)
                                    throws ConfigurationException

      This method loads all of the package configurations for the specified Bundle and BundleContext. Introduces a new loadPackages method signature including a Container reference. This is necessary as the FileManagerFactory depends on access to an initialized Container reference to function properly.
      Parameters:
        `container` - The Container from the ActionContext (or another context).
        `bundle` - The OSGi bundle.
        `bundleContext` - The OSGi bundle BundleContext.
        `objectFactory` - The ObjectFactory to create object instances.
        `fileManagerFactory` - The FileManagerFactory to access files.
        `map` - The Map of PackageConfigs (by String name).
      Returns:
        A List of PackageConfigs that contains the packages loaded for the bundle.
      Throws:
        `ConfigurationException` - When the package load operation fails due to configuration errors.

Copyright © 2000–2026 Apache Software Foundation. All rights reserved.