3 namespace Drupal\aggregator\Plugin;
5 use Drupal\Core\Cache\CacheBackendInterface;
6 use Drupal\Core\Extension\ModuleHandlerInterface;
7 use Drupal\Core\Plugin\DefaultPluginManager;
10 * Manages aggregator plugins.
12 * @see \Drupal\aggregator\Annotation\AggregatorParser
13 * @see \Drupal\aggregator\Annotation\AggregatorFetcher
14 * @see \Drupal\aggregator\Annotation\AggregatorProcessor
15 * @see \Drupal\aggregator\Plugin\AggregatorPluginSettingsBase
16 * @see \Drupal\aggregator\Plugin\FetcherInterface
17 * @see \Drupal\aggregator\Plugin\ProcessorInterface
18 * @see \Drupal\aggregator\Plugin\ParserInterface
21 class AggregatorPluginManager extends DefaultPluginManager {
24 * Constructs a AggregatorPluginManager object.
27 * The plugin type, for example fetcher.
28 * @param \Traversable $namespaces
29 * An object that implements \Traversable which contains the root paths
30 * keyed by the corresponding namespace to look for plugin implementations.
31 * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
32 * Cache backend instance to use.
33 * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
36 public function __construct($type, \Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
38 'fetcher' => 'Drupal\aggregator\Annotation\AggregatorFetcher',
39 'parser' => 'Drupal\aggregator\Annotation\AggregatorParser',
40 'processor' => 'Drupal\aggregator\Annotation\AggregatorProcessor',
42 $plugin_interfaces = [
43 'fetcher' => 'Drupal\aggregator\Plugin\FetcherInterface',
44 'parser' => 'Drupal\aggregator\Plugin\ParserInterface',
45 'processor' => 'Drupal\aggregator\Plugin\ProcessorInterface',
48 parent::__construct("Plugin/aggregator/$type", $namespaces, $module_handler, $plugin_interfaces[$type], $type_annotations[$type]);
49 $this->setCacheBackend($cache_backend, 'aggregator_' . $type . '_plugins');