felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1565687 - in /felix/sandbox/marrs/dependencymanager-prototype: ./ cnf/ cnf/buildrepo/ cnf/buildrepo/biz.aQute.junit/ cnf/buildrepo/biz.aQute.launcher/ cnf/buildrepo/ee.foundation/ cnf/buildrepo/ee.minimum/ cnf/buildrepo/junit.osgi/ cnf/bui...
Date Fri, 07 Feb 2014 15:23:35 GMT
Author: marrs
Date: Fri Feb  7 15:23:33 2014
New Revision: 1565687

URL: http://svn.apache.org/r1565687
Log:
Initial prototype. First commit, needs documentation.

Added:
    felix/sandbox/marrs/dependencymanager-prototype/
    felix/sandbox/marrs/dependencymanager-prototype/cnf/
    felix/sandbox/marrs/dependencymanager-prototype/cnf/.classpath
    felix/sandbox/marrs/dependencymanager-prototype/cnf/.gitignore
    felix/sandbox/marrs/dependencymanager-prototype/cnf/.project
    felix/sandbox/marrs/dependencymanager-prototype/cnf/build-template.xml
    felix/sandbox/marrs/dependencymanager-prototype/cnf/build.bnd
    felix/sandbox/marrs/dependencymanager-prototype/cnf/build.properties
    felix/sandbox/marrs/dependencymanager-prototype/cnf/build.xml
    felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/
    felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/README.txt
    felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/biz.aQute.junit/
    felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/biz.aQute.junit/biz.aQute.junit-latest.jar   (with props)
    felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/biz.aQute.launcher/
    felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/biz.aQute.launcher/biz.aQute.launcher-latest.jar   (with props)
    felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/ee.foundation/
    felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/ee.foundation/ee.foundation-1.1.0.jar   (with props)
    felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/ee.minimum/
    felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/ee.minimum/ee.minimum-1.2.0.jar   (with props)
    felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/ee.minimum/ee.minimum-1.2.1.jar   (with props)
    felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/junit.osgi/
    felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/junit.osgi/junit.osgi-3.8.2.jar   (with props)
    felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/org.osgi.ee.foundation/
    felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/org.osgi.ee.foundation/org.osgi.ee.foundation-1.0.0.jar   (with props)
    felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/org.osgi.ee.foundation/org.osgi.ee.foundation-1.0.1.jar   (with props)
    felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/org.osgi.ee.minimum/
    felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/org.osgi.ee.minimum/org.osgi.ee.minimum-1.1.0.jar   (with props)
    felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/org.osgi.ee.minimum/org.osgi.ee.minimum-1.1.1.jar   (with props)
    felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/org.osgi.ee.minimum/org.osgi.ee.minimum-1.1.3.jar   (with props)
    felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/osgi.core/
    felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/osgi.core/osgi.core-4.0.1.jar   (with props)
    felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/osgi.core/osgi.core-4.1.0.jar   (with props)
    felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/osgi.core/osgi.core-4.2.0.jar   (with props)
    felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/osgi.core/osgi.core-4.3.0.jar   (with props)
    felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/osgi.core/osgi.core-4.3.1.jar   (with props)
    felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/osgi.core/osgi.core-5.0.0.jar   (with props)
    felix/sandbox/marrs/dependencymanager-prototype/cnf/ext/
    felix/sandbox/marrs/dependencymanager-prototype/cnf/ext/pluginpaths.bnd
    felix/sandbox/marrs/dependencymanager-prototype/cnf/ext/repositories.bnd
    felix/sandbox/marrs/dependencymanager-prototype/cnf/localrepo/
    felix/sandbox/marrs/dependencymanager-prototype/cnf/localrepo/index.xml
    felix/sandbox/marrs/dependencymanager-prototype/cnf/plugins/
    felix/sandbox/marrs/dependencymanager-prototype/cnf/plugins/biz.aQute.bnd/
    felix/sandbox/marrs/dependencymanager-prototype/cnf/plugins/biz.aQute.bnd/biz.aQute.bnd-2.2.0.jar   (with props)
    felix/sandbox/marrs/dependencymanager-prototype/cnf/plugins/biz.aQute.repository/
    felix/sandbox/marrs/dependencymanager-prototype/cnf/plugins/biz.aQute.repository/biz.aQute.repository-2.1.0.jar   (with props)
    felix/sandbox/marrs/dependencymanager-prototype/cnf/releaserepo/
    felix/sandbox/marrs/dependencymanager-prototype/cnf/releaserepo/index.xml
    felix/sandbox/marrs/dependencymanager-prototype/cnf/src/
    felix/sandbox/marrs/dependencymanager-prototype/cnf/src/.gitignore
    felix/sandbox/marrs/dependencymanager-prototype/dm/
    felix/sandbox/marrs/dependencymanager-prototype/dm/.classpath
    felix/sandbox/marrs/dependencymanager-prototype/dm/.gitignore
    felix/sandbox/marrs/dependencymanager-prototype/dm/.project
    felix/sandbox/marrs/dependencymanager-prototype/dm/.settings/
    felix/sandbox/marrs/dependencymanager-prototype/dm/.settings/bndtools.core.prefs
    felix/sandbox/marrs/dependencymanager-prototype/dm/bnd.bnd
    felix/sandbox/marrs/dependencymanager-prototype/dm/build.xml
    felix/sandbox/marrs/dependencymanager-prototype/dm/design.txt
    felix/sandbox/marrs/dependencymanager-prototype/dm/src/
    felix/sandbox/marrs/dependencymanager-prototype/dm/src/.gitignore
    felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/
    felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/Component.java
    felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/ComponentStateListener.java
    felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/Dependency.java
    felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/Event.java
    felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/State.java
    felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/impl/
    felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/impl/ComponentImpl.java
    felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/impl/DependencyImpl.java
    felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/impl/EventImpl.java
    felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/impl/Logger.java
    felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/impl/SerialExecutor.java
    felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/packageinfo
    felix/sandbox/marrs/dependencymanager-prototype/dm/test/
    felix/sandbox/marrs/dependencymanager-prototype/dm/test/test/
    felix/sandbox/marrs/dependencymanager-prototype/dm/test/test/ComponentTest.java
    felix/sandbox/marrs/dependencymanager-prototype/dm/test/test/ConcurrencyTest.java

Added: felix/sandbox/marrs/dependencymanager-prototype/cnf/.classpath
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/cnf/.classpath?rev=1565687&view=auto
==============================================================================
--- felix/sandbox/marrs/dependencymanager-prototype/cnf/.classpath (added)
+++ felix/sandbox/marrs/dependencymanager-prototype/cnf/.classpath Fri Feb  7 15:23:33 2014
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

Added: felix/sandbox/marrs/dependencymanager-prototype/cnf/.gitignore
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/cnf/.gitignore?rev=1565687&view=auto
==============================================================================
--- felix/sandbox/marrs/dependencymanager-prototype/cnf/.gitignore (added)
+++ felix/sandbox/marrs/dependencymanager-prototype/cnf/.gitignore Fri Feb  7 15:23:33 2014
@@ -0,0 +1,2 @@
+/bin/
+/cache/

Added: felix/sandbox/marrs/dependencymanager-prototype/cnf/.project
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/cnf/.project?rev=1565687&view=auto
==============================================================================
--- felix/sandbox/marrs/dependencymanager-prototype/cnf/.project (added)
+++ felix/sandbox/marrs/dependencymanager-prototype/cnf/.project Fri Feb  7 15:23:33 2014
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>cnf</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

