Make vRouter components into separate apps.

This allows us to leverage the ONOS app subsystem for selecting which
components to load.

CORD-710

Change-Id: Ibd7c4c1afd2caa137b44c085e7b6b5b4a1082521
diff --git a/apps/bgprouter/BUCK b/apps/bgprouter/BUCK
index 0e1870f..211ae7a 100644
--- a/apps/bgprouter/BUCK
+++ b/apps/bgprouter/BUCK
@@ -6,7 +6,7 @@
 
 BUNDLES = [
     '//apps/routing-api:onos-apps-routing-api',
-    '//apps/routing:onos-apps-routing',
+    '//apps/routing/common:onos-apps-routing-common',
     '//apps/bgprouter:onos-apps-bgprouter',
 ]
 
@@ -20,4 +20,5 @@
     url = 'http://onosproject.org',
     description = 'BGP router application.',
     included_bundles = BUNDLES,
+    required_apps = [ 'org.onosproject.fibinstaller' ],
 )
diff --git a/apps/bgprouter/app.xml b/apps/bgprouter/app.xml
index 91e010a..fafba35 100644
--- a/apps/bgprouter/app.xml
+++ b/apps/bgprouter/app.xml
@@ -17,7 +17,7 @@
 <app name="org.onosproject.bgprouter" origin="ON.Lab" version="${project.version}"
      category="Traffic Steering" url="http://onosproject.org" title="BGP Router App"
      featuresRepo="mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features"
-     features="${project.artifactId}">
+     features="${project.artifactId}" apps="fibinstaller">
     <description>${project.description}</description>
     <artifact>mvn:${project.groupId}/${project.artifactId}/${project.version}</artifact>
     <artifact>mvn:${project.groupId}/onos-app-routing-api/${project.version}</artifact>
diff --git a/apps/bgprouter/src/main/java/org/onosproject/bgprouter/BgpRouter.java b/apps/bgprouter/src/main/java/org/onosproject/bgprouter/BgpRouter.java
index e6941c3..ce43a6a 100644
--- a/apps/bgprouter/src/main/java/org/onosproject/bgprouter/BgpRouter.java
+++ b/apps/bgprouter/src/main/java/org/onosproject/bgprouter/BgpRouter.java
@@ -94,9 +94,7 @@
     private static List<String> components = new ArrayList<>();
     static {
         components.add("org.onosproject.routing.bgp.BgpSessionManager");
-        components.add("org.onosproject.routing.impl.Router");
         components.add("org.onosproject.routing.impl.BgpSpeakerNeighbourHandler");
-        components.add("org.onosproject.routing.impl.SingleSwitchFibInstaller");
     }
 
     @Activate