You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by sv...@apache.org on 2016/03/08 16:53:19 UTC

[1/7] brooklyn-server git commit: Drop project brooklyn-rt-osgi

Repository: brooklyn-server
Updated Branches:
  refs/heads/master 3ac14e2bf -> 256aee05c


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/common/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.1.0.txt
----------------------------------------------------------------------
diff --git a/utils/common/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.1.0.txt b/utils/common/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.1.0.txt
new file mode 100644
index 0000000..80067a4
--- /dev/null
+++ b/utils/common/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.1.0.txt
@@ -0,0 +1,26 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you 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.
+
+The file brooklyn-test-osgi-entities.jar is for testing a deployment of
+an OSGi bundle containing entities.
+
+The source is in core/src/test/dependencies/osgi/more-entities-v1
+
+Under Apache conventions, binary files are not part of the source
+release. If you are using the source release, you may add this file
+by copying it from the master repository, which is accessible on the
+web at https://github.com/apache/incubator-brooklyn

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/common/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.2.0.jar
----------------------------------------------------------------------
diff --git a/utils/common/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.2.0.jar b/utils/common/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.2.0.jar
new file mode 100644
index 0000000..4de9b94
Binary files /dev/null and b/utils/common/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.2.0.jar differ

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/common/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.2.0.txt
----------------------------------------------------------------------
diff --git a/utils/common/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.2.0.txt b/utils/common/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.2.0.txt
new file mode 100644
index 0000000..3fb2d31
--- /dev/null
+++ b/utils/common/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.2.0.txt
@@ -0,0 +1,26 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you 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.
+
+The file brooklyn-test-osgi-entities.jar is for testing a deployment of
+an OSGi bundle containing entities.
+
+The source is in core/src/test/dependencies/osgi/more-entities-v2
+
+Under Apache conventions, binary files are not part of the source
+release. If you are using the source release, you may add this file
+by copying it from the master repository, which is accessible on the
+web at https://github.com/apache/incubator-brooklyn

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/common/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_evil-twin_0.2.0.jar
----------------------------------------------------------------------
diff --git a/utils/common/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_evil-twin_0.2.0.jar b/utils/common/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_evil-twin_0.2.0.jar
new file mode 100644
index 0000000..2c0e3a6
Binary files /dev/null and b/utils/common/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_evil-twin_0.2.0.jar differ

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/common/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_evil-twin_0.2.0.txt
----------------------------------------------------------------------
diff --git a/utils/common/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_evil-twin_0.2.0.txt b/utils/common/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_evil-twin_0.2.0.txt
new file mode 100644
index 0000000..1b9c2ab
--- /dev/null
+++ b/utils/common/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_evil-twin_0.2.0.txt
@@ -0,0 +1,26 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you 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.
+
+The file brooklyn-test-osgi-entities.jar is for testing a deployment of
+an OSGi bundle containing entities.
+
+The source is in core/src/test/dependencies/osgi/more-entities-v2-evil-twin
+
+Under Apache conventions, binary files are not part of the source
+release. If you are using the source release, you may add this file
+by copying it from the master repository, which is accessible on the
+web at https://github.com/apache/incubator-brooklyn

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/rt-felix/pom.xml
----------------------------------------------------------------------
diff --git a/utils/rt-felix/pom.xml b/utils/rt-felix/pom.xml
index 147e1de..5d1ff69 100644
--- a/utils/rt-felix/pom.xml
+++ b/utils/rt-felix/pom.xml
@@ -38,7 +38,7 @@
         </dependency>
         <dependency>
             <groupId>org.apache.brooklyn</groupId>
-            <artifactId>brooklyn-rt-osgi</artifactId>
+            <artifactId>brooklyn-utils-common</artifactId>
             <version>${project.version}</version>
         </dependency>
 
@@ -50,7 +50,7 @@
         </dependency>
         <dependency>
             <groupId>org.apache.brooklyn</groupId>
