Fixed some more compiler warnings:

- mostly due to the use of the latest OSGi R6 release;
- upgraded to latest Velocity as the previous one gave unreliable results in
  the unit tests. The latest version also includes its own version of
  commons-lang and commons-collections making these two dependencies
  superfluous (no other bundle uses them);
- refactored the RepositoryServlet and RepositoryReplicationServlet due to the
  use of the new OSGi R6 framework.



git-svn-id: https://svn.apache.org/repos/asf/ace/trunk@1726821 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/cnf/lib/index.xml.gz b/cnf/lib/index.xml.gz
index e26148a..8be26c0 100644
--- a/cnf/lib/index.xml.gz
+++ b/cnf/lib/index.xml.gz
Binary files differ
diff --git a/cnf/lib/velocity/velocity-1.6.2.jar b/cnf/lib/velocity/velocity-1.6.2.jar
deleted file mode 100644
index e0a73c1..0000000
--- a/cnf/lib/velocity/velocity-1.6.2.jar
+++ /dev/null
Binary files differ
diff --git a/cnf/localrepo/index.xml b/cnf/localrepo/index.xml
index cf5c169..d473394 100644
--- a/cnf/localrepo/index.xml
+++ b/cnf/localrepo/index.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<repository increment="1453801257000" name="Local" xmlns="http://www.osgi.org/xmlns/repository/v1.0.0">
+<repository increment="1453816578000" name="Local" xmlns="http://www.osgi.org/xmlns/repository/v1.0.0">
   <resource>
     <capability namespace="osgi.identity">
       <attribute name="osgi.identity" value="aws-common"/>
@@ -6805,135 +6805,6 @@
   </resource>
   <resource>
     <capability namespace="osgi.identity">
-      <attribute name="osgi.identity" value="org.apache.commons.collections"/>
-      <attribute name="type" value="osgi.bundle"/>
-      <attribute name="version" type="Version" value="3.2.1"/>
-    </capability>
-    <capability namespace="osgi.content">
-      <attribute name="osgi.content" value="87363a4c94eaabeefd8b930cb059f66b64c9f7d632862f23de3012da7660047b"/>
-      <attribute name="url" value="org.apache.commons.collections/org.apache.commons.collections-3.2.1.jar"/>
-      <attribute name="size" type="Long" value="575389"/>
-      <attribute name="mime" value="application/vnd.osgi.bundle"/>
-    </capability>
-    <capability namespace="osgi.wiring.bundle">
-      <attribute name="osgi.wiring.bundle" value="org.apache.commons.collections"/>
-      <attribute name="bundle-version" type="Version" value="3.2.1"/>
-    </capability>
-    <capability namespace="osgi.wiring.host">
-      <attribute name="osgi.wiring.host" value="org.apache.commons.collections"/>
-      <attribute name="bundle-version" type="Version" value="3.2.1"/>
-    </capability>
-    <capability namespace="osgi.wiring.package">
-      <attribute name="osgi.wiring.package" value="org.apache.commons.collections.map"/>
-      <attribute name="version" type="Version" value="3.2.1"/>
-      <attribute name="bundle-symbolic-name" value="org.apache.commons.collections"/>
-      <attribute name="bundle-version" type="Version" value="3.2.1"/>
-    </capability>
-    <capability namespace="osgi.wiring.package">
-      <attribute name="osgi.wiring.package" value="org.apache.commons.collections.buffer"/>
-      <attribute name="version" type="Version" value="3.2.1"/>
-      <attribute name="bundle-symbolic-name" value="org.apache.commons.collections"/>
-      <attribute name="bundle-version" type="Version" value="3.2.1"/>
-    </capability>
-    <capability namespace="osgi.wiring.package">
-      <attribute name="osgi.wiring.package" value="org.apache.commons.collections.comparators"/>
-      <attribute name="version" type="Version" value="3.2.1"/>
-      <attribute name="bundle-symbolic-name" value="org.apache.commons.collections"/>
-      <attribute name="bundle-version" type="Version" value="3.2.1"/>
-    </capability>
-    <capability namespace="osgi.wiring.package">
-      <attribute name="osgi.wiring.package" value="org.apache.commons.collections.collection"/>
-      <attribute name="version" type="Version" value="3.2.1"/>
-      <attribute name="bundle-symbolic-name" value="org.apache.commons.collections"/>
-      <attribute name="bundle-version" type="Version" value="3.2.1"/>
-    </capability>
-    <capability namespace="osgi.wiring.package">
-      <attribute name="osgi.wiring.package" value="org.apache.commons.collections.bag"/>
-      <attribute name="version" type="Version" value="3.2.1"/>
-      <attribute name="bundle-symbolic-name" value="org.apache.commons.collections"/>
-      <attribute name="bundle-version" type="Version" value="3.2.1"/>
-    </capability>
-    <capability namespace="osgi.wiring.package">
-      <attribute name="osgi.wiring.package" value="org.apache.commons.collections.iterators"/>
-      <attribute name="version" type="Version" value="3.2.1"/>
-      <attribute name="bundle-symbolic-name" value="org.apache.commons.collections"/>
-      <attribute name="bundle-version" type="Version" value="3.2.1"/>
-    </capability>
-    <capability namespace="osgi.wiring.package">
-      <attribute name="osgi.wiring.package" value="org.apache.commons.collections.bidimap"/>
-      <attribute name="version" type="Version" value="3.2.1"/>
-      <attribute name="bundle-symbolic-name" value="org.apache.commons.collections"/>
-      <attribute name="bundle-version" type="Version" value="3.2.1"/>
-    </capability>
-    <capability namespace="osgi.wiring.package">
-      <attribute name="osgi.wiring.package" value="org.apache.commons.collections.set"/>
-      <attribute name="version" type="Version" value="3.2.1"/>
-      <attribute name="bundle-symbolic-name" value="org.apache.commons.collections"/>
-      <attribute name="bundle-version" type="Version" value="3.2.1"/>
-    </capability>
-    <capability namespace="osgi.wiring.package">
-      <attribute name="osgi.wiring.package" value="org.apache.commons.collections.functors"/>
-      <attribute name="version" type="Version" value="3.2.1"/>
-      <attribute name="bundle-symbolic-name" value="org.apache.commons.collections"/>
-      <attribute name="bundle-version" type="Version" value="3.2.1"/>
-    </capability>
-    <capability namespace="osgi.wiring.package">
-      <attribute name="osgi.wiring.package" value="org.apache.commons.collections.list"/>
-      <attribute name="version" type="Version" value="3.2.1"/>
-      <attribute name="bundle-symbolic-name" value="org.apache.commons.collections"/>
-      <attribute name="bundle-version" type="Version" value="3.2.1"/>
-    </capability>
-    <capability namespace="osgi.wiring.package">
-      <attribute name="osgi.wiring.package" value="org.apache.commons.collections.keyvalue"/>
-      <attribute name="version" type="Version" value="3.2.1"/>
-      <attribute name="bundle-symbolic-name" value="org.apache.commons.collections"/>
-      <attribute name="bundle-version" type="Version" value="3.2.1"/>
-    </capability>
-    <capability namespace="osgi.wiring.package">
-      <attribute name="osgi.wiring.package" value="org.apache.commons.collections"/>
-      <attribute name="version" type="Version" value="3.2.1"/>
-      <attribute name="bundle-symbolic-name" value="org.apache.commons.collections"/>
-      <attribute name="bundle-version" type="Version" value="3.2.1"/>
-    </capability>
-    <requirement namespace="osgi.wiring.package">
-      <directive name="filter" value="(&amp;(osgi.wiring.package=org.apache.commons.collections)(version&gt;=3.2.1))"/>
-    </requirement>
-    <requirement namespace="osgi.wiring.package">
-      <directive name="filter" value="(&amp;(osgi.wiring.package=org.apache.commons.collections.bag)(version&gt;=3.2.1))"/>
-    </requirement>
-    <requirement namespace="osgi.wiring.package">
-      <directive name="filter" value="(&amp;(osgi.wiring.package=org.apache.commons.collections.bidimap)(version&gt;=3.2.1))"/>
-    </requirement>
-    <requirement namespace="osgi.wiring.package">
-      <directive name="filter" value="(&amp;(osgi.wiring.package=org.apache.commons.collections.buffer)(version&gt;=3.2.1))"/>
-    </requirement>
-    <requirement namespace="osgi.wiring.package">
-      <directive name="filter" value="(&amp;(osgi.wiring.package=org.apache.commons.collections.collection)(version&gt;=3.2.1))"/>
-    </requirement>
-    <requirement namespace="osgi.wiring.package">
-      <directive name="filter" value="(&amp;(osgi.wiring.package=org.apache.commons.collections.comparators)(version&gt;=3.2.1))"/>
-    </requirement>
-    <requirement namespace="osgi.wiring.package">
-      <directive name="filter" value="(&amp;(osgi.wiring.package=org.apache.commons.collections.functors)(version&gt;=3.2.1))"/>
-    </requirement>
-    <requirement namespace="osgi.wiring.package">
-      <directive name="filter" value="(&amp;(osgi.wiring.package=org.apache.commons.collections.iterators)(version&gt;=3.2.1))"/>
-    </requirement>
-    <requirement namespace="osgi.wiring.package">
-      <directive name="filter" value="(&amp;(osgi.wiring.package=org.apache.commons.collections.keyvalue)(version&gt;=3.2.1))"/>
-    </requirement>
-    <requirement namespace="osgi.wiring.package">
-      <directive name="filter" value="(&amp;(osgi.wiring.package=org.apache.commons.collections.list)(version&gt;=3.2.1))"/>
-    </requirement>
-    <requirement namespace="osgi.wiring.package">
-      <directive name="filter" value="(&amp;(osgi.wiring.package=org.apache.commons.collections.map)(version&gt;=3.2.1))"/>
-    </requirement>
-    <requirement namespace="osgi.wiring.package">
-      <directive name="filter" value="(&amp;(osgi.wiring.package=org.apache.commons.collections.set)(version&gt;=3.2.1))"/>
-    </requirement>
-  </resource>
-  <resource>
-    <capability namespace="osgi.identity">
       <attribute name="osgi.identity" value="org.apache.commons.io"/>
       <attribute name="type" value="osgi.bundle"/>
       <attribute name="version" type="Version" value="2.0.1"/>
@@ -6991,108 +6862,6 @@
   </resource>
   <resource>
     <capability namespace="osgi.identity">