Added: felix/sandbox/marrs/dependencymanager-prototype/cnf/build-template.xml
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/cnf/build-template.xml?rev=1565687&view=auto
==============================================================================
--- felix/sandbox/marrs/dependencymanager-prototype/cnf/build-template.xml (added)
+++ felix/sandbox/marrs/dependencymanager-prototype/cnf/build-template.xml Fri Feb  7 15:23:33 2014
@@ -0,0 +1,218 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="template" default="none">
+    <!--
+         WARNING!!!
+
+         This file is maintained automatically by Bndtools! You should not edit it directly.
+         Instead, insert overrides into build.xml as follows:
+
+         <target name="compile" depends="template.init">
+            <echo message="This task executed before compilation..."/>
+            <antcall target="template.compile"/>
+            <echo message="This task executed after compilation."/>
+         </target>
+    -->
+
+
+    <!--
+         Default Target
+    -->
+    <target name="none">
+        <fail message="This ant script should never be called directly." />
+    </target>
+
+
+    <!--
+         INIT
+
+         All other targets depend on init.
+         It's purpose is to set up the environment only once and avoid it being repeated for each antcall.
+    -->
+    <target name="init" unless="initialized">
+        <!-- Initialise some basic properties -->
+        <tstamp>
+            <format property="NOW" pattern="yyyyMMdd-HHmmss" timezone="UTC"/>
+        </tstamp>
+        <dirname property="projectdir" file="${ant.file}" />
+        <dirname property="workspacedir" file="${projectdir}" />
+
+        <!-- Define the classpath of bnd (location is defined in build.properties) -->
+        <property file="${workspacedir}/cnf/build.properties"/>
+        <path id="bnd-classpath" location="${workspacedir}/cnf/${bnd.location}" />
+
+        <!-- Load bnd and prepare the workspace -->
+        <taskdef resource="aQute/bnd/ant/taskdef.properties" classpathref="bnd-classpath" />
+        <bndprepare basedir="${projectdir}" print="false" top="${release.dir}" />
+
+        <condition property="testDirExists">
+            <available file="${basedir}/test" type="dir"/>
+        </condition>
+
+        <!-- Create a marker property to indicate that initialisation has been completed -->
+        <property name="initialized" value="set" />
+        <echo message="Enter project ${project.name}"/>
+    </target>
+
+
+    <!--
+        DEPENDENCIES
+
+        Build project dependencies.
+    -->
+    <target name="dependencies" depends="init" if="project.dependson" unless="donotrecurse">
+        <subant target="build" inheritAll="false" buildpath="${project.dependson}">
+            <property name="donotrecurse" value="true" />
+        </subant>
+    </target>
+
+
+    <!--
+         COMPILE
+
+         Compile the sources.
+    -->
+    <target name="compile" depends="dependencies" if="project.sourcepath">
+        <mkdir dir="${project.output}"/>
+        <javac fork="yes" executable="${javac}" srcdir="${project.sourcepath}" destdir="${project.output}" classpath="${project.buildpath}" bootclasspath="${project.bootclasspath}" deprecation="true" listfiles="true" target="${javac.target}" source="${javac.source}" debug="${javac.debug}" includeAntRuntime="no" verbose="${verbose}" />
+        <!--
+          The eclipse compiler copies resources but the Javac compiler does not
+          If ${src} == ${bin} then this is not necessary, but unfortunately, now
+          it is.
+        -->
+        <copy todir="${project.output}" verbose="${verbose}" preservelastmodified="true">
+            <fileset dir="${project.sourcepath}">
+                <exclude name="**/*.java" />
+                <exclude name="**/*.class" />
+            </fileset>
+        </copy>
+    </target>
+
+
+    <!--
+        BUILD
+
+        Build the project after building its dependencies.
+    -->
+    <target name="build" depends="compile">
+        <mkdir dir="${target}"/>
+        <bnd command="build" exceptions="true" basedir="${project}" />
+    </target>
+
+
+    <!--
+        JUNIT
+
+        Run the junit test if present and no disabled by the no.junit property.
+    -->
+    <target name="compileTests" depends="init,build" if="testDirExists">
+        <mkdir dir="bin_test"/>
+        <javac fork="yes" executable="${javac}" srcdir="test" destdir="bin_test" classpath="${project.buildpath}:${project.testpath}" bootclasspath="${project.bootclasspath}" deprecation="true" listfiles="true" target="${javac.target}" source="${javac.source}" debug="${javac.debug}" includeAntRuntime="no" verbose="${verbose}" />
+        <!--
+          The eclipse compiler copies resources but the Javac compiler does not
+          If ${src} == ${bin} then this is not necessary, but unfortunately, now
+          it is.
+        -->
+        <copy todir="bin_test" verbose="${verbose}" preservelastmodified="true">
+            <fileset dir="test">
+                <exclude name="**/*.java" />
+                <exclude name="**/*.class" />
+            </fileset>
+        </copy>
+    </target>
+
+    <target name="junit" depends="init,compileTests" if="testDirExists" unless="no.junit">
+        <junit showoutput="false" printsummary="true" failureproperty='stop' errorproperty='stop' fork="true" dir="${basedir}">
+            <assertions>
+                <enable />
+            </assertions>
+            <classpath path="${project.buildpath}:bin_test/" />
+            <formatter type="xml"/>
+            <batchtest todir="${target}">
+                <fileset dir="test">
+                    <include name="**/*.java"/>
+                </fileset>
+            </batchtest>
+        </junit>
+    </target>
+
+
+    <!--
+         TEST
+    -->
+    <target name="test" depends="compile">
+        <bndtest/>
+    </target>
+
+
+    <!--
+        RELEASE
+
+        Run the bnd release task on the project and its dependencies.
+    -->
+    <target name="_release" depends="init">
+        <bndrelease/>
+    </target>
+
+    <target name="release" depends="build">
+        <subant target="_release" inheritAll="false" buildpath="${project.dependson}">
+            <property name="donotrecurse" value="true" />
+        </subant>
+    </target>
+
+
+    <!--
+         CLEAN
+
+         Clean up the project.
+    -->
+    <target name="deepclean" depends="init,clean" if="project.dependson">
+        <subant target="clean" inheritAll="false" buildpath="${project.dependson}" />
+    </target>
+
+    <target name="clean" depends="init">
+        <bnd command="clean" exceptions="true" basedir="${project}" />
+        <delete dir="bin"/>
+        <delete dir="bin_test"/>
+        <delete dir="${target}"/>
+    </target>
+
+
+    <!--
+         ECHO
+
+         Print some settings
+    -->
+    <target name="echo" depends="init">
+        <echo>verbose:                ${verbose}</echo>
+        <echo>project.name:           ${project.name}</echo>
+        <echo>Bundle-Version:         ${Bundle-Version}</echo>
+        <echo>project.output:         ${project.output}</echo>
+        <echo>project.sourcepath:     ${project.sourcepath}</echo>
+        <echo>project.allsourcepath:  ${project.allsourcepath}</echo>
+        <echo>project.buildpath:      ${project.buildpath}</echo>
+        <echo>project.testpath:       ${project.testpath}</echo>
+        <echo>project.dependson:      ${project.dependson}</echo>
+        <echo>project.bootclasspath:  ${project.bootclasspath}</echo>
+        <echo>javac:                  ${javac}</echo>
+        <echo>javac.debug:            ${javac.debug}</echo>
+        <echo>javac.source:           ${javac.source}</echo>
+        <echo>javac.target:           ${javac.target}</echo>
+        <echo>p:                      ${p}</echo>
+        <echo>btool.manifestVersion:  ${btool.manifestVersion}</echo>
+        <echo>btool.analyse:          ${btool.analyse}</echo>
+        <echo>btool.showmanifest:     ${btool.showmanifest}</echo>
+        <echo>btool.noversion:        ${btool.noversion}</echo>
+        <echo>btool.sources:          ${btool.sources}</echo>
+        <echo>btool.noextraheaders:   ${btool.noextraheaders}</echo>
+        <echo>jars.compile.order:     ${jars.compile.order}</echo>
+        <echo>bin.includes:           ${bin.includes}</echo>
+        <echo>base.modfied:           ${base.modified} (${base.modified.readable})</echo>
+        <echo>target:                 ${target}</echo>
+        <echo>release.target:         ${release.target}</echo>
+        <echo>licensed repo:          ${licensed-repo}</echo>
+        <echo>repo:                   ${repo}</echo>
+        <echo>use.bnd:                ${use.bnd}</echo>
+        <echo>nodeploy:               ${nodeploy}</echo>
+        <echo>-dependson:             ${-dependson}</echo>
+    </target>
+</project>