-            <artifactId>brooklyn-rt-osgi</artifactId>
+            <artifactId>brooklyn-utils-common</artifactId>
             <version>${project.version}</version>
             <classifier>tests</classifier>
             <scope>test</scope>

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/rt-osgi/pom.xml
----------------------------------------------------------------------
diff --git a/utils/rt-osgi/pom.xml b/utils/rt-osgi/pom.xml
deleted file mode 100644
index 2cac7f0..0000000
--- a/utils/rt-osgi/pom.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-<!--
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-
-     http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-
-    <parent>
-        <groupId>org.apache.brooklyn</groupId>
-        <artifactId>brooklyn-parent</artifactId>
-        <version>0.9.0-SNAPSHOT</version>  <!-- BROOKLYN_VERSION -->
-        <relativePath>../../parent/pom.xml</relativePath>
-    </parent>
-
-    <name>Brooklyn OSGi Utils</name>
-    <artifactId>brooklyn-rt-osgi</artifactId>
-    <packaging>jar</packaging>
-
-
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>org.apache.felix.framework</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.brooklyn</groupId>
-            <artifactId>brooklyn-utils-common</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.brooklyn</groupId>
-            <artifactId>brooklyn-utils-test-support</artifactId>
-            <version>${project.version}</version>
-            <scope>test</scope>
-        </dependency>
-    </dependencies>
-
-</project>

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/rt-osgi/src/main/java/org/apache/brooklyn/util/osgi/OsgiUtils.java
----------------------------------------------------------------------
diff --git a/utils/rt-osgi/src/main/java/org/apache/brooklyn/util/osgi/OsgiUtils.java b/utils/rt-osgi/src/main/java/org/apache/brooklyn/util/osgi/OsgiUtils.java
deleted file mode 100644
index 4e28720..0000000
--- a/utils/rt-osgi/src/main/java/org/apache/brooklyn/util/osgi/OsgiUtils.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright 2015 The Apache Software Foundation.
- *
- * 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.apache.brooklyn.util.osgi;
-
-import java.io.IOException;
-import java.net.JarURLConnection;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.jar.Attributes;
-import java.util.jar.Manifest;
-import org.apache.brooklyn.util.guava.Maybe;
-import org.apache.brooklyn.util.text.Strings;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.Constants;
-import org.osgi.framework.Version;
-
-/**
- * Simple OSGi utilities.
- * 
- * @author Ciprian Ciubotariu <ch...@gmx.net>
- */
-public class OsgiUtils {
-
-    public static URL getContainerUrl(URL url, String resourceInThatDir) {
-        //Switching from manual parsing of jar: and file: URLs to java provided functionality.
-        //The old code was breaking on any Windows path and instead of fixing it, using
-        //the provided Java APIs seemed like the better option since they are already tested
-        //on multiple platforms.
-        boolean isJar = "jar".equals(url.getProtocol());
-        if(isJar) {
-            try {
-                //let java handle the parsing of jar URL, no network connection is established.
-                //Strips the jar protocol:
-                //  jar:file:/<path to jar>!<resourceInThatDir>
-                //  becomes
-                //  file:/<path to jar>
-                JarURLConnection connection = (JarURLConnection) url.openConnection();
-                url = connection.getJarFileURL();
-            } catch (IOException e) {
-                throw new IllegalStateException(e);
-            }
-        } else {
-            //Remove the trailing resouceInThatDir path from the URL, thus getting the parent folder.
-            String path = url.toString();
-            int i = path.indexOf(resourceInThatDir);
-            if (i==-1) throw new IllegalStateException("Resource path ("+resourceInThatDir+") not in url substring ("+url+")");
-            String parent = path.substring(0, i);
-            try {
-                url = new URL(parent);
-            } catch (MalformedURLException e) {
-                throw new IllegalStateException("Resource ("+resourceInThatDir+") found at invalid URL parent (" + parent + ")", e);
-            }
-        }
-        return url;
-    }
-
-    public static String getVersionedId(Manifest manifest) {
-        Attributes atts = manifest.getMainAttributes();
-        return atts.getValue(Constants.BUNDLE_SYMBOLICNAME) + ":" + atts.getValue(Constants.BUNDLE_VERSION);
-    }
-
-    public static String getVersionedId(Bundle b) {
-        return b.getSymbolicName() + ":" + b.getVersion();
-    }
-
-    /** Takes a string which might be of the form "symbolic-name" or "symbolic-name:version" (or something else entirely)
-     * and returns a VersionedName. The versionedName.getVersion() will be null if if there was no version in the input
-     * (or returning {@link Maybe#absent()} if not valid, with a suitable error message). */
-    public static Maybe<VersionedName> parseOsgiIdentifier(String symbolicNameOptionalWithVersion) {
-        if (Strings.isBlank(symbolicNameOptionalWithVersion)) {
-            return Maybe.absent("OSGi identifier is blank");
-        }
-        String[] parts = symbolicNameOptionalWithVersion.split(":");
-        if (parts.length > 2) {
-            return Maybe.absent("OSGi identifier has too many parts; max one ':' symbol");
-        }
-        Version v = null;
-        if (parts.length == 2) {
-            try {
-                v = Version.parseVersion(parts[1]);
-            } catch (IllegalArgumentException e) {
-                return Maybe.absent("OSGi identifier has invalid version string (" + e.getMessage() + ")");
-            }
-        }
-        return Maybe.of(new VersionedName(parts[0], v));
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/rt-osgi/src/main/java/org/apache/brooklyn/util/osgi/VersionedName.java
----------------------------------------------------------------------
diff --git a/utils/rt-osgi/src/main/java/org/apache/brooklyn/util/osgi/VersionedName.java b/utils/rt-osgi/src/main/java/org/apache/brooklyn/util/osgi/VersionedName.java
deleted file mode 100644
index df36a80..0000000
--- a/utils/rt-osgi/src/main/java/org/apache/brooklyn/util/osgi/VersionedName.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright 2015 The Apache Software Foundation.
- *
- * 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.apache.brooklyn.util.osgi;
-
-import com.google.common.base.Objects;
-import org.apache.brooklyn.util.text.Strings;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.Version;
-
-/**
- * Versioned name of an OSGi bundle.
- * @author Ciprian Ciubotariu <ch...@gmx.net>
- */
-public class VersionedName {
-    private final String symbolicName;
-    private final Version version;
-
-    public VersionedName(Bundle b) {
-        this.symbolicName = b.getSymbolicName();
-        this.version = b.getVersion();
-    }
-
-    public VersionedName(String symbolicName, Version version) {
-        this.symbolicName = symbolicName;
-        this.version = version;
-    }
-
-    @Override
-    public String toString() {
-        return symbolicName + ":" + Strings.toString(version);
-    }
-
-    public boolean equals(String sn, String v) {
-        return symbolicName.equals(sn) && (version == null && v == null || version != null && version.toString().equals(v));
-    }
-
-    public boolean equals(String sn, Version v) {
-        return symbolicName.equals(sn) && (version == null && v == null || version != null && version.equals(v));
-    }
-
-    public String getSymbolicName() {
-        return symbolicName;
-    }
-
-    public Version getVersion() {
-        return version;
-    }
-
-    @Override
-    public int hashCode() {
-        return Objects.hashCode(symbolicName, version);
-    }
-
-    @Override
-    public boolean equals(Object other) {
-        if (!(other instanceof VersionedName)) {
-            return false;
-        }
-        VersionedName o = (VersionedName) other;
-        return Objects.equal(symbolicName, o.symbolicName) && Objects.equal(version, o.version);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/rt-osgi/src/test/dependencies/osgi/README.md
----------------------------------------------------------------------
diff --git a/utils/rt-osgi/src/test/dependencies/osgi/README.md b/utils/rt-osgi/src/test/dependencies/osgi/README.md
deleted file mode 100644
index bda2287..0000000
--- a/utils/rt-osgi/src/test/dependencies/osgi/README.md
+++ /dev/null
@@ -1,33 +0,0 @@
-This directory contains source code for OSGi bundle files 
-used for testing.
-
-Binaries are included under src/test/resources.  They are
-copied there when these projects are built, and the binaries
-are included in source control to speed up build times
-(as these projects do not change much).  These projects are
-NOT built as part of the normal brooklyn build.
-
-To rebuild all:
-
-    for x in *entities* ; do pushd $x ; mvn clean install ; popd ; done
-
-See OsgiTestResources.java for information on the bundles.
-
-----
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you 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.
-

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/rt-osgi/src/test/dependencies/osgi/entities/pom.xml
----------------------------------------------------------------------
diff --git a/utils/rt-osgi/src/test/dependencies/osgi/entities/pom.xml b/utils/rt-osgi/src/test/dependencies/osgi/entities/pom.xml
deleted file mode 100644
index d391f34..0000000
--- a/utils/rt-osgi/src/test/dependencies/osgi/entities/pom.xml
+++ /dev/null
@@ -1,84 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-    
-     http://www.apache.org/licenses/LICENSE-2.0
-    
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-    <packaging>jar</packaging>
-
-    <groupId>org.apache.brooklyn.test.resources.osgi</groupId>
-    <artifactId>brooklyn-test-osgi-entities</artifactId>
-    <version>0.1.0</version>
-
-    <name>OSGi bundled test entities</name>
-
-    <description>
-        Simple entities for testing the OSGi functionality
-    </description>
-
-    <parent>
-        <groupId>org.apache.brooklyn</groupId>
-        <artifactId>brooklyn-parent</artifactId>
-        <version>0.9.0-SNAPSHOT</version><!-- BROOKLYN_VERSION -->
-        <relativePath>../../../../../../../parent/pom.xml</relativePath>
-    </parent>
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.brooklyn</groupId>
-            <artifactId>brooklyn-core</artifactId>
-            <version>${brooklyn.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.brooklyn</groupId>
-            <artifactId>brooklyn-api</artifactId>
-            <version>${brooklyn.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.brooklyn</groupId>
-            <artifactId>brooklyn-utils-common</artifactId>
-            <version>${brooklyn.version}</version>
-        </dependency>
-    </dependencies>
-    
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-jar-plugin</artifactId>
-                <version>2.3.2</version>
-                <configuration>
-                    <outputDirectory>../../../resources/brooklyn/osgi</outputDirectory>
-                    <finalName>brooklyn-test-osgi-entities</finalName>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-bundle-plugin</artifactId>
-                <version>2.5.3</version>
-                <configuration>
-                    <instructions>
-                        <Bundle-Version>${project.version}</Bundle-Version>
-                        <Brooklyn-Feature-BuildId>${buildNumber}</Brooklyn-Feature-BuildId>
-                        <Brooklyn-Feature-BuildBranch>${scmBranch}</Brooklyn-Feature-BuildBranch>
-                    </instructions>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-</project>

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/rt-osgi/src/test/dependencies/osgi/entities/src/main/java/org/apache/brooklyn/test/osgi/entities/SimpleApplication.java
----------------------------------------------------------------------
diff --git a/utils/rt-osgi/src/test/dependencies/osgi/entities/src/main/java/org/apache/brooklyn/test/osgi/entities/SimpleApplication.java b/utils/rt-osgi/src/test/dependencies/osgi/entities/src/main/java/org/apache/brooklyn/test/osgi/entities/SimpleApplication.java
deleted file mode 100644
index dcfb495..0000000
--- a/utils/rt-osgi/src/test/dependencies/osgi/entities/src/main/java/org/apache/brooklyn/test/osgi/entities/SimpleApplication.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.apache.brooklyn.test.osgi.entities;
-
-
-import org.apache.brooklyn.api.entity.ImplementedBy;
-import org.apache.brooklyn.core.entity.StartableApplication;
-
-@ImplementedBy(SimpleApplicationImpl.class)
-public interface SimpleApplication extends StartableApplication {
-
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/rt-osgi/src/test/dependencies/osgi/entities/src/main/java/org/apache/brooklyn/test/osgi/entities/SimpleApplicationImpl.java
----------------------------------------------------------------------
diff --git a/utils/rt-osgi/src/test/dependencies/osgi/entities/src/main/java/org/apache/brooklyn/test/osgi/entities/SimpleApplicationImpl.java b/utils/rt-osgi/src/test/dependencies/osgi/entities/src/main/java/org/apache/brooklyn/test/osgi/entities/SimpleApplicationImpl.java
deleted file mode 100644
index fe6f1a2..0000000
--- a/utils/rt-osgi/src/test/dependencies/osgi/entities/src/main/java/org/apache/brooklyn/test/osgi/entities/SimpleApplicationImpl.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.apache.brooklyn.test.osgi.entities;
-
-
-import org.apache.brooklyn.core.entity.AbstractApplication;
-import org.apache.brooklyn.core.entity.StartableApplication;
-
-public class SimpleApplicationImpl extends AbstractApplication implements StartableApplication, SimpleApplication {
-
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/rt-osgi/src/test/dependencies/osgi/entities/src/main/java/org/apache/brooklyn/test/osgi/entities/SimpleEntity.java
----------------------------------------------------------------------
diff --git a/utils/rt-osgi/src/test/dependencies/osgi/entities/src/main/java/org/apache/brooklyn/test/osgi/entities/SimpleEntity.java b/utils/rt-osgi/src/test/dependencies/osgi/entities/src/main/java/org/apache/brooklyn/test/osgi/entities/SimpleEntity.java
deleted file mode 100644
index 87cd944..0000000
--- a/utils/rt-osgi/src/test/dependencies/osgi/entities/src/main/java/org/apache/brooklyn/test/osgi/entities/SimpleEntity.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.apache.brooklyn.test.osgi.entities;
-
-
-import org.apache.brooklyn.api.entity.Entity;
-import org.apache.brooklyn.api.entity.ImplementedBy;
-
-@ImplementedBy(SimpleEntityImpl.class)
-public interface SimpleEntity extends Entity {
-
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/rt-osgi/src/test/dependencies/osgi/entities/src/main/java/org/apache/brooklyn/test/osgi/entities/SimpleEntityImpl.java
----------------------------------------------------------------------
diff --git a/utils/rt-osgi/src/test/dependencies/osgi/entities/src/main/java/org/apache/brooklyn/test/osgi/entities/SimpleEntityImpl.java b/utils/rt-osgi/src/test/dependencies/osgi/entities/src/main/java/org/apache/brooklyn/test/osgi/entities/SimpleEntityImpl.java
deleted file mode 100644
index 2595c39..0000000
--- a/utils/rt-osgi/src/test/dependencies/osgi/entities/src/main/java/org/apache/brooklyn/test/osgi/entities/SimpleEntityImpl.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.apache.brooklyn.test.osgi.entities;
-
-import org.apache.brooklyn.core.entity.AbstractEntity;
-
-
-public class SimpleEntityImpl extends AbstractEntity implements SimpleEntity {
-
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/rt-osgi/src/test/dependencies/osgi/entities/src/main/java/org/apache/brooklyn/test/osgi/entities/SimpleLocation.java
----------------------------------------------------------------------
diff --git a/utils/rt-osgi/src/test/dependencies/osgi/entities/src/main/java/org/apache/brooklyn/test/osgi/entities/SimpleLocation.java b/utils/rt-osgi/src/test/dependencies/osgi/entities/src/main/java/org/apache/brooklyn/test/osgi/entities/SimpleLocation.java
deleted file mode 100644
index 60749cf..0000000
--- a/utils/rt-osgi/src/test/dependencies/osgi/entities/src/main/java/org/apache/brooklyn/test/osgi/entities/SimpleLocation.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.apache.brooklyn.test.osgi.entities;
-
-import org.apache.brooklyn.config.ConfigKey;
-import org.apache.brooklyn.core.config.ConfigKeys;
-import org.apache.brooklyn.core.location.AbstractLocation;
-import org.apache.brooklyn.util.core.flags.SetFromFlag;
-
-public class SimpleLocation extends AbstractLocation {
-    @SetFromFlag("config1")
-    public static final ConfigKey<String> CONFIG1 = ConfigKeys.newStringConfigKey("config1");
-
-    @SetFromFlag("config2")
-    public static final ConfigKey<String> CONFIG2 = ConfigKeys.newStringConfigKey("config2");
-
-    @SetFromFlag("config3")
-    public static final ConfigKey<String> CONFIG3 = ConfigKeys.newStringConfigKey("config3");
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/rt-osgi/src/test/dependencies/osgi/entities/src/main/java/org/apache/brooklyn/test/osgi/entities/SimplePolicy.java
----------------------------------------------------------------------
diff --git a/utils/rt-osgi/src/test/dependencies/osgi/entities/src/main/java/org/apache/brooklyn/test/osgi/entities/SimplePolicy.java b/utils/rt-osgi/src/test/dependencies/osgi/entities/src/main/java/org/apache/brooklyn/test/osgi/entities/SimplePolicy.java
deleted file mode 100644
index fdea821..0000000
--- a/utils/rt-osgi/src/test/dependencies/osgi/entities/src/main/java/org/apache/brooklyn/test/osgi/entities/SimplePolicy.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.apache.brooklyn.test.osgi.entities;
-
-
-import org.apache.brooklyn.config.ConfigKey;
-import org.apache.brooklyn.core.config.ConfigKeys;
-import org.apache.brooklyn.core.policy.AbstractPolicy;
-import org.apache.brooklyn.util.core.flags.SetFromFlag;
-
-public class SimplePolicy extends AbstractPolicy {
-    @SetFromFlag("config1")
-    public static final ConfigKey<String> CONFIG1 = ConfigKeys.newStringConfigKey("config1");
-
-    @SetFromFlag("config2")
-    public static final ConfigKey<String> CONFIG2 = ConfigKeys.newStringConfigKey("config2");
-
-    @SetFromFlag("config3")
-    public static final ConfigKey<String> CONFIG3 = ConfigKeys.newStringConfigKey("config3");
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/rt-osgi/src/test/dependencies/osgi/entities/src/main/resources/org/apache/brooklyn/test/osgi/entities/icon.gif
----------------------------------------------------------------------
diff --git a/utils/rt-osgi/src/test/dependencies/osgi/entities/src/main/resources/org/apache/brooklyn/test/osgi/entities/icon.gif b/utils/rt-osgi/src/test/dependencies/osgi/entities/src/main/resources/org/apache/brooklyn/test/osgi/entities/icon.gif
deleted file mode 100644
index e565824..0000000
Binary files a/utils/rt-osgi/src/test/dependencies/osgi/entities/src/main/resources/org/apache/brooklyn/test/osgi/entities/icon.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v1/pom.xml
----------------------------------------------------------------------
diff --git a/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v1/pom.xml b/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v1/pom.xml
deleted file mode 100644
index 000c5cd..0000000
--- a/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v1/pom.xml
+++ /dev/null
@@ -1,82 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-    
-     http://www.apache.org/licenses/LICENSE-2.0
-    
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-    <packaging>jar</packaging>
-
-    <groupId>org.apache.brooklyn.test.resources.osgi</groupId>
-    <artifactId>brooklyn-test-osgi-more-entities</artifactId>
-    <version>0.1.0</version>
-
-    <name>OSGi bundled test entities</name>
-
-    <description>
-        Simple entities for testing the OSGi functionality
-    </description>
-
-    <parent>
-        <groupId>org.apache.brooklyn</groupId>
-        <artifactId>brooklyn-parent</artifactId>
-        <version>0.9.0-SNAPSHOT</version><!-- BROOKLYN_VERSION -->
-        <relativePath>../../../../../../../parent/pom.xml</relativePath>
-    </parent>
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.brooklyn</groupId>
-            <artifactId>brooklyn-core</artifactId>
-            <version>${brooklyn.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.brooklyn</groupId>
-            <artifactId>brooklyn-api</artifactId>
-            <version>${brooklyn.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.brooklyn</groupId>
-            <artifactId>brooklyn-utils-common</artifactId>
-            <version>${brooklyn.version}</version>
-        </dependency>
-    </dependencies>
-    
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-jar-plugin</artifactId>
-                <version>2.3.2</version>
-                <configuration>
-                    <outputDirectory>../../../resources/brooklyn/osgi</outputDirectory>
-                    <finalName>brooklyn-test-osgi-more-entities_${project.version}</finalName>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-bundle-plugin</artifactId>
-                <version>2.5.3</version>
-                <configuration>
-                    <instructions>
-                        <Bundle-Version>${project.version}</Bundle-Version>
-                    </instructions>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-</project>

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v1/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreEntity.java
----------------------------------------------------------------------
diff --git a/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v1/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreEntity.java b/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v1/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreEntity.java
deleted file mode 100644
index 4efd1e3..0000000
--- a/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v1/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreEntity.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.apache.brooklyn.test.osgi.entities.more;
-
-import org.apache.brooklyn.api.effector.Effector;
-import org.apache.brooklyn.api.entity.Entity;
-import org.apache.brooklyn.api.entity.ImplementedBy;
-import org.apache.brooklyn.core.effector.Effectors;
-
-@ImplementedBy(MoreEntityImpl.class)
-public interface MoreEntity extends Entity {
-
-    public static final Effector<String> SAY_HI = Effectors.effector(String.class, "sayHI")
-        .description("says HI to an uppercased name")
-        .parameter(String.class, "name")
-        .buildAbstract();
-
-    /** Makes a string saying hi to the given name, in uppercase, for testing. */
-    String sayHI(String name);
-    
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v1/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreEntityImpl.java
----------------------------------------------------------------------
diff --git a/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v1/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreEntityImpl.java b/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v1/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreEntityImpl.java
deleted file mode 100644
index c1eecd3..0000000
--- a/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v1/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreEntityImpl.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.apache.brooklyn.test.osgi.entities.more;
-
-import org.apache.brooklyn.core.effector.EffectorBody;
-import org.apache.brooklyn.core.entity.AbstractEntity;
-import org.apache.brooklyn.util.core.config.ConfigBag;
-
-public class MoreEntityImpl extends AbstractEntity implements MoreEntity {
-
-    @Override
-    public void init() {
-        super.init();
-        getMutableEntityType().addEffector(SAY_HI, new EffectorBody<String>() {
-            @Override
-            public String call(ConfigBag parameters) {
-                return sayHI((String)parameters.getStringKey("name"));
-            }
-        });
-    }
-    
-    @Override
-    public String sayHI(String name) {
-        return "Hi "+name.toUpperCase()+" from V1";
-    }
-    
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v1/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreLocation.java
----------------------------------------------------------------------
diff --git a/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v1/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreLocation.java b/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v1/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreLocation.java
deleted file mode 100644
index 943c53c..0000000
--- a/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v1/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreLocation.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.apache.brooklyn.test.osgi.entities.more;
-
-import org.apache.brooklyn.core.location.AbstractLocation;
-
-public class MoreLocation extends AbstractLocation {
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v1/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MorePolicy.java
----------------------------------------------------------------------
diff --git a/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v1/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MorePolicy.java b/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v1/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MorePolicy.java
deleted file mode 100644
index b72768b..0000000
--- a/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v1/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MorePolicy.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.apache.brooklyn.test.osgi.entities.more;
-
-import org.apache.brooklyn.core.policy.AbstractPolicy;
-
-public class MorePolicy extends AbstractPolicy {
-
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v1/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreTemplate.java
----------------------------------------------------------------------
diff --git a/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v1/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreTemplate.java b/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v1/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreTemplate.java
deleted file mode 100644
index c66ed32..0000000
--- a/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v1/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreTemplate.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.apache.brooklyn.test.osgi.entities.more;
-
-import org.apache.brooklyn.core.entity.AbstractApplication;
-
-public class MoreTemplate extends AbstractApplication {
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v2-evil-twin/pom.xml
----------------------------------------------------------------------
diff --git a/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v2-evil-twin/pom.xml b/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v2-evil-twin/pom.xml
deleted file mode 100644
index 9ad32fe..0000000
--- a/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v2-evil-twin/pom.xml
+++ /dev/null
@@ -1,88 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-    
-     http://www.apache.org/licenses/LICENSE-2.0
-    
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-    <packaging>jar</packaging>
-
-    <groupId>org.apache.brooklyn.test.resources.osgi.evil_twin</groupId>
-    <artifactId>brooklyn-test-osgi-more-entities</artifactId>
-    <version>0.2.0</version>
-
-    <name>OSGi bundled test entities</name>
-
-    <description>
-        Simple entities for testing the OSGi functionality
-    </description>
-
-    <parent>
-        <groupId>org.apache.brooklyn</groupId>
-        <artifactId>brooklyn-parent</artifactId>
-        <version>0.9.0-SNAPSHOT</version><!-- BROOKLYN_VERSION -->
-        <relativePath>../../../../../../../parent/pom.xml</relativePath>
-    </parent>
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.brooklyn</groupId>
-            <artifactId>brooklyn-core</artifactId>
-            <version>${brooklyn.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.brooklyn</groupId>
-            <artifactId>brooklyn-api</artifactId>
-            <version>${brooklyn.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.brooklyn</groupId>
-            <artifactId>brooklyn-utils-common</artifactId>
-            <version>${brooklyn.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.brooklyn.test.resources.osgi</groupId>
-            <artifactId>brooklyn-test-osgi-entities</artifactId>
-            <version>0.1.0</version>
-        </dependency>
-    </dependencies>
-    
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-jar-plugin</artifactId>
-                <version>2.3.2</version>
-                <configuration>
-                    <outputDirectory>../../../resources/brooklyn/osgi</outputDirectory>
-                    <finalName>brooklyn-test-osgi-more-entities_evil-twin_${project.version}</finalName>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-bundle-plugin</artifactId>
-                <version>2.5.3</version>
-                <configuration>
-                    <instructions>
-                        <Bundle-SymbolicName>org.apache.brooklyn.test.resources.osgi.brooklyn-test-osgi-more-entities</Bundle-SymbolicName>
-                        <Bundle-Version>${project.version}</Bundle-Version>
-                    </instructions>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-</project>

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v2-evil-twin/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreEntity.java
----------------------------------------------------------------------
diff --git a/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v2-evil-twin/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreEntity.java b/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v2-evil-twin/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreEntity.java
deleted file mode 100644
index f0ace90..0000000
--- a/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v2-evil-twin/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreEntity.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.apache.brooklyn.test.osgi.entities.more;
-
-import org.apache.brooklyn.api.effector.Effector;
-import org.apache.brooklyn.api.entity.Entity;
-import org.apache.brooklyn.api.entity.ImplementedBy;
-import org.apache.brooklyn.core.effector.Effectors;
-
-@ImplementedBy(MoreEntityImpl.class)
-public interface MoreEntity extends Entity {
-
-    public static final Effector<String> SAY_HI = Effectors.effector(String.class, "sayHI")
-        .description("says HO to an uppercased name")
-        .parameter(String.class, "name")
-        .buildAbstract();
-
-    /** Makes a string saying HO to the given name, in contrast to v1 and v2. */
-    String sayHI(String name);
-    
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v2-evil-twin/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreEntityImpl.java
----------------------------------------------------------------------
diff --git a/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v2-evil-twin/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreEntityImpl.java b/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v2-evil-twin/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreEntityImpl.java
deleted file mode 100644
index d2cfa08..0000000
--- a/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v2-evil-twin/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreEntityImpl.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.apache.brooklyn.test.osgi.entities.more;
-
-import org.apache.brooklyn.api.policy.PolicySpec;
-import org.apache.brooklyn.core.effector.EffectorBody;
-import org.apache.brooklyn.core.entity.AbstractEntity;
-import org.apache.brooklyn.util.core.config.ConfigBag;
-
-public class MoreEntityImpl extends AbstractEntity implements MoreEntity {
-
-    /** Unlike v1, this declares an explicit dependency on SimplePolicy */
-    @Override
-    public void init() {
-        super.init();
-        getMutableEntityType().addEffector(SAY_HI, new EffectorBody<String>() {
-            @Override
-            public String call(ConfigBag parameters) {
-                return sayHI((String)parameters.getStringKey("name"));
-            }
-        });
-        addPolicy(PolicySpec.create(org.apache.brooklyn.test.osgi.entities.SimplePolicy.class));
-    }
-    
-    /** Returns HO instead of HI (like v2 non-evil twin) or Hi (like v1) */
-    public String sayHI(String name) {
-        return "HO "+name.toUpperCase()+" FROM V2 EVIL TWIN";
-    }
-    
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v2/pom.xml
----------------------------------------------------------------------
diff --git a/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v2/pom.xml b/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v2/pom.xml
deleted file mode 100644
index 4b4a4fb..0000000
--- a/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v2/pom.xml
+++ /dev/null
@@ -1,88 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-    
-     http://www.apache.org/licenses/LICENSE-2.0
-    
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-    <packaging>jar</packaging>
-
-    <groupId>org.apache.brooklyn.test.resources.osgi</groupId>
-    <artifactId>brooklyn-test-osgi-more-entities</artifactId>
-    <version>0.2.0</version>
-
-    <name>OSGi bundled test entities</name>
-
-    <description>
-        Simple entities for testing the OSGi functionality
-    </description>
-
-    <parent>
-        <groupId>org.apache.brooklyn</groupId>
-        <artifactId>brooklyn-parent</artifactId>
-        <version>0.9.0-SNAPSHOT</version><!-- BROOKLYN_VERSION -->
-        <relativePath>../../../../../../../parent/pom.xml</relativePath>
-    </parent>
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.brooklyn</groupId>
-            <artifactId>brooklyn-core</artifactId>
-            <version>${brooklyn.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.brooklyn</groupId>
-            <artifactId>brooklyn-api</artifactId>
-            <version>${brooklyn.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.brooklyn</groupId>
-            <artifactId>brooklyn-utils-common</artifactId>
-            <version>${brooklyn.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.brooklyn.test.resources.osgi</groupId>
-            <artifactId>brooklyn-test-osgi-entities</artifactId>
-            <version>0.1.0</version>
-        </dependency>
-    </dependencies>
-    
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-jar-plugin</artifactId>
-                <version>2.3.2</version>
-                <configuration>
-                    <outputDirectory>../../../resources/brooklyn/osgi</outputDirectory>
-                    <finalName>brooklyn-test-osgi-more-entities_${project.version}</finalName>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-bundle-plugin</artifactId>
-                <version>2.5.3</version>
-                <configuration>
-                    <instructions>
-                        <Bundle-SymbolicName>org.apache.brooklyn.test.resources.osgi.brooklyn-test-osgi-more-entities</Bundle-SymbolicName>
-                        <Bundle-Version>${project.version}</Bundle-Version>
-                    </instructions>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-</project>

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v2/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreEntity.java
----------------------------------------------------------------------
diff --git a/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v2/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreEntity.java b/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v2/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreEntity.java
deleted file mode 100644
index 9d4d840..0000000
--- a/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v2/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreEntity.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.apache.brooklyn.test.osgi.entities.more;
-
-import org.apache.brooklyn.api.catalog.Catalog;
-import org.apache.brooklyn.api.effector.Effector;
-import org.apache.brooklyn.api.entity.Entity;
-import org.apache.brooklyn.api.entity.ImplementedBy;
-import org.apache.brooklyn.config.ConfigKey;
-import org.apache.brooklyn.core.config.ConfigKeys;
-import org.apache.brooklyn.core.effector.Effectors;
-
-@Catalog(name="More Entity v2")
-@ImplementedBy(MoreEntityImpl.class)
-public interface MoreEntity extends Entity {
-
-    public static final ConfigKey<String> MORE_CONFIG = ConfigKeys.newStringConfigKey("more_config");
-    public static final Effector<String> SAY_HI = Effectors.effector(String.class, "sayHI")
-        .description("says HI to an uppercased name")
-        .parameter(String.class, "name")
-        .buildAbstract();
-
-    /** Makes a string saying hi to the given name, in uppercase, for testing. 
-     * In contrast to v1, impl here returns HI not Hi. */
-    String sayHI(String name);
-    
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v2/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreEntityImpl.java
----------------------------------------------------------------------
diff --git a/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v2/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreEntityImpl.java b/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v2/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreEntityImpl.java
deleted file mode 100644
index 0aff562..0000000
--- a/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v2/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreEntityImpl.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.apache.brooklyn.test.osgi.entities.more;
-
-import org.apache.brooklyn.api.policy.PolicySpec;
-import org.apache.brooklyn.core.effector.EffectorBody;
-import org.apache.brooklyn.core.entity.AbstractEntity;
-import org.apache.brooklyn.util.core.config.ConfigBag;
-
-public class MoreEntityImpl extends AbstractEntity implements MoreEntity {
-
-    /** Unlike v1, this declares an explicit dependency on SimplePolicy */
-    @Override
-    public void init() {
-        super.init();
-        getMutableEntityType().addEffector(SAY_HI, new EffectorBody<String>() {
-            @Override
-            public String call(ConfigBag parameters) {
-                return sayHI((String)parameters.getStringKey("name"));
-            }
-        });
-        addPolicy(PolicySpec.create(org.apache.brooklyn.test.osgi.entities.SimplePolicy.class));
-    }
-    
-    /** Unlike v1, this returns "HI " rather than "Hi " */
-    public String sayHI(String name) {
-        return "HI "+name.toUpperCase()+" FROM V2";
-    }
-    
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v2/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreLocation.java
----------------------------------------------------------------------
diff --git a/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v2/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreLocation.java b/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v2/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreLocation.java
deleted file mode 100644
index ed10541..0000000
--- a/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v2/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreLocation.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.apache.brooklyn.test.osgi.entities.more;
-
-import org.apache.brooklyn.api.catalog.Catalog;
-import org.apache.brooklyn.core.location.AbstractLocation;
-
-@Catalog(name="More Location", description="Cataliog item OSGi test location")
-public class MoreLocation extends AbstractLocation {
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v2/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MorePolicy.java
----------------------------------------------------------------------
diff --git a/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v2/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MorePolicy.java b/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v2/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MorePolicy.java
deleted file mode 100644
index 7909d5b..0000000
--- a/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v2/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MorePolicy.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.apache.brooklyn.test.osgi.entities.more;
-
-import org.apache.brooklyn.api.catalog.Catalog;
-import org.apache.brooklyn.core.policy.AbstractPolicy;
-
-@Catalog(name="More Policy", description="Cataliog item OSGi test policy")
-public class MorePolicy extends AbstractPolicy {
-    public String sayHI(String name) {
-        return "HI "+name.toUpperCase()+" FROM V2";
-    }
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v2/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreTemplate.java
----------------------------------------------------------------------
diff --git a/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v2/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreTemplate.java b/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v2/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreTemplate.java
deleted file mode 100644
index 9e0fc85..0000000
--- a/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v2/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreTemplate.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.apache.brooklyn.test.osgi.entities.more;
-
-import org.apache.brooklyn.api.catalog.Catalog;
-import org.apache.brooklyn.core.entity.AbstractApplication;
-
-@Catalog(name="More Template", description="Cataliog item OSGi test template")
-public class MoreTemplate extends AbstractApplication {
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/rt-osgi/src/test/resources/brooklyn/osgi/README.md
----------------------------------------------------------------------
diff --git a/utils/rt-osgi/src/test/resources/brooklyn/osgi/README.md b/utils/rt-osgi/src/test/resources/brooklyn/osgi/README.md
deleted file mode 100644
index 1d78ddb..0000000
--- a/utils/rt-osgi/src/test/resources/brooklyn/osgi/README.md
+++ /dev/null
@@ -1,25 +0,0 @@
-This directory contains OSGi bundle files used for testing.
-
-Source code including pom.xml is contained in the bundles,
-or in /src/dependencies, or both.
-
-See OsgiTestResources.java for information on the bundles.
-
-----
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you 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.
-

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/rt-osgi/src/test/resources/brooklyn/osgi/brooklyn-osgi-test-a_0.1.0.jar
----------------------------------------------------------------------
diff --git a/utils/rt-osgi/src/test/resources/brooklyn/osgi/brooklyn-osgi-test-a_0.1.0.jar b/utils/rt-osgi/src/test/resources/brooklyn/osgi/brooklyn-osgi-test-a_0.1.0.jar
deleted file mode 100644
index b4c777c..0000000
Binary files a/utils/rt-osgi/src/test/resources/brooklyn/osgi/brooklyn-osgi-test-a_0.1.0.jar and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/rt-osgi/src/test/resources/brooklyn/osgi/brooklyn-osgi-test-a_0.1.0.txt
----------------------------------------------------------------------
diff --git a/utils/rt-osgi/src/test/resources/brooklyn/osgi/brooklyn-osgi-test-a_0.1.0.txt b/utils/rt-osgi/src/test/resources/brooklyn/osgi/brooklyn-osgi-test-a_0.1.0.txt
deleted file mode 100644
index e6dde72..0000000
--- a/utils/rt-osgi/src/test/resources/brooklyn/osgi/brooklyn-osgi-test-a_0.1.0.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you 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.
-
-The file brooklyn-osgi-test-a_0.1.0.jar is an extremely simple OSGi bundle,
-used in brooklyn.management.osgi.OsgiStandaloneTest.
-
-The jar contains its source.
-
-Under Apache conventions, binary files are not part of the source
-release. If you are using the source release, you may add this file
-by copying it from the master repository, which is accessible on the
-web at https://github.com/apache/incubator-brooklyn

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/rt-osgi/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-entities.jar
----------------------------------------------------------------------
diff --git a/utils/rt-osgi/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-entities.jar b/utils/rt-osgi/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-entities.jar
deleted file mode 100644
index c76d03b..0000000
Binary files a/utils/rt-osgi/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-entities.jar and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/rt-osgi/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-entities.txt
----------------------------------------------------------------------
diff --git a/utils/rt-osgi/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-entities.txt b/utils/rt-osgi/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-entities.txt
deleted file mode 100644
index 9cf43a4..0000000
--- a/utils/rt-osgi/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-entities.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you 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.
-
-The file brooklyn-test-osgi-entities.jar is for testing a deployment of
-an OSGi bundle containing entities.
-
-The source is in core/src/test/dependencies/osgi/entities
-
-Under Apache conventions, binary files are not part of the source
-release. If you are using the source release, you may add this file
-by copying it from the master repository, which is accessible on the
-web at https://github.com/apache/incubator-brooklyn

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/rt-osgi/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.1.0.jar
----------------------------------------------------------------------
diff --git a/utils/rt-osgi/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.1.0.jar b/utils/rt-osgi/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.1.0.jar
deleted file mode 100644
index 1101112..0000000
Binary files a/utils/rt-osgi/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.1.0.jar and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/rt-osgi/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.1.0.txt
----------------------------------------------------------------------
diff --git a/utils/rt-osgi/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.1.0.txt b/utils/rt-osgi/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.1.0.txt
deleted file mode 100644
index 80067a4..0000000
--- a/utils/rt-osgi/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.1.0.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you 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.
-
-The file brooklyn-test-osgi-entities.jar is for testing a deployment of
-an OSGi bundle containing entities.
-
-The source is in core/src/test/dependencies/osgi/more-entities-v1
-
-Under Apache conventions, binary files are not part of the source
-release. If you are using the source release, you may add this file
-by copying it from the master repository, which is accessible on the
-web at https://github.com/apache/incubator-brooklyn

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/rt-osgi/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.2.0.jar
----------------------------------------------------------------------
diff --git a/utils/rt-osgi/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.2.0.jar b/utils/rt-osgi/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.2.0.jar
deleted file mode 100644
index 4de9b94..0000000
Binary files a/utils/rt-osgi/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.2.0.jar and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/rt-osgi/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.2.0.txt
----------------------------------------------------------------------
diff --git a/utils/rt-osgi/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.2.0.txt b/utils/rt-osgi/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.2.0.txt
deleted file mode 100644
index 3fb2d31..0000000
--- a/utils/rt-osgi/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.2.0.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you 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.
-
-The file brooklyn-test-osgi-entities.jar is for testing a deployment of
-an OSGi bundle containing entities.
-
-The source is in core/src/test/dependencies/osgi/more-entities-v2
-
-Under Apache conventions, binary files are not part of the source
-release. If you are using the source release, you may add this file
-by copying it from the master repository, which is accessible on the
-web at https://github.com/apache/incubator-brooklyn

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/rt-osgi/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_evil-twin_0.2.0.jar
----------------------------------------------------------------------
diff --git a/utils/rt-osgi/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_evil-twin_0.2.0.jar b/utils/rt-osgi/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_evil-twin_0.2.0.jar
deleted file mode 100644
index 2c0e3a6..0000000
Binary files a/utils/rt-osgi/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_evil-twin_0.2.0.jar and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/rt-osgi/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_evil-twin_0.2.0.txt
----------------------------------------------------------------------
diff --git a/utils/rt-osgi/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_evil-twin_0.2.0.txt b/utils/rt-osgi/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_evil-twin_0.2.0.txt
deleted file mode 100644
index 1b9c2ab..0000000
--- a/utils/rt-osgi/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_evil-twin_0.2.0.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you 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.
-
-The file brooklyn-test-osgi-entities.jar is for testing a deployment of
-an OSGi bundle containing entities.
-
-The source is in core/src/test/dependencies/osgi/more-entities-v2-evil-twin
-
-Under Apache conventions, binary files are not part of the source
-release. If you are using the source release, you may add this file
-by copying it from the master repository, which is accessible on the
-web at https://github.com/apache/incubator-brooklyn


[3/7] brooklyn-server git commit: [BROOKLYN-183] Initialize brooklyn-core on bundle activation

Posted by sv...@apache.org.
[BROOKLYN-183] Initialize brooklyn-core on bundle activation

Naively initialize brooklyn-core following the call-graph performed by
the non-OSGi launcher, starting from o.a.b.cli.Main down to
o.a.b.launcher.BrooklynLauncher.

Initialization is done via an artifical o.a.b.core.OsgiLauncher bean so
that the initialization sequence could be more easily compared to that
of the cli launcher.

Fix access to ManagementContextInternal from CXF REST resources by
injecting it explicitly. Karaf injects a service proxy instead of wiring
the service implementor, and as a result simply casting the management
context to ManagementContextInternal interface does not work.


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/cca26a6f
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/cca26a6f
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/cca26a6f

Branch: refs/heads/master
Commit: cca26a6ffbdc8ce1f498e7080d72462d3b28f088
Parents: 972854a
Author: Ciprian Ciubotariu <ch...@gmx.net>
Authored: Wed Feb 10 00:04:41 2016 +0200
Committer: Ciprian Ciubotariu <ch...@gmx.net>
Committed: Mon Feb 29 20:11:15 2016 +0200

----------------------------------------------------------------------
 .../org/apache/brooklyn/core/OsgiLauncher.java  | 557 +++++++++++++++++++
 .../resources/OSGI-INF/blueprint/blueprint.xml  |  43 +-
 .../etc/org.apache.brooklyn.osgilauncher.cfg    |  59 ++
 .../main/resources/etc/org.apache.cxf.osgi.cfg  |  20 -
 karaf/features/src/main/feature/feature.xml     |   4 +
 .../features/src/main/feature/feature.xml.orig  | 288 ++++++++++
 .../java/org/apache/brooklyn/AssemblyTest.java  |  13 +-
 .../rest/BrooklynRestApiLauncherTest.java       |  98 ++++
 .../resources/AbstractBrooklynRestResource.java |  16 +
 .../brooklyn/rest/resources/AccessResource.java |   5 +-
 .../brooklyn/rest/resources/ServerResource.java |   7 +-
 .../brooklyn/rest/resources/UsageResource.java  |   9 +-
 .../resources/OSGI-INF/blueprint/service.xml    |  20 +
 13 files changed, 1095 insertions(+), 44 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/cca26a6f/core/src/main/java/org/apache/brooklyn/core/OsgiLauncher.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/OsgiLauncher.java b/core/src/main/java/org/apache/brooklyn/core/OsgiLauncher.java
new file mode 100644
index 0000000..b7f5bea
--- /dev/null
+++ b/core/src/main/java/org/apache/brooklyn/core/OsgiLauncher.java
@@ -0,0 +1,557 @@
+/*
+ * Copyright 2016 The Apache Software Foundation.
+ *
+ * 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.apache.brooklyn.core;
+
+import com.google.common.base.Function;
+import com.google.common.base.Stopwatch;
+import com.google.common.collect.Iterables;
+import groovy.lang.GroovyClassLoader;
+import java.io.Closeable;
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.util.concurrent.TimeoutException;
+import org.apache.brooklyn.api.catalog.BrooklynCatalog;
+import org.apache.brooklyn.api.catalog.CatalogItem;
+import org.apache.brooklyn.api.entity.EntitySpec;
+import org.apache.brooklyn.api.location.Location;
+import org.apache.brooklyn.api.mgmt.ManagementContext;
+import org.apache.brooklyn.api.mgmt.ha.HighAvailabilityManager;
+import org.apache.brooklyn.api.mgmt.ha.HighAvailabilityMode;
+import org.apache.brooklyn.api.mgmt.ha.ManagementNodeState;
+import org.apache.brooklyn.api.mgmt.ha.ManagementPlaneSyncRecordPersister;
+import org.apache.brooklyn.api.mgmt.rebind.PersistenceExceptionHandler;
+import org.apache.brooklyn.api.mgmt.rebind.RebindManager;
+import org.apache.brooklyn.core.catalog.internal.CatalogInitialization;
+import org.apache.brooklyn.core.entity.Entities;
+import org.apache.brooklyn.core.internal.BrooklynProperties;
+import org.apache.brooklyn.core.mgmt.ha.HighAvailabilityManagerImpl;
+import org.apache.brooklyn.core.mgmt.ha.ManagementPlaneSyncRecordPersisterToObjectStore;
+import org.apache.brooklyn.core.mgmt.internal.BrooklynShutdownHooks;
+import org.apache.brooklyn.core.mgmt.internal.LocalManagementContext;
+import org.apache.brooklyn.core.mgmt.internal.ManagementContextInternal;
+import org.apache.brooklyn.core.mgmt.persist.BrooklynMementoPersisterToObjectStore;
+import org.apache.brooklyn.core.mgmt.persist.BrooklynPersistenceUtils;
+import org.apache.brooklyn.core.mgmt.persist.PersistMode;
+import org.apache.brooklyn.core.mgmt.persist.PersistenceObjectStore;
+import org.apache.brooklyn.core.mgmt.rebind.PersistenceExceptionHandlerImpl;
+import org.apache.brooklyn.core.mgmt.rebind.RebindManagerImpl;
+import org.apache.brooklyn.core.objs.BrooklynTypes;
+import org.apache.brooklyn.core.server.BrooklynServerConfig;
+import org.apache.brooklyn.core.server.BrooklynServerPaths;
+import org.apache.brooklyn.util.core.ResourceUtils;
+import org.apache.brooklyn.util.exceptions.Exceptions;
+import org.apache.brooklyn.util.exceptions.FatalConfigurationRuntimeException;
+import org.apache.brooklyn.util.exceptions.FatalRuntimeException;
+import org.apache.brooklyn.util.exceptions.RuntimeInterruptedException;
+import org.apache.brooklyn.util.guava.Maybe;
+import org.apache.brooklyn.util.io.FileUtil;
+import org.apache.brooklyn.util.os.Os;
+import org.apache.brooklyn.util.stream.Streams;
+import org.apache.brooklyn.util.text.Strings;
+import org.apache.brooklyn.util.time.Duration;
+import org.apache.brooklyn.util.time.Time;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Initializer for brooklyn-core when running in an OSGi environment.
+ *
+ * Temporarily here; should be totally contained in blueprint beans' init-methods.
+ */
+public class OsgiLauncher {
+
+    private static final Logger log = LoggerFactory.getLogger(OsgiLauncher.class);
+
+    private ManagementContext managementContext;
+
+    private boolean ignoreCatalogErrors = true;
+    private boolean ignorePersistenceErrors = true;
+
+    private HighAvailabilityMode highAvailabilityMode = HighAvailabilityMode.DISABLED;
+
+    private PersistMode persistMode = PersistMode.DISABLED;
+    private String persistenceDir = null;
+    private String persistenceLocation = null;
+    private Duration persistPeriod = Duration.ONE_SECOND;
+
+    public void start() {
+        // Configure launcher
+//        ShutdownHandler shutdownHandler = new AppShutdownHandler();
+        try {
+//            initBrooklynProperties();
+            initCatalog();
+
+            // TODO
+//            launcher.stopWhichAppsOnShutdown(stopWhichAppsOnShutdownMode);
+//            launcher.shutdownHandler(shutdownHandler);
+//
+//            computeAndSetApp(launcher, utils, loader);
+//            customize(launcher);
+//        } catch (FatalConfigurationRuntimeException e) {
+//            throw e;
+//        } catch (Exception e) {
+//            throw new FatalConfigurationRuntimeException("Fatal error configuring Brooklyn launch: " + e.getMessage(), e);
+//        }
+//
+//        try {
+            launcherStart();
+        } catch (FatalRuntimeException e) {
+            // rely on caller logging this propagated exception
+            throw e;
+        } catch (Exception e) {
+            // for other exceptions we log it, possibly redundantly but better too much than too little
+            Exceptions.propagateIfFatal(e);
+            log.error("Error launching brooklyn: " + Exceptions.collapseText(e), e);
+            try {
+                shutdown();
+            } catch (Exception e2) {
+                log.warn("Subsequent error during termination: " + e2);
+                log.debug("Details of subsequent error during termination: " + e2, e2);
+            }
+            Exceptions.propagate(e);
+        }
+
+        // TODO
+//        if (verbose) {
+//            Entities.dumpInfo(launcher.getApplications());
+//        }
+    }
+
+    private void initCatalog() {
+        // TODO
+//            StopWhichAppsOnShutdown stopWhichAppsOnShutdownMode = computeStopWhichAppsOnShutdown();
+//
+//            computeLocations();
+
+//            ResourceUtils utils = ResourceUtils.create(this);
+//            GroovyClassLoader loader = new GroovyClassLoader(getClass().getClassLoader());
+//
+//            // First, run a setup script if the user has provided one
+//            if (script != null) {
+//                execGroovyScript(utils, loader, script);
+//            }
+        // TODO: extract method for catalog initialization
+        CatalogInitialization catInit = new CatalogInitialization();
+        catInit.addPopulationCallback(new Function<CatalogInitialization, Void>() {
+            @Override
+            public Void apply(CatalogInitialization catInit) {
+                try {
+                    populateCatalog(catInit.getManagementContext().getCatalog());
+                } catch (Throwable e) {
+                    catInit.handleException(e, "overridden main class populate catalog");
+                }
+
+                // Force load of catalog
+                confirmCatalog(catInit);
+                return null;
+            }
+        });
+        catInit.setFailOnStartupErrors(!ignoreCatalogErrors);
+//            launcher.catalogInitialization(catInit);
+    }
+
+//    private void initBrooklynProperties() {
+//        BrooklynProperties.Factory.Builder builder = BrooklynProperties.Factory.builderDefault();
+//
+//        if (globalBrooklynPropertiesFile != null) {
+//            File globalProperties = new File(Os.tidyPath(globalBrooklynPropertiesFile));
+//            if (globalProperties.exists()) {
+//                globalProperties = resolveSymbolicLink(globalProperties);
+//                checkFileReadable(globalProperties);
+//                    // brooklyn.properties stores passwords (web-console and cloud credentials),
+//                // so ensure it has sensible permissions
+//                checkFilePermissionsX00(globalProperties);
+//                log.debug("Using global properties file " + globalProperties);
+//            } else {
+//                log.debug("Global properties file " + globalProperties + " does not exist, will ignore");
+//            }
+//            builder.globalPropertiesFile(globalProperties.getAbsolutePath());
+//        } else {
+//            log.debug("Global properties file disabled");
+//            builder.globalPropertiesFile(null);
+//        }
+//
+//        if (localBrooklynPropertiesFile != null) {
+//            File localProperties = new File(Os.tidyPath(localBrooklynPropertiesFile));
+//            localProperties = resolveSymbolicLink(localProperties);
+//            checkFileReadable(localProperties);
+//            checkFilePermissionsX00(localProperties);
+//            builder.localPropertiesFile(localProperties.getAbsolutePath());
+//        }
+//
+//        managementContext = new LocalManagementContext(builder, brooklynAdditionalProperties);
+//
+//        // not needed: called by osgi framework
+////            // We created the management context, so we are responsible for terminating it
+////            BrooklynShutdownHooks.invokeTerminateOnShutdown(managementContext);
+//    }
+//    /**
+//     * @return The canonical path of the argument.
+//     */
+//    private File resolveSymbolicLink(File f) {
+//        File f2 = f;
+//        try {
+//            f2 = f.getCanonicalFile();
+//            if (Files.isSymbolicLink(f.toPath())) {
+//                log.debug("Resolved symbolic link: {} -> {}", f, f2);
+//            }
+//        } catch (IOException e) {
+//            log.warn("Could not determine canonical name of file " + f + "; returning original file", e);
+//        }
+//        return f2;
+//    }
+//
+//    private void checkFileReadable(File f) {
+//        if (!f.exists()) {
+//            throw new FatalRuntimeException("File " + f + " does not exist");
+//        }
+//        if (!f.isFile()) {
+//            throw new FatalRuntimeException(f + " is not a file");
+//        }
+//        if (!f.canRead()) {
+//            throw new FatalRuntimeException(f + " is not readable");
+//        }
+//    }
+//
+//    private void checkFilePermissionsX00(File f) {
+//
+//        Maybe<String> permission = FileUtil.getFilePermissions(f);
+//        if (permission.isAbsent()) {
+//            log.debug("Could not determine permissions of file; assuming ok: " + f);
+//        } else {
+//            if (!permission.get().subSequence(4, 10).equals("------")) {
+//                throw new FatalRuntimeException("Invalid permissions for file " + f + "; expected ?00 but was " + permission.get());
+//            }
+//        }
+//    }
+
+    /* equivalent of launcher.start() in Main.java */
+    private void launcherStart() {
+        // not needed: management context already running (courtesy of blueprint.xml)
+//        // Create the management context
+//        initManagementContext();
+
+        // Inform catalog initialization that it is starting up
+        CatalogInitialization catInit = ((ManagementContextInternal) managementContext).getCatalogInitialization();
+        catInit.setStartingUp(true);
+
+        // not needed: webapps are started as different features (brooklyn-rest-resources-cxf, brooklyn-jsgui etc)
+//        // Start webapps as soon as mgmt context available -- can use them to detect progress of other processes
+//        if (startWebApps) {
+//            try {
+//                startWebApps();
+//            } catch (Exception e) {
+//                handleSubsystemStartupError(ignoreWebErrors, "core web apps", e);
+//            }
+//        }
+        // not needed: camp is a separate karaf feature - let it initialize itself
+//        // Add a CAMP platform
+//        campPlatform = new BrooklynCampPlatformLauncherNoServer()
+//                .useManagementContext(managementContext)
+//                .launch()
+//                .getCampPlatform();
+        try {
+            initPersistence();
+            startPersistence();
+        } catch (Exception e) {
+            handleSubsystemStartupError(ignorePersistenceErrors, "persistence", e);
+        }
+
+        try {
+            // run cat init now if it hasn't yet been run;
+            // will also run if there was an ignored error in catalog above, allowing it to fail startup here if requested
+            if (!catInit.hasRunOfficialInitialization()) {
+                if (persistMode == PersistMode.DISABLED) {
+                    log.debug("Loading catalog as part of launch sequence (it was not loaded as part of any rebind sequence)");
+                    catInit.populateCatalog(ManagementNodeState.MASTER, true, true, null);
+                } else {
+                    // should have loaded during rebind
+                    ManagementNodeState state = managementContext.getHighAvailabilityManager().getNodeState();
+                    log.warn("Loading catalog for " + state + " as part of launch sequence (it was not loaded as part of the rebind sequence)");
+                    catInit.populateCatalog(state, true, true, null);
+                }
+            }
+        } catch (Exception e) {
+            handleSubsystemStartupError(ignoreCatalogErrors, "initial catalog", e);
+        }
+        catInit.setStartingUp(false);
+
+        // no need for command-line locations
+//        // Create the locations. Must happen after persistence is started in case the
+//        // management context's catalog is loaded from persisted state. (Location
+//        // resolution uses the catalog's classpath to scan for resolvers.)
+//        locations.addAll(managementContext.getLocationRegistry().resolve(locationSpecs));
+        // Already rebinded successfully, so previous apps are now available.
+        // Allow the startup to be visible in console for newly created apps.
+        ((LocalManagementContext) managementContext).noteStartupComplete();
+
+//        // TODO create apps only after becoming master, analogously to catalog initialization
+//        try {
+//            createApps();
+//            startApps();
+//        } catch (Exception e) {
+//            handleSubsystemStartupError(ignoreAppErrors, "brooklyn autostart apps", e);
+//        }
+//        if (startBrooklynNode) {
+//            try {
+//                startBrooklynNode();
+//            } catch (Exception e) {
+//                handleSubsystemStartupError(ignoreAppErrors, "brooklyn node / self entity", e);
+//            }
+//        }
+//
+        if (persistMode != PersistMode.DISABLED) {
+            // Make sure the new apps are persisted in case process exits immediately.
+            managementContext.getRebindManager().forcePersistNow(false, null);
+        }
+    }
+
+    public void shutdown() {
+        // not needed: webserver is in other bundles
+//        if (webServer != null) {
+//            try {
+//                webServer.stop();
+//            } catch (Exception e) {
+//                LOG.warn("Error stopping web-server; continuing with termination", e);
+//            }
+//        }
+
+        // TODO Do we want to do this as part of managementContext.terminate, so after other threads are terminated etc?
+        // Otherwise the app can change between this persist and the terminate.
+        if (persistMode != PersistMode.DISABLED) {
+            try {
+                Stopwatch stopwatch = Stopwatch.createStarted();
+                if (managementContext.getHighAvailabilityManager().getPersister() != null) {
+                    managementContext.getHighAvailabilityManager().getPersister().waitForWritesCompleted(Duration.TEN_SECONDS);
+                }
+                managementContext.getRebindManager().waitForPendingComplete(Duration.TEN_SECONDS, true);
+                log.info("Finished waiting for persist; took " + Time.makeTimeStringRounded(stopwatch));
+            } catch (RuntimeInterruptedException e) {
+                Thread.currentThread().interrupt(); // keep going with shutdown
+                log.warn("Persistence interrupted during shutdown: " + e, e);
+            } catch (InterruptedException e) {
+                Thread.currentThread().interrupt(); // keep going with shutdown
+                log.warn("Persistence interrupted during shutdown: " + e, e);
+            } catch (TimeoutException e) {
+                log.warn("Timeout after 10 seconds waiting for persistence to write all data; continuing");
+            }
+        }
+
+        // not needed; called using blueprint.xml
+//        if (managementContext instanceof ManagementContextInternal) {
+//            ((ManagementContextInternal) managementContext).terminate();
+//        }
+        // TODO
+//        for (Location loc : locations) {
+//            if (loc instanceof Closeable) {
+//                Streams.closeQuietly((Closeable) loc);
+//            }
+//        }
+    }
+
+    /**
+     * method intended for subclassing, to add custom items to the catalog
+     *
+     * @todo Remove ?
+     */
+    protected void populateCatalog(BrooklynCatalog catalog) {
+        // nothing else added here
+    }
+
+    protected void confirmCatalog(CatalogInitialization catInit) {
+        Stopwatch time = Stopwatch.createStarted();
+        BrooklynCatalog catalog = catInit.getManagementContext().getCatalog();
+        Iterable<CatalogItem<Object, Object>> items = catalog.getCatalogItems();
+        for (CatalogItem<Object, Object> item : items) {
+            try {
+                if (item.getCatalogItemType() == CatalogItem.CatalogItemType.TEMPLATE) {
+                    // skip validation of templates, they might contain instructions,
+                    // and additionally they might contain multiple items in which case
+                    // the validation below won't work anyway (you need to go via a deployment plan)
+                } else {
+                    @SuppressWarnings({"unchecked", "rawtypes"})
+                    Object spec = catalog.createSpec((CatalogItem) item);
+                    if (spec instanceof EntitySpec) {
+                        BrooklynTypes.getDefinedEntityType(((EntitySpec<?>) spec).getType());
+                    }
+                    log.debug("Catalog loaded spec " + spec + " for item " + item);
+                }
+            } catch (Throwable throwable) {
+                catInit.handleException(throwable, item);
+            }
+        }
+        log.debug("Catalog (size " + Iterables.size(items) + ") confirmed in " + Duration.of(time));
+    }
+
+    private void handleSubsystemStartupError(boolean ignoreSuchErrors, String system, Exception e) {
+        Exceptions.propagateIfFatal(e);
+        if (ignoreSuchErrors) {
+            log.error("Subsystem for " + system + " had startup error (continuing with startup): " + e, e);
+            if (managementContext != null) {
+                ((ManagementContextInternal) managementContext).errors().add(e);
+            }
+        } else {
+            throw Exceptions.propagate(e);
+        }
+    }
+
+    protected void initPersistence() {
+        // Prepare the rebind directory, and initialise the RebindManager as required
+        final PersistenceObjectStore objectStore;
+        if (persistMode == PersistMode.DISABLED) {
+            log.info("Persistence disabled");
+            objectStore = null;
+
+        } else {
+            try {
+                BrooklynProperties brooklynProperties = ((ManagementContextInternal) managementContext).getBrooklynProperties();
+                if (persistenceLocation == null) {
+                    persistenceLocation = brooklynProperties.getConfig(BrooklynServerConfig.PERSISTENCE_LOCATION_SPEC);
+                }
+                persistenceDir = BrooklynServerPaths.newMainPersistencePathResolver(brooklynProperties).location(persistenceLocation).dir(persistenceDir).resolve();
+                objectStore = BrooklynPersistenceUtils.newPersistenceObjectStore(managementContext, persistenceLocation, persistenceDir,
+                        persistMode, highAvailabilityMode);
+
+                RebindManager rebindManager = managementContext.getRebindManager();
+
+                BrooklynMementoPersisterToObjectStore persister = new BrooklynMementoPersisterToObjectStore(
+                        objectStore,
+                        ((ManagementContextInternal) managementContext).getBrooklynProperties(),
+                        managementContext.getCatalogClassLoader());
+                PersistenceExceptionHandler persistenceExceptionHandler = PersistenceExceptionHandlerImpl.builder().build();
+                ((RebindManagerImpl) rebindManager).setPeriodicPersistPeriod(persistPeriod);
+                rebindManager.setPersister(persister, persistenceExceptionHandler);
+            } catch (FatalConfigurationRuntimeException e) {
+                throw e;
+            } catch (Exception e) {
+                Exceptions.propagateIfFatal(e);
+                log.debug("Error initializing persistence subsystem (rethrowing): " + e, e);
+                throw new FatalRuntimeException("Error initializing persistence subsystem: "
+                        + Exceptions.collapseText(e), e);
+            }
+        }
+
+        // Initialise the HA manager as required
+        if (highAvailabilityMode == HighAvailabilityMode.DISABLED) {
+            log.info("High availability disabled");
+        } else {
+            if (objectStore == null) {
+                throw new FatalConfigurationRuntimeException("Cannot run in HA mode when no persistence configured.");
+            }
+
+            HighAvailabilityManager haManager = managementContext.getHighAvailabilityManager();
+            ManagementPlaneSyncRecordPersister persister
+                    = new ManagementPlaneSyncRecordPersisterToObjectStore(managementContext,
+                            objectStore,
+                            managementContext.getCatalogClassLoader());
+            // not needed: set from config keys
+//            ((HighAvailabilityManagerImpl) haManager).setHeartbeatTimeout(haHeartbeatTimeoutOverride);
+//            ((HighAvailabilityManagerImpl) haManager).setPollPeriod(haHeartbeatPeriodOverride);
+            haManager.setPersister(persister);
+        }
+    }
+
+    protected void startPersistence() {
+        // Now start the HA Manager and the Rebind manager, as required
+        if (highAvailabilityMode == HighAvailabilityMode.DISABLED) {
+            HighAvailabilityManager haManager = managementContext.getHighAvailabilityManager();
+            haManager.disabled();
+
+            if (persistMode != PersistMode.DISABLED) {
+                startPersistenceWithoutHA();
+            }
+
+        } else {
+            // Let the HA manager decide when objectstore.prepare and rebindmgr.rebind need to be called
+            // (based on whether other nodes in plane are already running).
+
+            HighAvailabilityMode startMode = null;
+            switch (highAvailabilityMode) {
+                case AUTO:
+                case MASTER:
+                case STANDBY:
+                case HOT_STANDBY:
+                case HOT_BACKUP:
+                    startMode = highAvailabilityMode;
+                    break;
+                case DISABLED:
+                    throw new IllegalStateException("Unexpected code-branch for high availability mode " + highAvailabilityMode);
+            }
+            if (startMode == null) {
+                throw new IllegalStateException("Unexpected high availability mode " + highAvailabilityMode);
+            }
+
+            log.debug("Management node (with HA) starting");
+            HighAvailabilityManager haManager = managementContext.getHighAvailabilityManager();
+            // prepare after HA mode is known, to prevent backups happening in standby mode
+            haManager.start(startMode);
+        }
+    }
+
+    private void startPersistenceWithoutHA() {
+        RebindManager rebindManager = managementContext.getRebindManager();
+        if (Strings.isNonBlank(persistenceLocation)) {
+            log.info("Management node (no HA) rebinding to entities at " + persistenceLocation + " in " + persistenceDir);
+        } else {
+            log.info("Management node (no HA) rebinding to entities on file system in " + persistenceDir);
+        }
+
+        ClassLoader classLoader = managementContext.getCatalogClassLoader();
+        try {
+            rebindManager.rebind(classLoader, null, ManagementNodeState.MASTER);
+        } catch (Exception e) {
+            Exceptions.propagateIfFatal(e);
+            log.debug("Error rebinding to persisted state (rethrowing): " + e, e);
+            throw new FatalRuntimeException("Error rebinding to persisted state: "
+                    + Exceptions.collapseText(e), e);
+        }
+        rebindManager.startPersistence();
+    }
+
+    public void setHighAvailabilityMode(HighAvailabilityMode highAvailabilityMode) {
+        this.highAvailabilityMode = highAvailabilityMode;
+    }
+
+    public void setIgnoreCatalogErrors(boolean ignoreCatalogErrors) {
+        this.ignoreCatalogErrors = ignoreCatalogErrors;
+    }
+
+    public void setIgnorePersistenceErrors(boolean ignorePersistenceErrors) {
+        this.ignorePersistenceErrors = ignorePersistenceErrors;
+    }
+
+    public void setManagementContext(ManagementContext managementContext) {
+        this.managementContext = managementContext;
+    }
+
+    public void setPersistMode(PersistMode persistMode) {
+        this.persistMode = persistMode;
+    }
+
+    public void setPersistenceDir(String persistenceDir) {
+        this.persistenceDir = persistenceDir;
+    }
+
+    public void setPersistenceLocation(String persistenceLocation) {
+        this.persistenceLocation = persistenceLocation;
+    }
+
+    public void setPersistPeriod(String persistPeriodDescription) {
+        this.persistPeriod = Duration.parse(persistPeriodDescription);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/cca26a6f/core/src/main/resources/OSGI-INF/blueprint/blueprint.xml
----------------------------------------------------------------------
diff --git a/core/src/main/resources/OSGI-INF/blueprint/blueprint.xml b/core/src/main/resources/OSGI-INF/blueprint/blueprint.xml
index 08dcbe5..bd0c7eb 100644
--- a/core/src/main/resources/OSGI-INF/blueprint/blueprint.xml
+++ b/core/src/main/resources/OSGI-INF/blueprint/blueprint.xml
@@ -17,25 +17,48 @@ limitations under the License.
 
 <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-           xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
+           xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.2.0"
            xsi:schemaLocation="
              http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
              http://aries.apache.org/schemas/blueprint-cm/blueprint-cm-1.1.0.xsd
              ">
 
-<!--    <cm:property-placeholder persistent-id="org.apache.brooklyn.properties" update-strategy="reload">
+    <cm:property-placeholder persistent-id="org.apache.brooklyn.osgilauncher" update-strategy="reload">
         <cm:default-properties>
-            <cm:property name="some-property" value="${karaf.data}/some-path"/>
+            <cm:property name="ignoreCatalogErrors" value="true" />
+            <cm:property name="ignorePersistenceErrors" value="true" />
+            <cm:property name="highAvailabilityMode" value="DISABLED" />
+            <cm:property name="persistMode" value="DISABLED" />
+            <cm:property name="persistenceDir" value="" />
+            <cm:property name="persistenceLocation" value="" />
+            <cm:property name="persistPeriod" value="1s" />
         </cm:default-properties>
-    </cm:property-placeholder>-->
+    </cm:property-placeholder>
 
     <bean id="localManagementContextService"
-          class="org.apache.brooklyn.core.mgmt.internal.LocalManagementContext" />
+          class="org.apache.brooklyn.core.mgmt.internal.LocalManagementContext" 
+          destroy-method="terminate" />
 
-    <service ref="localManagementContextService"
-             interface="org.apache.brooklyn.api.mgmt.ManagementContext" />
-    
-<!--    <service ref="localManagementContextService"
-             interface="org.apache.brooklyn.core.mgmt.internal.ManagementContextInternal" />-->
+    <service ref="localManagementContextService">
+        <interfaces>
+            <value>org.apache.brooklyn.api.mgmt.ManagementContext</value>
+            <value>org.apache.brooklyn.core.mgmt.internal.ManagementContextInternal</value>
+        </interfaces>
+    </service>
+
+    <bean id="launcher"
+          class="org.apache.brooklyn.core.OsgiLauncher"
+          init-method="start">
+
+        <property name="managementContext" ref="localManagementContextService" />
+
+        <property name="ignoreCatalogErrors" value="${ignoreCatalogErrors}" />
+        <property name="ignorePersistenceErrors" value="${ignorePersistenceErrors}" />
+        <property name="highAvailabilityMode" value="${highAvailabilityMode}" />
+        <property name="persistMode" value="${persistMode}" />
+        <property name="persistenceDir" value="${persistenceDir}" />
+        <property name="persistenceLocation" value="${persistenceLocation}" />
+        <property name="persistPeriod" value="${persistPeriod}" />
+    </bean>
 
 </blueprint>

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/cca26a6f/karaf/apache-brooklyn/src/main/resources/etc/org.apache.brooklyn.osgilauncher.cfg
----------------------------------------------------------------------
diff --git a/karaf/apache-brooklyn/src/main/resources/etc/org.apache.brooklyn.osgilauncher.cfg b/karaf/apache-brooklyn/src/main/resources/etc/org.apache.brooklyn.osgilauncher.cfg
new file mode 100644
index 0000000..9b70306
--- /dev/null
+++ b/karaf/apache-brooklyn/src/main/resources/etc/org.apache.brooklyn.osgilauncher.cfg
@@ -0,0 +1,59 @@
+################################################################################
+#
+#    Licensed to the Apache Software Foundation (ASF) under one or more
+#    contributor license agreements.  See the NOTICE file distributed with
+#    this work for additional information regarding copyright ownership.
+#    The ASF licenses this file to You 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.
+#
+################################################################################
+
+# This file temporarily contains boot settings for brooklyn karaf launcher,
+# matching some of the command-line options of the previous brooklyn-cli launcher
+# (those used during the initialization sequence)
+#
+# Most of these will migrate to a permanent cfg file, once the components themselves get refactored
+# and the configuration options are agreed upon
+
+
+# Ignore catalog subsystem failures during startup (default is to continue, so errors can be viewed via the API)
+#ignoreCatalogErrors=true
+
+# Ignore persistence/HA subsystem failures during startup (default is to continue, so errors can be viewed via the API)
+#ignorePersistenceErrors=true
+
+# The high availability mode. Possible values are:
+# - disabled: management node works in isolation - will not cooperate with any other standby/master nodes in management plane;
+# - auto: will look for other management nodes, and will allocate itself as standby or master based on other nodes' states;
+# - master: will startup as master - if there is already a master then fails immediately;
+# - standby: will start up as lukewarm standby with no state - if there is not already a master then fails immediately,
+#   and if there is a master which subsequently fails, this node can promote itself;
+# - hot_standby: will start up as hot standby in read-only mode - if there is not already a master then fails immediately,
+#   and if there is a master which subseuqently fails, this node can promote itself;
+# - hot_backup: will start up as hot backup in read-only mode - no master is required, and this node will not become a master
+#highAvailabilityMode=disabled
+
+# The persistence mode. Possible values are:
+# - disabled: will not read or persist any state;
+# - auto: will rebind to any existing state, or start up fresh if no state;
+# - rebind: will rebind to the existing state, or fail if no state available;
+# - clean: will start up fresh (removing any existing state)
+#persistMode=disabled
+
+# The directory to read/write persisted state (or container name if using an object store)
+#persistenceDir=
+
+# The location spec for an object store to read/write persisted state
+#persistenceLocation=
+
+# Periodic read-only rebind
+#persistPeriod=1s

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/cca26a6f/karaf/apache-brooklyn/src/main/resources/etc/org.apache.cxf.osgi.cfg
----------------------------------------------------------------------
diff --git a/karaf/apache-brooklyn/src/main/resources/etc/org.apache.cxf.osgi.cfg b/karaf/apache-brooklyn/src/main/resources/etc/org.apache.cxf.osgi.cfg
deleted file mode 100644
index e82b1d0..0000000
--- a/karaf/apache-brooklyn/src/main/resources/etc/org.apache.cxf.osgi.cfg
+++ /dev/null
@@ -1,20 +0,0 @@
-################################################################################
-#
-#    Licensed to the Apache Software Foundation (ASF) under one or more
-#    contributor license agreements.  See the NOTICE file distributed with
-#    this work for additional information regarding copyright ownership.
-#    The ASF licenses this file to You 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.
-#
-################################################################################
-
-org.apache.cxf.servlet.context = /v1

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/cca26a6f/karaf/features/src/main/feature/feature.xml
----------------------------------------------------------------------
diff --git a/karaf/features/src/main/feature/feature.xml b/karaf/features/src/main/feature/feature.xml
index c590469..833b318 100644
--- a/karaf/features/src/main/feature/feature.xml
+++ b/karaf/features/src/main/feature/feature.xml
@@ -182,6 +182,10 @@
         <!-- should be deps of jax-rs-2.0 rest-api project -->
         <bundle dependency="true">mvn:javax.servlet/javax.servlet-api/${javax-servlet.version}</bundle>
         <bundle dependency="true">mvn:javax.ws.rs/javax.ws.rs-api/${jax-rs-api.version}</bundle>
+
+        <config name="org.apache.cxf.osgi">
+            org.apache.cxf.servlet.context = /v1
+        </config>
     </feature>
 
     <feature name="brooklyn-jsgui" version="${project.version}" description="Brooklyn REST JavaScript Web GUI">

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/cca26a6f/karaf/features/src/main/feature/feature.xml.orig
----------------------------------------------------------------------
diff --git a/karaf/features/src/main/feature/feature.xml.orig b/karaf/features/src/main/feature/feature.xml.orig
new file mode 100644
index 0000000..5a4ac7d
--- /dev/null
+++ b/karaf/features/src/main/feature/feature.xml.orig
@@ -0,0 +1,288 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<features xmlns="http://karaf.apache.org/xmlns/features/v1.2.0" name="org.apache.brooklyn-${project.version}">
+
+    <repository>mvn:org.apache.karaf.features/standard/${karaf.version}/xml/features</repository>
+    <repository>mvn:org.apache.karaf.features/enterprise/${karaf.version}/xml/features</repository>
+    <repository>mvn:org.apache.karaf.features/spring/${karaf.version}/xml/features</repository>
+
+    <repository>mvn:org.apache.cxf.karaf/apache-cxf/${cxf.version}/xml/features</repository>
+
+    <!-- temporary feature until we migrate to swagger-1.5.4, which is properly bundled -->
+    <feature name="swagger-crippled" version="${swagger.version}" description="Swagger Annotations+Core+JAXRS+Models">
+        <bundle>mvn:io.swagger/swagger-annotations/${swagger.version}</bundle>
+<!--        <bundle>wrap:mvn:io.swagger/swagger-core/${swagger.version}</bundle>
+        <bundle>wrap:mvn:io.swagger/swagger-jaxrs/${swagger.version}</bundle>-->
+        <bundle>mvn:io.swagger/swagger-models/${swagger.version}</bundle>
+
+        <!--<bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.javassist/${javassist.bundle.version}</bundle>-->
+        <!--<bundle dependency='true'>mvn:com.google.guava/guava/${guava.version}</bundle>-->
+        <bundle dependency='true'>mvn:com.fasterxml.jackson.core/jackson-annotations/${fasterxml.jackson.version}</bundle>
+        <bundle dependency='true'>mvn:com.fasterxml.jackson.core/jackson-core/${fasterxml.jackson.version}</bundle>
+        <bundle dependency='true'>mvn:com.fasterxml.jackson.core/jackson-databind/${fasterxml.jackson.version}</bundle>
+        <bundle dependency='true'>mvn:com.fasterxml.jackson.dataformat/jackson-dataformat-yaml/${fasterxml.jackson.version}</bundle>
+        <bundle dependency='true'>mvn:com.fasterxml.jackson.jaxrs/jackson-jaxrs-base/${fasterxml.jackson.version}</bundle>
+        <bundle dependency='true'>mvn:com.fasterxml.jackson.jaxrs/jackson-jaxrs-json-provider/${fasterxml.jackson.version}</bundle>
+    </feature>
+
+    <feature name="brooklyn-utils-common" version="${project.version}" description="Brooklyn Common Utils">
+        <bundle>mvn:org.apache.brooklyn/brooklyn-utils-common/${project.version}</bundle>
+        <bundle>mvn:org.apache.brooklyn/brooklyn-logback-includes/${project.version}</bundle>
+
+        <bundle dependency="true">mvn:com.google.guava/guava/${guava.version}</bundle>
+        <bundle dependency="true">mvn:org.codehaus.groovy/groovy-all/${groovy.version}</bundle>
+        <bundle dependency="true">mvn:commons-io/commons-io/${commons-io.version}</bundle>
+        <bundle dependency="true">mvn:commons-codec/commons-codec/${commons-codec.version}</bundle>
+        <bundle dependency="true">mvn:org.slf4j/jul-to-slf4j/${slf4j.version}</bundle>
+        <bundle dependency="true">mvn:org.yaml/snakeyaml/${snakeyaml.version}</bundle>
+        <bundle dependency="true">mvn:org.apache.httpcomponents/httpcore-osgi/${httpclient.version}</bundle>
+        <bundle dependency="true">mvn:org.apache.httpcomponents/httpclient-osgi/${httpclient.version}</bundle>
+
+        <bundle dependency="true">mvn:ch.qos.logback/logback-classic/${logback.version}</bundle>
+        <bundle dependency="true">mvn:ch.qos.logback/logback-core/${logback.version}</bundle>
+    </feature>
+
+    <feature name="brooklyn-utils-groovy" version="${project.version}" description="Brooklyn Groovy Utils">
+        <feature>brooklyn-utils-common</feature>
+        <bundle>mvn:org.apache.brooklyn/brooklyn-utils-common/${project.version}</bundle>
+    </feature>
+
+    <feature name="brooklyn-utils-rest-swagger" version="${project.version}" description="Brooklyn REST Swagger Apidoc Utilities">
+        <feature>brooklyn-utils-common</feature>
+        <feature version="${swagger.version}">swagger-crippled</feature>
+
+        <bundle>mvn:org.apache.brooklyn/brooklyn-utils-rest-swagger/${project.version}</bundle>
+
+        <!--<feature>jersey</feature>-->
+        <bundle dependency="true">mvn:com.sun.jersey/jersey-server/${jersey.version}</bundle>
+        <bundle dependency="true">mvn:com.sun.jersey/jersey-core/${jersey.version}</bundle>
+        <bundle dependency="true">mvn:com.sun.jersey/jersey-servlet/${jersey.version}</bundle>
+        <bundle dependency="true">mvn:org.apache.commons/commons-lang3/${commons-lang3.version}</bundle>
+
+        <bundle dependency="true">mvn:javax.servlet/javax.servlet-api/${javax-servlet.version}</bundle>
+        <bundle dependency="true">mvn:javax.ws.rs/javax.ws.rs-api/${jax-rs-api.version}</bundle>
+
+        <!-- TODO: version 1.1.0.Final has OSGi manifest; check if upgrade doesn't get rid of wrap -->
+        <bundle dependency="true">wrap:mvn:javax.validation/validation-api/${validation-api.version}</bundle>
+        <bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.reflections/${reflections.bundle.version}</bundle>
+    </feature>
+
+    <feature name="brooklyn-rest-api" version="${project.version}" description="Brooklyn REST API">
+        <feature>brooklyn-utils-rest-swagger</feature>
+        <feature>brooklyn-api</feature>
+
+        <bundle>mvn:org.apache.brooklyn/brooklyn-rest-api/${project.version}</bundle>
+
+        <bundle dependency="true">mvn:com.sun.jersey.contribs/jersey-multipart/${jersey.version}</bundle>
+        <bundle dependency="true">mvn:org.jvnet.mimepull/mimepull/1.9.3</bundle>
+        <bundle dependency="true">mvn:commons-lang/commons-lang/${commons-lang.version}</bundle>
+
+        <!-- TODO: version 1.1.0.Final has OSGi manifest; check if upgrade doesn't get rid of wrap -->
+        <bundle dependency="true">wrap:mvn:javax.validation/validation-api/${validation-api.version}</bundle>
+
+        <!--<feature>jersey</feature>-->
+        <bundle dependency="true">mvn:com.sun.jersey/jersey-servlet/${jersey.version}</bundle>
+        <bundle dependency="true">mvn:org.apache.commons/commons-lang3/${commons-lang3.version}</bundle>
+        <bundle dependency="true">mvn:org.codehaus.jackson/jackson-core-asl/${jackson.version}</bundle>
+        <bundle dependency="true">mvn:org.codehaus.jackson/jackson-mapper-asl/${jackson.version}</bundle>
+
+        <bundle dependency="true">mvn:javax.servlet/javax.servlet-api/${javax-servlet.version}</bundle>
+    </feature>
+
+    <feature name="brooklyn-api"  version="${project.version}" description="Brooklyn API">
+        <feature>brooklyn-utils-common</feature>
+        <bundle>mvn:org.apache.brooklyn/brooklyn-api/${project.version}</bundle>
+    </feature>
+
+    <feature name="brooklyn-core" version="${project.version}" description="Brooklyn Core">
+        <feature>brooklyn-api</feature>
+
+        <bundle>mvn:org.apache.brooklyn/brooklyn-core/${project.version}</bundle>
+        <bundle>mvn:org.apache.brooklyn/brooklyn-rt-osgi/${project.version}</bundle>
+        <bundle>mvn:org.apache.brooklyn/brooklyn-utils-groovy/${project.version}</bundle>
+    
+        <bundle dependency="true">mvn:com.google.code.gson/gson/${gson.version}</bundle>
+        <bundle dependency="true">mvn:com.jayway.jsonpath/json-path/${jsonPath.version}</bundle>
+        <bundle dependency="true">mvn:com.fasterxml.jackson.core/jackson-core/${fasterxml.jackson.version}</bundle>
+        <bundle dependency="true">mvn:com.fasterxml.jackson.core/jackson-databind/${fasterxml.jackson.version}</bundle>
+        <bundle dependency="true">mvn:com.fasterxml.jackson.core/jackson-annotations/${fasterxml.jackson.version}</bundle>
+        <bundle dependency="true">mvn:net.minidev/json-smart/${jsonSmart.version}</bundle>
+        <bundle dependency="true">mvn:net.minidev/asm/${minidev.asm.version}</bundle>
+        <bundle dependency="true">mvn:com.thoughtworks.xstream/xstream/${xstream.version}</bundle>
+        <bundle dependency="true">mvn:org.freemarker/freemarker/${freemarker.version}</bundle>
+        <bundle dependency="true">mvn:net.schmizz/sshj/${sshj.version}</bundle>
+        <bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.jzlib/1.1.3_2</bundle> <!-- jzlib version is 1.1.3, but bundle is 1.1.3_2 -->
+        <bundle dependency="true">mvn:org.bouncycastle/bcprov-ext-jdk15on/${bouncycastle.version}</bundle>
+        <bundle dependency="true">mvn:org.bouncycastle/bcpkix-jdk15on/${bouncycastle.version}</bundle>
+        <bundle dependency="true">mvn:commons-codec/commons-codec/${commons-codec.version}</bundle>
+        <bundle dependency="true">mvn:org.apache.commons/commons-lang3/${commons-lang3.version}</bundle>
+        <bundle dependency="true">mvn:org.codehaus.jackson/jackson-core-asl/${jackson.version}</bundle>
+        <bundle dependency="true">mvn:org.codehaus.jackson/jackson-mapper-asl/${jackson.version}</bundle>
+        <bundle dependency="true">mvn:org.codehaus.jackson/jackson-jaxrs/${jackson.version}</bundle>
+
+        <!-- TODO: don't use wrap -->
+        <bundle dependency="true">wrap:mvn:com.google.http-client/google-http-client/1.18.0-rc</bundle> <!-- from geoip -->
+        <bundle dependency="true">wrap:mvn:com.maxmind.geoip2/geoip2/${maxmind.version}</bundle> <!-- from geoip2 -->
+        <bundle dependency="true">wrap:mvn:xpp3/xpp3_min/1.1.4c</bundle> <!-- from com.thoughtworks.xstream/xstream -->
+
+        <bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.reflections/${reflections.bundle.version}</bundle>
+    </feature>
+
+    <feature name="brooklyn-camp-brooklyn" version="${project.version}" description="Brooklyn CAMP REST API">
+        <bundle>mvn:org.apache.brooklyn/brooklyn-camp/${project.version}</bundle>
+
+        <feature>brooklyn-core</feature>
+        <feature>brooklyn-camp-base</feature>
+        <bundle dependency="true">mvn:commons-beanutils/commons-beanutils/${commons-beanutils.version}</bundle>
+        <bundle dependency="true">mvn:commons-collections/commons-collections/${commons-collections.version}</bundle>
+    </feature>
+
+    <feature name="brooklyn-camp-base" version="${project.version}" description="Brooklyn CAMP Base">
+        <bundle>mvn:org.apache.brooklyn.camp/camp-base/${project.version}</bundle>
+
+        <feature>brooklyn-utils-common</feature>
+        <bundle dependency="true">mvn:org.apache.commons/commons-compress/${commons-compress.version}</bundle>
+        <bundle dependency="true">wrap:mvn:org.tukaani/xz/${commons-compress.version}</bundle>
+        <bundle dependency="true">mvn:org.apache.commons/commons-lang3/${commons-lang3.version}</bundle>
+    </feature>
+
+    <feature name="brooklyn-camp-server" version="${project.version}" description="Brooklyn CAMP Server">
+        <bundle>mvn:org.apache.brooklyn.camp/camp-server/${project.version}</bundle>
+
+        <feature>brooklyn-camp-base</feature>
+        <feature>brooklyn-utils-rest-swagger</feature>
+        <feature>jetty</feature> <!-- TODO: pax-jetty??? -->
+
+        <bundle dependency="true">mvn:org.codehaus.jackson/jackson-core-asl/${jackson.version}</bundle>
+        
+        <bundle dependency="true">wrap:mvn:javax.validation/validation-api/${validation-api.version}</bundle>
+        <bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.reflections/${reflections.bundle.version}</bundle>
+    </feature>
+
+    <feature name="brooklyn-rest-resources" version="${project.version}" description="Brooklyn REST Resources (CXF)">
+        <bundle>mvn:org.apache.brooklyn/brooklyn-rest-resources/${project.version}</bundle>
+        <feature>brooklyn-core</feature>
+        <feature>brooklyn-rest-api</feature>
+        <feature>brooklyn-camp-brooklyn</feature>
+        <feature>brooklyn-camp-base</feature>
+
+        <feature>cxf-jaxrs</feature>
+
+        <!-- should be deps of jax-rs-2.0 rest-api project -->
+        <bundle dependency="true">mvn:javax.servlet/javax.servlet-api/${javax-servlet.version}</bundle>
+        <bundle dependency="true">mvn:javax.ws.rs/javax.ws.rs-api/${jax-rs-api.version}</bundle>
+    </feature>
+
+    <feature name="brooklyn-jsgui" version="${project.version}" description="Brooklyn REST JavaScript Web GUI">
+        <bundle>mvn:org.apache.brooklyn/brooklyn-jsgui/${project.version}/war</bundle>
+        <feature>war</feature>
+    </feature>
+  
+    <feature name="brooklyn-commands"  version="${project.version}"  description="Brooklyn Shell Commands">
+        <bundle>mvn:org.apache.brooklyn/brooklyn-commands/${project.version}</bundle>
+        <!--<feature version="${project.version}">brooklyn-core</feature>-->
+    </feature>
+  
+    <feature name="brooklyn-software-winrm" version="${project.version}" description="Brooklyn WinRM Software Entities">
+        <bundle>mvn:org.apache.brooklyn/brooklyn-software-winrm/${project.version}</bundle>
+        <feature>brooklyn-core</feature>
+        <bundle dependency="true">wrap:mvn:io.cloudsoft.windows/winrm4j/${winrm4j.version}</bundle>
+    </feature>
+
+    <feature name="brooklyn-policy"  version="${project.version}" description="Brooklyn Policies">
+        <bundle>mvn:org.apache.brooklyn/brooklyn-policy/${project.version}</bundle>
+        <feature>brooklyn-core</feature>
+    </feature>
+
+    <feature name="brooklyn-software-base"  version="${project.version}"  description="Brooklyn Software Base">
+        <bundle>mvn:org.apache.brooklyn/brooklyn-software-base/${project.version}</bundle>
+        <feature>brooklyn-software-winrm</feature>
+        <feature>brooklyn-policy</feature>
+        <!-- python dependency required but not supported since karaf cannot handle its runtime bindings -->
+    </feature>
+
+    <feature name="brooklyn-jmxmp-agent" version="${project.version}" description="Brooklyn Secure JMXMP Agent">
+        <bundle>mvn:org.apache.brooklyn/brooklyn-jmxmp-agent/${project.version}</bundle>
+        <feature>brooklyn-core</feature>
+        <bundle dependency="true">wrap:mvn:org.glassfish.external/opendmk_jmxremote_optional_jar/${opendmk_jmxremote_optional_jar.version}</bundle>
+    </feature>
+
+    <feature name="brooklyn-jmxrmi-agent" version="${project.version}" description="Brooklyn JMX RMI Agent">
+        <bundle>mvn:org.apache.brooklyn/brooklyn-jmxrmi-agent/${project.version}</bundle>
+    </feature>
+
+    <!-- WARNING: feature brooklyn-locations-jclouds cannot really be installed, due to guava 17 issues -->
+    <feature name="brooklyn-locations-jclouds" version="${project.version}" description="Brooklyn Jclouds Location Targets">
+        <bundle>mvn:org.apache.brooklyn/brooklyn-locations-jclouds/${project.version}</bundle>
+        <feature>brooklyn-software-winrm</feature>
+        <bundle dependency="true">mvn:com.google.inject/guice/${guice.version}</bundle>
+        <bundle dependency="true">mvn:${jclouds.groupId}.driver/jclouds-bouncycastle/${jclouds.version}</bundle>
+        <bundle dependency="true">mvn:${jclouds.groupId}/jclouds-core/${jclouds.version}</bundle>
+        <bundle dependency="true">mvn:com.google.guava/guava/${guava.version}</bundle>
+    </feature>
+
+    <feature name="brooklyn-software-network" version="${project.version}" description="Brooklyn Network Software Entities">
+        <bundle>mvn:org.apache.brooklyn/brooklyn-software-network/${project.version}</bundle>
+        <feature>brooklyn-software-base</feature>
+    </feature>
+
+    <feature name="brooklyn-software-osgi" version="${project.version}" description="Brooklyn OSGi Software Entities">
+        <bundle>mvn:org.apache.brooklyn/brooklyn-software-osgi/${project.version}</bundle>
+        <feature>brooklyn-core</feature>
+        <feature>brooklyn-api</feature>
+        <feature>brooklyn-software-base</feature>
+        <bundle dependency="true">mvn:com.google.guava/guava/${guava.version}</bundle>
+    </feature>
+
+    <feature name="brooklyn-software-database" version="${project.version}" description="Brooklyn Database Software Entities">
+        <bundle>mvn:org.apache.brooklyn/brooklyn-software-database/${project.version}</bundle>
+        <feature>brooklyn-core</feature>
+        <feature>brooklyn-api</feature>
+        <feature>brooklyn-software-base</feature>
+        <bundle dependency="true">mvn:com.google.guava/guava/${guava.version}</bundle>
+    </feature>
+
+    <feature name="brooklyn-software-webapp" version="${project.version}" description="Brooklyn Web App Software Entities">
+        <bundle>mvn:org.apache.brooklyn/brooklyn-software-webapp/${project.version}</bundle>
+        <feature>brooklyn-software-base</feature>
+        <bundle dependency="true">wrap:mvn:org.hibernate/jtidy/${jtidy.version}</bundle>
+    </feature>
+
+    <feature name="brooklyn-software-messaging" version="${project.version}" description="Brooklyn Messaging Software Entities">
+        <bundle>mvn:org.apache.brooklyn/brooklyn-software-messaging/${project.version}</bundle>
+        <feature>brooklyn-software-base</feature>
+    </feature>
+
+    <feature name="brooklyn-software-nosql" version="${project.version}" description="Brooklyn NoSQL Data Store Software Entities">
+        <bundle>mvn:org.apache.brooklyn/brooklyn-software-nosql/${project.version}</bundle>
+        <feature>brooklyn-software-base</feature>
+        <feature>brooklyn-software-database</feature>
+        <feature>brooklyn-software-webapp</feature>
+        <bundle dependency="true">mvn:org.mongodb/mongo-java-driver/3.0.3</bundle>
+    </feature>
+
+    <feature name="brooklyn-software-monitoring" version="${project.version}" description="Brooklyn Monitoring Software Entities">
+        <bundle>mvn:org.apache.brooklyn/brooklyn-software-monitoring/${project.version}</bundle>
+        <feature>brooklyn-core</feature>
+        <feature>brooklyn-api</feature>
+        <feature>brooklyn-software-base</feature>
+        <bundle dependency="true">mvn:com.google.guava/guava/${guava.version}</bundle>
+    </feature>
+    
+</features>

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/cca26a6f/karaf/itest/src/test/java/org/apache/brooklyn/AssemblyTest.java
----------------------------------------------------------------------
diff --git a/karaf/itest/src/test/java/org/apache/brooklyn/AssemblyTest.java b/karaf/itest/src/test/java/org/apache/brooklyn/AssemblyTest.java
index e4ac052..c8389d6 100644
--- a/karaf/itest/src/test/java/org/apache/brooklyn/AssemblyTest.java
+++ b/karaf/itest/src/test/java/org/apache/brooklyn/AssemblyTest.java
@@ -89,7 +89,7 @@ public class AssemblyTest {
                 .groupId("org.apache.brooklyn")
                 .artifactId("apache-brooklyn")
                 .type("zip")
-                .version(asInProject());
+                .versionAsInProject();
     }
 
     public static MavenUrlReference karafStandardFeaturesRepository() {
@@ -98,7 +98,16 @@ public class AssemblyTest {
                 .artifactId("standard")
                 .type("xml")
                 .classifier("features")
-                .version(asInProject());
+                .versionAsInProject();
+    }
+
+    public static MavenUrlReference brooklynFeaturesRepository() {
+        return maven()
+                .groupId("org.apache.brooklyn")
+                .artifactId("brooklyn-features")
+                .type("xml")
+                .classifier("features")
+                .versionAsInProject();
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/cca26a6f/karaf/itest/src/test/java/org/apache/brooklyn/rest/BrooklynRestApiLauncherTest.java
----------------------------------------------------------------------
diff --git a/karaf/itest/src/test/java/org/apache/brooklyn/rest/BrooklynRestApiLauncherTest.java b/karaf/itest/src/test/java/org/apache/brooklyn/rest/BrooklynRestApiLauncherTest.java
new file mode 100644
index 0000000..6792ea2
--- /dev/null
+++ b/karaf/itest/src/test/java/org/apache/brooklyn/rest/BrooklynRestApiLauncherTest.java
@@ -0,0 +1,98 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.brooklyn.rest;
+
+import java.io.File;
+import java.util.concurrent.Callable;
+import org.apache.brooklyn.AssemblyTest;
+import org.apache.brooklyn.entity.brooklynnode.BrooklynNode;
+
+import org.apache.brooklyn.test.Asserts;
+import org.apache.brooklyn.util.http.HttpAsserts;
+import org.apache.brooklyn.util.http.HttpTool;
+import org.apache.http.HttpStatus;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Configuration;
+import static org.ops4j.pax.exam.CoreOptions.junitBundles;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.PaxExam;
+import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.configureConsole;
+import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
+import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.features;
+import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
+import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.logLevel;
+import org.ops4j.pax.exam.karaf.options.LogLevelOption;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerClass;
+
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerClass.class)
+@Ignore // TODO: re-enable after brooklyn is properly initialized within the OSGI environment
+public class BrooklynRestApiLauncherTest {
+
+    private static final String HTTP_PORT = "9998";
+    private static final String ROOT_URL = "http://localhost:" + HTTP_PORT;
+
+    @Configuration
+    public static Option[] configuration() throws Exception {
+        return new Option[]{
+            karafDistributionConfiguration()
+            .frameworkUrl(AssemblyTest.brooklynKarafDist())
+            .unpackDirectory(new File("target/paxexam/unpack/"))
+            .useDeployFolder(false),
+            editConfigurationFilePut("etc/org.ops4j.pax.web.cfg", "org.osgi.service.http.port", HTTP_PORT),
+            configureConsole().ignoreLocalConsole(),
+            logLevel(LogLevelOption.LogLevel.INFO),
+//            features(AssemblyTest.karafStandardFeaturesRepository(), "eventadmin"),
+            features(AssemblyTest.brooklynFeaturesRepository(), "brooklyn-software-base"),
+            junitBundles()
+
+            // for debugging
+//            , keepRuntimeFolder()
+//            , debugConfiguration()
+        };
+    }
+
+    @Test
+    public void testStart() throws Exception {
+        ensureBrooklynStarted();
+
+        final String testUrl = ROOT_URL + "/v1/catalog/entities";
+        int code = Asserts.succeedsEventually(new Callable<Integer>() {
+            @Override
+            public Integer call() throws Exception {
+                int code = HttpTool.getHttpStatusCode(testUrl);
+                if (code == HttpStatus.SC_FORBIDDEN) {
+                    throw new RuntimeException("Retry request");
+                } else {
+                    return code;
+                }
+            }
+        });
+        HttpAsserts.assertHealthyStatusCode(code);
+        HttpAsserts.assertContentContainsText(testUrl, BrooklynNode.class.getSimpleName());
+    }
+
+    private void ensureBrooklynStarted() {
+        final String upUrl = ROOT_URL + "/v1/server/up";
+        HttpAsserts.assertContentEventuallyMatches(upUrl, "true");
+    }
+}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/cca26a6f/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/AbstractBrooklynRestResource.java
----------------------------------------------------------------------
diff --git a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/AbstractBrooklynRestResource.java b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/AbstractBrooklynRestResource.java
index 9882eb3..118c9c7 100644
--- a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/AbstractBrooklynRestResource.java
+++ b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/AbstractBrooklynRestResource.java
@@ -27,6 +27,7 @@ import org.apache.brooklyn.api.entity.Entity;
 import org.apache.brooklyn.api.mgmt.ManagementContext;
 import org.apache.brooklyn.core.config.render.RendererHints;
 import org.apache.brooklyn.core.mgmt.ManagementContextInjectable;
+import org.apache.brooklyn.core.mgmt.internal.ManagementContextInternal;
 import org.apache.brooklyn.rest.util.BrooklynRestResourceUtils;
 import org.apache.brooklyn.rest.util.OsgiCompat;
 import org.apache.brooklyn.rest.util.WebResourceUtils;
@@ -49,12 +50,18 @@ public abstract class AbstractBrooklynRestResource implements ManagementContextI
 
     
     private ManagementContext managementContext;
+    private ManagementContextInternal managementContextInternal;
+
     private BrooklynRestResourceUtils brooklynRestResourceUtils;
     private ObjectMapper mapper;
 
     public ManagementContext mgmt() {
         return mgmtMaybe().get();
     }
+
+    public ManagementContextInternal mgmtInternal() {
+        return managementContextInternal;
+    }
     
     protected synchronized Maybe<ManagementContext> mgmtMaybe() {
         if (managementContext!=null) return Maybe.of(managementContext);
@@ -71,8 +78,17 @@ public abstract class AbstractBrooklynRestResource implements ManagementContextI
             throw new IllegalStateException("ManagementContext cannot be changed: specified twice for Brooklyn Jersey Resource "+this);
         }
         this.managementContext = managementContext;
+        if (managementContext instanceof ManagementContextInternal) {
+            // when running outside OSGi container
+            this.managementContextInternal = (ManagementContextInternal)managementContext;
+        }
     }
 
+    public void setManagementContextInternal(ManagementContextInternal managementContextInternal) {
+        this.managementContextInternal = managementContextInternal;
+    }
+
+
     public synchronized BrooklynRestResourceUtils brooklyn() {
         if (brooklynRestResourceUtils!=null) return brooklynRestResourceUtils;
         brooklynRestResourceUtils = new BrooklynRestResourceUtils(mgmt());

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/cca26a6f/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/AccessResource.java
----------------------------------------------------------------------
diff --git a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/AccessResource.java b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/AccessResource.java
index bb40edf..0aed2c8 100644
--- a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/AccessResource.java
+++ b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/AccessResource.java
@@ -21,7 +21,6 @@ package org.apache.brooklyn.rest.resources;
 import javax.ws.rs.core.Response;
 
 import org.apache.brooklyn.core.mgmt.internal.AccessManager;
-import org.apache.brooklyn.core.mgmt.internal.ManagementContextInternal;
 import org.apache.brooklyn.rest.api.AccessApi;
 import org.apache.brooklyn.rest.domain.AccessSummary;
 import org.apache.brooklyn.rest.transform.AccessTransformer;
@@ -33,13 +32,13 @@ public class AccessResource extends AbstractBrooklynRestResource implements Acce
 
     @Override
     public AccessSummary get() {
-        AccessManager accessManager = ((ManagementContextInternal) mgmt()).getAccessManager();
+        AccessManager accessManager = mgmtInternal().getAccessManager();
         return AccessTransformer.accessSummary(accessManager, ui.getBaseUriBuilder());
     }
 
     @Override
     public Response locationProvisioningAllowed(boolean allowed) {
-        AccessManager accessManager = ((ManagementContextInternal) mgmt()).getAccessManager();
+        AccessManager accessManager = mgmtInternal().getAccessManager();
         accessManager.setLocationProvisioningAllowed(allowed);
         return Response.status(Response.Status.OK).build();
     }

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/cca26a6f/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/ServerResource.java
----------------------------------------------------------------------
diff --git a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/ServerResource.java b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/ServerResource.java
index fe7893b..3f06cc5 100644
--- a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/ServerResource.java
+++ b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/ServerResource.java
@@ -52,7 +52,6 @@ import org.apache.brooklyn.core.entity.Entities;
 import org.apache.brooklyn.core.entity.StartableApplication;
 import org.apache.brooklyn.core.entity.lifecycle.Lifecycle;
 import org.apache.brooklyn.core.mgmt.entitlement.Entitlements;
-import org.apache.brooklyn.core.mgmt.internal.ManagementContextInternal;
 import org.apache.brooklyn.core.mgmt.persist.BrooklynPersistenceUtils;
 import org.apache.brooklyn.core.mgmt.persist.FileBasedObjectStore;
 import org.apache.brooklyn.core.mgmt.persist.PersistenceObjectStore;
@@ -190,7 +189,7 @@ public class ServerResource extends AbstractBrooklynRestResource implements Serv
                     }
 
                     terminateTried = true;
-                    ((ManagementContextInternal)mgmt).terminate(); 
+                    mgmtInternal().terminate(); 
 
                 } catch (Throwable e) {
                     Throwable interesting = Exceptions.getFirstInteresting(e);
@@ -208,7 +207,7 @@ public class ServerResource extends AbstractBrooklynRestResource implements Serv
                     hasAppErrorsOrTimeout.set(true);
                     
                     if (!terminateTried) {
-                        ((ManagementContextInternal)mgmt).terminate(); 
+                        mgmtInternal().terminate(); 
                     }
                 } finally {
 
@@ -356,7 +355,7 @@ public class ServerResource extends AbstractBrooklynRestResource implements Serv
     
     @Override
     public boolean isHealthy() {
-        return isUp() && ((ManagementContextInternal) mgmt()).errors().isEmpty();
+        return isUp() && mgmtInternal().errors().isEmpty();
     }
     
     @Override

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/cca26a6f/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/UsageResource.java
----------------------------------------------------------------------
diff --git a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/UsageResource.java b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/UsageResource.java
index ebcd2fa..3c226bd 100644
--- a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/UsageResource.java
+++ b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/UsageResource.java
@@ -30,7 +30,6 @@ import javax.annotation.Nullable;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.apache.brooklyn.core.entity.lifecycle.Lifecycle;
-import org.apache.brooklyn.core.mgmt.internal.ManagementContextInternal;
 import org.apache.brooklyn.core.mgmt.usage.ApplicationUsage;
 import org.apache.brooklyn.core.mgmt.usage.LocationUsage;
 import org.apache.brooklyn.core.mgmt.usage.ApplicationUsage.ApplicationEvent;
@@ -67,7 +66,7 @@ public class UsageResource extends AbstractBrooklynRestResource implements Usage
         
         checkDates(startDate, endDate);
 
-        Set<ApplicationUsage> usages = ((ManagementContextInternal) mgmt()).getUsageManager().getApplicationUsage(Predicates.alwaysTrue());
+        Set<ApplicationUsage> usages = mgmtInternal().getUsageManager().getApplicationUsage(Predicates.alwaysTrue());
 
         for (ApplicationUsage usage : usages) {
             List<UsageStatistic> statistics = retrieveApplicationUsage(usage, startDate, endDate);
@@ -87,7 +86,7 @@ public class UsageResource extends AbstractBrooklynRestResource implements Usage
 
         checkDates(startDate, endDate);
 
-        ApplicationUsage usage = ((ManagementContextInternal) mgmt()).getUsageManager().getApplicationUsage(application);
+        ApplicationUsage usage = mgmtInternal().getUsageManager().getApplicationUsage(application);
         if (usage != null) {
             List<UsageStatistic> statistics = retrieveApplicationUsage(usage, startDate, endDate);
             return new UsageStatistics(statistics, ImmutableMap.<String,URI>of());
@@ -146,7 +145,7 @@ public class UsageResource extends AbstractBrooklynRestResource implements Usage
         checkDates(startDate, endDate);
         
         // Note currently recording ALL metrics for a machine that contains an Event from given Application
-        Set<LocationUsage> matches = ((ManagementContextInternal) mgmt()).getUsageManager().getLocationUsage(new Predicate<LocationUsage>() {
+        Set<LocationUsage> matches = mgmtInternal().getUsageManager().getLocationUsage(new Predicate<LocationUsage>() {
             @Override
             public boolean apply(LocationUsage input) {
                 LocationUsage.LocationEvent first = input.getEvents().get(0);
@@ -189,7 +188,7 @@ public class UsageResource extends AbstractBrooklynRestResource implements Usage
         checkDates(startDate, endDate);
         
         // Note currently recording ALL metrics for a machine that contains an Event from given Application
-        LocationUsage usage = ((ManagementContextInternal) mgmt()).getUsageManager().getLocationUsage(machine);
+        LocationUsage usage = mgmtInternal().getUsageManager().getLocationUsage(machine);
         
         if (usage == null) {
             throw notFound("Machine '%s' not found", machine);

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/cca26a6f/rest/rest-resources/src/main/resources/OSGI-INF/blueprint/service.xml
----------------------------------------------------------------------
diff --git a/rest/rest-resources/src/main/resources/OSGI-INF/blueprint/service.xml b/rest/rest-resources/src/main/resources/OSGI-INF/blueprint/service.xml
index 1639fef..c1482b7 100644
--- a/rest/rest-resources/src/main/resources/OSGI-INF/blueprint/service.xml
+++ b/rest/rest-resources/src/main/resources/OSGI-INF/blueprint/service.xml
@@ -29,58 +29,78 @@ limitations under the License.
 
     <cxf:bus>
         <cxf:features>
+<!--            <bean class="org.apache.cxf.interceptor.security.JAASAuthenticationFeature">
+                    <property name="reportFault" value="true"/>
+            </bean>-->
             <cxf:logging/>
         </cxf:features>
     </cxf:bus>
 
     <reference id="localManagementContext"
                interface="org.apache.brooklyn.api.mgmt.ManagementContext" />
+    <reference id="localManagementContextInternal"
+               interface="org.apache.brooklyn.core.mgmt.internal.ManagementContextInternal" />
 
     <bean id="accessResourceBean" class="org.apache.brooklyn.rest.resources.AccessResource">
         <property name="managementContext" ref="localManagementContext" />
+        <property name="managementContextInternal" ref="localManagementContextInternal" />
     </bean>
     <bean id="activityResourceBean" class="org.apache.brooklyn.rest.resources.ActivityResource">
         <property name="managementContext" ref="localManagementContext" />
+        <property name="managementContextInternal" ref="localManagementContextInternal" />
     </bean>
     <!--<bean id="apidocResourceBean" class="org.apache.brooklyn.rest.resources.ApidocResource" />-->
     <bean id="applicationResourceBean" class="org.apache.brooklyn.rest.resources.ApplicationResource">
         <property name="managementContext" ref="localManagementContext" />
+        <property name="managementContextInternal" ref="localManagementContextInternal" />
     </bean>
     <bean id="catalogResourceBean" class="org.apache.brooklyn.rest.resources.CatalogResource">
         <property name="managementContext" ref="localManagementContext" />
+        <property name="managementContextInternal" ref="localManagementContextInternal" />
     </bean>
     <bean id="effectorResourceBean" class="org.apache.brooklyn.rest.resources.EffectorResource">
         <property name="managementContext" ref="localManagementContext" />
+        <property name="managementContextInternal" ref="localManagementContextInternal" />
     </bean>
     <bean id="entityConfigResourceBean" class="org.apache.brooklyn.rest.resources.EntityConfigResource">
         <property name="managementContext" ref="localManagementContext" />
+        <property name="managementContextInternal" ref="localManagementContextInternal" />
     </bean>
     <bean id="entityResourceBean" class="org.apache.brooklyn.rest.resources.EntityResource">
         <property name="managementContext" ref="localManagementContext" />
+        <property name="managementContextInternal" ref="localManagementContextInternal" />
     </bean>
     <bean id="locationResourceBean" class="org.apache.brooklyn.rest.resources.LocationResource">
         <property name="managementContext" ref="localManagementContext" />
+        <property name="managementContextInternal" ref="localManagementContextInternal" />
     </bean>
     <bean id="policyConfigResourceBean" class="org.apache.brooklyn.rest.resources.PolicyConfigResource">
         <property name="managementContext" ref="localManagementContext" />
+        <property name="managementContextInternal" ref="localManagementContextInternal" />
     </bean>
     <bean id="policyResourceBean" class="org.apache.brooklyn.rest.resources.PolicyResource">
         <property name="managementContext" ref="localManagementContext" />
+        <property name="managementContextInternal" ref="localManagementContextInternal" />
     </bean>
     <bean id="scriptResourceBean" class="org.apache.brooklyn.rest.resources.ScriptResource">
         <property name="managementContext" ref="localManagementContext" />
+        <property name="managementContextInternal" ref="localManagementContextInternal" />
     </bean>
     <bean id="sensorResourceBean" class="org.apache.brooklyn.rest.resources.SensorResource">
         <property name="managementContext" ref="localManagementContext" />
+        <property name="managementContextInternal" ref="localManagementContextInternal" />
     </bean>
     <bean id="serverResourceBean" class="org.apache.brooklyn.rest.resources.ServerResource">
         <property name="managementContext" ref="localManagementContext" />
+        <property name="managementContextInternal" ref="localManagementContextInternal" />
     </bean>
     <bean id="usageResourceBean" class="org.apache.brooklyn.rest.resources.UsageResource">
         <property name="managementContext" ref="localManagementContext" />
+        <property name="managementContextInternal" ref="localManagementContextInternal" />
     </bean>
     <bean id="versionResourceBean" class="org.apache.brooklyn.rest.resources.VersionResource">
         <property name="managementContext" ref="localManagementContext" />
+        <property name="managementContextInternal" ref="localManagementContextInternal" />
     </bean>
 
     <jaxrs:server id="brooklynRestApiV1" address="/">


[7/7] brooklyn-server git commit: Closes #34

Posted by sv...@apache.org.
Closes #34

Initialization of brooklyn within karaf

Initializes brooklyn using a serial initialization sequence in a new class `org.apache.brooklyn.core.OsgiLauncher` in `brooklyn-core`. The purpose of this PR is to stay close to the existing `BrooklynLauncher` initialization code, while discussing the location of various settings within karaf's etc folder. Further work should move individual bean initialization into corresponding  `init-method`s of each bean specified in `OSGI-INF/blueprint/blueprint.xml`


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/256aee05
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/256aee05
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/256aee05

Branch: refs/heads/master
Commit: 256aee05c1a4435d8dfdb5468e1dab4822f28937
Parents: 3ac14e2 ec56f2a
Author: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Authored: Tue Mar 8 17:52:12 2016 +0200
Committer: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Committed: Tue Mar 8 17:52:12 2016 +0200

----------------------------------------------------------------------
 camp/camp-brooklyn/pom.xml                      |  14 +-
 core/pom.xml                                    |   7 -
 .../org/apache/brooklyn/core/OsgiLauncher.java  | 557 +++++++++++++++++++
 .../resources/OSGI-INF/blueprint/blueprint.xml  |  43 +-
 .../etc/org.apache.brooklyn.osgilauncher.cfg    |  59 ++
 .../main/resources/etc/org.apache.cxf.osgi.cfg  |  20 -
 karaf/features/src/main/feature/feature.xml     |  10 +-
 .../java/org/apache/brooklyn/AssemblyTest.java  |  13 +-
 .../rest/BrooklynRestApiLauncherTest.java       |  98 ++++
 pom.xml                                         |   1 -
 rest/rest-resources/pom.xml                     |   2 +-
 .../resources/AbstractBrooklynRestResource.java |  16 +
 .../brooklyn/rest/resources/AccessResource.java |   5 +-
 .../brooklyn/rest/resources/ServerResource.java |   7 +-
 .../brooklyn/rest/resources/UsageResource.java  |   9 +-
 .../resources/OSGI-INF/blueprint/service.xml    |  20 +
 rest/rest-server-jersey/pom.xml                 |   2 +-
 rest/rest-server/pom.xml                        |   2 +-
 .../org/apache/brooklyn/rest/RestApiSetup.java  |  26 +-
 utils/common/dependencies/osgi/README.md        |  33 ++
 utils/common/dependencies/osgi/entities/pom.xml |  84 +++
 .../test/osgi/entities/SimpleApplication.java   |  28 +
 .../osgi/entities/SimpleApplicationImpl.java    |  27 +
 .../test/osgi/entities/SimpleEntity.java        |  28 +
 .../test/osgi/entities/SimpleEntityImpl.java    |  26 +
 .../test/osgi/entities/SimpleLocation.java      |  35 ++
 .../test/osgi/entities/SimplePolicy.java        |  36 ++
 .../apache/brooklyn/test/osgi/entities/icon.gif | Bin 0 -> 43 bytes
 .../dependencies/osgi/more-entities-v1/pom.xml  |  82 +++
 .../test/osgi/entities/more/MoreEntity.java     |  37 ++
 .../test/osgi/entities/more/MoreEntityImpl.java |  43 ++
 .../test/osgi/entities/more/MoreLocation.java   |  24 +
 .../test/osgi/entities/more/MorePolicy.java     |  25 +
 .../test/osgi/entities/more/MoreTemplate.java   |  24 +
 .../osgi/more-entities-v2-evil-twin/pom.xml     |  88 +++
 .../test/osgi/entities/more/MoreEntity.java     |  37 ++
 .../test/osgi/entities/more/MoreEntityImpl.java |  46 ++
 .../dependencies/osgi/more-entities-v2/pom.xml  |  88 +++
 .../test/osgi/entities/more/MoreEntity.java     |  43 ++
 .../test/osgi/entities/more/MoreEntityImpl.java |  46 ++
 .../test/osgi/entities/more/MoreLocation.java   |  26 +
 .../test/osgi/entities/more/MorePolicy.java     |  29 +
 .../test/osgi/entities/more/MoreTemplate.java   |  26 +
 .../apache/brooklyn/util/osgi/OsgiUtils.java    | 101 ++++
 .../brooklyn/util/osgi/VersionedName.java       |  76 +++
 .../brooklyn/util/osgi/OsgiTestResources.java   |  74 +++
 .../apache/brooklyn/util/osgi/OsgisTest.java    |  41 ++
 .../src/test/resources/brooklyn/osgi/README.md  |  25 +
 .../osgi/brooklyn-osgi-test-a_0.1.0.jar         | Bin 0 -> 2055 bytes
 .../osgi/brooklyn-osgi-test-a_0.1.0.txt         |  26 +
 .../osgi/brooklyn-test-osgi-entities.jar        | Bin 0 -> 14454 bytes
 .../osgi/brooklyn-test-osgi-entities.txt        |  26 +
 .../brooklyn-test-osgi-more-entities_0.1.0.jar  | Bin 0 -> 14964 bytes
 .../brooklyn-test-osgi-more-entities_0.1.0.txt  |  26 +
 .../brooklyn-test-osgi-more-entities_0.2.0.jar  | Bin 0 -> 15646 bytes
 .../brooklyn-test-osgi-more-entities_0.2.0.txt  |  26 +
 ...-test-osgi-more-entities_evil-twin_0.2.0.jar | Bin 0 -> 13811 bytes
 ...-test-osgi-more-entities_evil-twin_0.2.0.txt |  26 +
 utils/rt-felix/pom.xml                          |   4 +-
 utils/rt-osgi/pom.xml                           |  53 --
 .../apache/brooklyn/util/osgi/OsgiUtils.java    | 101 ----
 .../brooklyn/util/osgi/VersionedName.java       |  76 ---
 .../src/test/dependencies/osgi/README.md        |  33 --
 .../src/test/dependencies/osgi/entities/pom.xml |  84 ---
 .../test/osgi/entities/SimpleApplication.java   |  28 -
 .../osgi/entities/SimpleApplicationImpl.java    |  27 -
 .../test/osgi/entities/SimpleEntity.java        |  28 -
 .../test/osgi/entities/SimpleEntityImpl.java    |  26 -
 .../test/osgi/entities/SimpleLocation.java      |  35 --
 .../test/osgi/entities/SimplePolicy.java        |  36 --
 .../apache/brooklyn/test/osgi/entities/icon.gif | Bin 43 -> 0 bytes
 .../dependencies/osgi/more-entities-v1/pom.xml  |  82 ---
 .../test/osgi/entities/more/MoreEntity.java     |  37 --
 .../test/osgi/entities/more/MoreEntityImpl.java |  43 --
 .../test/osgi/entities/more/MoreLocation.java   |  24 -
 .../test/osgi/entities/more/MorePolicy.java     |  25 -
 .../test/osgi/entities/more/MoreTemplate.java   |  24 -
 .../osgi/more-entities-v2-evil-twin/pom.xml     |  88 ---
 .../test/osgi/entities/more/MoreEntity.java     |  37 --
 .../test/osgi/entities/more/MoreEntityImpl.java |  46 --
 .../dependencies/osgi/more-entities-v2/pom.xml  |  88 ---
 .../test/osgi/entities/more/MoreEntity.java     |  43 --
 .../test/osgi/entities/more/MoreEntityImpl.java |  46 --
 .../test/osgi/entities/more/MoreLocation.java   |  26 -
 .../test/osgi/entities/more/MorePolicy.java     |  29 -
 .../test/osgi/entities/more/MoreTemplate.java   |  26 -
 .../src/test/resources/brooklyn/osgi/README.md  |  25 -
 .../osgi/brooklyn-osgi-test-a_0.1.0.jar         | Bin 2055 -> 0 bytes
 .../osgi/brooklyn-osgi-test-a_0.1.0.txt         |  26 -
 .../osgi/brooklyn-test-osgi-entities.jar        | Bin 14454 -> 0 bytes
 .../osgi/brooklyn-test-osgi-entities.txt        |  26 -
 .../brooklyn-test-osgi-more-entities_0.1.0.jar  | Bin 14964 -> 0 bytes
 .../brooklyn-test-osgi-more-entities_0.1.0.txt  |  26 -
 .../brooklyn-test-osgi-more-entities_0.2.0.jar  | Bin 15646 -> 0 bytes
 .../brooklyn-test-osgi-more-entities_0.2.0.txt  |  26 -
 ...-test-osgi-more-entities_evil-twin_0.2.0.jar | Bin 13811 -> 0 bytes
 ...-test-osgi-more-entities_evil-twin_0.2.0.txt |  26 -
 97 files changed, 2256 insertions(+), 1413 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/256aee05/pom.xml
----------------------------------------------------------------------


[2/7] brooklyn-server git commit: Drop project brooklyn-rt-osgi

Posted by sv...@apache.org.
Drop project brooklyn-rt-osgi

With the addition of OsgiUtil in brooklyn-utils-common a split package
appeared between the brooklyn-utils-common and brooklyn-rt-osgi bundles.

It makes sense to merge brooklyn-rt-osgi into brooklyn-utils-common
since the new OsgiUtil class in it is about backward compatibility with
the monolithic launcher, as is brooklyn-rt-osgi.


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/0afb2c96
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/0afb2c96
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/0afb2c96

Branch: refs/heads/master
Commit: 0afb2c9637018fb84aa49864b0ee6efb648f82db
Parents: cca26a6
Author: Ciprian Ciubotariu <ch...@gmx.net>
Authored: Tue Feb 23 00:21:33 2016 +0200
Committer: Ciprian Ciubotariu <ch...@gmx.net>
Committed: Mon Feb 29 20:11:15 2016 +0200

----------------------------------------------------------------------
 camp/camp-brooklyn/pom.xml                      |  14 +--
 core/pom.xml                                    |   7 --
 karaf/features/src/main/feature/feature.xml     |   1 -
 pom.xml                                         |   1 -
 rest/rest-resources/pom.xml                     |   2 +-
 rest/rest-server-jersey/pom.xml                 |   2 +-
 rest/rest-server/pom.xml                        |   2 +-
 utils/common/dependencies/osgi/README.md        |  33 ++++++
 utils/common/dependencies/osgi/entities/pom.xml |  84 +++++++++++++++
 .../test/osgi/entities/SimpleApplication.java   |  28 +++++
 .../osgi/entities/SimpleApplicationImpl.java    |  27 +++++
 .../test/osgi/entities/SimpleEntity.java        |  28 +++++
 .../test/osgi/entities/SimpleEntityImpl.java    |  26 +++++
 .../test/osgi/entities/SimpleLocation.java      |  35 +++++++
 .../test/osgi/entities/SimplePolicy.java        |  36 +++++++
 .../apache/brooklyn/test/osgi/entities/icon.gif | Bin 0 -> 43 bytes
 .../dependencies/osgi/more-entities-v1/pom.xml  |  82 +++++++++++++++
 .../test/osgi/entities/more/MoreEntity.java     |  37 +++++++
 .../test/osgi/entities/more/MoreEntityImpl.java |  43 ++++++++
 .../test/osgi/entities/more/MoreLocation.java   |  24 +++++
 .../test/osgi/entities/more/MorePolicy.java     |  25 +++++
 .../test/osgi/entities/more/MoreTemplate.java   |  24 +++++
 .../osgi/more-entities-v2-evil-twin/pom.xml     |  88 ++++++++++++++++
 .../test/osgi/entities/more/MoreEntity.java     |  37 +++++++
 .../test/osgi/entities/more/MoreEntityImpl.java |  46 +++++++++
 .../dependencies/osgi/more-entities-v2/pom.xml  |  88 ++++++++++++++++
 .../test/osgi/entities/more/MoreEntity.java     |  43 ++++++++
 .../test/osgi/entities/more/MoreEntityImpl.java |  46 +++++++++
 .../test/osgi/entities/more/MoreLocation.java   |  26 +++++
 .../test/osgi/entities/more/MorePolicy.java     |  29 ++++++
 .../test/osgi/entities/more/MoreTemplate.java   |  26 +++++
 .../apache/brooklyn/util/osgi/OsgiUtils.java    | 101 +++++++++++++++++++
 .../brooklyn/util/osgi/VersionedName.java       |  76 ++++++++++++++
 .../brooklyn/util/osgi/OsgiTestResources.java   |  74 ++++++++++++++
 .../apache/brooklyn/util/osgi/OsgisTest.java    |  41 ++++++++
 .../src/test/resources/brooklyn/osgi/README.md  |  25 +++++
 .../osgi/brooklyn-osgi-test-a_0.1.0.jar         | Bin 0 -> 2055 bytes
 .../osgi/brooklyn-osgi-test-a_0.1.0.txt         |  26 +++++
 .../osgi/brooklyn-test-osgi-entities.jar        | Bin 0 -> 14454 bytes
 .../osgi/brooklyn-test-osgi-entities.txt        |  26 +++++
 .../brooklyn-test-osgi-more-entities_0.1.0.jar  | Bin 0 -> 14964 bytes
 .../brooklyn-test-osgi-more-entities_0.1.0.txt  |  26 +++++
 .../brooklyn-test-osgi-more-entities_0.2.0.jar  | Bin 0 -> 15646 bytes
 .../brooklyn-test-osgi-more-entities_0.2.0.txt  |  26 +++++
 ...-test-osgi-more-entities_evil-twin_0.2.0.jar | Bin 0 -> 13811 bytes
 ...-test-osgi-more-entities_evil-twin_0.2.0.txt |  26 +++++
 utils/rt-felix/pom.xml                          |   4 +-
 utils/rt-osgi/pom.xml                           |  53 ----------
 .../apache/brooklyn/util/osgi/OsgiUtils.java    | 101 -------------------
 .../brooklyn/util/osgi/VersionedName.java       |  76 --------------
 .../src/test/dependencies/osgi/README.md        |  33 ------
 .../src/test/dependencies/osgi/entities/pom.xml |  84 ---------------
 .../test/osgi/entities/SimpleApplication.java   |  28 -----
 .../osgi/entities/SimpleApplicationImpl.java    |  27 -----
 .../test/osgi/entities/SimpleEntity.java        |  28 -----
 .../test/osgi/entities/SimpleEntityImpl.java    |  26 -----
 .../test/osgi/entities/SimpleLocation.java      |  35 -------
 .../test/osgi/entities/SimplePolicy.java        |  36 -------
 .../apache/brooklyn/test/osgi/entities/icon.gif | Bin 43 -> 0 bytes
 .../dependencies/osgi/more-entities-v1/pom.xml  |  82 ---------------
 .../test/osgi/entities/more/MoreEntity.java     |  37 -------
 .../test/osgi/entities/more/MoreEntityImpl.java |  43 --------
 .../test/osgi/entities/more/MoreLocation.java   |  24 -----
 .../test/osgi/entities/more/MorePolicy.java     |  25 -----
 .../test/osgi/entities/more/MoreTemplate.java   |  24 -----
 .../osgi/more-entities-v2-evil-twin/pom.xml     |  88 ----------------
 .../test/osgi/entities/more/MoreEntity.java     |  37 -------
 .../test/osgi/entities/more/MoreEntityImpl.java |  46 ---------
 .../dependencies/osgi/more-entities-v2/pom.xml  |  88 ----------------
 .../test/osgi/entities/more/MoreEntity.java     |  43 --------
 .../test/osgi/entities/more/MoreEntityImpl.java |  46 ---------
 .../test/osgi/entities/more/MoreLocation.java   |  26 -----
 .../test/osgi/entities/more/MorePolicy.java     |  29 ------
 .../test/osgi/entities/more/MoreTemplate.java   |  26 -----
 .../src/test/resources/brooklyn/osgi/README.md  |  25 -----
 .../osgi/brooklyn-osgi-test-a_0.1.0.jar         | Bin 2055 -> 0 bytes
 .../osgi/brooklyn-osgi-test-a_0.1.0.txt         |  26 -----
 .../osgi/brooklyn-test-osgi-entities.jar        | Bin 14454 -> 0 bytes
 .../osgi/brooklyn-test-osgi-entities.txt        |  26 -----
 .../brooklyn-test-osgi-more-entities_0.1.0.jar  | Bin 14964 -> 0 bytes
 .../brooklyn-test-osgi-more-entities_0.1.0.txt  |  26 -----
 .../brooklyn-test-osgi-more-entities_0.2.0.jar  | Bin 15646 -> 0 bytes
 .../brooklyn-test-osgi-more-entities_0.2.0.txt  |  26 -----
 ...-test-osgi-more-entities_evil-twin_0.2.0.jar | Bin 13811 -> 0 bytes
 ...-test-osgi-more-entities_evil-twin_0.2.0.txt |  26 -----
 85 files changed, 1420 insertions(+), 1367 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/camp/camp-brooklyn/pom.xml
----------------------------------------------------------------------
diff --git a/camp/camp-brooklyn/pom.xml b/camp/camp-brooklyn/pom.xml
index b818b99..4ffeb44 100644
--- a/camp/camp-brooklyn/pom.xml
+++ b/camp/camp-brooklyn/pom.xml
@@ -127,13 +127,6 @@
         </dependency>
         <dependency>
             <groupId>org.apache.brooklyn</groupId>
-            <artifactId>brooklyn-rt-osgi</artifactId>
-            <version>${project.version}</version>
-            <classifier>tests</classifier>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.brooklyn</groupId>
             <artifactId>brooklyn-software-base</artifactId>
             <version>${project.version}</version>
             <classifier>tests</classifier>
@@ -156,6 +149,13 @@
             <artifactId>testng</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.apache.brooklyn</groupId>
+            <artifactId>brooklyn-utils-common</artifactId>
+            <version>${project.version}</version>
+            <classifier>tests</classifier>
+            <scope>test</scope>
+        </dependency>
 
         <!-- Transitive dependencies, declared explicitly due to version mismatch -->
         <dependency>

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/core/pom.xml
----------------------------------------------------------------------
diff --git a/core/pom.xml b/core/pom.xml
index fadc689..4603ad5 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -201,13 +201,6 @@
             <classifier>tests</classifier>
             <scope>test</scope>
         </dependency>
-       <dependency>
-            <groupId>org.apache.brooklyn</groupId>
-            <artifactId>brooklyn-rt-osgi</artifactId>
-            <version>${project.version}</version>
-            <classifier>tests</classifier>
-            <scope>test</scope>
-        </dependency>
         <dependency>
             <groupId>org.apache.brooklyn</groupId>
             <artifactId>brooklyn-utils-common</artifactId>

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/karaf/features/src/main/feature/feature.xml
----------------------------------------------------------------------
diff --git a/karaf/features/src/main/feature/feature.xml b/karaf/features/src/main/feature/feature.xml
index 833b318..55170d8 100644
--- a/karaf/features/src/main/feature/feature.xml
+++ b/karaf/features/src/main/feature/feature.xml
@@ -115,7 +115,6 @@
         <feature>brooklyn-api</feature>
 
         <bundle>mvn:org.apache.brooklyn/brooklyn-core/${project.version}</bundle>
-        <bundle>mvn:org.apache.brooklyn/brooklyn-rt-osgi/${project.version}</bundle>
         <bundle>mvn:org.apache.brooklyn/brooklyn-utils-groovy/${project.version}</bundle>
 
         <bundle dependency="true">mvn:com.google.code.gson/gson/${gson.version}</bundle>

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index f710b91..778200e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -224,7 +224,6 @@
 
         <module>karaf</module>
 
-        <module>utils/rt-osgi</module>
         <module>utils/rt-felix</module>
 
     </modules>

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/rest/rest-resources/pom.xml
----------------------------------------------------------------------
diff --git a/rest/rest-resources/pom.xml b/rest/rest-resources/pom.xml
index 498cfde..0a1d43d 100644
--- a/rest/rest-resources/pom.xml
+++ b/rest/rest-resources/pom.xml
@@ -180,7 +180,7 @@
         </dependency>
         <dependency>
             <groupId>org.apache.brooklyn</groupId>
-            <artifactId>brooklyn-rt-osgi</artifactId>
+            <artifactId>brooklyn-utils-common</artifactId>
             <version>${project.version}</version>
             <classifier>tests</classifier>
             <scope>test</scope>

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/rest/rest-server-jersey/pom.xml
----------------------------------------------------------------------
diff --git a/rest/rest-server-jersey/pom.xml b/rest/rest-server-jersey/pom.xml
index bf5e2c2..a102681 100644
--- a/rest/rest-server-jersey/pom.xml
+++ b/rest/rest-server-jersey/pom.xml
@@ -216,7 +216,7 @@
         </dependency>
         <dependency>
             <groupId>org.apache.brooklyn</groupId>
-            <artifactId>brooklyn-rt-osgi</artifactId>
+            <artifactId>brooklyn-utils-common</artifactId>
             <version>${project.version}</version>
             <classifier>tests</classifier>
             <scope>test</scope>

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/rest/rest-server/pom.xml
----------------------------------------------------------------------
diff --git a/rest/rest-server/pom.xml b/rest/rest-server/pom.xml
index 66325e8..94d4895 100644
--- a/rest/rest-server/pom.xml
+++ b/rest/rest-server/pom.xml
@@ -178,7 +178,7 @@
         </dependency>
         <dependency>
             <groupId>org.apache.brooklyn</groupId>
-            <artifactId>brooklyn-rt-osgi</artifactId>
+            <artifactId>brooklyn-utils-common</artifactId>
             <version>${project.version}</version>
             <classifier>tests</classifier>
             <scope>test</scope>

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/common/dependencies/osgi/README.md
----------------------------------------------------------------------
diff --git a/utils/common/dependencies/osgi/README.md b/utils/common/dependencies/osgi/README.md
new file mode 100644
index 0000000..bda2287
--- /dev/null
+++ b/utils/common/dependencies/osgi/README.md
@@ -0,0 +1,33 @@
+This directory contains source code for OSGi bundle files 
+used for testing.
+
+Binaries are included under src/test/resources.  They are
+copied there when these projects are built, and the binaries
+are included in source control to speed up build times
+(as these projects do not change much).  These projects are
+NOT built as part of the normal brooklyn build.
+
+To rebuild all:
+
+    for x in *entities* ; do pushd $x ; mvn clean install ; popd ; done
+
+See OsgiTestResources.java for information on the bundles.
+
+----
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you 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.
+

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/common/dependencies/osgi/entities/pom.xml
----------------------------------------------------------------------
diff --git a/utils/common/dependencies/osgi/entities/pom.xml b/utils/common/dependencies/osgi/entities/pom.xml
new file mode 100644
index 0000000..d391f34
--- /dev/null
+++ b/utils/common/dependencies/osgi/entities/pom.xml
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+     http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <packaging>jar</packaging>
+
+    <groupId>org.apache.brooklyn.test.resources.osgi</groupId>
+    <artifactId>brooklyn-test-osgi-entities</artifactId>
+    <version>0.1.0</version>
+
+    <name>OSGi bundled test entities</name>
+
+    <description>
+        Simple entities for testing the OSGi functionality
+    </description>
+
+    <parent>
+        <groupId>org.apache.brooklyn</groupId>
+        <artifactId>brooklyn-parent</artifactId>
+        <version>0.9.0-SNAPSHOT</version><!-- BROOKLYN_VERSION -->
+        <relativePath>../../../../../../../parent/pom.xml</relativePath>
+    </parent>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.brooklyn</groupId>
+            <artifactId>brooklyn-core</artifactId>
+            <version>${brooklyn.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.brooklyn</groupId>
+            <artifactId>brooklyn-api</artifactId>
+            <version>${brooklyn.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.brooklyn</groupId>
+            <artifactId>brooklyn-utils-common</artifactId>
+            <version>${brooklyn.version}</version>
+        </dependency>
+    </dependencies>
+    
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <version>2.3.2</version>
+                <configuration>
+                    <outputDirectory>../../../resources/brooklyn/osgi</outputDirectory>
+                    <finalName>brooklyn-test-osgi-entities</finalName>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <version>2.5.3</version>
+                <configuration>
+                    <instructions>
+                        <Bundle-Version>${project.version}</Bundle-Version>
+                        <Brooklyn-Feature-BuildId>${buildNumber}</Brooklyn-Feature-BuildId>
+                        <Brooklyn-Feature-BuildBranch>${scmBranch}</Brooklyn-Feature-BuildBranch>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/common/dependencies/osgi/entities/src/main/java/org/apache/brooklyn/test/osgi/entities/SimpleApplication.java
----------------------------------------------------------------------
diff --git a/utils/common/dependencies/osgi/entities/src/main/java/org/apache/brooklyn/test/osgi/entities/SimpleApplication.java b/utils/common/dependencies/osgi/entities/src/main/java/org/apache/brooklyn/test/osgi/entities/SimpleApplication.java
new file mode 100644
index 0000000..dcfb495
--- /dev/null
+++ b/utils/common/dependencies/osgi/entities/src/main/java/org/apache/brooklyn/test/osgi/entities/SimpleApplication.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.brooklyn.test.osgi.entities;
+
+
+import org.apache.brooklyn.api.entity.ImplementedBy;
+import org.apache.brooklyn.core.entity.StartableApplication;
+
+@ImplementedBy(SimpleApplicationImpl.class)
+public interface SimpleApplication extends StartableApplication {
+
+}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/common/dependencies/osgi/entities/src/main/java/org/apache/brooklyn/test/osgi/entities/SimpleApplicationImpl.java
----------------------------------------------------------------------
diff --git a/utils/common/dependencies/osgi/entities/src/main/java/org/apache/brooklyn/test/osgi/entities/SimpleApplicationImpl.java b/utils/common/dependencies/osgi/entities/src/main/java/org/apache/brooklyn/test/osgi/entities/SimpleApplicationImpl.java
new file mode 100644
index 0000000..fe6f1a2
--- /dev/null
+++ b/utils/common/dependencies/osgi/entities/src/main/java/org/apache/brooklyn/test/osgi/entities/SimpleApplicationImpl.java
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.brooklyn.test.osgi.entities;
+
+
+import org.apache.brooklyn.core.entity.AbstractApplication;
+import org.apache.brooklyn.core.entity.StartableApplication;
+
+public class SimpleApplicationImpl extends AbstractApplication implements StartableApplication, SimpleApplication {
+
+}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/common/dependencies/osgi/entities/src/main/java/org/apache/brooklyn/test/osgi/entities/SimpleEntity.java
----------------------------------------------------------------------
diff --git a/utils/common/dependencies/osgi/entities/src/main/java/org/apache/brooklyn/test/osgi/entities/SimpleEntity.java b/utils/common/dependencies/osgi/entities/src/main/java/org/apache/brooklyn/test/osgi/entities/SimpleEntity.java
new file mode 100644
index 0000000..87cd944
--- /dev/null
+++ b/utils/common/dependencies/osgi/entities/src/main/java/org/apache/brooklyn/test/osgi/entities/SimpleEntity.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.brooklyn.test.osgi.entities;
+
+
+import org.apache.brooklyn.api.entity.Entity;
+import org.apache.brooklyn.api.entity.ImplementedBy;
+
+@ImplementedBy(SimpleEntityImpl.class)
+public interface SimpleEntity extends Entity {
+
+}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/common/dependencies/osgi/entities/src/main/java/org/apache/brooklyn/test/osgi/entities/SimpleEntityImpl.java
----------------------------------------------------------------------
diff --git a/utils/common/dependencies/osgi/entities/src/main/java/org/apache/brooklyn/test/osgi/entities/SimpleEntityImpl.java b/utils/common/dependencies/osgi/entities/src/main/java/org/apache/brooklyn/test/osgi/entities/SimpleEntityImpl.java
new file mode 100644
index 0000000..2595c39
--- /dev/null
+++ b/utils/common/dependencies/osgi/entities/src/main/java/org/apache/brooklyn/test/osgi/entities/SimpleEntityImpl.java
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.brooklyn.test.osgi.entities;
+
+import org.apache.brooklyn.core.entity.AbstractEntity;
+
+
+public class SimpleEntityImpl extends AbstractEntity implements SimpleEntity {
+
+}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/common/dependencies/osgi/entities/src/main/java/org/apache/brooklyn/test/osgi/entities/SimpleLocation.java
----------------------------------------------------------------------
diff --git a/utils/common/dependencies/osgi/entities/src/main/java/org/apache/brooklyn/test/osgi/entities/SimpleLocation.java b/utils/common/dependencies/osgi/entities/src/main/java/org/apache/brooklyn/test/osgi/entities/SimpleLocation.java
new file mode 100644
index 0000000..60749cf
--- /dev/null
+++ b/utils/common/dependencies/osgi/entities/src/main/java/org/apache/brooklyn/test/osgi/entities/SimpleLocation.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.brooklyn.test.osgi.entities;
+
+import org.apache.brooklyn.config.ConfigKey;
+import org.apache.brooklyn.core.config.ConfigKeys;
+import org.apache.brooklyn.core.location.AbstractLocation;
+import org.apache.brooklyn.util.core.flags.SetFromFlag;
+
+public class SimpleLocation extends AbstractLocation {
+    @SetFromFlag("config1")
+    public static final ConfigKey<String> CONFIG1 = ConfigKeys.newStringConfigKey("config1");
+
+    @SetFromFlag("config2")
+    public static final ConfigKey<String> CONFIG2 = ConfigKeys.newStringConfigKey("config2");
+
+    @SetFromFlag("config3")
+    public static final ConfigKey<String> CONFIG3 = ConfigKeys.newStringConfigKey("config3");
+}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/common/dependencies/osgi/entities/src/main/java/org/apache/brooklyn/test/osgi/entities/SimplePolicy.java
----------------------------------------------------------------------
diff --git a/utils/common/dependencies/osgi/entities/src/main/java/org/apache/brooklyn/test/osgi/entities/SimplePolicy.java b/utils/common/dependencies/osgi/entities/src/main/java/org/apache/brooklyn/test/osgi/entities/SimplePolicy.java
new file mode 100644
index 0000000..fdea821
--- /dev/null
+++ b/utils/common/dependencies/osgi/entities/src/main/java/org/apache/brooklyn/test/osgi/entities/SimplePolicy.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.brooklyn.test.osgi.entities;
+
+
+import org.apache.brooklyn.config.ConfigKey;
+import org.apache.brooklyn.core.config.ConfigKeys;
+import org.apache.brooklyn.core.policy.AbstractPolicy;
+import org.apache.brooklyn.util.core.flags.SetFromFlag;
+
+public class SimplePolicy extends AbstractPolicy {
+    @SetFromFlag("config1")
+    public static final ConfigKey<String> CONFIG1 = ConfigKeys.newStringConfigKey("config1");
+
+    @SetFromFlag("config2")
+    public static final ConfigKey<String> CONFIG2 = ConfigKeys.newStringConfigKey("config2");
+
+    @SetFromFlag("config3")
+    public static final ConfigKey<String> CONFIG3 = ConfigKeys.newStringConfigKey("config3");
+}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/common/dependencies/osgi/entities/src/main/resources/org/apache/brooklyn/test/osgi/entities/icon.gif
----------------------------------------------------------------------
diff --git a/utils/common/dependencies/osgi/entities/src/main/resources/org/apache/brooklyn/test/osgi/entities/icon.gif b/utils/common/dependencies/osgi/entities/src/main/resources/org/apache/brooklyn/test/osgi/entities/icon.gif
new file mode 100644
index 0000000..e565824
Binary files /dev/null and b/utils/common/dependencies/osgi/entities/src/main/resources/org/apache/brooklyn/test/osgi/entities/icon.gif differ

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/common/dependencies/osgi/more-entities-v1/pom.xml
----------------------------------------------------------------------
diff --git a/utils/common/dependencies/osgi/more-entities-v1/pom.xml b/utils/common/dependencies/osgi/more-entities-v1/pom.xml
new file mode 100644
index 0000000..000c5cd
--- /dev/null
+++ b/utils/common/dependencies/osgi/more-entities-v1/pom.xml
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+     http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <packaging>jar</packaging>
+
+    <groupId>org.apache.brooklyn.test.resources.osgi</groupId>
+    <artifactId>brooklyn-test-osgi-more-entities</artifactId>
+    <version>0.1.0</version>
+
+    <name>OSGi bundled test entities</name>
+
+    <description>
+        Simple entities for testing the OSGi functionality
+    </description>
+
+    <parent>
+        <groupId>org.apache.brooklyn</groupId>
+        <artifactId>brooklyn-parent</artifactId>
+        <version>0.9.0-SNAPSHOT</version><!-- BROOKLYN_VERSION -->
+        <relativePath>../../../../../../../parent/pom.xml</relativePath>
+    </parent>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.brooklyn</groupId>
+            <artifactId>brooklyn-core</artifactId>
+            <version>${brooklyn.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.brooklyn</groupId>
+            <artifactId>brooklyn-api</artifactId>
+            <version>${brooklyn.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.brooklyn</groupId>
+            <artifactId>brooklyn-utils-common</artifactId>
+            <version>${brooklyn.version}</version>
+        </dependency>
+    </dependencies>
+    
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <version>2.3.2</version>
+                <configuration>
+                    <outputDirectory>../../../resources/brooklyn/osgi</outputDirectory>
+                    <finalName>brooklyn-test-osgi-more-entities_${project.version}</finalName>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <version>2.5.3</version>
+                <configuration>
+                    <instructions>
+                        <Bundle-Version>${project.version}</Bundle-Version>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/common/dependencies/osgi/more-entities-v1/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreEntity.java
----------------------------------------------------------------------
diff --git a/utils/common/dependencies/osgi/more-entities-v1/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreEntity.java b/utils/common/dependencies/osgi/more-entities-v1/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreEntity.java
new file mode 100644
index 0000000..4efd1e3
--- /dev/null
+++ b/utils/common/dependencies/osgi/more-entities-v1/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreEntity.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.brooklyn.test.osgi.entities.more;
+
+import org.apache.brooklyn.api.effector.Effector;
+import org.apache.brooklyn.api.entity.Entity;
+import org.apache.brooklyn.api.entity.ImplementedBy;
+import org.apache.brooklyn.core.effector.Effectors;
+
+@ImplementedBy(MoreEntityImpl.class)
+public interface MoreEntity extends Entity {
+
+    public static final Effector<String> SAY_HI = Effectors.effector(String.class, "sayHI")
+        .description("says HI to an uppercased name")
+        .parameter(String.class, "name")
+        .buildAbstract();
+
+    /** Makes a string saying hi to the given name, in uppercase, for testing. */
+    String sayHI(String name);
+    
+}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/common/dependencies/osgi/more-entities-v1/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreEntityImpl.java
----------------------------------------------------------------------
diff --git a/utils/common/dependencies/osgi/more-entities-v1/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreEntityImpl.java b/utils/common/dependencies/osgi/more-entities-v1/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreEntityImpl.java
new file mode 100644
index 0000000..c1eecd3
--- /dev/null
+++ b/utils/common/dependencies/osgi/more-entities-v1/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreEntityImpl.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.brooklyn.test.osgi.entities.more;
+
+import org.apache.brooklyn.core.effector.EffectorBody;
+import org.apache.brooklyn.core.entity.AbstractEntity;
+import org.apache.brooklyn.util.core.config.ConfigBag;
+
+public class MoreEntityImpl extends AbstractEntity implements MoreEntity {
+
+    @Override
+    public void init() {
+        super.init();
+        getMutableEntityType().addEffector(SAY_HI, new EffectorBody<String>() {
+            @Override
+            public String call(ConfigBag parameters) {
+                return sayHI((String)parameters.getStringKey("name"));
+            }
+        });
+    }
+    
+    @Override
+    public String sayHI(String name) {
+        return "Hi "+name.toUpperCase()+" from V1";
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/common/dependencies/osgi/more-entities-v1/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreLocation.java
----------------------------------------------------------------------
diff --git a/utils/common/dependencies/osgi/more-entities-v1/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreLocation.java b/utils/common/dependencies/osgi/more-entities-v1/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreLocation.java
new file mode 100644
index 0000000..943c53c
--- /dev/null
+++ b/utils/common/dependencies/osgi/more-entities-v1/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreLocation.java
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.brooklyn.test.osgi.entities.more;
+
+import org.apache.brooklyn.core.location.AbstractLocation;
+
+public class MoreLocation extends AbstractLocation {
+}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/common/dependencies/osgi/more-entities-v1/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MorePolicy.java
----------------------------------------------------------------------
diff --git a/utils/common/dependencies/osgi/more-entities-v1/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MorePolicy.java b/utils/common/dependencies/osgi/more-entities-v1/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MorePolicy.java
new file mode 100644
index 0000000..b72768b
--- /dev/null
+++ b/utils/common/dependencies/osgi/more-entities-v1/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MorePolicy.java
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.brooklyn.test.osgi.entities.more;
+
+import org.apache.brooklyn.core.policy.AbstractPolicy;
+
+public class MorePolicy extends AbstractPolicy {
+
+}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/common/dependencies/osgi/more-entities-v1/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreTemplate.java
----------------------------------------------------------------------
diff --git a/utils/common/dependencies/osgi/more-entities-v1/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreTemplate.java b/utils/common/dependencies/osgi/more-entities-v1/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreTemplate.java
new file mode 100644
index 0000000..c66ed32
--- /dev/null
+++ b/utils/common/dependencies/osgi/more-entities-v1/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreTemplate.java
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.brooklyn.test.osgi.entities.more;
+
+import org.apache.brooklyn.core.entity.AbstractApplication;
+
+public class MoreTemplate extends AbstractApplication {
+}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/common/dependencies/osgi/more-entities-v2-evil-twin/pom.xml
----------------------------------------------------------------------
diff --git a/utils/common/dependencies/osgi/more-entities-v2-evil-twin/pom.xml b/utils/common/dependencies/osgi/more-entities-v2-evil-twin/pom.xml
new file mode 100644
index 0000000..9ad32fe
--- /dev/null
+++ b/utils/common/dependencies/osgi/more-entities-v2-evil-twin/pom.xml
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+     http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <packaging>jar</packaging>
+
+    <groupId>org.apache.brooklyn.test.resources.osgi.evil_twin</groupId>
+    <artifactId>brooklyn-test-osgi-more-entities</artifactId>
+    <version>0.2.0</version>
+
+    <name>OSGi bundled test entities</name>
+
+    <description>
+        Simple entities for testing the OSGi functionality
+    </description>
+
+    <parent>
+        <groupId>org.apache.brooklyn</groupId>
+        <artifactId>brooklyn-parent</artifactId>
+        <version>0.9.0-SNAPSHOT</version><!-- BROOKLYN_VERSION -->
+        <relativePath>../../../../../../../parent/pom.xml</relativePath>
+    </parent>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.brooklyn</groupId>
+            <artifactId>brooklyn-core</artifactId>
+            <version>${brooklyn.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.brooklyn</groupId>
+            <artifactId>brooklyn-api</artifactId>
+            <version>${brooklyn.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.brooklyn</groupId>
+            <artifactId>brooklyn-utils-common</artifactId>
+            <version>${brooklyn.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.brooklyn.test.resources.osgi</groupId>
+            <artifactId>brooklyn-test-osgi-entities</artifactId>
+            <version>0.1.0</version>
+        </dependency>
+    </dependencies>
+    
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <version>2.3.2</version>
+                <configuration>
+                    <outputDirectory>../../../resources/brooklyn/osgi</outputDirectory>
+                    <finalName>brooklyn-test-osgi-more-entities_evil-twin_${project.version}</finalName>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <version>2.5.3</version>
+                <configuration>
+                    <instructions>
+                        <Bundle-SymbolicName>org.apache.brooklyn.test.resources.osgi.brooklyn-test-osgi-more-entities</Bundle-SymbolicName>
+                        <Bundle-Version>${project.version}</Bundle-Version>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/common/dependencies/osgi/more-entities-v2-evil-twin/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreEntity.java
----------------------------------------------------------------------
diff --git a/utils/common/dependencies/osgi/more-entities-v2-evil-twin/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreEntity.java b/utils/common/dependencies/osgi/more-entities-v2-evil-twin/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreEntity.java
new file mode 100644
index 0000000..f0ace90
--- /dev/null
+++ b/utils/common/dependencies/osgi/more-entities-v2-evil-twin/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreEntity.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.brooklyn.test.osgi.entities.more;
+
+import org.apache.brooklyn.api.effector.Effector;
+import org.apache.brooklyn.api.entity.Entity;
+import org.apache.brooklyn.api.entity.ImplementedBy;
+import org.apache.brooklyn.core.effector.Effectors;
+
+@ImplementedBy(MoreEntityImpl.class)
+public interface MoreEntity extends Entity {
+
+    public static final Effector<String> SAY_HI = Effectors.effector(String.class, "sayHI")
+        .description("says HO to an uppercased name")
+        .parameter(String.class, "name")
+        .buildAbstract();
+
+    /** Makes a string saying HO to the given name, in contrast to v1 and v2. */
+    String sayHI(String name);
+    
+}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/common/dependencies/osgi/more-entities-v2-evil-twin/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreEntityImpl.java
----------------------------------------------------------------------
diff --git a/utils/common/dependencies/osgi/more-entities-v2-evil-twin/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreEntityImpl.java b/utils/common/dependencies/osgi/more-entities-v2-evil-twin/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreEntityImpl.java
new file mode 100644
index 0000000..d2cfa08
--- /dev/null
+++ b/utils/common/dependencies/osgi/more-entities-v2-evil-twin/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreEntityImpl.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.brooklyn.test.osgi.entities.more;
+
+import org.apache.brooklyn.api.policy.PolicySpec;
+import org.apache.brooklyn.core.effector.EffectorBody;
+import org.apache.brooklyn.core.entity.AbstractEntity;
+import org.apache.brooklyn.util.core.config.ConfigBag;
+
+public class MoreEntityImpl extends AbstractEntity implements MoreEntity {
+
+    /** Unlike v1, this declares an explicit dependency on SimplePolicy */
+    @Override
+    public void init() {
+        super.init();
+        getMutableEntityType().addEffector(SAY_HI, new EffectorBody<String>() {
+            @Override
+            public String call(ConfigBag parameters) {
+                return sayHI((String)parameters.getStringKey("name"));
+            }
+        });
+        addPolicy(PolicySpec.create(org.apache.brooklyn.test.osgi.entities.SimplePolicy.class));
+    }
+    
+    /** Returns HO instead of HI (like v2 non-evil twin) or Hi (like v1) */
+    public String sayHI(String name) {
+        return "HO "+name.toUpperCase()+" FROM V2 EVIL TWIN";
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/common/dependencies/osgi/more-entities-v2/pom.xml
----------------------------------------------------------------------
diff --git a/utils/common/dependencies/osgi/more-entities-v2/pom.xml b/utils/common/dependencies/osgi/more-entities-v2/pom.xml
new file mode 100644
index 0000000..4b4a4fb
--- /dev/null
+++ b/utils/common/dependencies/osgi/more-entities-v2/pom.xml
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+     http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <packaging>jar</packaging>
+
+    <groupId>org.apache.brooklyn.test.resources.osgi</groupId>
+    <artifactId>brooklyn-test-osgi-more-entities</artifactId>
+    <version>0.2.0</version>
+
+    <name>OSGi bundled test entities</name>
+
+    <description>
+        Simple entities for testing the OSGi functionality
+    </description>
+
+    <parent>
+        <groupId>org.apache.brooklyn</groupId>
+        <artifactId>brooklyn-parent</artifactId>
+        <version>0.9.0-SNAPSHOT</version><!-- BROOKLYN_VERSION -->
+        <relativePath>../../../../../../../parent/pom.xml</relativePath>
+    </parent>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.brooklyn</groupId>
+            <artifactId>brooklyn-core</artifactId>
+            <version>${brooklyn.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.brooklyn</groupId>
+            <artifactId>brooklyn-api</artifactId>
+            <version>${brooklyn.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.brooklyn</groupId>
+            <artifactId>brooklyn-utils-common</artifactId>
+            <version>${brooklyn.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.brooklyn.test.resources.osgi</groupId>
+            <artifactId>brooklyn-test-osgi-entities</artifactId>
+            <version>0.1.0</version>
+        </dependency>
+    </dependencies>
+    
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <version>2.3.2</version>
+                <configuration>
+                    <outputDirectory>../../../resources/brooklyn/osgi</outputDirectory>
+                    <finalName>brooklyn-test-osgi-more-entities_${project.version}</finalName>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <version>2.5.3</version>
+                <configuration>
+                    <instructions>
+                        <Bundle-SymbolicName>org.apache.brooklyn.test.resources.osgi.brooklyn-test-osgi-more-entities</Bundle-SymbolicName>
+                        <Bundle-Version>${project.version}</Bundle-Version>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/common/dependencies/osgi/more-entities-v2/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreEntity.java
----------------------------------------------------------------------
diff --git a/utils/common/dependencies/osgi/more-entities-v2/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreEntity.java b/utils/common/dependencies/osgi/more-entities-v2/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreEntity.java
new file mode 100644
index 0000000..9d4d840
--- /dev/null
+++ b/utils/common/dependencies/osgi/more-entities-v2/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreEntity.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.brooklyn.test.osgi.entities.more;
+
+import org.apache.brooklyn.api.catalog.Catalog;
+import org.apache.brooklyn.api.effector.Effector;
+import org.apache.brooklyn.api.entity.Entity;
+import org.apache.brooklyn.api.entity.ImplementedBy;
+import org.apache.brooklyn.config.ConfigKey;
+import org.apache.brooklyn.core.config.ConfigKeys;
+import org.apache.brooklyn.core.effector.Effectors;
+
+@Catalog(name="More Entity v2")
+@ImplementedBy(MoreEntityImpl.class)
+public interface MoreEntity extends Entity {
+
+    public static final ConfigKey<String> MORE_CONFIG = ConfigKeys.newStringConfigKey("more_config");
+    public static final Effector<String> SAY_HI = Effectors.effector(String.class, "sayHI")
+        .description("says HI to an uppercased name")
+        .parameter(String.class, "name")
+        .buildAbstract();
+
+    /** Makes a string saying hi to the given name, in uppercase, for testing. 
+     * In contrast to v1, impl here returns HI not Hi. */
+    String sayHI(String name);
+    
+}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/common/dependencies/osgi/more-entities-v2/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreEntityImpl.java
----------------------------------------------------------------------
diff --git a/utils/common/dependencies/osgi/more-entities-v2/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreEntityImpl.java b/utils/common/dependencies/osgi/more-entities-v2/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreEntityImpl.java
new file mode 100644
index 0000000..0aff562
--- /dev/null
+++ b/utils/common/dependencies/osgi/more-entities-v2/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreEntityImpl.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.brooklyn.test.osgi.entities.more;
+
+import org.apache.brooklyn.api.policy.PolicySpec;
+import org.apache.brooklyn.core.effector.EffectorBody;
+import org.apache.brooklyn.core.entity.AbstractEntity;
+import org.apache.brooklyn.util.core.config.ConfigBag;
+
+public class MoreEntityImpl extends AbstractEntity implements MoreEntity {
+
+    /** Unlike v1, this declares an explicit dependency on SimplePolicy */
+    @Override
+    public void init() {
+        super.init();
+        getMutableEntityType().addEffector(SAY_HI, new EffectorBody<String>() {
+            @Override
+            public String call(ConfigBag parameters) {
+                return sayHI((String)parameters.getStringKey("name"));
+            }
+        });
+        addPolicy(PolicySpec.create(org.apache.brooklyn.test.osgi.entities.SimplePolicy.class));
+    }
+    
+    /** Unlike v1, this returns "HI " rather than "Hi " */
+    public String sayHI(String name) {
+        return "HI "+name.toUpperCase()+" FROM V2";
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/common/dependencies/osgi/more-entities-v2/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreLocation.java
----------------------------------------------------------------------
diff --git a/utils/common/dependencies/osgi/more-entities-v2/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreLocation.java b/utils/common/dependencies/osgi/more-entities-v2/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreLocation.java
new file mode 100644
index 0000000..ed10541
--- /dev/null
+++ b/utils/common/dependencies/osgi/more-entities-v2/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreLocation.java
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.brooklyn.test.osgi.entities.more;
+
+import org.apache.brooklyn.api.catalog.Catalog;
+import org.apache.brooklyn.core.location.AbstractLocation;
+
+@Catalog(name="More Location", description="Cataliog item OSGi test location")
+public class MoreLocation extends AbstractLocation {
+}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/common/dependencies/osgi/more-entities-v2/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MorePolicy.java
----------------------------------------------------------------------
diff --git a/utils/common/dependencies/osgi/more-entities-v2/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MorePolicy.java b/utils/common/dependencies/osgi/more-entities-v2/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MorePolicy.java
new file mode 100644
index 0000000..7909d5b
--- /dev/null
+++ b/utils/common/dependencies/osgi/more-entities-v2/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MorePolicy.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.brooklyn.test.osgi.entities.more;
+
+import org.apache.brooklyn.api.catalog.Catalog;
+import org.apache.brooklyn.core.policy.AbstractPolicy;
+
+@Catalog(name="More Policy", description="Cataliog item OSGi test policy")
+public class MorePolicy extends AbstractPolicy {
+    public String sayHI(String name) {
+        return "HI "+name.toUpperCase()+" FROM V2";
+    }
+}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/common/dependencies/osgi/more-entities-v2/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreTemplate.java
----------------------------------------------------------------------
diff --git a/utils/common/dependencies/osgi/more-entities-v2/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreTemplate.java b/utils/common/dependencies/osgi/more-entities-v2/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreTemplate.java
new file mode 100644
index 0000000..9e0fc85
--- /dev/null
+++ b/utils/common/dependencies/osgi/more-entities-v2/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreTemplate.java
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.brooklyn.test.osgi.entities.more;
+
+import org.apache.brooklyn.api.catalog.Catalog;
+import org.apache.brooklyn.core.entity.AbstractApplication;
+
+@Catalog(name="More Template", description="Cataliog item OSGi test template")
+public class MoreTemplate extends AbstractApplication {
+}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/common/src/main/java/org/apache/brooklyn/util/osgi/OsgiUtils.java
----------------------------------------------------------------------
diff --git a/utils/common/src/main/java/org/apache/brooklyn/util/osgi/OsgiUtils.java b/utils/common/src/main/java/org/apache/brooklyn/util/osgi/OsgiUtils.java
new file mode 100644
index 0000000..4e28720
--- /dev/null
+++ b/utils/common/src/main/java/org/apache/brooklyn/util/osgi/OsgiUtils.java
@@ -0,0 +1,101 @@
+/*
+ * Copyright 2015 The Apache Software Foundation.
+ *
+ * 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.apache.brooklyn.util.osgi;
+
+import java.io.IOException;
+import java.net.JarURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.jar.Attributes;
+import java.util.jar.Manifest;
+import org.apache.brooklyn.util.guava.Maybe;
+import org.apache.brooklyn.util.text.Strings;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.Constants;
+import org.osgi.framework.Version;
+
+/**
+ * Simple OSGi utilities.
+ * 
+ * @author Ciprian Ciubotariu <ch...@gmx.net>
+ */
+public class OsgiUtils {
+
+    public static URL getContainerUrl(URL url, String resourceInThatDir) {
+        //Switching from manual parsing of jar: and file: URLs to java provided functionality.
+        //The old code was breaking on any Windows path and instead of fixing it, using
+        //the provided Java APIs seemed like the better option since they are already tested
+        //on multiple platforms.
+        boolean isJar = "jar".equals(url.getProtocol());
+        if(isJar) {
+            try {
+                //let java handle the parsing of jar URL, no network connection is established.
+                //Strips the jar protocol:
+                //  jar:file:/<path to jar>!<resourceInThatDir>
+                //  becomes
+                //  file:/<path to jar>
+                JarURLConnection connection = (JarURLConnection) url.openConnection();
+                url = connection.getJarFileURL();
+            } catch (IOException e) {
+                throw new IllegalStateException(e);
+            }
+        } else {
+            //Remove the trailing resouceInThatDir path from the URL, thus getting the parent folder.
+            String path = url.toString();
+            int i = path.indexOf(resourceInThatDir);
+            if (i==-1) throw new IllegalStateException("Resource path ("+resourceInThatDir+") not in url substring ("+url+")");
+            String parent = path.substring(0, i);
+            try {
+                url = new URL(parent);
+            } catch (MalformedURLException e) {
+                throw new IllegalStateException("Resource ("+resourceInThatDir+") found at invalid URL parent (" + parent + ")", e);
+            }
+        }
+        return url;
+    }
+
+    public static String getVersionedId(Manifest manifest) {
+        Attributes atts = manifest.getMainAttributes();
+        return atts.getValue(Constants.BUNDLE_SYMBOLICNAME) + ":" + atts.getValue(Constants.BUNDLE_VERSION);
+    }
+
+    public static String getVersionedId(Bundle b) {
+        return b.getSymbolicName() + ":" + b.getVersion();
+    }
+
+    /** Takes a string which might be of the form "symbolic-name" or "symbolic-name:version" (or something else entirely)
+     * and returns a VersionedName. The versionedName.getVersion() will be null if if there was no version in the input
+     * (or returning {@link Maybe#absent()} if not valid, with a suitable error message). */
+    public static Maybe<VersionedName> parseOsgiIdentifier(String symbolicNameOptionalWithVersion) {
+        if (Strings.isBlank(symbolicNameOptionalWithVersion)) {
+            return Maybe.absent("OSGi identifier is blank");
+        }
+        String[] parts = symbolicNameOptionalWithVersion.split(":");
+        if (parts.length > 2) {
+            return Maybe.absent("OSGi identifier has too many parts; max one ':' symbol");
+        }
+        Version v = null;
+        if (parts.length == 2) {
+            try {
+                v = Version.parseVersion(parts[1]);
+            } catch (IllegalArgumentException e) {
+                return Maybe.absent("OSGi identifier has invalid version string (" + e.getMessage() + ")");
+            }
+        }
+        return Maybe.of(new VersionedName(parts[0], v));
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/common/src/main/java/org/apache/brooklyn/util/osgi/VersionedName.java
----------------------------------------------------------------------
diff --git a/utils/common/src/main/java/org/apache/brooklyn/util/osgi/VersionedName.java b/utils/common/src/main/java/org/apache/brooklyn/util/osgi/VersionedName.java
new file mode 100644
index 0000000..df36a80
--- /dev/null
+++ b/utils/common/src/main/java/org/apache/brooklyn/util/osgi/VersionedName.java
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2015 The Apache Software Foundation.
+ *
+ * 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.apache.brooklyn.util.osgi;
+
+import com.google.common.base.Objects;
+import org.apache.brooklyn.util.text.Strings;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.Version;
+
+/**
+ * Versioned name of an OSGi bundle.
+ * @author Ciprian Ciubotariu <ch...@gmx.net>
+ */
+public class VersionedName {
+    private final String symbolicName;
+    private final Version version;
+
+    public VersionedName(Bundle b) {
+        this.symbolicName = b.getSymbolicName();
+        this.version = b.getVersion();
+    }
+
+    public VersionedName(String symbolicName, Version version) {
+        this.symbolicName = symbolicName;
+        this.version = version;
+    }
+
+    @Override
+    public String toString() {
+        return symbolicName + ":" + Strings.toString(version);
+    }
+
+    public boolean equals(String sn, String v) {
+        return symbolicName.equals(sn) && (version == null && v == null || version != null && version.toString().equals(v));
+    }
+
+    public boolean equals(String sn, Version v) {
+        return symbolicName.equals(sn) && (version == null && v == null || version != null && version.equals(v));
+    }
+
+    public String getSymbolicName() {
+        return symbolicName;
+    }
+
+    public Version getVersion() {
+        return version;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hashCode(symbolicName, version);
+    }
+
+    @Override
+    public boolean equals(Object other) {
+        if (!(other instanceof VersionedName)) {
+            return false;
+        }
+        VersionedName o = (VersionedName) other;
+        return Objects.equal(symbolicName, o.symbolicName) && Objects.equal(version, o.version);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/common/src/test/java/org/apache/brooklyn/util/osgi/OsgiTestResources.java
----------------------------------------------------------------------
diff --git a/utils/common/src/test/java/org/apache/brooklyn/util/osgi/OsgiTestResources.java b/utils/common/src/test/java/org/apache/brooklyn/util/osgi/OsgiTestResources.java
new file mode 100644
index 0000000..21827a0
--- /dev/null
+++ b/utils/common/src/test/java/org/apache/brooklyn/util/osgi/OsgiTestResources.java
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.brooklyn.util.osgi;
+
+/**
+ * Many OSGi tests require OSGi bundles (of course). Test bundles have been collected here
+ * for convenience and clarity. Available bundles (on the classpath, with source code
+ * either embedded or in /src/dependencies) are described by the constants in this class.
+ * <p>
+ * Some of these bundles are also used in REST API tests, as that stretches catalog further
+ * (using CAMP) and that is one area where OSGi is heavily used. 
+ */
+public class OsgiTestResources {
+
+
+    /**
+     * brooklyn-osgi-test-a_0.1.0 -
+     * defines TestA which has a "times" method and a static multiplier field;
+     * we set the multiplier to determine when we are sharing versions and when not
+     */
+    public static final String BROOKLYN_OSGI_TEST_A_0_1_0_PATH = "/brooklyn/osgi/brooklyn-osgi-test-a_0.1.0.jar";
+
+    /**
+     * brooklyn-test-osgi-entities (v 0.1.0) -
+     * defines an entity and an application, to confirm it can be read and used by brooklyn
+     */
+    public static final String BROOKLYN_TEST_OSGI_ENTITIES_PATH = "/brooklyn/osgi/brooklyn-test-osgi-entities.jar";
+    public static final String BROOKLYN_TEST_OSGI_ENTITIES_SIMPLE_APPLICATION = "org.apache.brooklyn.test.osgi.entities.SimpleApplication";
+    public static final String BROOKLYN_TEST_OSGI_ENTITIES_SIMPLE_ENTITY = "org.apache.brooklyn.test.osgi.entities.SimpleEntity";
+    public static final String BROOKLYN_TEST_OSGI_ENTITIES_SIMPLE_POLICY = "org.apache.brooklyn.test.osgi.entities.SimplePolicy";
+
+    /**
+     * brooklyn-test-osgi-more-entities_0.1.0 -
+     * another bundle with a minimal sayHi effector, used to test versioning and dependencies
+     * (this one has no dependencies, but see also {@value #BROOKLYN_TEST_MORE_ENTITIES_V2_PATH})
+     */
+    public static final String BROOKLYN_TEST_MORE_ENTITIES_SYMBOLIC_NAME_FINAL_PART = "brooklyn-test-osgi-more-entities";
+    public static final String BROOKLYN_TEST_MORE_ENTITIES_SYMBOLIC_NAME_FULL = 
+        "org.apache.brooklyn.test.resources.osgi."+BROOKLYN_TEST_MORE_ENTITIES_SYMBOLIC_NAME_FINAL_PART;
+    public static final String BROOKLYN_TEST_MORE_ENTITIES_V1_PATH = "/brooklyn/osgi/" + BROOKLYN_TEST_MORE_ENTITIES_SYMBOLIC_NAME_FINAL_PART + "_0.1.0.jar";
+    public static final String BROOKLYN_TEST_MORE_ENTITIES_MORE_ENTITY = "org.apache.brooklyn.test.osgi.entities.more.MoreEntity";
+    
+    /**
+     * brooklyn-test-osgi-more-entities_0.2.0 -
+     * similar to {@link #BROOKLYN_TEST_MORE_ENTITIES_V1_PATH} but saying "HI NAME" rather than "Hi NAME",
+     * and declaring an explicit dependency on SimplePolicy from {@link #BROOKLYN_TEST_OSGI_ENTITIES_PATH}
+     */
+    public static final String BROOKLYN_TEST_MORE_ENTITIES_V2_PATH = "/brooklyn/osgi/" + BROOKLYN_TEST_MORE_ENTITIES_SYMBOLIC_NAME_FINAL_PART + "_0.2.0.jar";
+    
+    /**
+     * bundle with identical metadata (same symbolic name and version -- hence being an evil twin) 
+     * as {@link #BROOKLYN_TEST_MORE_ENTITIES_V2_PATH},
+     * but slightly different behaviour -- saying "HO NAME" -- in order to make sure we can differentiate two two
+     * at runtime.
+     */
+    public static final String BROOKLYN_TEST_MORE_ENTITIES_V2_EVIL_TWIN_PATH = "/brooklyn/osgi/" + BROOKLYN_TEST_MORE_ENTITIES_SYMBOLIC_NAME_FINAL_PART + "_evil-twin_0.2.0.jar";
+    
+}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/common/src/test/java/org/apache/brooklyn/util/osgi/OsgisTest.java
----------------------------------------------------------------------
diff --git a/utils/common/src/test/java/org/apache/brooklyn/util/osgi/OsgisTest.java b/utils/common/src/test/java/org/apache/brooklyn/util/osgi/OsgisTest.java
new file mode 100644
index 0000000..c23c185
--- /dev/null
+++ b/utils/common/src/test/java/org/apache/brooklyn/util/osgi/OsgisTest.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.brooklyn.util.osgi;
+
+import org.apache.brooklyn.util.osgi.OsgiUtils;
+import org.apache.brooklyn.util.osgi.VersionedName;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
+
+import org.osgi.framework.Version;
+import org.testng.annotations.Test;
+
+public class OsgisTest {
+
+    @Test
+    public void testParseOsgiIdentifier() throws Exception {
+        assertEquals(OsgiUtils.parseOsgiIdentifier("a.b").get(), new VersionedName("a.b", null));
+        assertEquals(OsgiUtils.parseOsgiIdentifier("a.b:0.1.2").get(), new VersionedName("a.b", Version.parseVersion("0.1.2")));
+        assertEquals(OsgiUtils.parseOsgiIdentifier("a.b:0.0.0.SNAPSHOT").get(), new VersionedName("a.b", Version.parseVersion("0.0.0.SNAPSHOT")));
+        assertFalse(OsgiUtils.parseOsgiIdentifier("a.b:0.notanumber.2").isPresent()); // invalid version
+        assertFalse(OsgiUtils.parseOsgiIdentifier("a.b:0.1.2:3.4.5").isPresent());    // too many colons
+        assertFalse(OsgiUtils.parseOsgiIdentifier("a.b:0.0.0_SNAPSHOT").isPresent()); // invalid version
+        assertFalse(OsgiUtils.parseOsgiIdentifier("").isPresent());
+    }
+}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/common/src/test/resources/brooklyn/osgi/README.md
----------------------------------------------------------------------
diff --git a/utils/common/src/test/resources/brooklyn/osgi/README.md b/utils/common/src/test/resources/brooklyn/osgi/README.md
new file mode 100644
index 0000000..1d78ddb
--- /dev/null
+++ b/utils/common/src/test/resources/brooklyn/osgi/README.md
@@ -0,0 +1,25 @@
+This directory contains OSGi bundle files used for testing.
+
+Source code including pom.xml is contained in the bundles,
+or in /src/dependencies, or both.
+
+See OsgiTestResources.java for information on the bundles.
+
+----
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you 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.
+

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/common/src/test/resources/brooklyn/osgi/brooklyn-osgi-test-a_0.1.0.jar
----------------------------------------------------------------------
diff --git a/utils/common/src/test/resources/brooklyn/osgi/brooklyn-osgi-test-a_0.1.0.jar b/utils/common/src/test/resources/brooklyn/osgi/brooklyn-osgi-test-a_0.1.0.jar
new file mode 100644
index 0000000..b4c777c
Binary files /dev/null and b/utils/common/src/test/resources/brooklyn/osgi/brooklyn-osgi-test-a_0.1.0.jar differ

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/common/src/test/resources/brooklyn/osgi/brooklyn-osgi-test-a_0.1.0.txt
----------------------------------------------------------------------
diff --git a/utils/common/src/test/resources/brooklyn/osgi/brooklyn-osgi-test-a_0.1.0.txt b/utils/common/src/test/resources/brooklyn/osgi/brooklyn-osgi-test-a_0.1.0.txt
new file mode 100644
index 0000000..e6dde72
--- /dev/null
+++ b/utils/common/src/test/resources/brooklyn/osgi/brooklyn-osgi-test-a_0.1.0.txt
@@ -0,0 +1,26 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you 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.
+
+The file brooklyn-osgi-test-a_0.1.0.jar is an extremely simple OSGi bundle,
+used in brooklyn.management.osgi.OsgiStandaloneTest.
+
+The jar contains its source.
+
+Under Apache conventions, binary files are not part of the source
+release. If you are using the source release, you may add this file
+by copying it from the master repository, which is accessible on the
+web at https://github.com/apache/incubator-brooklyn

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/common/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-entities.jar
----------------------------------------------------------------------
diff --git a/utils/common/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-entities.jar b/utils/common/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-entities.jar
new file mode 100644
index 0000000..c76d03b
Binary files /dev/null and b/utils/common/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-entities.jar differ

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/common/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-entities.txt
----------------------------------------------------------------------
diff --git a/utils/common/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-entities.txt b/utils/common/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-entities.txt
new file mode 100644
index 0000000..9cf43a4
--- /dev/null
+++ b/utils/common/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-entities.txt
@@ -0,0 +1,26 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you 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.
+
+The file brooklyn-test-osgi-entities.jar is for testing a deployment of
+an OSGi bundle containing entities.
+
+The source is in core/src/test/dependencies/osgi/entities
+
+Under Apache conventions, binary files are not part of the source
+release. If you are using the source release, you may add this file
+by copying it from the master repository, which is accessible on the
+web at https://github.com/apache/incubator-brooklyn

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0afb2c96/utils/common/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.1.0.jar
----------------------------------------------------------------------
diff --git a/utils/common/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.1.0.jar b/utils/common/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.1.0.jar
new file mode 100644
index 0000000..1101112
Binary files /dev/null and b/utils/common/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.1.0.jar differ


[5/7] brooklyn-server git commit: Remove leftover feature.xml.orig

Posted by sv...@apache.org.
Remove leftover feature.xml.orig


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/01be9161
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/01be9161
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/01be9161

Branch: refs/heads/master
Commit: 01be9161736b977d6f606bde0229ab041af5aaee
Parents: 563537e
Author: Ciprian Ciubotariu <ch...@gmx.net>
Authored: Fri Mar 4 16:06:12 2016 +0200
Committer: Ciprian Ciubotariu <ch...@gmx.net>
Committed: Fri Mar 4 16:06:12 2016 +0200

----------------------------------------------------------------------
 .../features/src/main/feature/feature.xml.orig  | 288 -------------------
 1 file changed, 288 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/01be9161/karaf/features/src/main/feature/feature.xml.orig
----------------------------------------------------------------------
diff --git a/karaf/features/src/main/feature/feature.xml.orig b/karaf/features/src/main/feature/feature.xml.orig
deleted file mode 100644
index 5a4ac7d..0000000
--- a/karaf/features/src/main/feature/feature.xml.orig
+++ /dev/null
@@ -1,288 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
-    Licensed to the Apache Software Foundation (ASF) under one or more
-    contributor license agreements.  See the NOTICE file distributed with
-    this work for additional information regarding copyright ownership.
-    The ASF licenses this file to You under the Apache License, Version 2.0
-    (the "License"); you may not use this file except in compliance with
-    the License.  You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing, software
-    distributed under the License is distributed on an "AS IS" BASIS,
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-    See the License for the specific language governing permissions and
-    limitations under the License.
--->
-<features xmlns="http://karaf.apache.org/xmlns/features/v1.2.0" name="org.apache.brooklyn-${project.version}">
-
-    <repository>mvn:org.apache.karaf.features/standard/${karaf.version}/xml/features</repository>
-    <repository>mvn:org.apache.karaf.features/enterprise/${karaf.version}/xml/features</repository>
-    <repository>mvn:org.apache.karaf.features/spring/${karaf.version}/xml/features</repository>
-
-    <repository>mvn:org.apache.cxf.karaf/apache-cxf/${cxf.version}/xml/features</repository>
-
-    <!-- temporary feature until we migrate to swagger-1.5.4, which is properly bundled -->
-    <feature name="swagger-crippled" version="${swagger.version}" description="Swagger Annotations+Core+JAXRS+Models">
-        <bundle>mvn:io.swagger/swagger-annotations/${swagger.version}</bundle>
-<!--        <bundle>wrap:mvn:io.swagger/swagger-core/${swagger.version}</bundle>
-        <bundle>wrap:mvn:io.swagger/swagger-jaxrs/${swagger.version}</bundle>-->
-        <bundle>mvn:io.swagger/swagger-models/${swagger.version}</bundle>
-
-        <!--<bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.javassist/${javassist.bundle.version}</bundle>-->
-        <!--<bundle dependency='true'>mvn:com.google.guava/guava/${guava.version}</bundle>-->
-        <bundle dependency='true'>mvn:com.fasterxml.jackson.core/jackson-annotations/${fasterxml.jackson.version}</bundle>
-        <bundle dependency='true'>mvn:com.fasterxml.jackson.core/jackson-core/${fasterxml.jackson.version}</bundle>
-        <bundle dependency='true'>mvn:com.fasterxml.jackson.core/jackson-databind/${fasterxml.jackson.version}</bundle>
-        <bundle dependency='true'>mvn:com.fasterxml.jackson.dataformat/jackson-dataformat-yaml/${fasterxml.jackson.version}</bundle>
-        <bundle dependency='true'>mvn:com.fasterxml.jackson.jaxrs/jackson-jaxrs-base/${fasterxml.jackson.version}</bundle>
-        <bundle dependency='true'>mvn:com.fasterxml.jackson.jaxrs/jackson-jaxrs-json-provider/${fasterxml.jackson.version}</bundle>
-    </feature>
-
-    <feature name="brooklyn-utils-common" version="${project.version}" description="Brooklyn Common Utils">
-        <bundle>mvn:org.apache.brooklyn/brooklyn-utils-common/${project.version}</bundle>
-        <bundle>mvn:org.apache.brooklyn/brooklyn-logback-includes/${project.version}</bundle>
-
-        <bundle dependency="true">mvn:com.google.guava/guava/${guava.version}</bundle>
-        <bundle dependency="true">mvn:org.codehaus.groovy/groovy-all/${groovy.version}</bundle>
-        <bundle dependency="true">mvn:commons-io/commons-io/${commons-io.version}</bundle>
-        <bundle dependency="true">mvn:commons-codec/commons-codec/${commons-codec.version}</bundle>
-        <bundle dependency="true">mvn:org.slf4j/jul-to-slf4j/${slf4j.version}</bundle>
-        <bundle dependency="true">mvn:org.yaml/snakeyaml/${snakeyaml.version}</bundle>
-        <bundle dependency="true">mvn:org.apache.httpcomponents/httpcore-osgi/${httpclient.version}</bundle>
-        <bundle dependency="true">mvn:org.apache.httpcomponents/httpclient-osgi/${httpclient.version}</bundle>
-
-        <bundle dependency="true">mvn:ch.qos.logback/logback-classic/${logback.version}</bundle>
-        <bundle dependency="true">mvn:ch.qos.logback/logback-core/${logback.version}</bundle>
-    </feature>
-
-    <feature name="brooklyn-utils-groovy" version="${project.version}" description="Brooklyn Groovy Utils">
-        <feature>brooklyn-utils-common</feature>
-        <bundle>mvn:org.apache.brooklyn/brooklyn-utils-common/${project.version}</bundle>
-    </feature>
-
-    <feature name="brooklyn-utils-rest-swagger" version="${project.version}" description="Brooklyn REST Swagger Apidoc Utilities">
-        <feature>brooklyn-utils-common</feature>
-        <feature version="${swagger.version}">swagger-crippled</feature>
-
-        <bundle>mvn:org.apache.brooklyn/brooklyn-utils-rest-swagger/${project.version}</bundle>
-
-        <!--<feature>jersey</feature>-->
-        <bundle dependency="true">mvn:com.sun.jersey/jersey-server/${jersey.version}</bundle>
-        <bundle dependency="true">mvn:com.sun.jersey/jersey-core/${jersey.version}</bundle>
-        <bundle dependency="true">mvn:com.sun.jersey/jersey-servlet/${jersey.version}</bundle>
-        <bundle dependency="true">mvn:org.apache.commons/commons-lang3/${commons-lang3.version}</bundle>
-
-        <bundle dependency="true">mvn:javax.servlet/javax.servlet-api/${javax-servlet.version}</bundle>
-        <bundle dependency="true">mvn:javax.ws.rs/javax.ws.rs-api/${jax-rs-api.version}</bundle>
-
-        <!-- TODO: version 1.1.0.Final has OSGi manifest; check if upgrade doesn't get rid of wrap -->
-        <bundle dependency="true">wrap:mvn:javax.validation/validation-api/${validation-api.version}</bundle>
-        <bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.reflections/${reflections.bundle.version}</bundle>
-    </feature>
-
-    <feature name="brooklyn-rest-api" version="${project.version}" description="Brooklyn REST API">
-        <feature>brooklyn-utils-rest-swagger</feature>
-        <feature>brooklyn-api</feature>
-
-        <bundle>mvn:org.apache.brooklyn/brooklyn-rest-api/${project.version}</bundle>
-
-        <bundle dependency="true">mvn:com.sun.jersey.contribs/jersey-multipart/${jersey.version}</bundle>
-        <bundle dependency="true">mvn:org.jvnet.mimepull/mimepull/1.9.3</bundle>
-        <bundle dependency="true">mvn:commons-lang/commons-lang/${commons-lang.version}</bundle>
-
-        <!-- TODO: version 1.1.0.Final has OSGi manifest; check if upgrade doesn't get rid of wrap -->
-        <bundle dependency="true">wrap:mvn:javax.validation/validation-api/${validation-api.version}</bundle>
-
-        <!--<feature>jersey</feature>-->
-        <bundle dependency="true">mvn:com.sun.jersey/jersey-servlet/${jersey.version}</bundle>
-        <bundle dependency="true">mvn:org.apache.commons/commons-lang3/${commons-lang3.version}</bundle>
-        <bundle dependency="true">mvn:org.codehaus.jackson/jackson-core-asl/${jackson.version}</bundle>
-        <bundle dependency="true">mvn:org.codehaus.jackson/jackson-mapper-asl/${jackson.version}</bundle>
-
-        <bundle dependency="true">mvn:javax.servlet/javax.servlet-api/${javax-servlet.version}</bundle>
-    </feature>
-
-    <feature name="brooklyn-api"  version="${project.version}" description="Brooklyn API">
-        <feature>brooklyn-utils-common</feature>
-        <bundle>mvn:org.apache.brooklyn/brooklyn-api/${project.version}</bundle>
-    </feature>
-
-    <feature name="brooklyn-core" version="${project.version}" description="Brooklyn Core">
-        <feature>brooklyn-api</feature>
-
-        <bundle>mvn:org.apache.brooklyn/brooklyn-core/${project.version}</bundle>
-        <bundle>mvn:org.apache.brooklyn/brooklyn-rt-osgi/${project.version}</bundle>
-        <bundle>mvn:org.apache.brooklyn/brooklyn-utils-groovy/${project.version}</bundle>
-    
-        <bundle dependency="true">mvn:com.google.code.gson/gson/${gson.version}</bundle>
-        <bundle dependency="true">mvn:com.jayway.jsonpath/json-path/${jsonPath.version}</bundle>
-        <bundle dependency="true">mvn:com.fasterxml.jackson.core/jackson-core/${fasterxml.jackson.version}</bundle>
-        <bundle dependency="true">mvn:com.fasterxml.jackson.core/jackson-databind/${fasterxml.jackson.version}</bundle>
-        <bundle dependency="true">mvn:com.fasterxml.jackson.core/jackson-annotations/${fasterxml.jackson.version}</bundle>
-        <bundle dependency="true">mvn:net.minidev/json-smart/${jsonSmart.version}</bundle>
-        <bundle dependency="true">mvn:net.minidev/asm/${minidev.asm.version}</bundle>
-        <bundle dependency="true">mvn:com.thoughtworks.xstream/xstream/${xstream.version}</bundle>
-        <bundle dependency="true">mvn:org.freemarker/freemarker/${freemarker.version}</bundle>
-        <bundle dependency="true">mvn:net.schmizz/sshj/${sshj.version}</bundle>
-        <bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.jzlib/1.1.3_2</bundle> <!-- jzlib version is 1.1.3, but bundle is 1.1.3_2 -->
-        <bundle dependency="true">mvn:org.bouncycastle/bcprov-ext-jdk15on/${bouncycastle.version}</bundle>
-        <bundle dependency="true">mvn:org.bouncycastle/bcpkix-jdk15on/${bouncycastle.version}</bundle>
-        <bundle dependency="true">mvn:commons-codec/commons-codec/${commons-codec.version}</bundle>
-        <bundle dependency="true">mvn:org.apache.commons/commons-lang3/${commons-lang3.version}</bundle>
-        <bundle dependency="true">mvn:org.codehaus.jackson/jackson-core-asl/${jackson.version}</bundle>
-        <bundle dependency="true">mvn:org.codehaus.jackson/jackson-mapper-asl/${jackson.version}</bundle>
-        <bundle dependency="true">mvn:org.codehaus.jackson/jackson-jaxrs/${jackson.version}</bundle>
-
-        <!-- TODO: don't use wrap -->
-        <bundle dependency="true">wrap:mvn:com.google.http-client/google-http-client/1.18.0-rc</bundle> <!-- from geoip -->
-        <bundle dependency="true">wrap:mvn:com.maxmind.geoip2/geoip2/${maxmind.version}</bundle> <!-- from geoip2 -->
-        <bundle dependency="true">wrap:mvn:xpp3/xpp3_min/1.1.4c</bundle> <!-- from com.thoughtworks.xstream/xstream -->
-
-        <bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.reflections/${reflections.bundle.version}</bundle>
-    </feature>
-
-    <feature name="brooklyn-camp-brooklyn" version="${project.version}" description="Brooklyn CAMP REST API">
-        <bundle>mvn:org.apache.brooklyn/brooklyn-camp/${project.version}</bundle>
-
-        <feature>brooklyn-core</feature>
-        <feature>brooklyn-camp-base</feature>
-        <bundle dependency="true">mvn:commons-beanutils/commons-beanutils/${commons-beanutils.version}</bundle>
-        <bundle dependency="true">mvn:commons-collections/commons-collections/${commons-collections.version}</bundle>
-    </feature>
-
-    <feature name="brooklyn-camp-base" version="${project.version}" description="Brooklyn CAMP Base">
-        <bundle>mvn:org.apache.brooklyn.camp/camp-base/${project.version}</bundle>
-
-        <feature>brooklyn-utils-common</feature>
-        <bundle dependency="true">mvn:org.apache.commons/commons-compress/${commons-compress.version}</bundle>
-        <bundle dependency="true">wrap:mvn:org.tukaani/xz/${commons-compress.version}</bundle>
-        <bundle dependency="true">mvn:org.apache.commons/commons-lang3/${commons-lang3.version}</bundle>
-    </feature>
-
-    <feature name="brooklyn-camp-server" version="${project.version}" description="Brooklyn CAMP Server">
-        <bundle>mvn:org.apache.brooklyn.camp/camp-server/${project.version}</bundle>
-
-        <feature>brooklyn-camp-base</feature>
-        <feature>brooklyn-utils-rest-swagger</feature>
-        <feature>jetty</feature> <!-- TODO: pax-jetty??? -->
-
-        <bundle dependency="true">mvn:org.codehaus.jackson/jackson-core-asl/${jackson.version}</bundle>
-        
-        <bundle dependency="true">wrap:mvn:javax.validation/validation-api/${validation-api.version}</bundle>
-        <bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.reflections/${reflections.bundle.version}</bundle>
-    </feature>
-
-    <feature name="brooklyn-rest-resources" version="${project.version}" description="Brooklyn REST Resources (CXF)">
-        <bundle>mvn:org.apache.brooklyn/brooklyn-rest-resources/${project.version}</bundle>
-        <feature>brooklyn-core</feature>
-        <feature>brooklyn-rest-api</feature>
-        <feature>brooklyn-camp-brooklyn</feature>
-        <feature>brooklyn-camp-base</feature>
-
-        <feature>cxf-jaxrs</feature>
-
-        <!-- should be deps of jax-rs-2.0 rest-api project -->
-        <bundle dependency="true">mvn:javax.servlet/javax.servlet-api/${javax-servlet.version}</bundle>
-        <bundle dependency="true">mvn:javax.ws.rs/javax.ws.rs-api/${jax-rs-api.version}</bundle>
-    </feature>
-
-    <feature name="brooklyn-jsgui" version="${project.version}" description="Brooklyn REST JavaScript Web GUI">
-        <bundle>mvn:org.apache.brooklyn/brooklyn-jsgui/${project.version}/war</bundle>
-        <feature>war</feature>
-    </feature>
-  
-    <feature name="brooklyn-commands"  version="${project.version}"  description="Brooklyn Shell Commands">
-        <bundle>mvn:org.apache.brooklyn/brooklyn-commands/${project.version}</bundle>
-        <!--<feature version="${project.version}">brooklyn-core</feature>-->
-    </feature>
-  
-    <feature name="brooklyn-software-winrm" version="${project.version}" description="Brooklyn WinRM Software Entities">
-        <bundle>mvn:org.apache.brooklyn/brooklyn-software-winrm/${project.version}</bundle>
-        <feature>brooklyn-core</feature>
-        <bundle dependency="true">wrap:mvn:io.cloudsoft.windows/winrm4j/${winrm4j.version}</bundle>
-    </feature>
-
-    <feature name="brooklyn-policy"  version="${project.version}" description="Brooklyn Policies">
-        <bundle>mvn:org.apache.brooklyn/brooklyn-policy/${project.version}</bundle>
-        <feature>brooklyn-core</feature>
-    </feature>
-
-    <feature name="brooklyn-software-base"  version="${project.version}"  description="Brooklyn Software Base">
-        <bundle>mvn:org.apache.brooklyn/brooklyn-software-base/${project.version}</bundle>
-        <feature>brooklyn-software-winrm</feature>
-        <feature>brooklyn-policy</feature>
-        <!-- python dependency required but not supported since karaf cannot handle its runtime bindings -->
-    </feature>
-
-    <feature name="brooklyn-jmxmp-agent" version="${project.version}" description="Brooklyn Secure JMXMP Agent">
-        <bundle>mvn:org.apache.brooklyn/brooklyn-jmxmp-agent/${project.version}</bundle>
-        <feature>brooklyn-core</feature>
-        <bundle dependency="true">wrap:mvn:org.glassfish.external/opendmk_jmxremote_optional_jar/${opendmk_jmxremote_optional_jar.version}</bundle>
-    </feature>
-
-    <feature name="brooklyn-jmxrmi-agent" version="${project.version}" description="Brooklyn JMX RMI Agent">
-        <bundle>mvn:org.apache.brooklyn/brooklyn-jmxrmi-agent/${project.version}</bundle>
-    </feature>
-
-    <!-- WARNING: feature brooklyn-locations-jclouds cannot really be installed, due to guava 17 issues -->
-    <feature name="brooklyn-locations-jclouds" version="${project.version}" description="Brooklyn Jclouds Location Targets">
-        <bundle>mvn:org.apache.brooklyn/brooklyn-locations-jclouds/${project.version}</bundle>
-        <feature>brooklyn-software-winrm</feature>
-        <bundle dependency="true">mvn:com.google.inject/guice/${guice.version}</bundle>
-        <bundle dependency="true">mvn:${jclouds.groupId}.driver/jclouds-bouncycastle/${jclouds.version}</bundle>
-        <bundle dependency="true">mvn:${jclouds.groupId}/jclouds-core/${jclouds.version}</bundle>
-        <bundle dependency="true">mvn:com.google.guava/guava/${guava.version}</bundle>
-    </feature>
-
-    <feature name="brooklyn-software-network" version="${project.version}" description="Brooklyn Network Software Entities">
-        <bundle>mvn:org.apache.brooklyn/brooklyn-software-network/${project.version}</bundle>
-        <feature>brooklyn-software-base</feature>
-    </feature>
-
-    <feature name="brooklyn-software-osgi" version="${project.version}" description="Brooklyn OSGi Software Entities">
-        <bundle>mvn:org.apache.brooklyn/brooklyn-software-osgi/${project.version}</bundle>
-        <feature>brooklyn-core</feature>
-        <feature>brooklyn-api</feature>
-        <feature>brooklyn-software-base</feature>
-        <bundle dependency="true">mvn:com.google.guava/guava/${guava.version}</bundle>
-    </feature>
-
-    <feature name="brooklyn-software-database" version="${project.version}" description="Brooklyn Database Software Entities">
-        <bundle>mvn:org.apache.brooklyn/brooklyn-software-database/${project.version}</bundle>
-        <feature>brooklyn-core</feature>
-        <feature>brooklyn-api</feature>
-        <feature>brooklyn-software-base</feature>
-        <bundle dependency="true">mvn:com.google.guava/guava/${guava.version}</bundle>
-    </feature>
-
-    <feature name="brooklyn-software-webapp" version="${project.version}" description="Brooklyn Web App Software Entities">
-        <bundle>mvn:org.apache.brooklyn/brooklyn-software-webapp/${project.version}</bundle>
-        <feature>brooklyn-software-base</feature>
-        <bundle dependency="true">wrap:mvn:org.hibernate/jtidy/${jtidy.version}</bundle>
-    </feature>
-
-    <feature name="brooklyn-software-messaging" version="${project.version}" description="Brooklyn Messaging Software Entities">
-        <bundle>mvn:org.apache.brooklyn/brooklyn-software-messaging/${project.version}</bundle>
-        <feature>brooklyn-software-base</feature>
-    </feature>
-
-    <feature name="brooklyn-software-nosql" version="${project.version}" description="Brooklyn NoSQL Data Store Software Entities">
-        <bundle>mvn:org.apache.brooklyn/brooklyn-software-nosql/${project.version}</bundle>
-        <feature>brooklyn-software-base</feature>
-        <feature>brooklyn-software-database</feature>
-        <feature>brooklyn-software-webapp</feature>
-        <bundle dependency="true">mvn:org.mongodb/mongo-java-driver/3.0.3</bundle>
-    </feature>
-
-    <feature name="brooklyn-software-monitoring" version="${project.version}" description="Brooklyn Monitoring Software Entities">
-        <bundle>mvn:org.apache.brooklyn/brooklyn-software-monitoring/${project.version}</bundle>
-        <feature>brooklyn-core</feature>
-        <feature>brooklyn-api</feature>
-        <feature>brooklyn-software-base</feature>
-        <bundle dependency="true">mvn:com.google.guava/guava/${guava.version}</bundle>
-    </feature>
-    
-</features>


[6/7] brooklyn-server git commit: Fix karaf feature brooklyn-software-base

Posted by sv...@apache.org.
Fix karaf feature brooklyn-software-base

Update winrm4j dependencies to match upstream progress.


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/ec56f2ae
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/ec56f2ae
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/ec56f2ae

Branch: refs/heads/master
Commit: ec56f2ae239a7bd02168ce8d2893a7e22000009b
Parents: 01be916
Author: Ciprian Ciubotariu <ch...@gmx.net>
Authored: Fri Mar 4 18:31:56 2016 +0200
Committer: Ciprian Ciubotariu <ch...@gmx.net>
Committed: Fri Mar 4 18:31:56 2016 +0200

----------------------------------------------------------------------
 karaf/features/src/main/feature/feature.xml | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/ec56f2ae/karaf/features/src/main/feature/feature.xml
----------------------------------------------------------------------
diff --git a/karaf/features/src/main/feature/feature.xml b/karaf/features/src/main/feature/feature.xml
index 55170d8..fbcbd0f 100644
--- a/karaf/features/src/main/feature/feature.xml
+++ b/karaf/features/src/main/feature/feature.xml
@@ -200,7 +200,10 @@
     <feature name="brooklyn-software-winrm" version="${project.version}" description="Brooklyn WinRM Software Entities">
         <bundle>mvn:org.apache.brooklyn/brooklyn-software-winrm/${project.version}</bundle>
         <feature>brooklyn-core</feature>
-        <bundle dependency="true">wrap:mvn:io.cloudsoft.windows/winrm4j/${winrm4j.version}</bundle>
+        <bundle dependency="true">mvn:io.cloudsoft.windows/winrm4j/${winrm4j.version}</bundle>
+        <bundle dependency="true">mvn:io.cloudsoft.windows/winrm4j-client/${winrm4j.version}</bundle>
+        <feature>cxf-jaxws</feature>
+        <feature>cxf-http-async</feature>
     </feature>
 
     <feature name="brooklyn-policy"  version="${project.version}" description="Brooklyn Policies">


[4/7] brooklyn-server git commit: Fix injection of management context into CXF resources

Posted by sv...@apache.org.
Fix injection of management context into CXF resources


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/563537e2
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/563537e2
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/563537e2

Branch: refs/heads/master
Commit: 563537e278d82c247fdd1ab954ed1bd5bff2f747
Parents: 0afb2c9
Author: Ciprian Ciubotariu <ch...@gmx.net>
Authored: Tue Feb 16 02:10:24 2016 +0200
Committer: Ciprian Ciubotariu <ch...@gmx.net>
Committed: Mon Feb 29 20:12:39 2016 +0200

----------------------------------------------------------------------
 .../org/apache/brooklyn/rest/RestApiSetup.java  | 26 +++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/563537e2/rest/rest-server/src/main/java/org/apache/brooklyn/rest/RestApiSetup.java
----------------------------------------------------------------------
diff --git a/rest/rest-server/src/main/java/org/apache/brooklyn/rest/RestApiSetup.java b/rest/rest-server/src/main/java/org/apache/brooklyn/rest/RestApiSetup.java
index d868a77..c38fe2f 100644
--- a/rest/rest-server/src/main/java/org/apache/brooklyn/rest/RestApiSetup.java
+++ b/rest/rest-server/src/main/java/org/apache/brooklyn/rest/RestApiSetup.java
@@ -34,6 +34,9 @@ import org.eclipse.jetty.servlet.ServletContextHandler;
 import org.eclipse.jetty.servlet.ServletHolder;
 
 import io.swagger.config.ScannerFactory;
+import org.apache.brooklyn.api.mgmt.ManagementContext;
+import org.apache.brooklyn.core.mgmt.ManagementContextInjectable;
+import org.apache.brooklyn.rest.util.ManagementContextProvider;
 
 public class RestApiSetup {
 
@@ -44,6 +47,12 @@ public class RestApiSetup {
         for (Object o : providers) {
             app.singleton(o);
         }
+
+        ManagementContext managementContext = extractManagementContext(providers);
+        for (Object o : app.getSingletons()) {
+            injectManagementContext(managementContext, o);
+        }
+
         CXFNonSpringJaxrsServlet servlet = new CXFNonSpringJaxrsServlet(app);
         servlet.setBus(BusFactory.newInstance().createBus());
         servlet.getBus().getInInterceptors().add(new GZIPInInterceptor());
@@ -54,6 +63,21 @@ public class RestApiSetup {
         context.addServlet(servletHolder, "/v1/*");
     }
 
+    private static void injectManagementContext(ManagementContext managementContext, Object o) {
+        if (managementContext != null && o instanceof ManagementContextInjectable) {
+            ((ManagementContextInjectable) o).setManagementContext(managementContext);
+        }
+    }
+
+    private static ManagementContext extractManagementContext(Object... providers) {
+        for (Object o : providers) {
+            if (o instanceof ManagementContextProvider) {
+                return ((ManagementContextProvider) o).getContext(ManagementContext.class);
+            }
+        }
+        return null;
+    }
+
     @SafeVarargs
     public static void installServletFilters(ServletContextHandler context, Class<? extends Filter>... filters) {
         installServletFilters(context, Arrays.asList(filters));
@@ -64,7 +88,7 @@ public class RestApiSetup {
             context.addFilter(filter, "/*", EnumSet.allOf(DispatcherType.class));
         }
     }
-    
+
     public static void initSwagger() {
         ScannerFactory.setScanner(new RestApiResourceScanner());
     }