Added cubby-holes for new projects.
diff --git a/utils/rest/pom.xml b/utils/rest/pom.xml
new file mode 100644
index 0000000..52988cf
--- /dev/null
+++ b/utils/rest/pom.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.onlab.onos</groupId>
+ <artifactId>onos-utils</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>onos-utils-rest</artifactId>
+ <packaging>bundle</packaging>
+
+ <description>JAX-RS utilities</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.sun.jersey</groupId>
+ <artifactId>jersey-servlet</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.jersey.jersey-test-framework</groupId>
+ <artifactId>jersey-test-framework-core</artifactId>
+ <version>1.18.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.jersey.jersey-test-framework</groupId>
+ <artifactId>jersey-test-framework-grizzly2</artifactId>
+ <version>1.18.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.onlab.onos</groupId>
+ <artifactId>onos-utils-osgi</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+</project>
diff --git a/utils/rest/src/main/java/org/onlab/rest/BaseResource.java b/utils/rest/src/main/java/org/onlab/rest/BaseResource.java
new file mode 100644
index 0000000..78fa031
--- /dev/null
+++ b/utils/rest/src/main/java/org/onlab/rest/BaseResource.java
@@ -0,0 +1,36 @@
+package org.onlab.rest;
+
+import org.onlab.osgi.DefaultServiceDirectory;
+import org.onlab.osgi.ServiceDirectory;
+
+/**
+ * Base abstraction of a JAX-RS resource.
+ */
+public abstract class BaseResource {
+
+ private static ServiceDirectory services = new DefaultServiceDirectory();
+
+ /**
+ * Sets alternate service directory to be used for lookups.
+ * <p>
+ * Intended to ease unit testing and not intended for use in production.
+ * </p>
+ *
+ * @param serviceDirectory alternate service directory
+ */
+ public static void setServiceDirectory(ServiceDirectory serviceDirectory) {
+ services = serviceDirectory;
+ }
+
+ /**
+ * Returns reference to the specified service implementation.
+ *
+ * @param service service class
+ * @param <T> type of service
+ * @return service implementation
+ */
+ protected static <T> T get(Class<T> service) {
+ return services.get(service);
+ }
+
+}
diff --git a/utils/rest/src/main/javadoc/org/onlab/rest/package.html b/utils/rest/src/main/javadoc/org/onlab/rest/package.html
new file mode 100644
index 0000000..09b098f
--- /dev/null
+++ b/utils/rest/src/main/javadoc/org/onlab/rest/package.html
@@ -0,0 +1,3 @@
+<body>
+Facilities for building JAX-RS web resources.
+</body>
\ No newline at end of file