Added: felix/sandbox/marrs/dependencymanager-prototype/cnf/build.bnd
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/cnf/build.bnd?rev=1565687&view=auto
==============================================================================
--- felix/sandbox/marrs/dependencymanager-prototype/cnf/build.bnd (added)
+++ felix/sandbox/marrs/dependencymanager-prototype/cnf/build.bnd Fri Feb  7 15:23:33 2014
@@ -0,0 +1,50 @@
+########################
+## BND BUILD SETTINGS ##
+########################
+
+
+## Global defaults are loaded from the bnd library (as shown below), place your
+## specific settings here. Additional settings are inherited from ext/*.bnd and
+## they will be overridden by anything you specify in this file.
+
+## General Options
+#project.dependson:     ${p-dependson;:}
+#project.bootclasspath: ${p-bootclasspath;:}
+#project.buildpath:     ${p-buildpath;:}
+#project.sourcepath:    ${p-sourcepath;:}
+#project.allsourcepath: ${p-allsourcepath;:}
+#project.output:        ${p-output}
+#project.testpath:      ${p-testpath;:}
+
+#-verbose:              true
+#project:               ${basedir}
+#src:                   src
+#bin:                   bin
+#target-dir:            generated
+#target:                ${project}/${target-dir}
+#build:                 ${workspace}/cnf
+#p:                     ${basename;${project}}
+#project.name:          ${p}
+#plugin-dir:            ${build}/plugins
+
+## Java Compiler Options
+#java:                  java
+#javac:                 javac
+#javac.source:          1.5
+#javac.target:          1.5
+#javac.debug:           on
+
+## Bnd Options
+#-sources:              true
+#-sourcepath:           ${project}/src
+
+
+## Properties from ext/*.bnd can be referenced in order to extend them. For
+## example, to add one additional plugin to the list defined in
+## ext/repositories.bnd:
+# -plugin: ${ext.repositories.-plugin}, org.example.MyPlugin
+
+
+## If you use git, you might want to uncomment the following lines:
+# Git-Descriptor:       ${system-allow-fail;git describe --dirty --always}
+# Git-SHA:              ${system-allow-fail;git rev-list -1 HEAD}

Added: felix/sandbox/marrs/dependencymanager-prototype/cnf/build.properties
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/cnf/build.properties?rev=1565687&view=auto
==============================================================================
--- felix/sandbox/marrs/dependencymanager-prototype/cnf/build.properties (added)
+++ felix/sandbox/marrs/dependencymanager-prototype/cnf/build.properties Fri Feb  7 15:23:33 2014
@@ -0,0 +1,3 @@
+# This file is used to bootstrap the bnd ANT Task definition found in build-template.xml
+
+bnd.location=plugins/biz.aQute.bnd/biz.aQute.bnd-2.2.0.jar

Added: felix/sandbox/marrs/dependencymanager-prototype/cnf/build.xml
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/cnf/build.xml?rev=1565687&view=auto
==============================================================================
--- felix/sandbox/marrs/dependencymanager-prototype/cnf/build.xml (added)
+++ felix/sandbox/marrs/dependencymanager-prototype/cnf/build.xml Fri Feb  7 15:23:33 2014
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="master" default="none">
+
+    <import file="build-template.xml" />
+
+    <!--
+        Use this file to provide your workspace-specific tasks. Several examples follow.
+
+        Note: make sure that all defined targets depends on the template.init target.
+
+        1. To execute tasks before/after compilation:
+
+        <target name="compile" depends="template.init">
+            <echo message="This task executed before compilation..."/>
+            <antcall target="template.compile"/>
+            <echo message="This task executed AFTER compilation."/>
+        </target>
+
+        2. Insert a build target:
+
+        <target name="build" dependencies="template.init,template.build, findbugs"/>
+        <target name="findbugs">
+            ...
+        </target>
+    -->
+
+</project>
\ No newline at end of file

Added: felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/README.txt
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/README.txt?rev=1565687&view=auto
==============================================================================
--- felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/README.txt (added)
+++ felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/README.txt Fri Feb  7 15:23:33 2014
@@ -0,0 +1,6 @@
+WARNING
+=======
+
+This directory contains JAR file dependencies that are intended ONLY FOR BUILT-TIME usage.
+None are intended to be deployed as bundles into a running OSGi Framework, and indeed they may cause
+unexpected errors if they are used at runtime.

Added: felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/biz.aQute.junit/biz.aQute.junit-latest.jar
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/biz.aQute.junit/biz.aQute.junit-latest.jar?rev=1565687&view=auto
==============================================================================
Binary file - no diff available.

Propchange: felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/biz.aQute.junit/biz.aQute.junit-latest.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/biz.aQute.launcher/biz.aQute.launcher-latest.jar
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/biz.aQute.launcher/biz.aQute.launcher-latest.jar?rev=1565687&view=auto
==============================================================================
Binary file - no diff available.

Propchange: felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/biz.aQute.launcher/biz.aQute.launcher-latest.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/ee.foundation/ee.foundation-1.1.0.jar
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/ee.foundation/ee.foundation-1.1.0.jar?rev=1565687&view=auto
==============================================================================
Binary file - no diff available.

Propchange: felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/ee.foundation/ee.foundation-1.1.0.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/ee.minimum/ee.minimum-1.2.0.jar
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/ee.minimum/ee.minimum-1.2.0.jar?rev=1565687&view=auto
==============================================================================
Binary file - no diff available.

Propchange: felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/ee.minimum/ee.minimum-1.2.0.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/ee.minimum/ee.minimum-1.2.1.jar
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/ee.minimum/ee.minimum-1.2.1.jar?rev=1565687&view=auto
==============================================================================
Binary file - no diff available.

Propchange: felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/ee.minimum/ee.minimum-1.2.1.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/junit.osgi/junit.osgi-3.8.2.jar
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/junit.osgi/junit.osgi-3.8.2.jar?rev=1565687&view=auto
==============================================================================
Binary file - no diff available.

Propchange: felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/junit.osgi/junit.osgi-3.8.2.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/org.osgi.ee.foundation/org.osgi.ee.foundation-1.0.0.jar
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/org.osgi.ee.foundation/org.osgi.ee.foundation-1.0.0.jar?rev=1565687&view=auto
==============================================================================
Binary file - no diff available.