-      <attribute name="osgi.identity" value="org.apache.commons.lang"/>
-      <attribute name="type" value="osgi.bundle"/>
-      <attribute name="version" type="Version" value="2.4.0"/>
-    </capability>
-    <capability namespace="osgi.content">
-      <attribute name="osgi.content" value="2c73b940c91250bc98346926270f13a6a10bb6e29d2c9316a70d134e382c873e"/>
-      <attribute name="url" value="org.apache.commons.lang/org.apache.commons.lang-2.4.0.jar"/>
-      <attribute name="size" type="Long" value="261809"/>
-      <attribute name="mime" value="application/vnd.osgi.bundle"/>
-    </capability>
-    <capability namespace="osgi.wiring.bundle">
-      <attribute name="osgi.wiring.bundle" value="org.apache.commons.lang"/>
-      <attribute name="bundle-version" type="Version" value="2.4.0"/>
-    </capability>
-    <capability namespace="osgi.wiring.host">
-      <attribute name="osgi.wiring.host" value="org.apache.commons.lang"/>
-      <attribute name="bundle-version" type="Version" value="2.4.0"/>
-    </capability>
-    <capability namespace="osgi.wiring.package">
-      <attribute name="osgi.wiring.package" value="org.apache.commons.lang.math"/>
-      <attribute name="version" type="Version" value="2.4.0"/>
-      <attribute name="bundle-symbolic-name" value="org.apache.commons.lang"/>
-      <attribute name="bundle-version" type="Version" value="2.4.0"/>
-    </capability>
-    <capability namespace="osgi.wiring.package">
-      <attribute name="osgi.wiring.package" value="org.apache.commons.lang.enums"/>
-      <attribute name="version" type="Version" value="2.4.0"/>
-      <attribute name="bundle-symbolic-name" value="org.apache.commons.lang"/>
-      <attribute name="bundle-version" type="Version" value="2.4.0"/>
-    </capability>
-    <capability namespace="osgi.wiring.package">
-      <attribute name="osgi.wiring.package" value="org.apache.commons.lang.builder"/>
-      <attribute name="version" type="Version" value="2.4.0"/>
-      <attribute name="bundle-symbolic-name" value="org.apache.commons.lang"/>
-      <attribute name="bundle-version" type="Version" value="2.4.0"/>
-    </capability>
-    <capability namespace="osgi.wiring.package">
-      <attribute name="osgi.wiring.package" value="org.apache.commons.lang.exception"/>
-      <attribute name="version" type="Version" value="2.4.0"/>
-      <attribute name="bundle-symbolic-name" value="org.apache.commons.lang"/>
-      <attribute name="bundle-version" type="Version" value="2.4.0"/>
-    </capability>
-    <capability namespace="osgi.wiring.package">
-      <attribute name="osgi.wiring.package" value="org.apache.commons.lang.enum"/>
-      <attribute name="version" type="Version" value="2.4.0"/>
-      <attribute name="bundle-symbolic-name" value="org.apache.commons.lang"/>
-      <attribute name="bundle-version" type="Version" value="2.4.0"/>
-    </capability>
-    <capability namespace="osgi.wiring.package">
-      <attribute name="osgi.wiring.package" value="org.apache.commons.lang.mutable"/>
-      <attribute name="version" type="Version" value="2.4.0"/>
-      <attribute name="bundle-symbolic-name" value="org.apache.commons.lang"/>
-      <attribute name="bundle-version" type="Version" value="2.4.0"/>
-    </capability>
-    <capability namespace="osgi.wiring.package">
-      <attribute name="osgi.wiring.package" value="org.apache.commons.lang.text"/>
-      <attribute name="version" type="Version" value="2.4.0"/>
-      <attribute name="bundle-symbolic-name" value="org.apache.commons.lang"/>
-      <attribute name="bundle-version" type="Version" value="2.4.0"/>
-    </capability>
-    <capability namespace="osgi.wiring.package">
-      <attribute name="osgi.wiring.package" value="org.apache.commons.lang.time"/>
-      <attribute name="version" type="Version" value="2.4.0"/>
-      <attribute name="bundle-symbolic-name" value="org.apache.commons.lang"/>
-      <attribute name="bundle-version" type="Version" value="2.4.0"/>
-    </capability>
-    <capability namespace="osgi.wiring.package">
-      <attribute name="osgi.wiring.package" value="org.apache.commons.lang"/>
-      <attribute name="version" type="Version" value="2.4.0"/>
-      <attribute name="bundle-symbolic-name" value="org.apache.commons.lang"/>
-      <attribute name="bundle-version" type="Version" value="2.4.0"/>
-    </capability>
-    <requirement namespace="osgi.wiring.package">
-      <directive name="filter" value="(&amp;(osgi.wiring.package=org.apache.commons.lang)(version&gt;=2.4.0))"/>
-    </requirement>
-    <requirement namespace="osgi.wiring.package">
-      <directive name="filter" value="(&amp;(osgi.wiring.package=org.apache.commons.lang.builder)(version&gt;=2.4.0))"/>
-    </requirement>
-    <requirement namespace="osgi.wiring.package">
-      <directive name="filter" value="(&amp;(osgi.wiring.package=org.apache.commons.lang.enum)(version&gt;=2.4.0))"/>
-    </requirement>
-    <requirement namespace="osgi.wiring.package">
-      <directive name="filter" value="(&amp;(osgi.wiring.package=org.apache.commons.lang.enums)(version&gt;=2.4.0))"/>
-    </requirement>
-    <requirement namespace="osgi.wiring.package">
-      <directive name="filter" value="(&amp;(osgi.wiring.package=org.apache.commons.lang.exception)(version&gt;=2.4.0))"/>
-    </requirement>
-    <requirement namespace="osgi.wiring.package">
-      <directive name="filter" value="(&amp;(osgi.wiring.package=org.apache.commons.lang.math)(version&gt;=2.4.0))"/>
-    </requirement>
-    <requirement namespace="osgi.wiring.package">
-      <directive name="filter" value="(&amp;(osgi.wiring.package=org.apache.commons.lang.mutable)(version&gt;=2.4.0))"/>
-    </requirement>
-    <requirement namespace="osgi.wiring.package">
-      <directive name="filter" value="(&amp;(osgi.wiring.package=org.apache.commons.lang.text)(version&gt;=2.4.0))"/>
-    </requirement>
-    <requirement namespace="osgi.wiring.package">
-      <directive name="filter" value="(&amp;(osgi.wiring.package=org.apache.commons.lang.time)(version&gt;=2.4.0))"/>
-    </requirement>
-  </resource>
-  <resource>
-    <capability namespace="osgi.identity">
       <attribute name="osgi.identity" value="org.apache.felix.configadmin"/>
       <attribute name="type" value="osgi.bundle"/>
       <attribute name="version" type="Version" value="1.8.0"/>
@@ -8386,6 +8155,386 @@
   </resource>
   <resource>
     <capability namespace="osgi.identity">
