Overrides Drupal\Component\Plugin\PluginManagerBase::__construct().
\Traversable $namespaces: An object that implements \Traversable which contains the root paths keyed by the corresponding namespace to look for plugin implementations,
public function __construct(\Traversable $namespaces) {
// Create resource plugin derivatives from declaratively defined resources.
$this->discovery = new AnnotatedClassDiscovery('rest/resource', $namespaces);
$this->discovery = new DerivativeDiscoveryDecorator($this->discovery);
$this->discovery = new AlterDecorator($this->discovery, 'rest_resource');
$this->discovery = new CacheDecorator($this->discovery, 'rest');
$this->factory = new ReflectionFactory($this->discovery);
}