Propchange: felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/org.osgi.ee.foundation/org.osgi.ee.foundation-1.0.0.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/org.osgi.ee.foundation/org.osgi.ee.foundation-1.0.1.jar
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/org.osgi.ee.foundation/org.osgi.ee.foundation-1.0.1.jar?rev=1565687&view=auto
==============================================================================
Binary file - no diff available.

Propchange: felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/org.osgi.ee.foundation/org.osgi.ee.foundation-1.0.1.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/org.osgi.ee.minimum/org.osgi.ee.minimum-1.1.0.jar
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/org.osgi.ee.minimum/org.osgi.ee.minimum-1.1.0.jar?rev=1565687&view=auto
==============================================================================
Binary file - no diff available.

Propchange: felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/org.osgi.ee.minimum/org.osgi.ee.minimum-1.1.0.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/org.osgi.ee.minimum/org.osgi.ee.minimum-1.1.1.jar
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/org.osgi.ee.minimum/org.osgi.ee.minimum-1.1.1.jar?rev=1565687&view=auto
==============================================================================
Binary file - no diff available.

Propchange: felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/org.osgi.ee.minimum/org.osgi.ee.minimum-1.1.1.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/org.osgi.ee.minimum/org.osgi.ee.minimum-1.1.3.jar
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/org.osgi.ee.minimum/org.osgi.ee.minimum-1.1.3.jar?rev=1565687&view=auto
==============================================================================
Binary file - no diff available.

Propchange: felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/org.osgi.ee.minimum/org.osgi.ee.minimum-1.1.3.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/osgi.core/osgi.core-4.0.1.jar
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/osgi.core/osgi.core-4.0.1.jar?rev=1565687&view=auto
==============================================================================
Binary file - no diff available.

Propchange: felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/osgi.core/osgi.core-4.0.1.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/osgi.core/osgi.core-4.1.0.jar
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/osgi.core/osgi.core-4.1.0.jar?rev=1565687&view=auto
==============================================================================
Binary file - no diff available.

Propchange: felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/osgi.core/osgi.core-4.1.0.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/osgi.core/osgi.core-4.2.0.jar
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/osgi.core/osgi.core-4.2.0.jar?rev=1565687&view=auto
==============================================================================
Binary file - no diff available.

Propchange: felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/osgi.core/osgi.core-4.2.0.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/osgi.core/osgi.core-4.3.0.jar
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/osgi.core/osgi.core-4.3.0.jar?rev=1565687&view=auto
==============================================================================
Binary file - no diff available.

Propchange: felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/osgi.core/osgi.core-4.3.0.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/osgi.core/osgi.core-4.3.1.jar
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/osgi.core/osgi.core-4.3.1.jar?rev=1565687&view=auto
==============================================================================
Binary file - no diff available.

Propchange: felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/osgi.core/osgi.core-4.3.1.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/osgi.core/osgi.core-5.0.0.jar
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/osgi.core/osgi.core-5.0.0.jar?rev=1565687&view=auto
==============================================================================
Binary file - no diff available.

Propchange: felix/sandbox/marrs/dependencymanager-prototype/cnf/buildrepo/osgi.core/osgi.core-5.0.0.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: felix/sandbox/marrs/dependencymanager-prototype/cnf/ext/pluginpaths.bnd
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/cnf/ext/pluginpaths.bnd?rev=1565687&view=auto
==============================================================================
--- felix/sandbox/marrs/dependencymanager-prototype/cnf/ext/pluginpaths.bnd (added)
+++ felix/sandbox/marrs/dependencymanager-prototype/cnf/ext/pluginpaths.bnd Fri Feb  7 15:23:33 2014
@@ -0,0 +1 @@
+-pluginpath: ${plugin-dir}/biz.aQute.repository/biz.aQute.repository-2.1.0.jar

Added: felix/sandbox/marrs/dependencymanager-prototype/cnf/ext/repositories.bnd
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/cnf/ext/repositories.bnd?rev=1565687&view=auto
==============================================================================
--- felix/sandbox/marrs/dependencymanager-prototype/cnf/ext/repositories.bnd (added)
+++ felix/sandbox/marrs/dependencymanager-prototype/cnf/ext/repositories.bnd Fri Feb  7 15:23:33 2014
@@ -0,0 +1,7 @@
+-plugin:\
+    aQute.bnd.deployer.repository.LocalIndexedRepo; name=Release;      local=${workspace}/cnf/releaserepo;pretty=true,\
+    aQute.bnd.deployer.repository.LocalIndexedRepo; name=Local;        local=${workspace}/cnf/localrepo;pretty=true,\
+    aQute.bnd.deployer.repository.FixedIndexedRepo; name=Bndtools Hub; locations=https://github.com/bndtools/bundle-hub/raw/master/index.xml.gz,\
+    aQute.lib.deployer.FileRepo;                    name=Build;        location=${workspace}/cnf/buildrepo
+
+-releaserepo: Release

Added: felix/sandbox/marrs/dependencymanager-prototype/cnf/localrepo/index.xml
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/cnf/localrepo/index.xml?rev=1565687&view=auto
==============================================================================
--- felix/sandbox/marrs/dependencymanager-prototype/cnf/localrepo/index.xml (added)
+++ felix/sandbox/marrs/dependencymanager-prototype/cnf/localrepo/index.xml Fri Feb  7 15:23:33 2014
@@ -0,0 +1,2 @@
+<?xml version='1.0' encoding='utf-8'?>
+<repository increment='1342528672992' name='Local' xmlns='http://www.osgi.org/xmlns/repository/v1.0.0'/>

Added: felix/sandbox/marrs/dependencymanager-prototype/cnf/plugins/biz.aQute.bnd/biz.aQute.bnd-2.2.0.jar
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/cnf/plugins/biz.aQute.bnd/biz.aQute.bnd-2.2.0.jar?rev=1565687&view=auto
==============================================================================
Binary file - no diff available.

Propchange: felix/sandbox/marrs/dependencymanager-prototype/cnf/plugins/biz.aQute.bnd/biz.aQute.bnd-2.2.0.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: felix/sandbox/marrs/dependencymanager-prototype/cnf/plugins/biz.aQute.repository/biz.aQute.repository-2.1.0.jar
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/cnf/plugins/biz.aQute.repository/biz.aQute.repository-2.1.0.jar?rev=1565687&view=auto
==============================================================================
Binary file - no diff available.

Propchange: felix/sandbox/marrs/dependencymanager-prototype/cnf/plugins/biz.aQute.repository/biz.aQute.repository-2.1.0.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: felix/sandbox/marrs/dependencymanager-prototype/cnf/releaserepo/index.xml
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/cnf/releaserepo/index.xml?rev=1565687&view=auto
==============================================================================
--- felix/sandbox/marrs/dependencymanager-prototype/cnf/releaserepo/index.xml (added)
+++ felix/sandbox/marrs/dependencymanager-prototype/cnf/releaserepo/index.xml Fri Feb  7 15:23:33 2014
@@ -0,0 +1,2 @@
+<?xml version='1.0' encoding='utf-8'?>
+<repository increment='1342528672992' name='Release' xmlns='http://www.osgi.org/xmlns/repository/v1.0.0'/>

Added: felix/sandbox/marrs/dependencymanager-prototype/cnf/src/.gitignore
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/cnf/src/.gitignore?rev=1565687&view=auto
==============================================================================
    (empty)

Added: felix/sandbox/marrs/dependencymanager-prototype/dm/.classpath
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/dm/.classpath?rev=1565687&view=auto
==============================================================================
--- felix/sandbox/marrs/dependencymanager-prototype/dm/.classpath (added)
+++ felix/sandbox/marrs/dependencymanager-prototype/dm/.classpath Fri Feb  7 15:23:33 2014
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="src" path="test"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="con" path="aQute.bnd.classpath.container"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

