Interface PluginIpdFactory
Important Note - meters lifecycle:
To avoid meters inconsistency due to plugin reloads and upgrades, the plugin should always cleanup its meters.
For safe cleanup of meters, the plugin has to either:
- Register created instance of IpdRegistry as a Bean in Spring context and let Spring manage its lifecycle.
- Manually call IpdRegistry.shutdown() method when the plugin is being shutdown.
- Since:
- 5.0.0
-
Method Summary
Modifier and TypeMethodDescriptioncreateJobRegistry(org.osgi.framework.BundleContext bundleContext) Creates a new instance of IpdJobRegistry specific for the plugin.createRegistry(MeterConfigurations meterConfig, org.osgi.framework.BundleContext bundleContext) Creates a new instance of IpdRegistry specific for the plugin.createRegistry(org.osgi.framework.BundleContext bundleContext) Creates a new instance of IpdRegistry specific for the plugin.
-
Method Details
-
createRegistry
Creates a new instance of IpdRegistry specific for the plugin.All meters created with this instance will apply configurations defined in the product.
Important Note - meters lifecycle:
To avoid meters inconsistency due to plugin reloads and upgrades, the plugin should always cleanup its meters. For safe cleanup of meters, the plugin has to either:
- Register created instance of IpdRegistry as a Bean in Spring context and let Spring manage its lifecycle.
- Manually callIpdRegistry.shutdown()method when the plugin is being shutdown.- Parameters:
bundleContext- the bundle context of the plugin- Returns:
- a new instance of IpdRegistry
-
createRegistry
IpdRegistry createRegistry(MeterConfigurations meterConfig, org.osgi.framework.BundleContext bundleContext) Creates a new instance of IpdRegistry specific for the plugin.All meters created with this instance will:
1. apply configurations defined in the product
2. override product configurations with plugin-specific configurations provided in the `meterConfig` parameter.Important Note - meters lifecycle:
To avoid meters inconsistency due to plugin reloads and upgrades, the plugin should always cleanup its meters. For safe cleanup of meters, the plugin has to either:
- Register created instance of IpdRegistry as a Bean in Spring context and let Spring manage its lifecycle.
- Manually callIpdRegistry.shutdown()method when the plugin is being shutdown.- Parameters:
bundleContext- the bundle context of the plugin- Returns:
- a new instance of IpdRegistry
-
createJobRegistry
Creates a new instance of IpdJobRegistry specific for the plugin.All jobs registered with this instance will run in regular interval until the plugin is disabled/uninstalled.
Important Note - jobs lifecycle:
To avoid inconsistency due to plugin reloads and upgrades, the plugin should always cleanup its jobs. For safe cleanup of jobs, the plugin has to either:
- Register created instance of IpdJobsRegistry as a Bean in Spring context and let Spring manage its lifecycle.
- Manually callIpdJobRegistry.shutdown()method when the plugin is being shutdown.- Parameters:
bundleContext- the bundle context of the plugin- Returns:
- a new instance of IpdJobRegistry
-