+      <attribute name="osgi.identity" value="org.apache.velocity-dep"/>
+      <attribute name="type" value="osgi.bundle"/>
+      <attribute name="version" type="Version" value="1.7.0"/>
+    </capability>
+    <capability namespace="osgi.content">
+      <attribute name="osgi.content" value="a2d1ae01c93113c3345979413fb19f93d9ca26631d75bc2b610116e759bb71d8"/>
+      <attribute name="url" value="org.apache.velocity-dep/org.apache.velocity-dep-1.7.0.jar"/>
+      <attribute name="size" type="Long" value="806736"/>
+      <attribute name="mime" value="application/vnd.osgi.bundle"/>
+    </capability>
+    <capability namespace="osgi.wiring.bundle">
+      <attribute name="osgi.wiring.bundle" value="org.apache.velocity-dep"/>
+      <attribute name="bundle-version" type="Version" value="1.7.0"/>
+    </capability>
+    <capability namespace="osgi.wiring.host">
+      <attribute name="osgi.wiring.host" value="org.apache.velocity-dep"/>
+      <attribute name="bundle-version" type="Version" value="1.7.0"/>
+    </capability>
+    <capability namespace="osgi.wiring.package">
+      <attribute name="osgi.wiring.package" value="org.apache.commons.collections"/>
+      <attribute name="version" type="Version" value="0.0.0"/>
+      <attribute name="bundle-symbolic-name" value="org.apache.velocity-dep"/>
+      <attribute name="bundle-version" type="Version" value="1.7.0"/>
+    </capability>
+    <capability namespace="osgi.wiring.package">
+      <attribute name="osgi.wiring.package" value="org.apache.commons.collections.iterators"/>
+      <attribute name="version" type="Version" value="0.0.0"/>
+      <attribute name="bundle-symbolic-name" value="org.apache.velocity-dep"/>
+      <attribute name="bundle-version" type="Version" value="1.7.0"/>
+      <directive name="uses" value="org.apache.commons.collections"/>
+    </capability>
+    <capability namespace="osgi.wiring.package">
+      <attribute name="osgi.wiring.package" value="org.apache.commons.collections.map"/>
+      <attribute name="version" type="Version" value="0.0.0"/>
+      <attribute name="bundle-symbolic-name" value="org.apache.velocity-dep"/>
+      <attribute name="bundle-version" type="Version" value="1.7.0"/>
+      <directive name="uses" value="org.apache.commons.collections"/>
+    </capability>
+    <capability namespace="osgi.wiring.package">
+      <attribute name="osgi.wiring.package" value="org.apache.commons.lang"/>
+      <attribute name="version" type="Version" value="0.0.0"/>
+      <attribute name="bundle-symbolic-name" value="org.apache.velocity-dep"/>
+      <attribute name="bundle-version" type="Version" value="1.7.0"/>
+      <directive name="uses" value="org.apache.commons.lang.exception"/>
+    </capability>
+    <capability namespace="osgi.wiring.package">
+      <attribute name="osgi.wiring.package" value="org.apache.commons.lang.builder"/>
+      <attribute name="version" type="Version" value="0.0.0"/>
+      <attribute name="bundle-symbolic-name" value="org.apache.velocity-dep"/>
+      <attribute name="bundle-version" type="Version" value="1.7.0"/>
+    </capability>
+    <capability namespace="osgi.wiring.package">
+      <attribute name="osgi.wiring.package" value="org.apache.commons.lang.enum"/>
+      <attribute name="version" type="Version" value="0.0.0"/>
+      <attribute name="bundle-symbolic-name" value="org.apache.velocity-dep"/>
+      <attribute name="bundle-version" type="Version" value="1.7.0"/>
+    </capability>
+    <capability namespace="osgi.wiring.package">
+      <attribute name="osgi.wiring.package" value="org.apache.commons.lang.enums"/>
+      <attribute name="version" type="Version" value="0.0.0"/>
+      <attribute name="bundle-symbolic-name" value="org.apache.velocity-dep"/>
+      <attribute name="bundle-version" type="Version" value="1.7.0"/>
+    </capability>
+    <capability namespace="osgi.wiring.package">
+      <attribute name="osgi.wiring.package" value="org.apache.commons.lang.exception"/>
+      <attribute name="version" type="Version" value="0.0.0"/>
+      <attribute name="bundle-symbolic-name" value="org.apache.velocity-dep"/>
+      <attribute name="bundle-version" type="Version" value="1.7.0"/>
+    </capability>
+    <capability namespace="osgi.wiring.package">
+      <attribute name="osgi.wiring.package" value="org.apache.commons.lang.math"/>
+      <attribute name="version" type="Version" value="0.0.0"/>
+      <attribute name="bundle-symbolic-name" value="org.apache.velocity-dep"/>
+      <attribute name="bundle-version" type="Version" value="1.7.0"/>
+    </capability>
+    <capability namespace="osgi.wiring.package">
+      <attribute name="osgi.wiring.package" value="org.apache.commons.lang.mutable"/>
+      <attribute name="version" type="Version" value="0.0.0"/>
+      <attribute name="bundle-symbolic-name" value="org.apache.velocity-dep"/>
+      <attribute name="bundle-version" type="Version" value="1.7.0"/>
+    </capability>
+    <capability namespace="osgi.wiring.package">
+      <attribute name="osgi.wiring.package" value="org.apache.commons.lang.text"/>
+      <attribute name="version" type="Version" value="0.0.0"/>
+      <attribute name="bundle-symbolic-name" value="org.apache.velocity-dep"/>
+      <attribute name="bundle-version" type="Version" value="1.7.0"/>
+    </capability>
+    <capability namespace="osgi.wiring.package">
+      <attribute name="osgi.wiring.package" value="org.apache.commons.lang.time"/>
+      <attribute name="version" type="Version" value="0.0.0"/>
+      <attribute name="bundle-symbolic-name" value="org.apache.velocity-dep"/>
+      <attribute name="bundle-version" type="Version" value="1.7.0"/>
+    </capability>
+    <capability namespace="osgi.wiring.package">
+      <attribute name="osgi.wiring.package" value="org.apache.oro.io"/>
+      <attribute name="version" type="Version" value="0.0.0"/>
+      <attribute name="bundle-symbolic-name" value="org.apache.velocity-dep"/>
+      <attribute name="bundle-version" type="Version" value="1.7.0"/>
+      <directive name="uses" value="org.apache.oro.text,org.apache.oro.text.regex"/>
+    </capability>
+    <capability namespace="osgi.wiring.package">
+      <attribute name="osgi.wiring.package" value="org.apache.oro.text"/>
+      <attribute name="version" type="Version" value="0.0.0"/>
+      <attribute name="bundle-symbolic-name" value="org.apache.velocity-dep"/>
+      <attribute name="bundle-version" type="Version" value="1.7.0"/>
+      <directive name="uses" value="org.apache.oro.text.regex,org.apache.oro.util"/>
+    </capability>
+    <capability namespace="osgi.wiring.package">
+      <attribute name="osgi.wiring.package" value="org.apache.oro.text.awk"/>
+      <attribute name="version" type="Version" value="0.0.0"/>
+      <attribute name="bundle-symbolic-name" value="org.apache.velocity-dep"/>
+      <attribute name="bundle-version" type="Version" value="1.7.0"/>
+      <directive name="uses" value="org.apache.oro.text.regex"/>
+    </capability>
+    <capability namespace="osgi.wiring.package">
+      <attribute name="osgi.wiring.package" value="org.apache.oro.text.perl"/>
+      <attribute name="version" type="Version" value="0.0.0"/>
+      <attribute name="bundle-symbolic-name" value="org.apache.velocity-dep"/>
+      <attribute name="bundle-version" type="Version" value="1.7.0"/>
+      <directive name="uses" value="org.apache.oro.text,org.apache.oro.text.regex"/>
+    </capability>
+    <capability namespace="osgi.wiring.package">
+      <attribute name="osgi.wiring.package" value="org.apache.oro.text.regex"/>
+      <attribute name="version" type="Version" value="0.0.0"/>
+      <attribute name="bundle-symbolic-name" value="org.apache.velocity-dep"/>
+      <attribute name="bundle-version" type="Version" value="1.7.0"/>
+    </capability>
+    <capability namespace="osgi.wiring.package">
+      <attribute name="osgi.wiring.package" value="org.apache.oro.util"/>
+      <attribute name="version" type="Version" value="0.0.0"/>
+      <attribute name="bundle-symbolic-name" value="org.apache.velocity-dep"/>
+      <attribute name="bundle-version" type="Version" value="1.7.0"/>
+    </capability>
+    <capability namespace="osgi.wiring.package">
+      <attribute name="osgi.wiring.package" value="org.apache.velocity"/>
+      <attribute name="version" type="Version" value="0.0.0"/>
+      <attribute name="bundle-symbolic-name" value="org.apache.velocity-dep"/>
+      <attribute name="bundle-version" type="Version" value="1.7.0"/>
+      <directive name="uses" value="org.apache.velocity.context,org.apache.velocity.exception,org.apache.velocity.runtime.resource"/>
+    </capability>
+    <capability namespace="osgi.wiring.package">
+      <attribute name="osgi.wiring.package" value="org.apache.velocity.anakia"/>
+      <attribute name="version" type="Version" value="0.0.0"/>
+      <attribute name="bundle-symbolic-name" value="org.apache.velocity-dep"/>
+      <attribute name="bundle-version" type="Version" value="1.7.0"/>
+      <directive name="uses" value="com.werken.xpath,org.apache.tools.ant,org.apache.tools.ant.taskdefs,org.jdom,org.jdom.output"/>
+    </capability>
+    <capability namespace="osgi.wiring.package">
+      <attribute name="osgi.wiring.package" value="org.apache.velocity.app"/>
+      <attribute name="version" type="Version" value="0.0.0"/>
+      <attribute name="bundle-symbolic-name" value="org.apache.velocity-dep"/>
+      <attribute name="bundle-version" type="Version" value="1.7.0"/>
+      <directive name="uses" value="org.apache.commons.collections,org.apache.velocity,org.apache.velocity.context,org.apache.velocity.exception,org.apache.velocity.runtime,org.apache.velocity.runtime.log"/>
+    </capability>
+    <capability namespace="osgi.wiring.package">
+      <attribute name="osgi.wiring.package" value="org.apache.velocity.app.event"/>
+      <attribute name="version" type="Version" value="0.0.0"/>
+      <attribute name="bundle-symbolic-name" value="org.apache.velocity-dep"/>
+      <attribute name="bundle-version" type="Version" value="1.7.0"/>
+      <directive name="uses" value="org.apache.velocity.context,org.apache.velocity.runtime,org.apache.velocity.util.introspection"/>
+    </capability>
+    <capability namespace="osgi.wiring.package">
+      <attribute name="osgi.wiring.package" value="org.apache.velocity.app.event.implement"/>
+      <attribute name="version" type="Version" value="0.0.0"/>
+      <attribute name="bundle-symbolic-name" value="org.apache.velocity-dep"/>
+      <attribute name="bundle-version" type="Version" value="1.7.0"/>
+      <directive name="uses" value="org.apache.velocity.app.event,org.apache.velocity.context,org.apache.velocity.runtime,org.apache.velocity.util,org.apache.velocity.util.introspection"/>
+    </capability>
+    <capability namespace="osgi.wiring.package">
+      <attribute name="osgi.wiring.package" value="org.apache.velocity.app.tools"/>
+      <attribute name="version" type="Version" value="0.0.0"/>
+      <attribute name="bundle-symbolic-name" value="org.apache.velocity-dep"/>
+      <attribute name="bundle-version" type="Version" value="1.7.0"/>
+      <directive name="uses" value="org.apache.velocity.context"/>
+    </capability>
+    <capability namespace="osgi.wiring.package">
+      <attribute name="osgi.wiring.package" value="org.apache.velocity.context"/>
+      <attribute name="version" type="Version" value="0.0.0"/>
+      <attribute name="bundle-symbolic-name" value="org.apache.velocity-dep"/>
+      <attribute name="bundle-version" type="Version" value="1.7.0"/>
+      <directive name="uses" value="org.apache.velocity.app.event,org.apache.velocity.exception,org.apache.velocity.runtime,org.apache.velocity.runtime.parser.node,org.apache.velocity.runtime.resource,org.apache.velocity.util.introspection"/>
+    </capability>
+    <capability namespace="osgi.wiring.package">
+      <attribute name="osgi.wiring.package" value="org.apache.velocity.convert"/>
+      <attribute name="version" type="Version" value="0.0.0"/>
+      <attribute name="bundle-symbolic-name" value="org.apache.velocity-dep"/>
+      <attribute name="bundle-version" type="Version" value="1.7.0"/>
+    </capability>
+    <capability namespace="osgi.wiring.package">
+      <attribute name="osgi.wiring.package" value="org.apache.velocity.exception"/>
+      <attribute name="version" type="Version" value="0.0.0"/>
+      <attribute name="bundle-symbolic-name" value="org.apache.velocity-dep"/>
+      <attribute name="bundle-version" type="Version" value="1.7.0"/>
+      <directive name="uses" value="org.apache.velocity.runtime.parser,org.apache.velocity.util.introspection"/>
+    </capability>
+    <capability namespace="osgi.wiring.package">
+      <attribute name="osgi.wiring.package" value="org.apache.velocity.io"/>
+      <attribute name="version" type="Version" value="0.0.0"/>
+      <attribute name="bundle-symbolic-name" value="org.apache.velocity-dep"/>
+      <attribute name="bundle-version" type="Version" value="1.7.0"/>
+    </capability>
+    <capability namespace="osgi.wiring.package">
+      <attribute name="osgi.wiring.package" value="org.apache.velocity.runtime"/>
+      <attribute name="version" type="Version" value="0.0.0"/>
+      <attribute name="bundle-symbolic-name" value="org.apache.velocity-dep"/>
+      <attribute name="bundle-version" type="Version" value="1.7.0"/>
+      <directive name="uses" value="org.apache.commons.collections,org.apache.velocity,org.apache.velocity.app.event,org.apache.velocity.context,org.apache.velocity.exception,org.apache.velocity.runtime.directive,org.apache.velocity.runtime.log,org.apache.velocity.runtime.parser,org.apache.velocity.runtime.parser.node,org.apache.velocity.runtime.resource,org.apache.velocity.util.introspection"/>
+    </capability>
+    <capability namespace="osgi.wiring.package">
+      <attribute name="osgi.wiring.package" value="org.apache.velocity.runtime.defaults"/>
+      <attribute name="version" type="Version" value="0.0.0"/>
+      <attribute name="bundle-symbolic-name" value="org.apache.velocity-dep"/>
+      <attribute name="bundle-version" type="Version" value="1.7.0"/>
+    </capability>
+    <capability namespace="osgi.wiring.package">
+      <attribute name="osgi.wiring.package" value="org.apache.velocity.runtime.directive"/>
+      <attribute name="version" type="Version" value="0.0.0"/>
+      <attribute name="bundle-symbolic-name" value="org.apache.velocity-dep"/>
+      <attribute name="bundle-version" type="Version" value="1.7.0"/>
+      <directive name="uses" value="org.apache.velocity.context,org.apache.velocity.exception,org.apache.velocity.runtime,org.apache.velocity.runtime.parser,org.apache.velocity.runtime.parser.node"/>
+    </capability>
+    <capability namespace="osgi.wiring.package">
+      <attribute name="osgi.wiring.package" value="org.apache.velocity.runtime.log"/>
+      <attribute name="version" type="Version" value="0.0.0"/>
+      <attribute name="bundle-symbolic-name" value="org.apache.velocity-dep"/>
+      <attribute name="bundle-version" type="Version" value="1.7.0"/>
+      <directive name="uses" value="org.apache.log.format,org.apache.velocity.runtime,org.apache.velocity.runtime.directive,org.apache.velocity.runtime.parser.node,org.apache.velocity.util.introspection"/>
+    </capability>
+    <capability namespace="osgi.wiring.package">
+      <attribute name="osgi.wiring.package" value="org.apache.velocity.runtime.parser"/>
+      <attribute name="version" type="Version" value="0.0.0"/>
+      <attribute name="bundle-symbolic-name" value="org.apache.velocity-dep"/>
+      <attribute name="bundle-version" type="Version" value="1.7.0"/>
+      <directive name="uses" value="org.apache.velocity.exception,org.apache.velocity.runtime,org.apache.velocity.runtime.directive,org.apache.velocity.runtime.parser.node"/>
+    </capability>
+    <capability namespace="osgi.wiring.package">
+      <attribute name="osgi.wiring.package" value="org.apache.velocity.runtime.parser.node"/>
+      <attribute name="version" type="Version" value="0.0.0"/>
+      <attribute name="bundle-symbolic-name" value="org.apache.velocity-dep"/>
+      <attribute name="bundle-version" type="Version" value="1.7.0"/>
+      <directive name="uses" value="org.apache.commons.lang.text,org.apache.velocity.context,org.apache.velocity.exception,org.apache.velocity.runtime,org.apache.velocity.runtime.log,org.apache.velocity.runtime.parser,org.apache.velocity.util.introspection"/>
+    </capability>
+    <capability namespace="osgi.wiring.package">
+      <attribute name="osgi.wiring.package" value="org.apache.velocity.runtime.resource"/>
+      <attribute name="version" type="Version" value="0.0.0"/>
+      <attribute name="bundle-symbolic-name" value="org.apache.velocity-dep"/>
+      <attribute name="bundle-version" type="Version" value="1.7.0"/>
+      <directive name="uses" value="org.apache.velocity.exception,org.apache.velocity.runtime,org.apache.velocity.runtime.resource.loader"/>
+    </capability>
+    <capability namespace="osgi.wiring.package">
+      <attribute name="osgi.wiring.package" value="org.apache.velocity.runtime.resource.loader"/>
+      <attribute name="version" type="Version" value="0.0.0"/>
+      <attribute name="bundle-symbolic-name" value="org.apache.velocity-dep"/>
+      <attribute name="bundle-version" type="Version" value="1.7.0"/>
+      <directive name="uses" value="javax.sql,org.apache.commons.collections,org.apache.velocity.exception,org.apache.velocity.runtime,org.apache.velocity.runtime.resource,org.apache.velocity.runtime.resource.util"/>
+    </capability>
+    <capability namespace="osgi.wiring.package">
+      <attribute name="osgi.wiring.package" value="org.apache.velocity.runtime.resource.util"/>
+      <attribute name="version" type="Version" value="0.0.0"/>
+      <attribute name="bundle-symbolic-name" value="org.apache.velocity-dep"/>
+      <attribute name="bundle-version" type="Version" value="1.7.0"/>
+    </capability>
+    <capability namespace="osgi.wiring.package">
+      <attribute name="osgi.wiring.package" value="org.apache.velocity.runtime.visitor"/>
+      <attribute name="version" type="Version" value="0.0.0"/>
+      <attribute name="bundle-symbolic-name" value="org.apache.velocity-dep"/>
+      <attribute name="bundle-version" type="Version" value="1.7.0"/>
+      <directive name="uses" value="org.apache.velocity.context,org.apache.velocity.runtime.parser.node"/>
+    </capability>
+    <capability namespace="osgi.wiring.package">
+      <attribute name="osgi.wiring.package" value="org.apache.velocity.servlet"/>
+      <attribute name="version" type="Version" value="0.0.0"/>
+      <attribute name="bundle-symbolic-name" value="org.apache.velocity-dep"/>
+      <attribute name="bundle-version" type="Version" value="1.7.0"/>
+      <directive name="uses" value="javax.servlet,javax.servlet.http,org.apache.velocity,org.apache.velocity.context,org.apache.velocity.exception"/>
+    </capability>
+    <capability namespace="osgi.wiring.package">
+      <attribute name="osgi.wiring.package" value="org.apache.velocity.texen"/>
+      <attribute name="version" type="Version" value="0.0.0"/>
+      <attribute name="bundle-symbolic-name" value="org.apache.velocity-dep"/>
+      <attribute name="bundle-version" type="Version" value="1.7.0"/>
+      <directive name="uses" value="org.apache.velocity,org.apache.velocity.app,org.apache.velocity.context"/>
+    </capability>
+    <capability namespace="osgi.wiring.package">
+      <attribute name="osgi.wiring.package" value="org.apache.velocity.texen.ant"/>
+      <attribute name="version" type="Version" value="0.0.0"/>
+      <attribute name="bundle-symbolic-name" value="org.apache.velocity-dep"/>
+      <attribute name="bundle-version" type="Version" value="1.7.0"/>
+      <directive name="uses" value="org.apache.commons.collections,org.apache.tools.ant,org.apache.velocity.context"/>
+    </capability>
+    <capability namespace="osgi.wiring.package">
+      <attribute name="osgi.wiring.package" value="org.apache.velocity.texen.defaults"/>
+      <attribute name="version" type="Version" value="0.0.0"/>
+      <attribute name="bundle-symbolic-name" value="org.apache.velocity-dep"/>
+      <attribute name="bundle-version" type="Version" value="1.7.0"/>
+    </capability>
+    <capability namespace="osgi.wiring.package">
+      <attribute name="osgi.wiring.package" value="org.apache.velocity.texen.util"/>
+      <attribute name="version" type="Version" value="0.0.0"/>
+      <attribute name="bundle-symbolic-name" value="org.apache.velocity-dep"/>
+      <attribute name="bundle-version" type="Version" value="1.7.0"/>
+    </capability>
+    <capability namespace="osgi.wiring.package">
+      <attribute name="osgi.wiring.package" value="org.apache.velocity.util"/>
+      <attribute name="version" type="Version" value="0.0.0"/>
+      <attribute name="bundle-symbolic-name" value="org.apache.velocity-dep"/>
+      <attribute name="bundle-version" type="Version" value="1.7.0"/>
+      <directive name="uses" value="org.apache.velocity.context,org.apache.velocity.runtime,org.apache.velocity.runtime.parser.node,org.apache.velocity.util.introspection"/>
+    </capability>
+    <capability namespace="osgi.wiring.package">
+      <attribute name="osgi.wiring.package" value="org.apache.velocity.util.introspection"/>
+      <attribute name="version" type="Version" value="0.0.0"/>
+      <attribute name="bundle-symbolic-name" value="org.apache.velocity-dep"/>
+      <attribute name="bundle-version" type="Version" value="1.7.0"/>
+      <directive name="uses" value="org.apache.velocity.runtime,org.apache.velocity.runtime.log,org.apache.velocity.runtime.parser.node,org.apache.velocity.util"/>
+    </capability>
+    <requirement namespace="osgi.wiring.package">
+      <directive name="filter" value="(osgi.wiring.package=com.werken.xpath)"/>
+      <directive name="resolution" value="optional"/>
+    </requirement>
+    <requirement namespace="osgi.wiring.package">
+      <directive name="filter" value="(osgi.wiring.package=javax.naming)"/>
+    </requirement>
+    <requirement namespace="osgi.wiring.package">
+      <directive name="filter" value="(osgi.wiring.package=javax.servlet)"/>
+      <directive name="resolution" value="optional"/>
+    </requirement>
+    <requirement namespace="osgi.wiring.package">
+      <directive name="filter" value="(osgi.wiring.package=javax.servlet.http)"/>
+      <directive name="resolution" value="optional"/>
+    </requirement>
+    <requirement namespace="osgi.wiring.package">
+      <directive name="filter" value="(osgi.wiring.package=javax.sql)"/>
+    </requirement>
+    <requirement namespace="osgi.wiring.package">
+      <directive name="filter" value="(osgi.wiring.package=org.apache.commons.logging)"/>
+      <directive name="resolution" value="optional"/>
+    </requirement>
+    <requirement namespace="osgi.wiring.package">
+      <directive name="filter" value="(osgi.wiring.package=org.apache.log)"/>
+      <directive name="resolution" value="optional"/>
+    </requirement>
+    <requirement namespace="osgi.wiring.package">
+      <directive name="filter" value="(osgi.wiring.package=org.apache.log.format)"/>
+      <directive name="resolution" value="optional"/>
+    </requirement>
+    <requirement namespace="osgi.wiring.package">
+      <directive name="filter" value="(osgi.wiring.package=org.apache.log.output.io)"/>
+      <directive name="resolution" value="optional"/>
+    </requirement>
+    <requirement namespace="osgi.wiring.package">
+      <directive name="filter" value="(osgi.wiring.package=org.apache.log4j)"/>
+      <directive name="resolution" value="optional"/>
+    </requirement>
+    <requirement namespace="osgi.wiring.package">
+      <directive name="filter" value="(osgi.wiring.package=org.apache.tools.ant)"/>
+      <directive name="resolution" value="optional"/>
+    </requirement>
+    <requirement namespace="osgi.wiring.package">
+      <directive name="filter" value="(osgi.wiring.package=org.apache.tools.ant.taskdefs)"/>
+      <directive name="resolution" value="optional"/>
+    </requirement>
+    <requirement namespace="osgi.wiring.package">
+      <directive name="filter" value="(osgi.wiring.package=org.jdom)"/>
+      <directive name="resolution" value="optional"/>
+    </requirement>
+    <requirement namespace="osgi.wiring.package">
+      <directive name="filter" value="(osgi.wiring.package=org.jdom.input)"/>
+      <directive name="resolution" value="optional"/>
+    </requirement>
+    <requirement namespace="osgi.wiring.package">
+      <directive name="filter" value="(osgi.wiring.package=org.jdom.output)"/>
+      <directive name="resolution" value="optional"/>
+    </requirement>
+    <requirement namespace="osgi.wiring.package">
+      <directive name="filter" value="(osgi.wiring.package=org.xml.sax)"/>
+    </requirement>
+  </resource>
+  <resource>
+    <capability namespace="osgi.identity">
       <attribute name="osgi.identity" value="org.mockito.mockito-all"/>
       <attribute name="type" value="osgi.bundle"/>
       <attribute name="version" type="Version" value="1.9.0"/>