Added: felix/sandbox/marrs/dependencymanager-prototype/dm/.gitignore
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/dm/.gitignore?rev=1565687&view=auto
==============================================================================
--- felix/sandbox/marrs/dependencymanager-prototype/dm/.gitignore (added)
+++ felix/sandbox/marrs/dependencymanager-prototype/dm/.gitignore Fri Feb  7 15:23:33 2014
@@ -0,0 +1,2 @@
+/bin/
+/generated/

Added: felix/sandbox/marrs/dependencymanager-prototype/dm/.project
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/dm/.project?rev=1565687&view=auto
==============================================================================
--- felix/sandbox/marrs/dependencymanager-prototype/dm/.project (added)
+++ felix/sandbox/marrs/dependencymanager-prototype/dm/.project Fri Feb  7 15:23:33 2014
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>dm</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>bndtools.core.bndbuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>bndtools.core.bndnature</nature>
+	</natures>
+</projectDescription>

Added: felix/sandbox/marrs/dependencymanager-prototype/dm/.settings/bndtools.core.prefs
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/dm/.settings/bndtools.core.prefs?rev=1565687&view=auto
==============================================================================
--- felix/sandbox/marrs/dependencymanager-prototype/dm/.settings/bndtools.core.prefs (added)
+++ felix/sandbox/marrs/dependencymanager-prototype/dm/.settings/bndtools.core.prefs Fri Feb  7 15:23:33 2014
@@ -0,0 +1,3 @@
+compileErrorAction=skip
+eclipse.preferences.version=1
+eclipseClasspath=expose

Added: felix/sandbox/marrs/dependencymanager-prototype/dm/bnd.bnd
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/dm/bnd.bnd?rev=1565687&view=auto
==============================================================================
--- felix/sandbox/marrs/dependencymanager-prototype/dm/bnd.bnd (added)
+++ felix/sandbox/marrs/dependencymanager-prototype/dm/bnd.bnd Fri Feb  7 15:23:33 2014
@@ -0,0 +1,4 @@
+-buildpath: osgi.cmpn,\
+	osgi.core
+Private-Package: dm.impl
+Export-Package: dm
\ No newline at end of file

Added: felix/sandbox/marrs/dependencymanager-prototype/dm/build.xml
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/dm/build.xml?rev=1565687&view=auto
==============================================================================
--- felix/sandbox/marrs/dependencymanager-prototype/dm/build.xml (added)
+++ felix/sandbox/marrs/dependencymanager-prototype/dm/build.xml Fri Feb  7 15:23:33 2014
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="project" default="build">
+
+	<!-- -->
+
+	<import file="../cnf/build.xml" />
+</project>

Added: felix/sandbox/marrs/dependencymanager-prototype/dm/design.txt
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/dm/design.txt?rev=1565687&view=auto
==============================================================================
--- felix/sandbox/marrs/dependencymanager-prototype/dm/design.txt (added)
+++ felix/sandbox/marrs/dependencymanager-prototype/dm/design.txt Fri Feb  7 15:23:33 2014
@@ -0,0 +1,22 @@
+7 feb 2014 (marrs & uiterlix):
+
+This prototype demonstrates the new concurrency principles that form the basis for the DM:
+
+ * All external events that influence the state of dependencies are recorded and given 
+   to the serial executor of the component. We record whatever data comes in, so when the
+   actual job is run by the serial executor, we still have access to the original data
+   without having to access other sources whose state might have changed since.
+ * The serial executor of a component will execute a job immediately if it is being called
+   by the thread that is already executing jobs.
+ * If the serial executor of a component had not yet started a job, it will queue and start
+   it on the current thread.
+ * If the serial executor gets invoked from a different thread than the one currently
+   executing jobs, the job will be put at the end of the queue. As mentioned before, any
+   data associated with the event will also be recorded so it is available when the job
+   executes.
+ * State in the component and dependency can only be modified via the serial executor
+   thread. This means we don't need explicit synchronization anywhere.
+
+
+
+

Added: felix/sandbox/marrs/dependencymanager-prototype/dm/src/.gitignore
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/dm/src/.gitignore?rev=1565687&view=auto
==============================================================================
    (empty)

Added: felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/Component.java
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/Component.java?rev=1565687&view=auto
==============================================================================
--- felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/Component.java (added)
+++ felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/Component.java Fri Feb  7 15:23:33 2014
@@ -0,0 +1,18 @@
+package dm;
+
+import java.util.List;
+
+import dm.impl.SerialExecutor;
+
+public interface Component {
+	void add(Dependency d);
+	void remove(Dependency d);
+	SerialExecutor getExecutor();
+	void start();
+	void stop();
+	void handleChange();
+	boolean isAvailable();
+	void add(ComponentStateListener l);
+	void remove(ComponentStateListener l);
+	List<Dependency> getDependencies();
+}

Added: felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/ComponentStateListener.java
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/ComponentStateListener.java?rev=1565687&view=auto
==============================================================================
--- felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/ComponentStateListener.java (added)
+++ felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/ComponentStateListener.java Fri Feb  7 15:23:33 2014
@@ -0,0 +1,5 @@
+package dm;
+
+public interface ComponentStateListener {
+	public void changed(State state);
+}

Added: felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/Dependency.java
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/Dependency.java?rev=1565687&view=auto
==============================================================================
--- felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/Dependency.java (added)
+++ felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/Dependency.java Fri Feb  7 15:23:33 2014
@@ -0,0 +1,13 @@
+package dm;
+
+public interface Dependency {
+	public void changed(final Event e);
+
+	void add(Component component);
+	void start();
+	void stop();
+
+	public boolean isAvailable();
+
+	public void remove(Component component);
+}

Added: felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/Event.java
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/Event.java?rev=1565687&view=auto
==============================================================================
--- felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/Event.java (added)
+++ felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/Event.java Fri Feb  7 15:23:33 2014
@@ -0,0 +1,7 @@
+package dm;
+
+public interface Event {
+
+	boolean isAvailable();
+
+}

Added: felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/State.java
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/State.java?rev=1565687&view=auto
==============================================================================
--- felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/State.java (added)
+++ felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/State.java Fri Feb  7 15:23:33 2014
@@ -0,0 +1,14 @@
+package dm;
+
+public class State {
+	private boolean m_available;
+
+	public State(boolean available) {
+		m_available = available;
+	}
+
+	public boolean isAvailable() {
+		return m_available;
+	}
+
+}

