We want all the discovery things for ResourcePluginManager to make it more powerful.
The first thing that comes to mind is swapping out a plugin definition. Example: I'm a contrib module and I'm really not happy how the entity:node resource plugin works, so I want to alter it because I want to treat REST requests for nodes in a more specific way.
Basically we can copy from ViewsPluginManager:
<?php
$this->discovery = new AnnotatedClassDiscovery('views', $type, $namespaces);
$this->discovery = new DerivativeDiscoveryDecorator($this->discovery);
$this->discovery = new ProcessDecorator($this->discovery, array($this, 'processDefinition'));
$this->discovery = new AlterDecorator($this->discovery, 'views_plugins_'. $type);
$this->discovery = new CacheDecorator($this->discovery, 'views:'. $type, 'views_info');
?>
ProcessDecorator does not make sense to me, but we want the rest!