diff --git a/cnf/localrepo/index.xml.sha b/cnf/localrepo/index.xml.sha
index a2da6c5..754c52c 100644
--- a/cnf/localrepo/index.xml.sha
+++ b/cnf/localrepo/index.xml.sha
@@ -1 +1 @@
-9f55200dab88670ffa750a9152fe96ca89b17362c17d453a9f0d417afdd47442
\ No newline at end of file
+1010768cf3ae35614a904dc32c127c7485e37690275337838a59a2f04f87b5a4
\ No newline at end of file
diff --git a/cnf/localrepo/org.apache.commons.collections/org.apache.commons.collections-3.2.1.jar b/cnf/localrepo/org.apache.commons.collections/org.apache.commons.collections-3.2.1.jar
deleted file mode 100644
index c35fa1f..0000000
--- a/cnf/localrepo/org.apache.commons.collections/org.apache.commons.collections-3.2.1.jar
+++ /dev/null
Binary files differ
diff --git a/cnf/localrepo/org.apache.commons.lang/org.apache.commons.lang-2.4.0.jar b/cnf/localrepo/org.apache.commons.lang/org.apache.commons.lang-2.4.0.jar
deleted file mode 100644
index 532939e..0000000
--- a/cnf/localrepo/org.apache.commons.lang/org.apache.commons.lang-2.4.0.jar
+++ /dev/null
Binary files differ
diff --git a/cnf/localrepo/org.apache.velocity-dep/org.apache.velocity-dep-1.7.0.jar b/cnf/localrepo/org.apache.velocity-dep/org.apache.velocity-dep-1.7.0.jar
new file mode 100644
index 0000000..c99aecf
--- /dev/null
+++ b/cnf/localrepo/org.apache.velocity-dep/org.apache.velocity-dep-1.7.0.jar
Binary files differ
diff --git a/org.apache.ace.agent.itest/src/org/apache/ace/agent/itest/AgentExtensionTest.java b/org.apache.ace.agent.itest/src/org/apache/ace/agent/itest/AgentExtensionTest.java
index 8a91427..02688b2 100644
--- a/org.apache.ace.agent.itest/src/org/apache/ace/agent/itest/AgentExtensionTest.java
+++ b/org.apache.ace.agent.itest/src/org/apache/ace/agent/itest/AgentExtensionTest.java
@@ -23,7 +23,6 @@
 import java.net.URLConnection;
 import java.util.Dictionary;
 import java.util.Hashtable;
-import java.util.Properties;
 
 import org.apache.ace.agent.AgentConstants;
 import org.apache.ace.agent.AgentControl;
diff --git a/org.apache.ace.client.automation/src/org/apache/ace/client/automation/AutoTargetOperator.java b/org.apache.ace.client.automation/src/org/apache/ace/client/automation/AutoTargetOperator.java
index 5b39ae9..865d8df 100644
--- a/org.apache.ace.client.automation/src/org/apache/ace/client/automation/AutoTargetOperator.java
+++ b/org.apache.ace.client.automation/src/org/apache/ace/client/automation/AutoTargetOperator.java
@@ -23,7 +23,6 @@
 import java.util.Dictionary;
 import java.util.Hashtable;
 import java.util.List;
-import java.util.Properties;
 
 import org.apache.ace.client.repository.RepositoryAdmin;
 import org.apache.ace.client.repository.RepositoryAdminLoginContext;
diff --git a/org.apache.ace.client.repository.itest/src/org/apache/ace/it/repositoryadmin/BaseRepositoryAdminTest.java b/org.apache.ace.client.repository.itest/src/org/apache/ace/it/repositoryadmin/BaseRepositoryAdminTest.java
index 26e6f15..9c533f9 100644
--- a/org.apache.ace.client.repository.itest/src/org/apache/ace/it/repositoryadmin/BaseRepositoryAdminTest.java
+++ b/org.apache.ace.client.repository.itest/src/org/apache/ace/it/repositoryadmin/BaseRepositoryAdminTest.java
@@ -162,7 +162,7 @@
         props.put("factory.instance.pid", instanceName);
         Configuration config = m_configAdmin.createFactoryConfiguration("org.apache.ace.server.repository.factory", null);
 
-        ServiceTracker tracker = new ServiceTracker(m_bundleContext, m_bundleContext.createFilter("(factory.instance.pid=" + instanceName + ")"), null);
+        ServiceTracker<?, ?> tracker = new ServiceTracker<>(m_bundleContext, m_bundleContext.createFilter("(factory.instance.pid=" + instanceName + ")"), null);
         tracker.open();
 
         config.update(props);