Added: felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/impl/ComponentImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/impl/ComponentImpl.java?rev=1565687&view=auto
==============================================================================
--- felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/impl/ComponentImpl.java (added)
+++ felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/impl/ComponentImpl.java Fri Feb  7 15:23:33 2014
@@ -0,0 +1,136 @@
+package dm.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import dm.Component;
+import dm.ComponentStateListener;
+import dm.Dependency;
+import dm.State;
+
+public class ComponentImpl implements Component {
+	private final SerialExecutor m_executor = new SerialExecutor(new Logger(null));
+	private List<Dependency> m_dependencies = new ArrayList<>();
+	private State m_state = new State(false);
+	private boolean m_available;
+	private List<ComponentStateListener> m_listeners = new ArrayList<>();
+
+	public SerialExecutor getExecutor() {
+		return m_executor;
+	}
+	
+	@Override
+	public void add(final Dependency d) {
+		getExecutor().execute(new Runnable() {
+			@Override
+			public void run() {
+				m_dependencies.add(d);
+				d.add(ComponentImpl.this);
+				handleChange();
+			}
+		});
+	}
+
+	@Override
+	public void remove(final Dependency d) {
+		getExecutor().execute(new Runnable() {
+			@Override
+			public void run() {
+				m_dependencies.remove(d);
+				d.remove(ComponentImpl.this);
+				handleChange();
+			}
+		});
+	}
+
+	public void start() {
+		getExecutor().execute(new Runnable() {
+			@Override
+			public void run() {
+				for (Dependency d : m_dependencies) {
+					d.start();
+				}
+				handleChange();
+			}
+		});
+		
+	}
+	
+	public void stop() {
+		getExecutor().execute(new Runnable() {
+			@Override
+			public void run() {
+				for (Dependency d : m_dependencies) {
+					d.stop();
+				}
+				m_available = false;
+			}
+		});
+		
+	}
+
+	@Override
+	public void handleChange() {
+		State oldState;
+		State newState;
+		do {
+			oldState = m_state;
+			newState = calculateNewState();
+			m_state = newState;
+		}
+		while (performTransition(oldState, newState));
+	}
+
+	private boolean performTransition(State oldState, State newState) {
+		if (!oldState.isAvailable() && newState.isAvailable()) {
+			m_available = true;
+			
+			notifyListeners(newState);
+			return true;
+		}
+		if (oldState.isAvailable() && !newState.isAvailable()) {
+			m_available = false;
+
+			notifyListeners(newState);
+			return true;
+		}
+		return false;
+	}
+	
+	private void notifyListeners(State state) {
+		List<ComponentStateListener> listeners = new ArrayList(m_listeners);
+		for (ComponentStateListener l : listeners) {
+			l.changed(state);
+		}
+	}
+
+	private State calculateNewState() {
+		boolean available = true;
+		for (Dependency d : m_dependencies) {
+			if (!d.isAvailable()) {
+				available = false;
+				break;
+			}
+		}
+		return new State(available);
+	}
+
+	public boolean isAvailable() {
+		return m_available;
+	}
+
+	@Override
+	public void add(ComponentStateListener l) {
+		m_listeners.add(l);
+	}
+
+	@Override
+	public void remove(ComponentStateListener l) {
+		m_listeners.remove(l);
+	}
+
+	@Override
+	public List<Dependency> getDependencies() {
+		return m_dependencies;
+	}
+}

Added: felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/impl/DependencyImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/impl/DependencyImpl.java?rev=1565687&view=auto
==============================================================================
--- felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/impl/DependencyImpl.java (added)
+++ felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/impl/DependencyImpl.java Fri Feb  7 15:23:33 2014
@@ -0,0 +1,48 @@
+package dm.impl;
+
+import dm.Component;
+import dm.Dependency;
+import dm.Event;
+
+public class DependencyImpl implements Dependency {
+	private Component m_component;
+	private boolean m_available;
+	public void changed(final Event e) {
+		m_component.getExecutor().execute(new Runnable() {
+			@Override
+			public void run() {
+				handle(e);
+			}
+		});
+	}
+
+	protected void handle(Event e) {
+		boolean oldState = m_available;
+		m_available = e.isAvailable();
+		if (oldState != m_available) {
+			m_component.handleChange();
+		}
+	}
+
+	@Override
+	public void add(Component component) {
+		m_component = component;
+	}
+	@Override
+	public void remove(Component component) {
+		m_component = null;
+	}
+
+	@Override
+	public void start() {
+	}
+
+	@Override
+	public void stop() {
+	}
+
+	@Override
+	public boolean isAvailable() {
+		return m_available;
+	}
+}

Added: felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/impl/EventImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/impl/EventImpl.java?rev=1565687&view=auto
==============================================================================
--- felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/impl/EventImpl.java (added)
+++ felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/impl/EventImpl.java Fri Feb  7 15:23:33 2014
@@ -0,0 +1,18 @@
+package dm.impl;
+
+import dm.Event;
+
+public class EventImpl implements Event {
+
+	private final boolean m_available;
+
+	public EventImpl(boolean available) {
+		m_available = available;
+	}
+
+	@Override
+	public boolean isAvailable() {
+		return m_available;
+	}
+
+}

Added: felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/impl/Logger.java
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/impl/Logger.java?rev=1565687&view=auto
==============================================================================
--- felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/impl/Logger.java (added)
+++ felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/impl/Logger.java Fri Feb  7 15:23:33 2014
@@ -0,0 +1,235 @@
+/*
+ * 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 dm.impl;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.FrameworkUtil;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceEvent;
+import org.osgi.framework.ServiceListener;
+import org.osgi.framework.ServiceReference;
+
+/**
+ * This class mimics the standard OSGi <tt>LogService</tt> interface. An
+ * instance of this class is used by the dependency manager for all logging. 
+ * By default this class logs messages to standard out. The log level can be set to
+ * control the amount of logging performed, where a higher number results in
+ * more logging. A log level of zero turns off logging completely.
+ * 
+ * The log levels match those specified in the OSGi Log Service.
+ * This class also tracks log services and will use the highest ranking 
+ * log service, if present, as a back end instead of printing to standard
+ * out. The class uses reflection to invoking the log service's method to 
+ * avoid a dependency on the log interface, which is also why it does not
+ * actually implement <code>LogService</code>. This class is in many ways 
+ * similar to the one used in the system bundle for that same purpose.
+ *
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+ */
+public class Logger implements ServiceListener {
+	private static final String LOG_SINGLE_CONTEXT = "org.apache.felix.dependencymanager.singleContextLog";
+    public static final int LOG_ERROR = 1;
+    public static final int LOG_WARNING = 2;
+    public static final int LOG_INFO = 3;
+    public static final int LOG_DEBUG = 4;
+
+    private final BundleContext m_context;
+
+    private final static int LOGGER_OBJECT_IDX = 0;
+    private final static int LOGGER_METHOD_IDX = 1;
+    private ServiceReference m_logRef = null;
+    private Object[] m_logger = null;
+
+    public Logger(BundleContext context) {
+//    	if ("true".equals(System.getProperty(LOG_SINGLE_CONTEXT))) {
+//    		m_context = FrameworkUtil.getBundle(DependencyManager.class).getBundleContext();
+//    	} else {
+//    		m_context = context;
+//    	}
+		m_context = context;
+//        startListeningForLogService();
+    }
+
+    public final void log(int level, String msg) {
+        _log(null, level, msg, null);
+    }
+
+    public final void log(int level, String msg, Throwable throwable) {
+        _log(null, level, msg, throwable);
+    }
+
+    public final void log(ServiceReference sr, int level, String msg) {
+        _log(sr, level, msg, null);
+    }
+
+    public final void log(ServiceReference sr, int level, String msg, Throwable throwable) {
+        _log(sr, level, msg, throwable);
+    }
+
+    protected void doLog(ServiceReference sr, int level, String msg, Throwable throwable) {
+        String s = (sr == null) ? null : "SvcRef " + sr;
+        s = (s == null) ? msg : s + " " + msg;
+        s = (throwable == null) ? s : s + " (" + throwable + ")";
+        switch (level) {
+            case LOG_DEBUG:
+                System.out.println("DEBUG: " + s);
+                break;
+            case LOG_ERROR:
+                System.out.println("ERROR: " + s);
+                if (throwable != null) {
+                    if ((throwable instanceof BundleException) && (((BundleException) throwable).getNestedException() != null)) {
+                        throwable = ((BundleException) throwable).getNestedException();
+                    }
+                    throwable.printStackTrace();
+                }
+                break;
+            case LOG_INFO:
+                System.out.println("INFO: " + s);
+                break;
+            case LOG_WARNING:
+                System.out.println("WARNING: " + s);
+                break;
+            default:
+                System.out.println("UNKNOWN[" + level + "]: " + s);
+        }
+    }
+
+    private void _log(ServiceReference sr, int level, String msg, Throwable throwable) {
+        // Save our own copy just in case it changes. We could try to do
+        // more conservative locking here, but let's be optimistic.
+        Object[] logger = m_logger;
+        // Use the log service if available.
+        if (logger != null) {
+            _logReflectively(logger, sr, level, msg, throwable);
+        }
+        // Otherwise, default logging action.
+        else {
+            doLog(sr, level, msg, throwable);
+        }
+    }
+
+    private void _logReflectively(Object[] logger, ServiceReference sr, int level, String msg, Throwable throwable) {
+        if (logger != null) {
+            Object[] params = { sr, new Integer(level), msg, throwable };
+            try {
+                ((Method) logger[LOGGER_METHOD_IDX]).invoke(logger[LOGGER_OBJECT_IDX], params);
+            }
+            catch (InvocationTargetException ex) {
+                System.err.println("Logger: " + ex);
+            }
+            catch (IllegalAccessException ex) {
+                System.err.println("Logger: " + ex);
+            }
+        }
+    }
+
+    /**
+     * This method is called when the bundle context is set;
+     * it simply adds a service listener so that the bundle can track
+     * log services to be used as the back end of the logging mechanism. It also
+     * attempts to get an existing log service, if present, but in general
+     * there will never be a log service present since the system bundle is
+     * started before every other bundle.
+     */
+    private synchronized void startListeningForLogService() {
+        try {
+            // add a service listener for log services, carefully avoiding any code dependency on it
+            m_context.addServiceListener(this, "(objectClass=org.osgi.service.log.LogService)");
+        }
+        catch (InvalidSyntaxException ex) {
+            // this will never happen since the filter is hard coded
+        }
+        // try to get an existing log service
+        m_logRef = m_context.getServiceReference("org.osgi.service.log.LogService");
+        // get the service object if available and set it in the logger
+        if (m_logRef != null) {
+            setLogger(m_context.getService(m_logRef));
+        }
+    }
+
+    /**
+     * This method implements the callback for the ServiceListener interface.
+     * It is public as a byproduct of implementing the interface and should
+     * not be called directly. This method tracks run-time changes to log
+     * service availability. If the log service being used by the framework's
+     * logging mechanism goes away, then this will try to find an alternative.
+     * If a higher ranking log service is registered, then this will switch
+     * to the higher ranking log service.
+     */
+    public final synchronized void serviceChanged(ServiceEvent event) {
+        // if no logger is in use, then grab this one
+        if ((event.getType() == ServiceEvent.REGISTERED) && (m_logRef == null)) {
+            m_logRef = event.getServiceReference();
+            // get the service object and set it in the logger
+            setLogger(m_context.getService(m_logRef));
+        }
+        // if a logger is in use, but this one has a higher ranking, then swap
+        // it for the existing logger
+        else if ((event.getType() == ServiceEvent.REGISTERED) && (m_logRef != null)) {
+            ServiceReference ref = m_context.getServiceReference("org.osgi.service.log.LogService");
+            if (!ref.equals(m_logRef)) {
+                m_context.ungetService(m_logRef);
+                m_logRef = ref;
+                setLogger(m_context.getService(m_logRef));
+            }
+        }
+        // if the current logger is going away, release it and try to
+        // find another one
+        else if ((event.getType() == ServiceEvent.UNREGISTERING) && m_logRef != null && m_logRef.equals(event.getServiceReference())) {
+            // Unget the service object.
+            m_context.ungetService(m_logRef);
+            // Try to get an existing log service.
+            m_logRef = m_context.getServiceReference("org.osgi.service.log.LogService");
+            // get the service object if available and set it in the logger
+            if (m_logRef != null) {
+                setLogger(m_context.getService(m_logRef));
+            }
+            else {
+                setLogger(null);
+            }
+        }
+    }
+
+    /**
+     * This method sets the new log service object. It also caches the method to
+     * invoke. The service object and method are stored in array to optimistically
+     * eliminate the need to locking when logging.
+     */
+    private void setLogger(Object logObj) {
+        if (logObj == null) {
+            m_logger = null;
+        }
+        else {
+            Class[] formalParams = { ServiceReference.class, Integer.TYPE, String.class, Throwable.class };
+            try {
+                Method logMethod = logObj.getClass().getMethod("log", formalParams);
+                logMethod.setAccessible(true);
+                m_logger = new Object[] { logObj, logMethod };
+            }
+            catch (NoSuchMethodException ex) {
+                System.err.println("Logger: " + ex);
+                m_logger = null;
+            }
+        }
+    }
+}
\ No newline at end of file

Added: felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/impl/SerialExecutor.java
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/impl/SerialExecutor.java?rev=1565687&view=auto
==============================================================================
--- felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/impl/SerialExecutor.java (added)
+++ felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/impl/SerialExecutor.java Fri Feb  7 15:23:33 2014
@@ -0,0 +1,128 @@
+/*
+ * 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 dm.impl;
+
+import java.util.LinkedList;
+
+import org.osgi.service.log.LogService;
+
+/**
+ * Allows you to enqueue tasks from multiple threads and then execute
+ * them on one thread sequentially. It assumes more than one thread will
+ * try to execute the tasks and it will make an effort to pick the first
+ * task that comes along whilst making sure subsequent tasks return
+ * without waiting.
+ * 
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+ */
+public final class SerialExecutor {
+	private static final Runnable DUMMY_RUNNABLE = new Runnable() { public void run() {}; };
+    private final LinkedList m_workQueue = new LinkedList();
+    private Runnable m_active;
+    private volatile Thread m_runningThread;
+    private final Logger m_logger;
+    
+    /**
+     * Makes a new SerialExecutor
+     * @param logger the logger used to log possible errors thrown by submitted tasks.
+     */
+    public SerialExecutor(Logger logger) {
+        m_logger = logger;
+    }
+    
+    /**
+     * Enqueue a new task for later execution. This method is
+     * thread-safe, so multiple threads can contribute tasks.
+     * 
+     * @param runnable the runnable containing the actual task
+     */
+    private synchronized void enqueue(final Runnable runnable) {
+    	m_workQueue.addLast(new Runnable() {
+			public void run() {
+				try {
+					runnable.run();
+				}
+				catch (Throwable t) {
+		            m_logger.log(LogService.LOG_ERROR, "got unexpected exception while executing dependencymanager task:"
+		                + toString(), t);
+				}
+				finally {
+					scheduleNext();
+				}
+			}
+		});
+    }
+    
+    /**
+     * Execute any pending tasks. This method is thread safe,
+     * so multiple threads can try to execute the pending
+     * tasks, but only the first will be used to actually do
+     * so. Other threads will return immediately.
+     */
+    private void execute() {
+    	Runnable active;
+    	synchronized (this) {
+    		active = m_active;
+    		// for now just put some non-null value in there so we can never
+    		// get a race condition when two threads enter this section after
+    		// one another (causing sheduleNext() to be invoked twice below)
+    		m_active = DUMMY_RUNNABLE;
+    	}
+    	if (active == null) {
+    	    scheduleNext();
+    	}
+    }
+    
+    /**
+     * Execute a task. This method is thread safe,
+     * so multiple threads can try to execute a task
+     * but only the first will be executed, other threads will return immediately, and the
+     * first thread will execute the tasks scheduled by the other threads.
+     */
+    public void execute(Runnable task) {
+    	boolean isExecutingOnThisThread;
+    	synchronized (this) {
+    		isExecutingOnThisThread = (Thread.currentThread() == (Thread) m_runningThread);
+    	}
+        if (isExecutingOnThisThread) {
+            task.run();
+        }
+        else {
+           enqueue(task);
+           execute();
+        }
+    }
+
+    private void scheduleNext() {
+    	Runnable active;
+    	synchronized (this) {
+			if (!m_workQueue.isEmpty()) {
+			    m_runningThread = Thread.currentThread();
+				m_active = (Runnable) m_workQueue.removeFirst();
+			} else {
+	            m_runningThread = null;
+			    m_active = null;
+			}
+    		active = m_active;
+    	}
+    	if (active != null) {
+            active.run();
+        }
+    }
+}

