FELIX-4401 use released R6 framework classes for base DTO support

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1614966 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/scr/pom.xml b/scr/pom.xml
index 7ceb875..2aa3b7a 100644
--- a/scr/pom.xml
+++ b/scr/pom.xml
@@ -78,14 +78,14 @@
         <dependency>
             <groupId>org.osgi</groupId>
             <artifactId>org.osgi.core</artifactId>
-            <version>5.0.0</version>
+            <version>6.0.0</version>
             <scope>provided</scope>
-            <exclusions>
-                <exclusion>
-                    <groupId>org.osgi</groupId>
-                    <artifactId>org.osgi.compendium</artifactId>
-                </exclusion>
-            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.annotation</artifactId>
+            <version>6.0.0</version>
+            <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.osgi</groupId>
diff --git a/scr/src/main/java/org/osgi/annotation/versioning/ConsumerType.java b/scr/src/main/java/org/osgi/annotation/versioning/ConsumerType.java
deleted file mode 100644
index f5fa786..0000000
--- a/scr/src/main/java/org/osgi/annotation/versioning/ConsumerType.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) OSGi Alliance (2013, 2014). All Rights Reserved.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.osgi.annotation.versioning;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * A type implemented by the Consumer Role.
- * 
- * <p>
- * A non-binary compatible change to a consumer type normally requires
- * incrementing the major version of the type's package. This change will
- * require all providers and all consumers to be updated to handle the change
- * since consumers implement the consumer type and all providers must understand
- * the change in the consumer type.
- * 
- * <p>
- * A type can be marked {@link ConsumerType} or {@link ProviderType} but not
- * both. A type is assumed to be {@link ConsumerType} if it is not marked either
- * {@link ConsumerType} or {@link ProviderType}.
- * 
- * <p>
- * This annotation is not retained at runtime. It is for use by tools to
- * understand the semantic version of a package. When a bundle implements a
- * consumer type from an imported package, then the bundle's import range for
- * that package must require the exact major version and a minor version greater
- * than or equal to the package's version.
- * 
- * @see <a href="http://www.osgi.org/wiki/uploads/Links/SemanticVersioning.pdf"
- *      >Semantic Versioning</a>
- * @author $Id: 319ac9d62b568a8cde1523e0059aa3e44c7e86af $
- */
-@Documented
-@Retention(RetentionPolicy.CLASS)
-@Target(ElementType.TYPE)
-public @interface ConsumerType {
-	// marker annotation
-}
diff --git a/scr/src/main/java/org/osgi/annotation/versioning/ProviderType.java b/scr/src/main/java/org/osgi/annotation/versioning/ProviderType.java
deleted file mode 100644
index fdfee9e..0000000
--- a/scr/src/main/java/org/osgi/annotation/versioning/ProviderType.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) OSGi Alliance (2013, 2014). All Rights Reserved.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.osgi.annotation.versioning;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * A type implemented by the Provider Role.
- * 
- * <p>
- * A non-binary compatible change to a provider type normally requires
- * incrementing the minor version of the type's package. This change will
- * require all providers to be updated to handle the change, but consumers of
- * that package will not require changes since they only use, and do not
- * implement, the provider type.
- * 
- * <p>
- * A type can be marked {@link ConsumerType} or {@link ProviderType} but not
- * both. A type is assumed to be {@link ConsumerType} if it is not marked either
- * {@link ConsumerType} or {@link ProviderType}.
- * 
- * <p>
- * This annotation is not retained at runtime. It is for use by tools to
- * understand the semantic version of a package. When a bundle implements a
- * provider type from an imported package, then the bundle's import range for
- * that package must require the package's exact major and minor version.
- * 
- * @see <a href="http://www.osgi.org/wiki/uploads/Links/SemanticVersioning.pdf"
- *      >Semantic Versioning</a>
- * @author $Id: 46ccfd7aa446f79451d090e0c23e257c3c5c3cf0 $
- */
-@Documented
-@Retention(RetentionPolicy.CLASS)
-@Target(ElementType.TYPE)
-public @interface ProviderType {
-	// marker annotation
-}
diff --git a/scr/src/main/java/org/osgi/annotation/versioning/Version.java b/scr/src/main/java/org/osgi/annotation/versioning/Version.java
deleted file mode 100644
index 982680a..0000000
--- a/scr/src/main/java/org/osgi/annotation/versioning/Version.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) OSGi Alliance (2013). All Rights Reserved.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.osgi.annotation.versioning;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Specify the version of a package.
- * 
- * <p>
- * This annotation is not retained at runtime. It is for use by tools to
- * generate bundle manifests or otherwise process the version of a package.
- * 
- * @see <a href="http://www.osgi.org/wiki/uploads/Links/SemanticVersioning.pdf"
- *      >Semantic Versioning</a>
- * @author $Id: dcb5aff364bf7d59d647211711ae0e32697cc56f $
- */
-@Documented
-@Retention(RetentionPolicy.CLASS)
-@Target(ElementType.PACKAGE)
-public @interface Version {
-	/**
-	 * The version of the annotated package.
-	 * 
-	 * <p>
-	 * The version must be a valid OSGi version string.
-	 */
-	String value();
-}
diff --git a/scr/src/main/java/org/osgi/annotation/versioning/package-info.java b/scr/src/main/java/org/osgi/annotation/versioning/package-info.java
deleted file mode 100644
index 7268d2d..0000000
--- a/scr/src/main/java/org/osgi/annotation/versioning/package-info.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) OSGi Alliance (2013). All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * OSGi Versioning Annotations Package Version 1.0.
- *
- * <p>
- * This package is not used at runtime.
- *
- * @see <a href="http://www.osgi.org/wiki/uploads/Links/SemanticVersioning.pdf"
- *      >Semantic Versioning</a>
- * @version 1.0
- * @author $Id: 1bffd081f72d9ddcdc31a7c49493b35b009ba0e3 $
- */
-@Version("1.0")
-package org.osgi.annotation.versioning;
-
diff --git a/scr/src/main/java/org/osgi/dto/DTO.java b/scr/src/main/java/org/osgi/dto/DTO.java
deleted file mode 100644
index acb9dd3..0000000
--- a/scr/src/main/java/org/osgi/dto/DTO.java
+++ /dev/null
@@ -1,266 +0,0 @@
-/*
- * Copyright (c) OSGi Alliance (2012). All Rights Reserved.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.osgi.dto;
-
-import java.lang.reflect.Array;
-import java.lang.reflect.Field;
-import java.lang.reflect.Modifier;
-import java.util.IdentityHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * Super type for Data Transfer Objects.
- * 
- * All data transfer objects are easily serializable having only public fields
- * of primitive types and their wrapper classes, Strings, and DTOs. List, Set,
- * Map and array aggregates may also be used. The aggregates must only hold
- * objects of the listed types or aggregates.
- * 
- * @author $Id: 36dd2d0b9df1b8a6f67c74eeaad1cc9e20e19574 $
- * @NotThreadSafe
- */
-public abstract class DTO {
-
-    /**
-     * Return a string representation of this DTO suitable for use when
-     * debugging.
-     * 
-     * <p>
-     * The format of the string representation is not specified and subject to
-     * change.
-     * 
-     * @return A string representation of this DTO suitable for use when
-     *         debugging.
-     */
-    @Override
-    public String toString() {
-        return appendValue(new StringBuilder(), new IdentityHashMap<Object, String>(), "#", this).toString();
-    }
-
-    /**
-     * Append the specified DTO's string representation to the specified
-     * StringBuilder.
-     * 
-     * <p>
-     * This method handles circular DTO references.
-     * 
-     * @param result StringBuilder to which the string representation is
-     *        appended.
-     * @param objectRefs References to "seen" objects.
-     * @param refpath The reference path of the specified DTO.
-     * @param dto The DTO whose string representation is to be appended.
-     * @return The specified StringBuilder.
-     */
-    private static StringBuilder appendDTO(final StringBuilder result, final Map<Object, String> objectRefs, final String refpath, final DTO dto) {
-        result.append("{");
-        String delim = "";
-        for (Field field : dto.getClass().getFields()) {
-            if (Modifier.isStatic(field.getModifiers())) {
-                continue;
-            }
-            result.append(delim);
-            final String name = field.getName();
-            appendString(result, name);
-            result.append(":");
-            Object value = null;
-            try {
-                value = field.get(dto);
-            } catch (IllegalAccessException e) {
-                // use null value;
-            }
-            appendValue(result, objectRefs, refpath + "/" + name, value);
-            delim = ", ";
-        }
-        result.append("}");
-        return result;
-    }
-
-    /**
-     * Append the specified value's string representation to the specified
-     * StringBuilder.
-     * 
-     * @param result StringBuilder to which the string representation is
-     *        appended.
-     * @param objectRefs References to "seen" objects.
-     * @param refpath The reference path of the specified value.
-     * @param value The object whose string representation is to be appended.
-     * @return The specified StringBuilder.
-     */
-    private static StringBuilder appendValue(final StringBuilder result, final Map<Object, String> objectRefs, final String refpath, final Object value) {
-        if (value == null) {
-            return result.append("null");
-        }
-        // Simple Java types
-        if (value instanceof String || value instanceof Character) {
-            return appendString(result, compress(value.toString()));
-        }
-        if (value instanceof Number || value instanceof Boolean) {
-            return result.append(value.toString());
-        }
-
-        // Complex types
-        final String path = objectRefs.get(value);
-        if (path != null) {
-            result.append("{\"$ref\":");
-            appendString(result, path);
-            result.append("}");
-            return result;
-        }
-        objectRefs.put(value, refpath);
-
-        if (value instanceof DTO) {
-            return appendDTO(result, objectRefs, refpath, (DTO) value);
-        }
-        if (value instanceof Map) {
-            return appendMap(result, objectRefs, refpath, (Map<?, ?>) value);
-        }
-        if (value instanceof List || value instanceof Set) {
-            return appendIterable(result, objectRefs, refpath, (Iterable<?>) value);
-        }
-        if (value.getClass().isArray()) {
-            return appendArray(result, objectRefs, refpath, value);
-        }
-        return appendString(result, compress(value.toString()));
-    }
-
-    /**
-     * Append the specified array's string representation to the specified
-     * StringBuilder.
-     * 
-     * @param result StringBuilder to which the string representation is
-     *        appended.
-     * @param objectRefs References to "seen" objects.
-     * @param refpath The reference path of the specified array.
-     * @param array The array whose string representation is to be appended.
-     * @return The specified StringBuilder.
-     */
-    private static StringBuilder appendArray(final StringBuilder result, final Map<Object, String> objectRefs, final String refpath, final Object array) {
-        result.append("[");
-        final int length = Array.getLength(array);
-        for (int i = 0; i < length; i++) {
-            if (i > 0) {
-                result.append(",");
-            }
-            appendValue(result, objectRefs, refpath + "/" + i, Array.get(array, i));
-        }
-        result.append("]");
-        return result;
-    }
-
-    /**
-     * Append the specified iterable's string representation to the specified
-     * StringBuilder.
-     * 
-     * @param result StringBuilder to which the string representation is
-     *        appended.
-     * @param objectRefs References to "seen" objects.
-     * @param refpath The reference path of the specified list.
-     * @param iterable The iterable whose string representation is to be
-     *        appended.
-     * @return The specified StringBuilder.
-     */
-    private static StringBuilder appendIterable(final StringBuilder result, final Map<Object, String> objectRefs, final String refpath, final Iterable<?> iterable) {
-        result.append("[");
-        int i = 0;
-        for (Object item : iterable) {
-            if (i > 0) {
-                result.append(",");
-            }
-            appendValue(result, objectRefs, refpath + "/" + i, item);
-            i++;
-        }
-        result.append("]");
-        return result;
-    }
-
-    /**
-     * Append the specified map's string representation to the specified
-     * StringBuilder.
-     * 
-     * @param result StringBuilder to which the string representation is
-     *        appended.
-     * @param objectRefs References to "seen" objects.
-     * @param refpath The reference path of the specified map.
-     * @param map The map whose string representation is to be appended.
-     * @return The specified StringBuilder.
-     */
-    private static StringBuilder appendMap(final StringBuilder result, final Map<Object, String> objectRefs, final String refpath, final Map<?, ?> map) {
-        result.append("{");
-        String delim = "";
-        for (Map.Entry<?, ?> entry : map.entrySet()) {
-            result.append(delim);
-            final String name = String.valueOf(entry.getKey());
-            appendString(result, name);
-            result.append(":");
-            final Object value = entry.getValue();
-            appendValue(result, objectRefs, refpath + "/" + name, value);
-            delim = ", ";
-        }
-        result.append("}");
-        return result;
-    }
-
-    /**
-     * Append the specified string to the specified StringBuilder.
-     * 
-     * @param result StringBuilder to which the string is appended.
-     * @param string The string to be appended.
-     * @return The specified StringBuilder.
-     */
-    private static StringBuilder appendString(final StringBuilder result, final CharSequence string) {
-        result.append("\"");
-        int i = result.length();
-        result.append(string);
-        while (i < result.length()) { // escape if necessary
-            char c = result.charAt(i);
-            if ((c == '"') || (c == '\\')) {
-                result.insert(i, '\\');
-                i = i + 2;
-                continue;
-            }
-            if (c < 0x20) {
-                result.insert(i + 1, Integer.toHexString(c | 0x10000));
-                result.replace(i, i + 2, "\\u");
-                i = i + 6;
-                continue;
-            }
-            i++;
-        }
-        result.append("\"");
-        return result;
-    }
-
-    /**
-     * Compress, in length, the specified string.
-     * 
-     * @param in The string to potentially compress.
-     * @return The string compressed, if necessary.
-     */
-    private static CharSequence compress(final CharSequence in) {
-        final int length = in.length();
-        if (length <= 21) {
-            return in;
-        }
-        StringBuilder result = new StringBuilder(21);
-        result.append(in, 0, 9);
-        result.append("...");
-        result.append(in, length - 9, length);
-        return result;
-    }
-}
diff --git a/scr/src/main/java/org/osgi/dto/package-info.java b/scr/src/main/java/org/osgi/dto/package-info.java
deleted file mode 100644
index c3010b3..0000000
--- a/scr/src/main/java/org/osgi/dto/package-info.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) OSGi Alliance (2012, 2013). All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * OSGi Data Transfer Object Package Version 1.0.
- *
- * <p>
- * Bundles wishing to use this package must list the package in the
- * Import-Package header of the bundle's manifest. This package has two types of
- * users: the consumers that use the API in this package and the providers that
- * implement the API in this package.
- *
- * <p>
- * Example import for consumers using the API in this package:
- * <p>
- * {@code  Import-Package: org.osgi.dto; version="[1.0,2.0)"}
- * <p>
- * Example import for providers implementing the API in this package:
- * <p>
- * {@code  Import-Package: org.osgi.dto; version="[1.0,1.1)"}
- *
- * @author $Id: 1209bb5e60e6b6fc8239119a2dd4a2c15b9a40f2 $
- */
-
-//@Version("1.0")
-package org.osgi.dto;
-
-//import org.osgi.annotation.versioning.Version;
-
diff --git a/scr/src/main/java/org/osgi/framework/PrototypeServiceFactory.java b/scr/src/main/java/org/osgi/framework/PrototypeServiceFactory.java
deleted file mode 100644
index 0561ccc..0000000
--- a/scr/src/main/java/org/osgi/framework/PrototypeServiceFactory.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Copyright (c) OSGi Alliance (2012, 2014). All Rights Reserved.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.osgi.framework;
-
-import org.osgi.annotation.versioning.ConsumerType;
-
-/**
- * A factory for {@link Constants#SCOPE_PROTOTYPE prototype scope} services. The
- * factory can provide multiple, customized service objects in the OSGi
- * environment.
- * 
- * <p>
- * When registering a service, a {@code PrototypeServiceFactory} object can be
- * used instead of a service object, so that the bundle developer can create a
- * customized service object for each caller that is using the service.
- * 
- * <p>
- * When a caller uses a {@link ServiceObjects} to
- * {@link ServiceObjects#getService() request} a service object, the framework
- * calls the {@link #getService(Bundle, ServiceRegistration) getService} method
- * to return a service object customized for the requesting caller. The caller
- * can {@link ServiceObjects#ungetService(Object) release} the returned service
- * object and the framework will call the
- * {@link #ungetService(Bundle, ServiceRegistration, Object) ungetService}
- * method with the service object.
- * 
- * <p>
- * When a bundle uses the {@link BundleContext#getService(ServiceReference)}
- * method to obtain a service object, the framework must act as if the service
- * has {@link Constants#SCOPE_BUNDLE bundle scope}. That is, the framework will
- * call the {@link #getService(Bundle, ServiceRegistration) getService} method
- * to obtain a bundle-scoped service object which will be cached and have a use
- * count. See {@link ServiceFactory}.
- * 
- * <p>
- * A bundle can use both {@link ServiceObjects} and
- * {@link BundleContext#getService(ServiceReference)} to obtain a service object
- * for a service. {@link ServiceObjects#getService()} will always return a
- * service object provided by a call to
- * {@link #getService(Bundle, ServiceRegistration)} and
- * {@link BundleContext#getService(ServiceReference)} will always return the
- * bundle-scoped service object.
- * 
- * <p>
- * {@code PrototypeServiceFactory} objects are only used by the Framework and
- * are not made available to other bundles in the OSGi environment. The
- * Framework may concurrently call a {@code PrototypeServiceFactory}.
- * 
- * @param <S> Type of Service
- * @see BundleContext#getServiceObjects(ServiceReference)
- * @see ServiceObjects
- * @ThreadSafe
- * @since 1.8
- * @author $Id: 12129fe6e66b1c9488f3cca84ac228f9baaea083 $
- */
-@ConsumerType
-public interface PrototypeServiceFactory<S> extends ServiceFactory<S> {
-	/**
-	 * Returns a service object for a caller.
-	 * 
-	 * <p>
-	 * The Framework invokes this method for each caller requesting a service
-	 * object using {@link ServiceObjects#getService()}. The factory can then
-	 * return a customized service object for the caller.
-	 * 
-	 * <p>
-	 * The Framework must check that the returned service object is valid. If
-	 * the returned service object is {@code null} or is not an
-	 * {@code instanceof} all the classes named when the service was registered,
-	 * a framework event of type {@link FrameworkEvent#ERROR} is fired
-	 * containing a service exception of type
-	 * {@link ServiceException#FACTORY_ERROR} and {@code null} is returned to
-	 * the caller. If this method throws an exception, a framework event of type
-	 * {@link FrameworkEvent#ERROR} is fired containing a service exception of
-	 * type {@link ServiceException#FACTORY_EXCEPTION} with the thrown exception
-	 * as the cause and {@code null} is returned to the caller.
-	 * 
-	 * @param bundle The bundle requesting the service.
-	 * @param registration The {@code ServiceRegistration} object for the
-	 *        requested service.
-	 * @return A service object that <strong>must</strong> be an instance of all
-	 *         the classes named when the service was registered.
-	 * @see ServiceObjects#getService()
-	 */
-	public S getService(Bundle bundle, ServiceRegistration<S> registration);
-
-	/**
-	 * Releases a service object customized for a caller.
-	 * 
-	 * <p>
-	 * The Framework invokes this method when a service has been released by a
-	 * bundle such as by calling {@link ServiceObjects#ungetService(Object)}.
-	 * The service object may then be destroyed.
-	 * 
-	 * <p>
-	 * If this method throws an exception, a framework event of type
-	 * {@link FrameworkEvent#ERROR} is fired containing a service exception of
-	 * type {@link ServiceException#FACTORY_EXCEPTION} with the thrown exception
-	 * as the cause.
-	 * 
-	 * @param bundle The bundle releasing the service.
-	 * @param registration The {@code ServiceRegistration} object for the
-	 *        service being released.
-	 * @param service The service object returned by a previous call to the
-	 *        {@link #getService(Bundle, ServiceRegistration) getService}
-	 *        method.
-	 * @see ServiceObjects#ungetService(Object)
-	 */
-	public void ungetService(Bundle bundle, ServiceRegistration<S> registration, S service);
-}
diff --git a/scr/src/main/java/org/osgi/framework/ServiceObjects.java b/scr/src/main/java/org/osgi/framework/ServiceObjects.java
deleted file mode 100644
index b47e5cc..0000000
--- a/scr/src/main/java/org/osgi/framework/ServiceObjects.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * Copyright (c) OSGi Alliance (2012, 2014). All Rights Reserved.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.osgi.framework;
-
-import org.osgi.annotation.versioning.ProviderType;
-
-/**
- * Allows multiple service objects for a service to be obtained.
- * 
- * <p>
- * For services with {@link Constants#SCOPE_PROTOTYPE prototype} scope, multiple
- * service objects for the service can be obtained. For services with
- * {@link Constants#SCOPE_SINGLETON singleton} or {@link Constants#SCOPE_BUNDLE
- * bundle} scope, only one, use-counted service object is available to a
- * requesting bundle.
- * 
- * <p>
- * Any unreleased service objects obtained from this {@code ServiceObjects}
- * object are automatically released by the framework when the bundle associated
- * with the BundleContext used to create this {@code ServiceObjects} object is
- * stopped.
- * 
- * @param <S> Type of Service
- * @see BundleContext#getServiceObjects(ServiceReference)
- * @see PrototypeServiceFactory
- * @ThreadSafe
- * @since 1.8
- * @author $Id: 99314fe285a227cd63a21814a2300b109845125f $
- */
-@ProviderType
-public interface ServiceObjects<S> {
-	/**
-	 * Returns a service object for the {@link #getServiceReference()
-	 * associated} service.
-	 * 
-	 * <p>
-	 * This {@code ServiceObjects} object can be used to obtain multiple service
-	 * objects for the associated service if the service has
-	 * {@link Constants#SCOPE_PROTOTYPE prototype} scope.
-	 * 
-	 * <p>
-	 * If the associated service has {@link Constants#SCOPE_SINGLETON singleton}
-	 * or {@link Constants#SCOPE_BUNDLE bundle} scope, this method behaves the
-	 * same as calling the {@link BundleContext#getService(ServiceReference)}
-	 * method for the associated service. That is, only one, use-counted service
-	 * object is available from this {@link ServiceObjects} object.
-	 * 
-	 * <p>
-	 * This method will always return {@code null} when the associated service
-	 * has been unregistered.
-	 * 
-	 * <p>
-	 * For a prototype scope service, the following steps are required to obtain
-	 * a service object:
-	 * <ol>
-	 * <li>If the associated service has been unregistered, {@code null} is
-	 * returned.</li>
-	 * <li>The
-	 * {@link PrototypeServiceFactory#getService(Bundle, ServiceRegistration)}
-	 * method is called to supply a customized service object for the caller.</li>
-	 * <li>If the service object returned by the {@code PrototypeServiceFactory}
-	 * object is {@code null}, not an {@code instanceof} all the classes named
-	 * when the service was registered or the {@code PrototypeServiceFactory}
-	 * object throws an exception, {@code null} is returned and a Framework
-	 * event of type {@link FrameworkEvent#ERROR} containing a
-	 * {@link ServiceException} describing the error is fired.</li>
-	 * <li>The customized service object is returned.</li>
-	 * </ol>
-	 * 
-	 * @return A service object for the associated service or {@code null} if
-	 *         the service is not registered, the customized service object
-	 *         returned by a {@code ServiceFactory} does not implement the
-	 *         classes under which it was registered or the
-	 *         {@code ServiceFactory} threw an exception.
-	 * @throws IllegalStateException If the BundleContext used to create this
-	 *         {@code ServiceObjects} object is no longer valid.
-	 * @see #ungetService(Object)
-	 */
-	public S getService();
-
-	/**
-	 * Releases a service object for the {@link #getServiceReference()
-	 * associated} service.
-	 * 
-	 * <p>
-	 * This {@code ServiceObjects} object can be used to obtain multiple service
-	 * objects for the associated service if the service has
-	 * {@link Constants#SCOPE_PROTOTYPE prototype} scope. If the associated
-	 * service has {@link Constants#SCOPE_SINGLETON singleton} or
-	 * {@link Constants#SCOPE_BUNDLE bundle} scope, this method behaves the same
-	 * as calling the {@link BundleContext#ungetService(ServiceReference)}
-	 * method for the associated service. That is, only one, use-counted service
-	 * object is available from this {@link ServiceObjects} object.
-	 * 
-	 * <p>
-	 * For a prototype scope service, the following steps are required to
-	 * release a service object:
-	 * <ol>
-	 * <li>If the associated service has been unregistered, this method returns
-	 * without doing anything.</li>
-	 * <li>The
-	 * {@link PrototypeServiceFactory#ungetService(Bundle, ServiceRegistration, Object)}
-	 * method is called to release the specified service object.</li>
-	 * </ol>
-	 * 
-	 * <p>
-	 * The specified service object must no longer be used and all references to
-	 * it should be destroyed after calling this method.
-	 * 
-	 * @param service A service object previously provided by this
-	 *        {@code ServiceObjects} object.
-	 * @throws IllegalStateException If the BundleContext used to create this
-	 *         {@code ServiceObjects} object is no longer valid.
-	 * @throws IllegalArgumentException If the specified service object was not
-	 *         provided by this {@code ServiceObjects} object.
-	 * @see #getService()
-	 */
-	public void ungetService(S service);
-
-	/**
-	 * Returns the {@link ServiceReference} for the service associated with this
-	 * {@code ServiceObjects} object.
-	 * 
-	 * @return The {@link ServiceReference} for the service associated with this
-	 *         {@code ServiceObjects} object.
-	 */
-	public ServiceReference<S> getServiceReference();
-}
diff --git a/scr/src/main/java/org/osgi/framework/dto/BundleDTO.java b/scr/src/main/java/org/osgi/framework/dto/BundleDTO.java
deleted file mode 100644
index 6b83401..0000000
--- a/scr/src/main/java/org/osgi/framework/dto/BundleDTO.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (c) OSGi Alliance (2012, 2014). All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.osgi.framework.dto;
-
-import org.osgi.dto.DTO;
-import org.osgi.framework.Bundle;
-
-/**
- * Data Transfer Object for a Bundle.
- * 
- * <p>
- * A Bundle can be adapted to provide a {@code BundleDTO} for the Bundle.
- * 
- * @author $Id: aa30709351d8fe70b19c9ea99456ebd15ecab7c3 $
- * @NotThreadSafe
- */
-public class BundleDTO extends DTO {
-    /**
-	 * The bundle's unique identifier.
-	 * 
-	 * @see Bundle#getBundleId()
-	 */
-    public long   id;
-
-    /**
-	 * The time when the bundle was last modified.
-	 * 
-	 * @see Bundle#getLastModified()
-	 */
-    public long   lastModified;
-
-    /**
-	 * The bundle's state.
-	 * 
-	 * @see Bundle#getState()
-	 */
-    public int    state;
-
-    /**
-	 * The bundle's symbolic name.
-	 * 
-	 * @see Bundle#getSymbolicName()
-	 */
-    public String symbolicName;
-
-    /**
-	 * The bundle's version.
-	 * 
-	 * @see Bundle#getVersion()
-	 */
-    public String version;
-}
diff --git a/scr/src/main/java/org/osgi/framework/dto/FrameworkDTO.java b/scr/src/main/java/org/osgi/framework/dto/FrameworkDTO.java
deleted file mode 100644
index 7b32f93..0000000
--- a/scr/src/main/java/org/osgi/framework/dto/FrameworkDTO.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) OSGi Alliance (2012, 2014). All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.osgi.framework.dto;
-
-import java.util.List;
-import java.util.Map;
-import org.osgi.dto.DTO;
-import org.osgi.framework.BundleContext;
-
-/**
- * Data Transfer Object for a Framework.
- * 
- * <p>
- * The System Bundle can be adapted to provide a {@code FrameworkDTO} for the
- * framework of the system bundle. A {@code FrameworkDTO} obtained from a
- * framework will contain only the launch properties of the framework. These
- * properties will not include the System properties.
- * 
- * @author $Id: 7c525727cbe877e888b460cd14d8f9054f99ee0c $
- * @NotThreadSafe
- */
-public class FrameworkDTO extends DTO {
-    /**
-	 * The bundles that are installed in the framework.
-	 * 
-	 * @see BundleContext#getBundles()
-	 */
-    public List<BundleDTO>           bundles;
-
-    /**
-	 * The launch properties of the framework.
-	 * 
-	 * The value type must be a numerical type, Boolean, String, DTO or an array
-	 * of any of the former.
-	 * 
-	 * @see BundleContext#getProperty(String)
-	 */
-    public Map<String, Object>       properties;
-
-    /**
-	 * The services that are registered in the framework.
-	 * 
-	 * @see BundleContext#getServiceReferences(String, String)
-	 */
-    public List<ServiceReferenceDTO> services;
-}
diff --git a/scr/src/main/java/org/osgi/framework/dto/ServiceReferenceDTO.java b/scr/src/main/java/org/osgi/framework/dto/ServiceReferenceDTO.java
deleted file mode 100644
index d08e2e3..0000000
--- a/scr/src/main/java/org/osgi/framework/dto/ServiceReferenceDTO.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) OSGi Alliance (2012, 2014). All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.osgi.framework.dto;
-
-import java.util.Map;
-import org.osgi.dto.DTO;
-import org.osgi.framework.Constants;
-import org.osgi.framework.ServiceReference;
-
-/**
- * Data Transfer Object for a ServiceReference.
- * 
- * <p>
- * {@code ServiceReferenceDTO}s for all registered services can be obtained from
- * a {@link FrameworkDTO}. An installed Bundle can be adapted to provide a
- * {@code ServiceReferenceDTO[]} of the services registered by the Bundle. A
- * {@code ServiceReferenceDTO} obtained from a framework must convert service
- * property values which are not valid value types for DTOs to type
- * {@code String} using {@code String.valueOf(Object)}.
- * 
- * @author $Id: 2c70b84f28c41fb51c488cb03950a46188ea209f $
- * @NotThreadSafe
- */
-public class ServiceReferenceDTO extends DTO {
-    /**
-	 * The id of the service.
-	 * 
-	 * @see Constants#SERVICE_ID
-	 */
-    public long                id;
-
-    /**
-	 * The id of the bundle that registered the service.
-	 * 
-	 * @see ServiceReference#getBundle()
-	 */
-    public long                bundle;
-
-    /**
-	 * The properties for the service.
-	 * 
-	 * The value type must be a numerical type, Boolean, String, DTO or an array
-	 * of any of the former.
-	 * 
-	 * @see ServiceReference#getProperty(String)
-	 */
-    public Map<String, Object> properties;
-
-    /**
-	 * The ids of the bundles that are using the service.
-	 * 
-	 * @see ServiceReference#getUsingBundles()
-	 */
-    public long[]              usingBundles;
-}
diff --git a/scr/src/main/java/org/osgi/framework/dto/package-info.java b/scr/src/main/java/org/osgi/framework/dto/package-info.java
deleted file mode 100644
index 5c0bffc..0000000
--- a/scr/src/main/java/org/osgi/framework/dto/package-info.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) OSGi Alliance (2012, 2014). All Rights Reserved.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * OSGi Data Transfer Object Framework Package Version 1.8.
- * 
- * <p>
- * Bundles wishing to use this package must list the package in the
- * Import-Package header of the bundle's manifest. This package has two types of
- * users: the consumers that use the API in this package and the providers that
- * implement the API in this package.
- * 
- * <p>
- * Example import for consumers using the API in this package:
- * <p>
- * {@code  Import-Package: org.osgi.framework.dto; version="[1.8,2.0)"}
- * <p>
- * Example import for providers implementing the API in this package:
- * <p>
- * {@code  Import-Package: org.osgi.framework.dto; version="[1.8,1.9)"}
- * 
- * @author $Id: 2acfb6f1633e18f1ceedd27c04e70131cae4f293 $
- */
-
-//@Version("1.8")
-package org.osgi.framework.dto;
-
-//import org.osgi.annotation.versioning.Version;
-