@@ -488,11 +488,9 @@
         if ((configs != null) && (configs.length > 0)) {
             final Semaphore sem = new Semaphore(0);
 
-            ServiceTracker tracker =
-                new ServiceTracker(m_bundleContext, m_bundleContext.createFilter("(" + Constants.OBJECTCLASS + "="
-                    + Repository.class.getName() + ")"), null) {
+            ServiceTracker<Repository, Repository> tracker = new ServiceTracker<Repository, Repository>(m_bundleContext, Repository.class, null) {
                     @Override
-                    public void removedService(ServiceReference reference, Object service) {
+                    public void removedService(ServiceReference<Repository> reference, Repository service) {
                         super.removedService(reference, service);
                         // config.length times two because the service tracker also sees added events for each instance
                         if (size() == 0) {
diff --git a/org.apache.ace.client.repository.itest/src/org/apache/ace/it/repositoryadmin/ClientAutomationTest.java b/org.apache.ace.client.repository.itest/src/org/apache/ace/it/repositoryadmin/ClientAutomationTest.java
index cfd643a..1a3ec7e 100644
--- a/org.apache.ace.client.repository.itest/src/org/apache/ace/it/repositoryadmin/ClientAutomationTest.java
+++ b/org.apache.ace.client.repository.itest/src/org/apache/ace/it/repositoryadmin/ClientAutomationTest.java
@@ -96,13 +96,13 @@
         int initRepoSize = m_statefulTargetRepository.get().size();
 
         // Get the processauditlog task and run it
-        ServiceTracker tracker = new ServiceTracker(m_bundleContext, m_bundleContext.createFilter("(&(" + Constants.OBJECTCLASS + "="
+        ServiceTracker<Runnable, Runnable> tracker = new ServiceTracker<Runnable, Runnable>(
+            m_bundleContext, m_bundleContext.createFilter("(&(" + Constants.OBJECTCLASS + "="
                 + Runnable.class.getName() + ")(" + SchedulerConstants.SCHEDULER_NAME_KEY + "="
                 + "org.apache.ace.client.processauditlog" + "))"), null);
         tracker.open();
 
-        final Runnable processAuditlog = (Runnable) tracker.waitForService(2000);
-
+        final Runnable processAuditlog = tracker.waitForService(2000);
         if (processAuditlog != null) {
             // commit should be called
             runAndWaitForEvent(new Callable<Object>() {
diff --git a/org.apache.ace.client.repository/bnd.bnd b/org.apache.ace.client.repository/bnd.bnd
index f9a8862..c862545 100644
--- a/org.apache.ace.client.repository/bnd.bnd
+++ b/org.apache.ace.client.repository/bnd.bnd
@@ -5,9 +5,7 @@
 	org.mockito.mockito-all,\
 	xpp3;version=1.1.4,\
 	xstream;version=1.2.2,\
-	velocity;version=1.6.2,\
-	org.apache.commons.lang;version=2.4.0,\
-	org.apache.commons.collections;version=3.2.1,\
+	org.apache.velocity-dep;version=1.7.0,\
 	org.apache.felix.dependencymanager,\
 	org.apache.felix.gogo.runtime,\
 	org.apache.ace.connectionfactory;version=latest,\
diff --git a/org.apache.ace.client.repository/helper.base.bnd b/org.apache.ace.client.repository/helper.base.bnd
index 280524d..485b9f0 100644
--- a/org.apache.ace.client.repository/helper.base.bnd
+++ b/org.apache.ace.client.repository/helper.base.bnd
@@ -1,4 +1,4 @@
-Private-Package: org.apache.commons.lang,\
+Private-Package: \
 	javax.xml.namespace,\
 	org.xmlpull.mxp1,\
 	org.xmlpull.mxp1_serializer,\
@@ -12,52 +12,9 @@
 	org.xmlpull.v1.util,\
 	org.xmlpull.v1.wrapper,\
 	org.xmlpull.v1.wrapper.classic,\
-	org.apache.velocity,\
-	org.apache.velocity.anakia,\
-	org.apache.velocity.app,\
-	org.apache.velocity.app.event,\
-	org.apache.velocity.app.event.implement,\
-	org.apache.velocity.app.tools,\
-	org.apache.velocity.context,\
-	org.apache.velocity.convert,\
-	org.apache.velocity.exception,\
-	org.apache.velocity.io,\
-	org.apache.velocity.runtime,\
-	org.apache.velocity.runtime.defaults,\
-	org.apache.velocity.runtime.directive,\
-	org.apache.velocity.runtime.log,\
-	org.apache.velocity.runtime.parser,\
-	org.apache.velocity.runtime.parser.node,\
-	org.apache.velocity.runtime.resource,\
-	org.apache.velocity.runtime.resource.loader,\
-	org.apache.velocity.runtime.resource.util,\
-	org.apache.velocity.runtime.visitor,\
-	org.apache.velocity.servlet,\
-	org.apache.velocity.texen,\
-	org.apache.velocity.texen.ant,\
-	org.apache.velocity.texen.defaults,\
-	org.apache.velocity.texen.util,\
-	org.apache.velocity.util,\
-	org.apache.velocity.util.introspection,\
-	org.apache.commons.lang.builder,\
-	org.apache.commons.lang.enums,\
-	org.apache.commons.lang.exception,\
-	org.apache.commons.lang.math,\
-	org.apache.commons.lang.mutable,\
-	org.apache.commons.lang.text,\
-	org.apache.commons.lang.time,\
-	org.apache.commons.collections,\
-	org.apache.commons.collections.bag,\
-	org.apache.commons.collections.bidimap,\
-	org.apache.commons.collections.buffer,\
-	org.apache.commons.collections.collection,\
-	org.apache.commons.collections.comparators,\
-	org.apache.commons.collections.functors,\
-	org.apache.commons.collections.iterators,\
-	org.apache.commons.collections.keyvalue,\
-	org.apache.commons.collections.list,\
-	org.apache.commons.collections.map,\
-	org.apache.commons.collections.set
+	org.apache.velocity.*,\
+	org.apache.commons.lang.*,\
+	org.apache.commons.collections.*
 Export-Package: org.apache.ace.client.repository.helper.base
 Import-Package: !javax.servlet,\
 	!javax.servlet.http,\
diff --git a/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/ArtifactRepositoryImpl.java b/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/ArtifactRepositoryImpl.java
index 5fab497..f373b96 100644
--- a/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/ArtifactRepositoryImpl.java
+++ b/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/ArtifactRepositoryImpl.java
@@ -25,7 +25,7 @@
 import java.net.URL;
 import java.net.URLConnection;
 import java.util.ArrayList;
-import java.util.Arrays;
+import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
@@ -200,29 +200,30 @@
         }
 
         // Get all published ArtifactRecognizers.
-        ServiceReference[] refs = null;
+        List<ServiceReference<ArtifactRecognizer>> refs = new ArrayList<>();
         try {
-            refs = m_context.getServiceReferences(ArtifactRecognizer.class.getName(), null);
+            Collection<ServiceReference<ArtifactRecognizer>> tmpRefs = m_context.getServiceReferences(ArtifactRecognizer.class, null);
+            refs.addAll(tmpRefs);
         }
         catch (InvalidSyntaxException e) {
             // We do not pass in a filter, so this should not happen.
             m_log.log(LogService.LOG_WARNING, "A null filter resulted in an InvalidSyntaxException from getServiceReferences.");
         }
 
-        if (refs == null) {
+        if (refs.isEmpty()) {
             throw new IllegalArgumentException("There are no artifact recognizers available.");
         }
 
         // Sort the references by service ranking.
-        Arrays.sort(refs, Collections.reverseOrder());
+        Collections.sort(refs, Collections.reverseOrder());
 
         ArtifactResource resource = convertToArtifactResource(url);
 
         // Check all referenced services to find one that matches our input.
         ArtifactRecognizer recognizer = null;
         String foundMimetype = null;
-        for (ServiceReference ref : refs) {
-            ArtifactRecognizer candidate = (ArtifactRecognizer) m_context.getService(ref);
+        for (ServiceReference<ArtifactRecognizer> ref : refs) {
+            ArtifactRecognizer candidate = m_context.getService(ref);
             try {
                 if (mimetype != null) {
                     if (candidate.canHandle(mimetype)) {
diff --git a/org.apache.ace.connectionfactory/src/org/apache/ace/connectionfactory/impl/Activator.java b/org.apache.ace.connectionfactory/src/org/apache/ace/connectionfactory/impl/Activator.java
index cc626d0..331dd03 100644
--- a/org.apache.ace.connectionfactory/src/org/apache/ace/connectionfactory/impl/Activator.java
+++ b/org.apache.ace.connectionfactory/src/org/apache/ace/connectionfactory/impl/Activator.java
@@ -21,7 +21,6 @@
 
 import java.util.Dictionary;
 import java.util.Hashtable;
-import java.util.Properties;
 
 import org.apache.ace.connectionfactory.ConnectionFactory;
 import org.osgi.framework.BundleActivator;
diff --git a/org.apache.ace.deployment.itest/src/org/apache/ace/it/deployment/DeploymentIntegrationTest.java b/org.apache.ace.deployment.itest/src/org/apache/ace/it/deployment/DeploymentIntegrationTest.java
index a055ef6..a85ba67 100644
--- a/org.apache.ace.deployment.itest/src/org/apache/ace/it/deployment/DeploymentIntegrationTest.java
+++ b/org.apache.ace.deployment.itest/src/org/apache/ace/it/deployment/DeploymentIntegrationTest.java
@@ -25,7 +25,6 @@
 import java.util.Dictionary;
 import java.util.Hashtable;
 import java.util.List;
-import java.util.Properties;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
 import java.util.concurrent.CopyOnWriteArrayList;
diff --git a/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/filebased/FileBasedProvider.java b/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/filebased/FileBasedProvider.java
index 2a08140..8587d56 100644
--- a/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/filebased/FileBasedProvider.java
+++ b/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/filebased/FileBasedProvider.java
@@ -183,7 +183,6 @@
      * returned. If there are no valid versions, return an empty list. If the target cannot be found, an
      * IllegalArgumentException is thrown. The list will be sorted on version.
      */
-    @SuppressWarnings("unchecked")
     public List<String> getVersions(String targetId) throws OverloadedException, IllegalArgumentException {
         try {
             int concurrentUsers = m_usageCounter.incrementAndGet();
diff --git a/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/repositorybased/RepositoryBasedProvider.java b/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/repositorybased/RepositoryBasedProvider.java
index 05e54a5..f586de1 100644
--- a/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/repositorybased/RepositoryBasedProvider.java
+++ b/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/repositorybased/RepositoryBasedProvider.java
@@ -211,7 +211,6 @@
         }
     }
 
-    @SuppressWarnings("unchecked")
     public List<String> getVersions(String targetId) throws OverloadedException, IllegalArgumentException, IOException {
         try {
             int concurrentUsers = m_usageCounter.incrementAndGet();
diff --git a/org.apache.ace.deployment/src/org/apache/ace/deployment/servlet/AgentDeploymentServlet.java b/org.apache.ace.deployment/src/org/apache/ace/deployment/servlet/AgentDeploymentServlet.java
index 23dd16b..d252e0d 100644
--- a/org.apache.ace.deployment/src/org/apache/ace/deployment/servlet/AgentDeploymentServlet.java
+++ b/org.apache.ace.deployment/src/org/apache/ace/deployment/servlet/AgentDeploymentServlet.java
@@ -293,7 +293,6 @@
         }
     }
 
-    @SuppressWarnings("unchecked")
     private List<Version> getVersionsFromOBR(URL obrBaseUrl, String agentID) throws XPathExpressionException, IOException {
         InputStream input = null;
         NodeList resources = getOBRNodeList(input);
diff --git a/org.apache.ace.http/src/org/apache/ace/http/listener/Activator.java b/org.apache.ace.http/src/org/apache/ace/http/listener/Activator.java
index 8d286cb..e569295 100644
--- a/org.apache.ace.http/src/org/apache/ace/http/listener/Activator.java
+++ b/org.apache.ace.http/src/org/apache/ace/http/listener/Activator.java
@@ -52,8 +52,8 @@
 public class Activator extends DependencyActivatorBase {
     private static final String INIT_PREFIX = "init.";
 
-    private final Set<ServiceReference> m_httpServices = new HashSet<ServiceReference>();
-    private final Map<ServiceReference, String> m_servlets = new HashMap<ServiceReference, String>();
+    private final Set<ServiceReference<HttpService>> m_httpServices = new HashSet<>();
+    private final Map<ServiceReference<Servlet>, String> m_servlets = new HashMap<>();
 
     private volatile LogService m_log; // injected
     private BundleContext m_context;
@@ -83,16 +83,16 @@
      * @param ref
      *            reference to the Servlet
      */
-    public synchronized void addServlet(ServiceReference ref) {
+    public synchronized void addServlet(ServiceReference<Servlet> ref) {
         // register servlet to all HttpServices
         String endpoint = (String) ref.getProperty(HttpConstants.ENDPOINT);
         m_servlets.put(ref, endpoint);
 
-        Servlet servlet = (Servlet) m_context.getService(ref);
+        Servlet servlet = m_context.getService(ref);
         Dictionary<String, Object> initParams = getInitParams(ref);
 
-        for (ServiceReference reference : m_httpServices) {
-            HttpService httpService = (HttpService) m_context.getService(reference);
+        for (ServiceReference<HttpService> reference : m_httpServices) {
+            HttpService httpService = m_context.getService(reference);
             try {
                 if ((httpService != null) && (endpoint != null) && (servlet != null)) {
                     httpService.registerServlet(endpoint, servlet, initParams, null);
@@ -123,7 +123,7 @@
      * @param ref
      *            reference to the Servlet
      */
-    public synchronized void changeServlet(ServiceReference ref) {
+    public synchronized void changeServlet(ServiceReference<Servlet> ref) {
         removeServlet(ref, m_servlets.get(ref));
         addServlet(ref);
     }
@@ -135,16 +135,16 @@
      * @param ref
      *            reference to the Servlet
      */
-    public synchronized void removeServlet(ServiceReference ref) {
+    public synchronized void removeServlet(ServiceReference<Servlet> ref) {
         // remove servlet from all HttpServices
         String endpoint = (String) ref.getProperty(HttpConstants.ENDPOINT);
         removeServlet(ref, endpoint);
     }
 
-    private void removeServlet(ServiceReference ref, String endpoint) {
+    private void removeServlet(ServiceReference<Servlet> ref, String endpoint) {
         m_servlets.remove(ref);
-        for (ServiceReference reference : m_httpServices) {
-            HttpService httpService = (HttpService) m_context.getService(reference);
+        for (ServiceReference<HttpService> reference : m_httpServices) {
+            HttpService httpService = m_context.getService(reference);
             if ((httpService != null) && (endpoint != null)) {
                 try {
                     httpService.unregister(endpoint);
@@ -163,11 +163,13 @@
      * @param ref
      *            reference to the Service
      */
-    public synchronized void addHttpService(ServiceReference ref, HttpService httpService) {
+    public synchronized void addHttpService(ServiceReference<HttpService> ref, HttpService httpService) {
         m_httpServices.add(ref);
+
         // register all servlets to this new HttpService
-        for (ServiceReference reference : m_servlets.keySet()) {
-            Servlet servlet = (Servlet) m_context.getService(reference);
+        for (ServiceReference<Servlet> reference : m_servlets.keySet()) {
+            Servlet servlet = m_context.getService(reference);
+
             String endpoint = (String) reference.getProperty(HttpConstants.ENDPOINT);
             if ((servlet != null) && (endpoint != null)) {
                 Dictionary<String, Object> initParams = getInitParams(reference);
@@ -197,8 +199,8 @@
 
     @Override
     public synchronized void destroy(BundleContext context, DependencyManager arg1) throws Exception {
-        for (ServiceReference httpRef : m_httpServices) {
-            HttpService httpService = (HttpService) m_context.getService(httpRef);
+        for (ServiceReference<HttpService> httpRef : m_httpServices) {
+            HttpService httpService = m_context.getService(httpRef);
             if (httpService != null) {
                 unregisterEndpoints(httpService);
             }
diff --git a/org.apache.ace.http/src/org/apache/ace/http/redirector/RedirectServlet.java b/org.apache.ace.http/src/org/apache/ace/http/redirector/RedirectServlet.java
index aa40ae6..750eaff 100644
--- a/org.apache.ace.http/src/org/apache/ace/http/redirector/RedirectServlet.java
+++ b/org.apache.ace.http/src/org/apache/ace/http/redirector/RedirectServlet.java
@@ -38,7 +38,9 @@
 	private static final long serialVersionUID = -2218040475620089019L;
 	public static final String REDIRECT_URL_KEY = "org.apache.ace.webui.vaadin.redirect";
     private final Object LOCK = new Object();
-    private volatile ServiceRegistration m_registration;
+    
+    private volatile ServiceRegistration<?> m_registration;
+    
     private String m_redirectURL;
     private String m_sourceURL;
     
@@ -63,7 +65,7 @@
         }
     }
     
-    public void update(Dictionary properties) throws ConfigurationException {
+    public void update(Dictionary<String, ?> properties) throws ConfigurationException {
         setup(properties);
         m_registration.setProperties(properties);
     }
diff --git a/org.apache.ace.log/src/org/apache/ace/log/listener/Activator.java b/org.apache.ace.log/src/org/apache/ace/log/listener/Activator.java
index cc47ce1..c714270 100644
--- a/org.apache.ace.log/src/org/apache/ace/log/listener/Activator.java
+++ b/org.apache.ace.log/src/org/apache/ace/log/listener/Activator.java
@@ -27,28 +27,24 @@
 import org.osgi.service.event.EventConstants;
 import org.osgi.service.event.EventHandler;
 import org.osgi.util.tracker.ServiceTracker;
-import org.osgi.util.tracker.ServiceTrackerCustomizer;
 
 /**
- * Activator for the bundle that listens to all life-cycle events, and logs them to the
- * log service. The BundleEvents, FrameworkEvents and the events related to
- * Deployment Packages are relevant for the audit log.
+ * Activator for the bundle that listens to all life-cycle events, and logs them to the log service. The BundleEvents,
+ * FrameworkEvents and the events related to Deployment Packages are relevant for the audit log.
  * <p>
- * Furthermore this bundle takes care of the situation when the real log is not
- * yet available within the framework, by using a cache that temporarily stores the
- * log entries, and flushing those when the real log service comes up.
- * BundleEvents and Framework events are always available, but events related to
- * Deployment Packages will only be available when the EventAdmin is present.
+ * Furthermore this bundle takes care of the situation when the real log is not yet available within the framework, by
+ * using a cache that temporarily stores the log entries, and flushing those when the real log service comes up.
+ * BundleEvents and Framework events are always available, but events related to Deployment Packages will only be
+ * available when the EventAdmin is present.
  */
 public class Activator implements BundleActivator {
-
     private static final String LOG_NAME = "auditlog";
 
-    private final static String [] topics = new String[] { "org/osgi/service/deployment/*", "org/apache/ace/deployment/*" };
-    private ServiceTracker m_logTracker;
+    private final static String[] topics = new String[] { "org/osgi/service/deployment/*", "org/apache/ace/deployment/*" };
+    private ServiceTracker<Log, Log> m_logTracker;
     private ListenerImpl m_listener;
 
-    public synchronized void start(BundleContext context) throws Exception {
+    public void start(BundleContext context) throws Exception {
         LogProxy logProxy = new LogProxy();
         m_listener = new ListenerImpl(context, logProxy);
         m_listener.startInternal();
@@ -62,16 +58,16 @@
         context.registerService(EventHandler.class.getName(), m_listener, dict);
 
         // keep track of when the real log is available
-        ServiceTrackerCustomizer logTrackerCust = new LogTracker(context, logProxy);
-        m_logTracker = new ServiceTracker(context, context.createFilter("(&(" + Constants.OBJECTCLASS + "=" + Log.class.getName() + ")(name=" + LOG_NAME + "))"), logTrackerCust);
+        LogTracker logTrackerCust = new LogTracker(context, logProxy);
+        m_logTracker = new ServiceTracker<>(context, context.createFilter("(&(" + Constants.OBJECTCLASS + "=" + Log.class.getName() + ")(name=" + LOG_NAME + "))"), logTrackerCust);
         m_logTracker.open();
     }
 
-    public synchronized void stop(BundleContext context) throws Exception {
+    public void stop(BundleContext context) throws Exception {
         // cleanup
         m_logTracker.close();
         context.removeFrameworkListener(m_listener);
         context.removeBundleListener(m_listener);
         m_listener.stopInternal();
     }
-}
\ No newline at end of file
+}
diff --git a/org.apache.ace.log/src/org/apache/ace/log/listener/ListenerImpl.java b/org.apache.ace.log/src/org/apache/ace/log/listener/ListenerImpl.java
index bebf8ca..4f5a890 100644
--- a/org.apache.ace.log/src/org/apache/ace/log/listener/ListenerImpl.java
+++ b/org.apache.ace.log/src/org/apache/ace/log/listener/ListenerImpl.java
@@ -229,9 +229,9 @@
                         String deplPackName = (String) event.getProperty("deploymentpackage.name");
 
                         // to retrieve the version, DeploymentAdmin has to be used
-                        ServiceReference ref = m_context.getServiceReference(DeploymentAdmin.class.getName());
+                        ServiceReference<DeploymentAdmin> ref = m_context.getServiceReference(DeploymentAdmin.class);
                         if (ref != null) {
-                            DeploymentAdmin deplAdmin = (DeploymentAdmin) m_context.getService(ref);
+                            DeploymentAdmin deplAdmin = m_context.getService(ref);
                             if (deplAdmin != null) {
                                 DeploymentPackage dp = deplAdmin.getDeploymentPackage(deplPackName);
                                 if (dp != null) {
diff --git a/org.apache.ace.log/src/org/apache/ace/log/listener/LogTracker.java b/org.apache.ace.log/src/org/apache/ace/log/listener/LogTracker.java
index 8dde9c4..9512837 100644
--- a/org.apache.ace.log/src/org/apache/ace/log/listener/LogTracker.java
+++ b/org.apache.ace.log/src/org/apache/ace/log/listener/LogTracker.java
@@ -24,13 +24,11 @@
 import org.osgi.util.tracker.ServiceTrackerCustomizer;
 
 /**
- * Keep track of whether the log is available. If available, use the real log,
- * else use the cache version. When the real log becomes available, flush all events
- * from the cache to the real log.
+ * Keep track of whether the log is available. If available, use the real log, else use the cache version. When the real
+ * log becomes available, flush all events from the cache to the real log.
  *
  */
-public class LogTracker implements ServiceTrackerCustomizer {
-
+public class LogTracker implements ServiceTrackerCustomizer<Log, Log> {
     private BundleContext m_context;
     private LogProxy m_proxy;
 
@@ -40,31 +38,32 @@
     }
 
     /**
-     * Called when the log service has been added. As result, the real
-     * log service will be used instead of the cache.
+     * Called when the log service has been added. As result, the real log service will be used instead of the cache.
      */
-    public Object addingService(ServiceReference ref) {
+    @Override
+    public Log addingService(ServiceReference<Log> ref) {
         // get the service based upon the reference, and return it
         // make sure the real Log will be used, and all events in the
         // cache are being flushed to the real Log.
-        Log externalLog = (Log) m_context.getService(ref);
+        Log externalLog = m_context.getService(ref);
         m_proxy.setLog(externalLog);
         return externalLog;
     }
 
     /**
-     * Called when the Log service is not available anymore. As result,
-     * the cache version of the Log will be used until the Log
-     * service is added again.
+     * Called when the Log service is not available anymore. As result, the cache version of the Log will be used until
+     * the Log service is added again.
      */
-    public void removedService(ServiceReference ref, Object log) {
+    @Override
+    public void removedService(ServiceReference<Log> ref, Log log) {
         // make sure the LogCache is used instead of the real Log
         m_proxy.setLog(null);
         // unget the service again
         m_context.ungetService(ref);
     }
 
-    public void modifiedService(ServiceReference ref, Object log) {
+    @Override
+    public void modifiedService(ServiceReference<Log> ref, Log log) {
         // do nothing
     }
-}
\ No newline at end of file
+}
diff --git a/org.apache.ace.processlauncher.itest/src/org/apache/ace/processlauncher/itest/ProcessLauncherRespawnIntegrationTest.java b/org.apache.ace.processlauncher.itest/src/org/apache/ace/processlauncher/itest/ProcessLauncherRespawnIntegrationTest.java
index 08a433f..aaa200a 100644
--- a/org.apache.ace.processlauncher.itest/src/org/apache/ace/processlauncher/itest/ProcessLauncherRespawnIntegrationTest.java
+++ b/org.apache.ace.processlauncher.itest/src/org/apache/ace/processlauncher/itest/ProcessLauncherRespawnIntegrationTest.java
@@ -269,13 +269,13 @@
      *         obtained.
      */
     private ConfigurationAdmin getConfigAdmin() {
-        ServiceTracker serviceTracker = new ServiceTracker(m_context, ConfigurationAdmin.class.getName(), null);
+        ServiceTracker<ConfigurationAdmin, ConfigurationAdmin> serviceTracker = new ServiceTracker<>(m_context, ConfigurationAdmin.class, null);
 
         ConfigurationAdmin instance = null;
 
         serviceTracker.open();
         try {
-            instance = (ConfigurationAdmin) serviceTracker.waitForService(2 * 1000);
+            instance = serviceTracker.waitForService(2 * 1000);
 
             if (instance == null) {
                 fail("ConfigurationAdmin service not found!");
diff --git a/org.apache.ace.processlauncher.itest/src/org/apache/ace/processlauncher/itest/ProcessLauncherServiceIntegrationTest.java b/org.apache.ace.processlauncher.itest/src/org/apache/ace/processlauncher/itest/ProcessLauncherServiceIntegrationTest.java
index 6bce46e..c46a26e 100644
--- a/org.apache.ace.processlauncher.itest/src/org/apache/ace/processlauncher/itest/ProcessLauncherServiceIntegrationTest.java
+++ b/org.apache.ace.processlauncher.itest/src/org/apache/ace/processlauncher/itest/ProcessLauncherServiceIntegrationTest.java
@@ -313,13 +313,13 @@
      *         obtained.
      */
     private ConfigurationAdmin getConfigAdmin() {
-        ServiceTracker serviceTracker = new ServiceTracker(m_context, ConfigurationAdmin.class.getName(), null);
+        ServiceTracker<ConfigurationAdmin, ConfigurationAdmin> serviceTracker = new ServiceTracker<>(m_context, ConfigurationAdmin.class, null);
 
         ConfigurationAdmin instance = null;
 
         serviceTracker.open();
         try {
-            instance = (ConfigurationAdmin) serviceTracker.waitForService(2 * 1000);
+            instance = serviceTracker.waitForService(2 * 1000);
 
             if (instance == null) {
                 fail("ConfigurationAdmin service not found!");
diff --git a/org.apache.ace.repository.itest/src/org/apache/ace/it/repository/RepositoryTest.java b/org.apache.ace.repository.itest/src/org/apache/ace/it/repository/RepositoryTest.java
index 70e200d..38e7df2 100644
--- a/org.apache.ace.repository.itest/src/org/apache/ace/it/repository/RepositoryTest.java
+++ b/org.apache.ace.repository.itest/src/org/apache/ace/it/repository/RepositoryTest.java
@@ -36,7 +36,6 @@
 import org.apache.ace.it.IntegrationTestBase;
 import org.apache.ace.repository.Repository;
 import org.apache.ace.test.constants.TestConstants;
-import org.osgi.framework.Constants;
 import org.osgi.framework.InvalidSyntaxException;
 import org.osgi.framework.ServiceReference;
 import org.osgi.service.cm.Configuration;
@@ -221,7 +220,7 @@
 
     /* Configure a new repository instance */
     private void addRepository(String instanceName, String customer, String name, String basedir, String fileextension, String initial, boolean isMaster) throws IOException, InterruptedException, InvalidSyntaxException {
-        ServiceTracker tracker = new ServiceTracker(m_bundleContext, m_bundleContext.createFilter("(factory.instance.pid=" + instanceName + ")"), null);
+        ServiceTracker<?, ?> tracker = new ServiceTracker<>(m_bundleContext, m_bundleContext.createFilter("(factory.instance.pid=" + instanceName + ")"), null);
         tracker.open();
 
         // Publish configuration for a repository instance
@@ -253,9 +252,9 @@
         if ((configs != null) && (configs.length > 0)) {
             final Semaphore sem = new Semaphore(0);
 
-            ServiceTracker tracker = new ServiceTracker(m_bundleContext, m_bundleContext.createFilter("(" + Constants.OBJECTCLASS + "=" + Repository.class.getName() + ")"), null) {
+            ServiceTracker<Repository, Repository> tracker = new ServiceTracker<Repository, Repository>(m_bundleContext, Repository.class, null) {
                 @Override
-                public void removedService(ServiceReference reference, Object service) {
+                public void removedService(ServiceReference<Repository> reference, Repository service) {
                     super.removedService(reference, service);
                     // config.length times two because the service tracker also sees added events for each instance
                     if (size() == 0) {
@@ -290,9 +289,9 @@
 
         if ((configs != null) && (configs.length > 0)) {
             final Semaphore sem = new Semaphore(0);
-            ServiceTracker tracker = new ServiceTracker(m_bundleContext, m_bundleContext.createFilter("(factory.instance.pid=" + instanceName + ")"), null) {
+            ServiceTracker<Object, Object> tracker = new ServiceTracker<Object, Object>(m_bundleContext, m_bundleContext.createFilter("(factory.instance.pid=" + instanceName + ")"), null) {
                 @Override
-                public void removedService(ServiceReference reference, Object service) {
+                public void removedService(ServiceReference<Object> reference, Object service) {
                     super.removedService(reference, service);
                     sem.release();
                 }
diff --git a/org.apache.ace.repository/src/org/apache/ace/repository/servlet/RepositoryReplicationServlet.java b/org.apache.ace.repository/src/org/apache/ace/repository/servlet/RepositoryReplicationServlet.java
index 3b520ce..d288f99 100644
--- a/org.apache.ace.repository/src/org/apache/ace/repository/servlet/RepositoryReplicationServlet.java
+++ b/org.apache.ace.repository/src/org/apache/ace/repository/servlet/RepositoryReplicationServlet.java
@@ -20,44 +20,15 @@
 
 import java.io.IOException;
 import java.io.InputStream;
-import java.util.Dictionary;
 
 import org.apache.ace.range.SortedRangeSet;
 import org.apache.ace.repository.RepositoryReplication;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.cm.ConfigurationException;
 
-public class RepositoryReplicationServlet extends RepositoryServletBase {
+public class RepositoryReplicationServlet extends RepositoryServletBase<RepositoryReplication> {
     private static final long serialVersionUID = 1L;
 
-    @Override
-    protected ServiceReference[] getRepositories(String filter) throws InvalidSyntaxException {
-        return m_context.getServiceReferences(RepositoryReplication.class.getName(), filter);
-    }
-
-    @Override
-    protected SortedRangeSet getRange(ServiceReference ref) throws IOException {
-        RepositoryReplication repository = (RepositoryReplication) m_context.getService(ref);
-        SortedRangeSet range = repository.getRange();
-        m_context.ungetService(ref);
-        return range;
-    }
-
-    @Override
-    protected boolean doCommit(ServiceReference ref, long version, InputStream data) throws IllegalArgumentException, IOException {
-        RepositoryReplication r = (RepositoryReplication) m_context.getService(ref);
-        boolean result = r.put(data, version);
-        m_context.ungetService(ref);
-        return result;
-    }
-
-    @Override
-    protected InputStream doCheckout(ServiceReference ref, long version) throws IllegalArgumentException, IOException {
-        RepositoryReplication r = (RepositoryReplication) m_context.getService(ref);
-        InputStream result = r.get(version);
-        m_context.ungetService(ref);
-        return result;
+    public RepositoryReplicationServlet() {
+        super(RepositoryReplication.class);
     }
 
     @Override
@@ -66,8 +37,13 @@
     }
 
     @Override
-    public void updated(Dictionary settings) throws ConfigurationException {
-        super.updated(settings);
+    protected InputStream doCheckout(RepositoryReplication repo, long version) throws IllegalArgumentException, IOException {
+        return repo.get(version);
+    }
+
+    @Override
+    protected boolean doCommit(RepositoryReplication repo, long version, InputStream data) throws IllegalArgumentException, IOException {
+        return repo.put(data, version);
     }
 
     @Override
@@ -79,4 +55,9 @@
     protected String getCommitCommand() {
         return "/put";
     }
-}
\ No newline at end of file
+
+    @Override
+    protected SortedRangeSet getRange(RepositoryReplication repo) throws IOException {
+        return repo.getRange();
+    }
+}
diff --git a/org.apache.ace.repository/src/org/apache/ace/repository/servlet/RepositoryServlet.java b/org.apache.ace.repository/src/org/apache/ace/repository/servlet/RepositoryServlet.java
index 57474c4..ac2ebb5 100644
--- a/org.apache.ace.repository/src/org/apache/ace/repository/servlet/RepositoryServlet.java
+++ b/org.apache.ace.repository/src/org/apache/ace/repository/servlet/RepositoryServlet.java
@@ -20,44 +20,15 @@
 
 import java.io.IOException;
 import java.io.InputStream;
-import java.util.Dictionary;
 
 import org.apache.ace.range.SortedRangeSet;
 import org.apache.ace.repository.Repository;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.cm.ConfigurationException;
 
-public class RepositoryServlet extends RepositoryServletBase {
+public class RepositoryServlet extends RepositoryServletBase<Repository> {
     private static final long serialVersionUID = 1L;
-
-    @Override
-    protected ServiceReference[] getRepositories(String filter) throws InvalidSyntaxException {
-        return m_context.getServiceReferences(Repository.class.getName(), filter);
-    }
-
-    @Override
-    protected SortedRangeSet getRange(ServiceReference ref) throws IOException {
-        Repository repository = (Repository) m_context.getService(ref);
-        SortedRangeSet range = repository.getRange();
-        m_context.ungetService(ref);
-        return range;
-    }
-
-    @Override
-    protected boolean doCommit(ServiceReference ref, long version, InputStream data) throws IllegalArgumentException, IOException {
-        Repository r = (Repository) m_context.getService(ref);
-        boolean result = r.commit(data, version);
-        m_context.ungetService(ref);
-        return result;
-    }
-
-    @Override
-    protected InputStream doCheckout(ServiceReference ref, long version) throws IllegalArgumentException, IOException {
-        Repository r = (Repository) m_context.getService(ref);
-        InputStream result = r.checkout(version);
-        m_context.ungetService(ref);
-        return result;
+    
+    public RepositoryServlet() {
+        super(Repository.class);
     }
 
     @Override
@@ -66,8 +37,13 @@
     }
 
     @Override
-    public void updated(Dictionary settings) throws ConfigurationException {
-        super.updated(settings);
+    protected InputStream doCheckout(Repository repo, long version) throws IllegalArgumentException, IOException {
+        return repo.checkout(version);
+    }
+
+    @Override
+    protected boolean doCommit(Repository repo, long version, InputStream data) throws IllegalArgumentException, IOException {
+        return repo.commit(data, version);
     }
 
     @Override
@@ -79,4 +55,9 @@
     protected String getCommitCommand() {
         return "/commit";
     }
+
+    @Override
+    protected SortedRangeSet getRange(Repository repo) throws IOException {
+        return repo.getRange();
+    }
 }
\ No newline at end of file
diff --git a/org.apache.ace.repository/src/org/apache/ace/repository/servlet/RepositoryServletBase.java b/org.apache.ace.repository/src/org/apache/ace/repository/servlet/RepositoryServletBase.java
index 0f7e182..d007a57 100644
--- a/org.apache.ace.repository/src/org/apache/ace/repository/servlet/RepositoryServletBase.java
+++ b/org.apache.ace.repository/src/org/apache/ace/repository/servlet/RepositoryServletBase.java
@@ -23,7 +23,9 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.util.ArrayList;
 import java.util.Dictionary;
+import java.util.List;
 
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServlet;
@@ -46,7 +48,7 @@
  * Base class for the repository servlets. Both the repository and the repository replication servlets work in a similar
  * way, so the specifics were factored out of this base class and put in two subclasses.
  */
-public abstract class RepositoryServletBase extends HttpServlet implements ManagedService {
+public abstract class RepositoryServletBase<REPO_TYPE> extends HttpServlet implements ManagedService {
     /** A boolean denoting whether or not authentication is enabled. */
     private static final String KEY_USE_AUTHENTICATION = "authentication.enabled";
     private static final int COPY_BUFFER_SIZE = 1024;
@@ -54,6 +56,7 @@
     protected static final String TEXT_MIMETYPE = "text/plain";
     protected static final String BINARY_MIMETYPE = "application/octet-stream";
 
+    private final Class<REPO_TYPE> m_repoType;
     // injected by Dependency Manager
     private volatile DependencyManager m_dm;
     private volatile AuthenticationService m_authService;
@@ -61,6 +64,53 @@
     protected volatile BundleContext m_context;
     protected volatile LogService m_log;
 
+    public RepositoryServletBase(Class<REPO_TYPE> repoType) {
+        m_repoType = repoType;
+    }
+
+    public void updated(Dictionary settings) throws ConfigurationException {
+        if (settings != null) {
+            String useAuthString = (String) settings.get(KEY_USE_AUTHENTICATION);
+            if ((useAuthString == null) ||
+                !("true".equalsIgnoreCase(useAuthString) || "false".equalsIgnoreCase(useAuthString))) {
+                throw new ConfigurationException(KEY_USE_AUTHENTICATION, "Missing or invalid value!");
+            }
+            boolean useAuth = Boolean.parseBoolean(useAuthString);
+            m_useAuth = useAuth;
+        }
+        else {
+            m_useAuth = false;
+        }
+    }
+
+    /**
+     * Checkout or get data from the repository.
+     * 
+     * @param repo
+     *            the repository service
+     * @param version
+     *            the version to check out.
+     * @return the data
+     * @throws IllegalArgumentException
+     * @throws java.io.IOException
+     */
+    protected abstract InputStream doCheckout(REPO_TYPE repo, long version) throws IllegalArgumentException, IOException;
+
+    /**
+     * Commit or put the data into the repository.
+     * 
+     * @param repo
+     *            the repository service
+     * @param version
+     *            The version to commit
+     * @param data
+     *            The data
+     * @return <code>true</code> if successful
+     * @throws IllegalArgumentException
+     * @throws IOException
+     */
+    protected abstract boolean doCommit(REPO_TYPE repo, long version, InputStream data) throws IllegalArgumentException, IOException;
+
     @Override
     protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
         String path = request.getPathInfo();
@@ -106,11 +156,6 @@
         }
     }
 
-    /**
-     * Returns the name of the "checkout" command.
-     */
-    protected abstract String getCheckoutCommand();
-
     @Override
     protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
         String path = request.getPathInfo();
@@ -134,64 +179,31 @@
     }
 
     /**
+     * Returns the name of the "checkout" command.
+     */
+    protected abstract String getCheckoutCommand();
+
+    /**
      * Returns the name of the "commit" command.
      */
     protected abstract String getCommitCommand();
 
     /**
-     * Handles a query command and sends back the response.
-     */
-    private void handleQuery(String filter, HttpServletResponse response) throws IOException {
-        try {
-            ServiceReference[] refs = getRepositories(filter);
-            StringBuffer result = new StringBuffer();
-
-            if (refs != null) {
-                for (ServiceReference ref : refs) {
-                    result.append((String) ref.getProperty("customer"));
-                    result.append(',');
-                    result.append((String) ref.getProperty("name"));
-                    result.append(',');
-                    result.append(getRange(ref).toRepresentation());
-                    result.append('\n');
-                }
-            }
-
-            response.setContentType(TEXT_MIMETYPE);
-            response.getWriter().print(result.toString());
-        }
-        catch (IOException e) {
-            response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
-                "Could not retrieve version range for repository: " + e.getMessage());
-        }
-        catch (InvalidSyntaxException e) {
-            response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
-                "Invalid filter syntax: " + e.getMessage());
-        }
-    }
-
-    /**
      * Implement this by asking the right repository for a range of available versions.
      * 
-     * @param ref Reference to the repository service you need to dereference
+     * @param repo
+     *            the repository service
      * @return a sorted range set
-     * @throws IOException If the range cannot be obtained
+     * @throws IOException
+     *             If the range cannot be obtained
      */
-    protected abstract SortedRangeSet getRange(ServiceReference ref) throws IOException;
-
-    /**
-     * Returns a list of repositories that match the specified filter condition.
-     * 
-     * @param filter The filter condition
-     * @return An array of service references
-     * @throws InvalidSyntaxException If the filter condition is invalid
-     */
-    protected abstract ServiceReference[] getRepositories(String filter) throws InvalidSyntaxException;
+    protected abstract SortedRangeSet getRange(REPO_TYPE repo) throws IOException;
 
     /**
      * Called by Dependency Manager upon initialization of this component.
      * 
-     * @param comp the component to initialize, cannot be <code>null</code>.
+     * @param comp
+     *            the component to initialize, cannot be <code>null</code>.
      */
     protected void init(Component comp) {
         comp.add(m_dm.createServiceDependency()
@@ -214,7 +226,8 @@
     /**
      * Authenticates, if needed the user with the information from the given request.
      * 
-     * @param request The request to obtain the credentials from, cannot be <code>null</code>.
+     * @param request
+     *            The request to obtain the credentials from, cannot be <code>null</code>.
      * @return <code>true</code> if the authentication was successful, <code>false</code> otherwise.
      */
     private boolean authenticate(HttpServletRequest request) {
@@ -232,103 +245,16 @@
     }
 
     /**
-     * Handles a commit command and sends back the response.
-     */
-    private void handleCommit(String customer, String name, long version, InputStream data, HttpServletResponse response) throws IOException {
-        try {
-            ServiceReference[] refs = getRepositories("(&(customer=" + customer + ")(name=" + name + "))");
-
-            if ((refs != null) && (refs.length == 1)) {
-                ServiceReference ref = refs[0];
-                try {
-                    if (!doCommit(ref, version, data)) {
-                        response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Could not commit");
-                    }
-                    else {
-                        response.sendError(HttpServletResponse.SC_OK);
-                    }
-                }
-                catch (IllegalArgumentException e) {
-                    response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Invalid version");
-                }
-                catch (IllegalStateException e) {
-                    response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
-                        "Cannot commit, not the master repository");
-                }
-            }
-        }
-        catch (IOException e) {
-            response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "I/O exception: " + e.getMessage());
-        }
-        catch (InvalidSyntaxException e) {
-            response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Invalid filter syntax: "
-                + e.getMessage());
-        }
-    }
-
-    /**
-     * Commit or put the data into the repository.
-     * 
-     * @param ref Reference to the repository service
-     * @param version The version
-     * @param data The data
-     * @return <code>true</code> if successful
-     * @throws IllegalArgumentException
-     * @throws IOException
-     */
-    protected abstract boolean doCommit(ServiceReference ref, long version, InputStream data) throws IllegalArgumentException, IOException;
-
-    /**
-     * Handles a checkout command and returns the response.
-     */
-    private void handleCheckout(String customer, String name, long version, HttpServletResponse response) throws IOException {
-        try {
-            ServiceReference[] refs = getRepositories("(&(customer=" + customer + ")(name=" + name + "))");
-            if ((refs != null) && (refs.length == 1)) {
-                ServiceReference ref = refs[0];
-                response.setContentType(BINARY_MIMETYPE);
-                InputStream data = doCheckout(ref, version);
-                if (data == null) {
-                    response.sendError(HttpServletResponse.SC_NOT_FOUND, "Requested version does not exist: "
-                        + version);
-                }
-                else {
-                    copy(data, response.getOutputStream(), name, version);
-                }
-            }
-            else {
-                response.sendError(HttpServletResponse.SC_NOT_FOUND,
-                    ((refs == null) ? "Could not find repository " : "Multiple repositories found ") + " for customer "
-                        + customer + ", name " + name);
-            }
-        }
-        catch (IOException e) {
-            response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "I/O exception: " + e.getMessage());
-        }
-        catch (InvalidSyntaxException e) {
-            response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Invalid filter syntax: " + e.getMessage());
-        }
-    }
-
-    /**
-     * Checkout or get data from the repository.
-     * 
-     * @param ref reference to the repository service
-     * @param version the version
-     * @return the data
-     * @throws IllegalArgumentException
-     * @throws java.io.IOException
-     */
-    protected abstract InputStream doCheckout(ServiceReference ref, long version) throws IllegalArgumentException, IOException;
-
-    /**
      * Copies data from an input stream to an output stream.
      * 
-     * @param in The input
-     * @param outThe output
+     * @param in
+     *            The input
+     * @param outThe
+     *            output
      * @param version
      * @param name
-     * @throws IOException If copying fails
+     * @throws IOException
+     *             If copying fails
      */
     private void copy(InputStream in, OutputStream out, String name, long version)
         throws IOException {
@@ -341,18 +267,157 @@
 
     }
 
-    public void updated(Dictionary settings) throws ConfigurationException {
-        if (settings != null) {
-            String useAuthString = (String) settings.get(KEY_USE_AUTHENTICATION);
-            if ((useAuthString == null) ||
-                !("true".equalsIgnoreCase(useAuthString) || "false".equalsIgnoreCase(useAuthString))) {
-                throw new ConfigurationException(KEY_USE_AUTHENTICATION, "Missing or invalid value!");
-            }
-            boolean useAuth = Boolean.parseBoolean(useAuthString);
-            m_useAuth = useAuth;
+    /**
+     * Returns a list of repositories that match the specified filter condition.
+     * 
+     * @param filter
+     *            The filter condition
+     * @return An array of service references
+     * @throws InvalidSyntaxException
+     *             If the filter condition is invalid
+     */
+    private List<ServiceReference<REPO_TYPE>> getRepositories(String filter) throws InvalidSyntaxException {
+        List<ServiceReference<REPO_TYPE>> result = new ArrayList<>();
+        result.addAll(m_context.getServiceReferences(m_repoType, filter));
+        return result;
+    }
+
+    /**
+     * Handles a checkout command and returns the response.
+     */
+    private void handleCheckout(String customer, String name, long version, HttpServletResponse response) throws IOException {
+        List<ServiceReference<REPO_TYPE>> refs;
+        try {
+            refs = getRepositories("(&(customer=" + customer + ")(name=" + name + "))");
         }
-        else {
-            m_useAuth = false;
+        catch (InvalidSyntaxException e) {
+            response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Invalid filter syntax: " + e.getMessage());
+            return;
+        }
+
+        try {
+            if (refs.size() != 1) {
+                response.sendError(HttpServletResponse.SC_NOT_FOUND,
+                    (refs.isEmpty() ? "Could not find repository " : "Multiple repositories found ") + " for customer " + customer + ", name " + name);
+                return;
+            }
+
+            ServiceReference<REPO_TYPE> ref = refs.get(0);
+            if (ref == null) {
+                response.sendError(HttpServletResponse.SC_NOT_FOUND, "Could not find repository for customer " + customer + ", name " + name);
+                return;
+            }
+
+            REPO_TYPE repo = m_context.getService(ref);
+
+            try {
+                response.setContentType(BINARY_MIMETYPE);
+
+                InputStream data = doCheckout(repo, version);
+                if (data == null) {
+                    response.sendError(HttpServletResponse.SC_NOT_FOUND, "Requested version does not exist: " + version);
+                }
+                else {
+                    copy(data, response.getOutputStream(), name, version);
+                }
+            }
+            finally {
+                m_context.ungetService(ref);
+            }
+        }
+        catch (IOException e) {
+            response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "I/O exception: " + e.getMessage());
+        }
+    }
+
+    /**
+     * Handles a commit command and sends back the response.
+     */
+    private void handleCommit(String customer, String name, long version, InputStream data, HttpServletResponse response) throws IOException {
+        List<ServiceReference<REPO_TYPE>> refs;
+        try {
+            refs = getRepositories("(&(customer=" + customer + ")(name=" + name + "))");
+        }
+        catch (InvalidSyntaxException e) {
+            response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Invalid filter syntax: " + e.getMessage());
+            return;
+        }
+
+        try {
+            if (refs.size() != 1) {
+                response.sendError(HttpServletResponse.SC_NOT_FOUND,
+                    (refs.isEmpty() ? "Could not find repository " : "Multiple repositories found ") + " for customer " + customer + ", name " + name);
+                return;
+            }
+
+            ServiceReference<REPO_TYPE> ref = refs.get(0);
+            if (ref == null) {
+                response.sendError(HttpServletResponse.SC_NOT_FOUND, "Could not find repository for customer " + customer + ", name " + name);
+                return;
+            }
+
+            REPO_TYPE repo = m_context.getService(ref);
+
+            try {
+                if (!doCommit(repo, version, data)) {
+                    response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Could not commit");
+                }
+                else {
+                    response.sendError(HttpServletResponse.SC_OK);
+                }
+            }
+            catch (IllegalArgumentException e) {
+                response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Invalid version");
+            }
+            catch (IllegalStateException e) {
+                response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Cannot commit, not the master repository");
+            }
+            finally {
+                m_context.ungetService(ref);
+            }
+        }
+        catch (IOException e) {
+            response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "I/O exception: " + e.getMessage());
+        }
+    }
+
+    /**
+     * Handles a query command and sends back the response.
+     */
+    private void handleQuery(String filter, HttpServletResponse response) throws IOException {
+        List<ServiceReference<REPO_TYPE>> refs;
+        try {
+            refs = getRepositories(filter);
+        }
+        catch (InvalidSyntaxException e) {
+            response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Invalid filter syntax: " + e.getMessage());
+            return;
+        }
+
+        try {
+            StringBuffer result = new StringBuffer();
+
+            for (ServiceReference<REPO_TYPE> ref : refs) {
+                REPO_TYPE repo = m_context.getService(ref);
+                try {
+                    result.append((String) ref.getProperty("customer"));
+                    result.append(',');
+                    result.append((String) ref.getProperty("name"));
+                    result.append(',');
+                    result.append(getRange(repo).toRepresentation());
+                    result.append('\n');
+                }
+                finally {
+                    m_context.ungetService(ref);
+                }
+            }
+
+            response.setContentType(TEXT_MIMETYPE);
+            response.getWriter().print(result.toString());
+        }
+        catch (IOException e) {
+            response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
+                "Could not retrieve version range for repository: " + e.getMessage());
         }
     }
 }