Added: felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/packageinfo
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/packageinfo?rev=1565687&view=auto
==============================================================================
--- felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/packageinfo (added)
+++ felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/packageinfo Fri Feb  7 15:23:33 2014
@@ -0,0 +1 @@
+version 1.0
\ No newline at end of file

Added: felix/sandbox/marrs/dependencymanager-prototype/dm/test/test/ComponentTest.java
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/dm/test/test/ComponentTest.java?rev=1565687&view=auto
==============================================================================
--- felix/sandbox/marrs/dependencymanager-prototype/dm/test/test/ComponentTest.java (added)
+++ felix/sandbox/marrs/dependencymanager-prototype/dm/test/test/ComponentTest.java Fri Feb  7 15:23:33 2014
@@ -0,0 +1,109 @@
+package test;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import dm.Component;
+import dm.ComponentStateListener;
+import dm.Dependency;
+import dm.State;
+import dm.impl.ComponentImpl;
+import dm.impl.DependencyImpl;
+import dm.impl.EventImpl;
+
+public class ComponentTest {
+	@Test
+	public void createComponent() {
+		Component c = new ComponentImpl();
+		Assert.assertEquals(false, c.isAvailable());
+		c.start();
+		Assert.assertEquals(true, c.isAvailable());
+		c.stop();
+		Assert.assertEquals(false, c.isAvailable());
+	}
+	@Test
+	public void createComponentDep1() {
+		Component c = new ComponentImpl();
+		Dependency d = new DependencyImpl();
+		c.add(d);
+		c.start();
+		Assert.assertEquals(false, c.isAvailable());
+		c.stop();
+		c.remove(d);
+	}
+	@Test
+	public void createComponentDep2() {
+		Component c = new ComponentImpl();
+		Dependency d = new DependencyImpl();
+		c.start();
+		Assert.assertEquals(true, c.isAvailable());
+		c.add(d);
+		Assert.assertEquals(false, d.isAvailable());
+		Assert.assertEquals(false, c.isAvailable());
+		c.remove(d);
+		c.stop();
+	}
+	@Test
+	public void createComponentDep3() {
+		Component c = new ComponentImpl();
+		Dependency d = new DependencyImpl();
+		c.start();
+		c.add(d);
+		Assert.assertEquals(false, c.isAvailable());
+		d.changed(new EventImpl(true));
+		Assert.assertEquals(true, c.isAvailable());
+		d.changed(new EventImpl(false));
+		Assert.assertEquals(false, c.isAvailable());
+		c.remove(d);
+		Assert.assertEquals(true, c.isAvailable());
+		c.stop();
+		Assert.assertEquals(false, c.isAvailable());
+	}
+	@Test
+	public void createComponentDep4() {
+		Component c = new ComponentImpl();
+		final Dependency d = new DependencyImpl();
+		ComponentStateListener l = new ComponentStateListener() {
+			@Override
+			public void changed(State state) {
+				d.changed(new EventImpl(false));
+			}
+		};
+		c.start();
+		c.add(d);
+		c.add(l);
+		Assert.assertEquals(false, c.isAvailable());
+		d.changed(new EventImpl(true));
+		Assert.assertEquals(false, c.isAvailable());
+		c.remove(l);
+		Assert.assertEquals(false, c.isAvailable());
+		c.remove(d);
+		Assert.assertEquals(true, c.isAvailable());
+		c.stop();
+		Assert.assertEquals(false, c.isAvailable());
+	}
+	@Test
+	public void createComponentDep5() {
+		Component c = new ComponentImpl();
+		Dependency d1 = new DependencyImpl();
+		Dependency d2 = new DependencyImpl();
+		c.start();
+		c.add(d1);
+		c.add(d2);
+		Assert.assertEquals(false, c.isAvailable());
+		d1.changed(new EventImpl(true));
+		Assert.assertEquals(false, c.isAvailable());
+		d2.changed(new EventImpl(true));
+		Assert.assertEquals(true, c.isAvailable());
+		d1.changed(new EventImpl(false));
+		Assert.assertEquals(false, c.isAvailable());
+		d2.changed(new EventImpl(false));
+		Assert.assertEquals(false, c.isAvailable());
+		c.remove(d2);
+		Assert.assertEquals(false, c.isAvailable());
+		c.remove(d1);
+		Assert.assertEquals(true, c.isAvailable());
+		c.stop();
+		Assert.assertEquals(false, c.isAvailable());
+	}
+}

Added: felix/sandbox/marrs/dependencymanager-prototype/dm/test/test/ConcurrencyTest.java
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/dm/test/test/ConcurrencyTest.java?rev=1565687&view=auto
==============================================================================
--- felix/sandbox/marrs/dependencymanager-prototype/dm/test/test/ConcurrencyTest.java (added)
+++ felix/sandbox/marrs/dependencymanager-prototype/dm/test/test/ConcurrencyTest.java Fri Feb  7 15:23:33 2014
@@ -0,0 +1,62 @@
+package test;
+
+import java.util.concurrent.Semaphore;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import dm.Component;
+import dm.ComponentStateListener;
+import dm.Dependency;
+import dm.State;
+import dm.impl.ComponentImpl;
+import dm.impl.DependencyImpl;
+import dm.impl.EventImpl;
+
+public class ConcurrencyTest {
+	@Test
+	public void createComponentDep4() {
+		final Semaphore s = new Semaphore(0);
+		final Component c = new ComponentImpl();
+		final Dependency d = new DependencyImpl();
+		final Dependency d2 = new DependencyImpl();
+		final Thread t = new Thread() {
+			public void run() {
+				c.add(d2);
+				s.release();
+			}
+		};
+		ComponentStateListener l = new ComponentStateListener() {
+			@Override
+			public void changed(State state) {
+				try {
+					c.remove(this);
+					t.start();
+					s.acquire();
+					Assert.assertEquals(1, c.getDependencies().size());
+				}
+				catch (InterruptedException e) {
+					e.printStackTrace();
+				}
+			}
+		};
+		
+		
+		c.start();
+		c.add(d);
+		c.add(l);
+		Assert.assertEquals(false, c.isAvailable());
+		d.changed(new EventImpl(true));
+		
+		Assert.assertEquals(false, c.isAvailable());
+		c.remove(l);
+		Assert.assertEquals(false, c.isAvailable());
+		c.remove(d);
+		Assert.assertEquals(false, c.isAvailable());
+		c.remove(d2);
+		Assert.assertEquals(true, c.isAvailable());
+		c.stop();
+		Assert.assertEquals(false, c.isAvailable());
+	}
+
+}



Mime
View raw message