Skeleton of the vRouter application

Change-Id: I471561808f7d1bf3b51ab72b9731d7bf3ec410e7
diff --git a/apps/pom.xml b/apps/pom.xml
index b536c7c..79e7466 100644
--- a/apps/pom.xml
+++ b/apps/pom.xml
@@ -64,6 +64,7 @@
         <module>drivermatrix</module>
         <module>cpman</module>
         <module>events</module>
+        <module>vrouter</module>
   </modules>
 
     <properties>
@@ -108,4 +109,3 @@
     </build>
 
 </project>
-
diff --git a/apps/vrouter/app.xml b/apps/vrouter/app.xml
new file mode 100644
index 0000000..9dc3dc4
--- /dev/null
+++ b/apps/vrouter/app.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Copyright 2016 Open Networking Laboratory
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~     http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+<app name="org.onosproject.vrouter" origin="ON.Lab" version="${project.version}"
+     featuresRepo="mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features"
+     features="${project.artifactId}">
+    <description>${project.description}</description>
+    <artifact>mvn:${project.groupId}/${project.artifactId}/${project.version}</artifact>
+    <artifact>mvn:${project.groupId}/onos-app-routing-api/${project.version}</artifact>
+    <artifact>mvn:${project.groupId}/onos-app-routing/${project.version}</artifact>
+</app>
diff --git a/apps/vrouter/features.xml b/apps/vrouter/features.xml
new file mode 100644
index 0000000..8609ba9
--- /dev/null
+++ b/apps/vrouter/features.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+  ~ Copyright 2016 Open Networking Laboratory
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~     http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+<features xmlns="http://karaf.apache.org/xmlns/features/v1.2.0" name="${project.artifactId}-${project.version}">
+    <feature name="onos-app-vrouter" version="${project.version}"
+             description="${project.description}">
+        <feature>onos-api</feature>
+        <bundle>mvn:${project.groupId}/onos-app-vrouter/${project.version}</bundle>
+        <bundle>mvn:${project.groupId}/onos-app-routing-api/${project.version}</bundle>
+        <bundle>mvn:${project.groupId}/onos-app-routing/${project.version}</bundle>
+    </feature>
+</features>
diff --git a/apps/vrouter/pom.xml b/apps/vrouter/pom.xml
new file mode 100644
index 0000000..8a58c84
--- /dev/null
+++ b/apps/vrouter/pom.xml
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Copyright 2016 Open Networking Laboratory
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~     http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <artifactId>onos-apps</artifactId>
+        <groupId>org.onosproject</groupId>
+        <version>1.5.0-SNAPSHOT</version>
+    </parent>
+
+    <groupId>org.onosproject</groupId>
+    <artifactId>onos-app-vrouter</artifactId>
+    <version>1.5.0-SNAPSHOT</version>
+    <packaging>bundle</packaging>
+
+    <description>Virtual router (vRouter) application</description>
+    <url>http://onosproject.org</url>
+
+    <properties>
+        <onos.version>1.5.0-SNAPSHOT</onos.version>
+        <onos.app.name>org.onosproject.vrouter</onos.app.name>
+        <onos.app.origin>ON.Lab</onos.app.origin>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-api</artifactId>
+            <version>${onos.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onlab-osgi</artifactId>
+            <version>${onos.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-incubator-api</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onlab-junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-api</artifactId>
+            <version>${onos.version}</version>
+            <scope>test</scope>
+            <classifier>tests</classifier>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.scr.annotations</artifactId>
+            <version>1.9.8</version>
+            <scope>provided</scope>
+        </dependency>
+    </dependencies>
+
+</project>
diff --git a/apps/vrouter/src/main/java/org/onosproject/vrouter/Vrouter.java b/apps/vrouter/src/main/java/org/onosproject/vrouter/Vrouter.java
new file mode 100644
index 0000000..6c884e9
--- /dev/null
+++ b/apps/vrouter/src/main/java/org/onosproject/vrouter/Vrouter.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2014 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.vrouter;
+
+import com.google.common.collect.ImmutableList;
+import org.apache.felix.scr.annotations.Activate;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Deactivate;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.ReferenceCardinality;
+import org.onosproject.core.ApplicationId;
+import org.onosproject.core.CoreService;
+import org.onosproject.incubator.component.ComponentService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.List;
+
+/**
+ * Virtual router (vRouter) application.
+ */
+@Component(immediate = true)
+public class Vrouter {
+
+    private final Logger log = LoggerFactory.getLogger(getClass());
+
+    private static final String APP_NAME = "org.onosproject.vrouter";
+
+    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
+    protected CoreService coreService;
+
+    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
+    protected ComponentService componentService;
+
+    private ApplicationId appId;
+
+    private final List<String> components = ImmutableList.<String>builder()
+            .add("org.onosproject.routing.fpm.FpmManager")
+            .add("org.onosproject.routing.impl.Router")
+            .add("org.onosproject.routing.impl.SingleSwitchFibInstaller")
+            .build();
+
+    @Activate
+    protected void activate() {
+        appId = coreService.registerApplication(APP_NAME);
+
+        components.forEach(name -> componentService.activate(appId, name));
+
+        log.info("Started");
+    }
+
+    @Deactivate
+    protected void deactivate() {
+        log.info("Stopped");
+    }
+
+}
diff --git a/apps/vrouter/src/main/java/org/onosproject/vrouter/package-info.java b/apps/vrouter/src/main/java/org/onosproject/vrouter/package-info.java
new file mode 100644
index 0000000..165d03e
--- /dev/null
+++ b/apps/vrouter/src/main/java/org/onosproject/vrouter/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2016 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Virtual Router (vRouter) application.
+ */
+package org.onosproject.vrouter;