diff --git a/core/modules/rest/lib/Drupal/rest/Plugin/ResourceBase.php b/core/modules/rest/lib/Drupal/rest/Plugin/ResourceBase.php
index e851352..b829c7c 100644
--- a/core/modules/rest/lib/Drupal/rest/Plugin/ResourceBase.php
+++ b/core/modules/rest/lib/Drupal/rest/Plugin/ResourceBase.php
@@ -8,13 +8,51 @@
 namespace Drupal\rest\Plugin;
 
 use Drupal\Component\Plugin\PluginBase;
+use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
+use Symfony\Component\DependencyInjection\ContainerInterface;
 use Symfony\Component\Routing\Route;
 use Symfony\Component\Routing\RouteCollection;
 
 /**
  * Common base class for resource plugins.
  */
-abstract class ResourceBase extends PluginBase implements ResourceInterface {
+abstract class ResourceBase extends PluginBase implements ContainerFactoryPluginInterface, ResourceInterface {
+
+  /**
+   * The available serialization formats.
+   *
+   * @var array
+   */
+  protected $serializerFormats = array();
+
+  /**
+   * Constructs a Drupal\rest\Plugin\ResourceBase object.
+   *
+   * @param array $configuration
+   *   A configuration array containing information about the plugin instance.
+   * @param string $plugin_id
+   *   The plugin_id for the plugin instance.
+   * @param array $plugin_definition
+   *   The plugin implementation definition.
+   * @param array $serializer_formats
+   *   The available serialization formats.
+   */
+  public function __construct(array $configuration, $plugin_id, array $plugin_definition, array $serializer_formats) {
+    parent::__construct($configuration, $plugin_id, $plugin_definition);
+    $this->serializerFormats = $serializer_formats;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function create(ContainerInterface $container, array $configuration, $plugin_id, array $plugin_definition) {
+    return new static(
+      $configuration,
+      $plugin_id,
+      $plugin_definition,
+      $container->getParameter('serializer.formats')
+    );
+  }
 
   /**
    * Implements ResourceInterface::permissions().
@@ -68,8 +106,7 @@ public function routes() {
         case 'HEAD':
           // Restrict GET and HEAD requests to the media type specified in the
           // HTTP Accept headers.
-          $formats = drupal_container()->getParameter('serializer.formats');
-          foreach ($formats as $format_name) {
+          foreach ($this->serializerFormats as $format_name) {
             // Expose one route per available format.
             //$format_route = new Route($route->getPattern(), $route->getDefaults(), $route->getRequirements());
             $format_route = clone $route;
@@ -124,4 +161,5 @@ public function availableMethods() {
     }
     return $available;
   }
+
 }
diff --git a/core/modules/rest/lib/Drupal/rest/Plugin/Type/ResourcePluginManager.php b/core/modules/rest/lib/Drupal/rest/Plugin/Type/ResourcePluginManager.php
index 6edea17..e403c5b 100644
--- a/core/modules/rest/lib/Drupal/rest/Plugin/Type/ResourcePluginManager.php
+++ b/core/modules/rest/lib/Drupal/rest/Plugin/Type/ResourcePluginManager.php
@@ -8,32 +8,40 @@
 namespace Drupal\rest\Plugin\Type;
 
 use Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator;
-use Drupal\Component\Plugin\Factory\ReflectionFactory;
-use Drupal\Component\Plugin\PluginManagerBase;
+use Drupal\Core\Cache\CacheBackendInterface;
+use Drupal\Core\Extension\ModuleHandlerInterface;
+use Drupal\Core\Language\LanguageManager;
+use Drupal\Core\Plugin\DefaultPluginManager;
 use Drupal\Core\Plugin\Discovery\AlterDecorator;
 use Drupal\Core\Plugin\Discovery\AnnotatedClassDiscovery;
 use Drupal\Core\Plugin\Discovery\CacheDecorator;
+use Drupal\Core\Plugin\Factory\ContainerFactory;
 
 /**
  * Manages discovery and instantiation of resource plugins.
  */
-class ResourcePluginManager extends PluginManagerBase {
+class ResourcePluginManager extends DefaultPluginManager {
 
   /**
-   * Overrides Drupal\Component\Plugin\PluginManagerBase::__construct().
+   * Constructs a new \Drupal\rest\Plugin\Type\ResourcePluginManager object.
    *
    * @param \Traversable $namespaces
    *   An object that implements \Traversable which contains the root paths
-   *   keyed by the corresponding namespace to look for plugin implementations,
+   *   keyed by the corresponding namespace to look for plugin implementations.
+   * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
+   *   Cache backend instance to use.
+   * @param \Drupal\Core\Language\LanguageManager $language_manager
+   *   The language manager.
+   * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
+   *   The module handler to invoke the alter hook with.
    */
-  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);
+  public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, LanguageManager $language_manager, ModuleHandlerInterface $module_handler) {
+    parent::__construct('rest/resource', $namespaces);
     $this->discovery = new AlterDecorator($this->discovery, 'rest_resource');
     $this->discovery = new CacheDecorator($this->discovery, 'rest');
 
-    $this->factory = new ReflectionFactory($this->discovery);
+    $this->setCacheBackend($cache_backend, $language_manager, 'rest_plugins');
+    $this->alterInfo($module_handler, 'rest');
   }
 
   /**
diff --git a/core/modules/rest/lib/Drupal/rest/Plugin/views/display/RestExport.php b/core/modules/rest/lib/Drupal/rest/Plugin/views/display/RestExport.php
index 694a422..33a7e6b 100644
--- a/core/modules/rest/lib/Drupal/rest/Plugin/views/display/RestExport.php
+++ b/core/modules/rest/lib/Drupal/rest/Plugin/views/display/RestExport.php
@@ -9,8 +9,11 @@
 
 use Drupal\Component\Annotation\Plugin;
 use Drupal\Core\Annotation\Translation;
+use Drupal\Core\ContentNegotiation;
 use Drupal\views\ViewExecutable;
 use Drupal\views\Plugin\views\display\PathPluginBase;
+use Symfony\Component\DependencyInjection\ContainerInterface;
+use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpFoundation\Response;
 use Symfony\Component\Routing\RouteCollection;
 
@@ -70,16 +73,59 @@ class RestExport extends PathPluginBase {
   protected $mimeType;
 
   /**
+   * The content negotiation library.
+   *
+   * @var \Drupal\Core\ContentNegotiation
+   */
+  protected $contentNegotiation;
+
+  /**
+   * The request object.
+   *
+   * @var \Symfony\Component\HttpFoundation\Request
+   */
+  protected $request;
+
+  /**
+   * Constructs a Drupal\rest\Plugin\ResourceBase object.
+   *
+   * @param array $configuration
+   *   A configuration array containing information about the plugin instance.
+   * @param string $plugin_id
+   *   The plugin_id for the plugin instance.
+   * @param array $plugin_definition
+   *   The plugin implementation definition.
+   * @param \Drupal\Core\ContentNegotiation $content_negotiation
+   *   The content negotiation library.
+   * @param \Symfony\Component\HttpFoundation\Request $request
+   *   The request object.
+   */
+  public function __construct(array $configuration, $plugin_id, array $plugin_definition, ContentNegotiation $content_negotiation, Request $request) {
+    parent::__construct($configuration, $plugin_id, $plugin_definition);
+    $this->contentNegotiation = $content_negotiation;
+    $this->request = $request;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function create(ContainerInterface $container, array $configuration, $plugin_id, array $plugin_definition) {
+    return new static(
+      $configuration,
+      $plugin_id,
+      $plugin_definition,
+      $container->get('content_negotiation'),
+      $container->get('request')
+    );
+  }
+
+  /**
    * {@inheritdoc}
    */
   public function initDisplay(ViewExecutable $view, array &$display, array &$options = NULL) {
     parent::initDisplay($view, $display, $options);
 
-    $container = drupal_container();
-    $negotiation = $container->get('content_negotiation');
-    $request = $container->get('request');
-
-    $request_content_type = $negotiation->getContentType($request);
+    $request_content_type = $this->contentNegotiation->getContentType($this->request);
     // Only use the requested content type if it's not 'html'. If it is then
     // default to 'json' to aid debugging.
     // @todo Remove the need for this when we have better content negotiation.
@@ -87,7 +133,7 @@ public function initDisplay(ViewExecutable $view, array &$display, array &$optio
       $this->setContentType($request_content_type);
     }
 
-    $this->setMimeType($request->getMimeType($this->contentType));
+    $this->setMimeType($this->request->getMimeType($this->contentType));
   }
 
   /**
diff --git a/core/modules/rest/lib/Drupal/rest/Tests/CreateTest.php b/core/modules/rest/lib/Drupal/rest/Tests/CreateTest.php
index 4ccc0b6..91afc34 100644
--- a/core/modules/rest/lib/Drupal/rest/Tests/CreateTest.php
+++ b/core/modules/rest/lib/Drupal/rest/Tests/CreateTest.php
@@ -33,7 +33,7 @@ public static function getInfo() {
    * Tests several valid and invalid create requests on all entity types.
    */
   public function testCreate() {
-    $serializer = drupal_container()->get('serializer');
+    $serializer = $this->container->get('serializer');
     // @todo once EntityNG is implemented for other entity types test all other
     // entity types here as well.
     $entity_type = 'entity_test';
diff --git a/core/modules/rest/lib/Drupal/rest/Tests/RESTTestBase.php b/core/modules/rest/lib/Drupal/rest/Tests/RESTTestBase.php
index f1817d7..b0d57a5 100644
--- a/core/modules/rest/lib/Drupal/rest/Tests/RESTTestBase.php
+++ b/core/modules/rest/lib/Drupal/rest/Tests/RESTTestBase.php
@@ -205,7 +205,7 @@ protected function enableService($resource_type, $method = 'GET', $format = NULL
     $config->save();
 
     // Rebuild routing cache, so that the REST API paths are available.
-    drupal_container()->get('router.builder')->rebuild();
+    $this->container->get('router.builder')->rebuild();
     // Reset the Simpletest permission cache, so that the new resource
     // permissions get picked up.
     drupal_static_reset('checkPermissions');
diff --git a/core/modules/rest/lib/Drupal/rest/Tests/UpdateTest.php b/core/modules/rest/lib/Drupal/rest/Tests/UpdateTest.php
index eca41bc..ca4f2b9 100644
--- a/core/modules/rest/lib/Drupal/rest/Tests/UpdateTest.php
+++ b/core/modules/rest/lib/Drupal/rest/Tests/UpdateTest.php
@@ -33,7 +33,7 @@ public static function getInfo() {
    * Tests several valid and invalid partial update requests on test entities.
    */
   public function testPatchUpdate() {
-    $serializer = drupal_container()->get('serializer');
+    $serializer = $this->container->get('serializer');
     // @todo once EntityNG is implemented for other entity types test all other
     // entity types here as well.
     $entity_type = 'entity_test';
diff --git a/core/modules/rest/lib/Drupal/rest/Tests/Views/StyleSerializerTest.php b/core/modules/rest/lib/Drupal/rest/Tests/Views/StyleSerializerTest.php
index 332310e..48bf955 100644
--- a/core/modules/rest/lib/Drupal/rest/Tests/Views/StyleSerializerTest.php
+++ b/core/modules/rest/lib/Drupal/rest/Tests/Views/StyleSerializerTest.php
@@ -109,7 +109,7 @@ public function testSerializerResponses() {
     $this->executeView($view);
 
     // Get the serializer service.
-    $serializer = drupal_container()->get('serializer');
+    $serializer = $this->container->get('serializer');
 
     $entities = array();
     foreach ($view->result as $row) {
diff --git a/core/modules/rest/rest.module b/core/modules/rest/rest.module
index 28b33cb..9100df6 100644
--- a/core/modules/rest/rest.module
+++ b/core/modules/rest/rest.module
@@ -10,16 +10,14 @@
  */
 function rest_permission() {
   $permissions = array();
-  if (drupal_container()->has('plugin.manager.rest')) {
-    $manager = drupal_container()->get('plugin.manager.rest');
-    $resources = config('rest.settings')->get('resources');
+  $manager = Drupal::service('plugin.manager.rest');
+  $resources = config('rest.settings')->get('resources');
     if ($resources && $enabled = array_intersect_key($manager->getDefinitions(), $resources)) {
       foreach ($enabled as $key => $resource) {
         $plugin = $manager->getInstance(array('id' => $key));
         $permissions = array_merge($permissions, $plugin->permissions());
       }
     }
-  }
   return $permissions;
 }
 
diff --git a/core/modules/rest/rest.services.yml b/core/modules/rest/rest.services.yml
index 97817ad..d238442 100644
--- a/core/modules/rest/rest.services.yml
+++ b/core/modules/rest/rest.services.yml
@@ -1,7 +1,14 @@
 services:
   plugin.manager.rest:
     class: Drupal\rest\Plugin\Type\ResourcePluginManager
-    arguments: ['@container.namespaces']
+    arguments: ['@container.namespaces', '@cache.rest', '@language_manager', '@module_handler']
+  cache.rest:
+    class: Drupal\Core\Cache\CacheBackendInterface
+    tags:
+      - { name: cache.bin }
+    factory_method: get
+    factory_service: cache_factory
+    arguments: [rest]
   rest.route_subscriber:
     class: Drupal\rest\EventSubscriber\RouteSubscriber
     tags:
