felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pde...@apache.org
Subject svn commit: r1626391 - in /felix/sandbox/pderop/dependencymanager-prototype: ./ cnf/localrepo/ cnf/localrepo/org.apache.felix.configadmin/ org.apache.felix.dependencymanager.benchmark/ org.apache.felix.dependencymanager.itest/ org.apache.felix.dependen...
Date Sat, 20 Sep 2014 07:05:50 GMT
Author: pderop
Date: Sat Sep 20 07:05:49 2014
New Revision: 1626391

URL: http://svn.apache.org/r1626391
Log:
Added org.apache.felix.dependencymanager.samples project.
Use org.apache.felix.configadmin 1.8.0.
Added README file.

Added:
    felix/sandbox/pderop/dependencymanager-prototype/README
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/.classpath
  (with props)
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/.gitignore
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/.project
  (with props)
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/.settings/
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/.settings/org.eclipse.jdt.core.prefs
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/bnd.bnd
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/build.xml
  (with props)
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/conf.bnd
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/hello.bnd
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/.gitignore
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/conf/
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/conf/Activator.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/conf/Configurator.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/conf/MyComponent.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/hello/
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/hello/Activator.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/hello/ServiceConsumer.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/hello/ServiceImplementation.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/hello/ServiceInterface.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/tpool/
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/tpool/Activator.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/test/
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/test/.gitignore
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/tpool.bnd
Removed:
    felix/sandbox/pderop/dependencymanager-prototype/cnf/localrepo/org.apache.felix.configadmin/
Modified:
    felix/sandbox/pderop/dependencymanager-prototype/cnf/localrepo/index.xml
    felix/sandbox/pderop/dependencymanager-prototype/cnf/localrepo/index.xml.sha
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.benchmark/bnd.bnd
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/bnd.bnd
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/bnd.bnd
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/bnd.bnd

Added: felix/sandbox/pderop/dependencymanager-prototype/README
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/README?rev=1626391&view=auto
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/README (added)
+++ felix/sandbox/pderop/dependencymanager-prototype/README Sat Sep 20 07:05:49 2014
@@ -0,0 +1,37 @@
+Dependency Manager 4.0.0 general README
+
+* misc documentations:
+
+- org.apache.felix.dependencymanager/design.txt
+- org.apache.felix.dependencymanager.benchmark/README
+
+* to compile:
+
+- Install Eclipse Kepler SR2 + Java8 support (need by benchmark) + Eclipse Luna
+- Install bndtools
+- Install java7/Java8 JREs in Eclipse:
+
+Window -> Preferences -> Java -> Installed JREs
+
+- add Java7 and Java8 JREs, but make sure the default JRE used is Java7 
+(Only the org.apache.felix.dependencymanager.benchmark module is needing Java8).
+
+- Open Bndtools perspective
+- Import Dependency Manager in Eclipse
+
+* To run tests:
+
+- Click on org.apache.felix.dependencymanager project and run it as "JUnit test".
+- Click on org.apache.felix.dependencymanager.itest and run it as "Bnd OSGi Test Launcer
(Junit)".
+- Click on org.apache.felix.dependencymanager.runtime.itest and run it as ""Bnd OSGi Test
Launcer (Junit)".
+- Click on org.apache.felix.dependencymanager.shell and run it as "JUnit test"
+
+* To execute samples:
+
+- Click on org.apache.felix.dependencymanager.samples and run it as "Bnd OSGi Run Launcher"
+
+* To execute the benchmark:
+
+- Click on org.apache.felix.dependencymanager.benchmark and run it as ""Bnd OSGi Run Launcher"
+More informations on the benchmark can be found from org.apache.felix.dependencymanager.benchmark/README
file.
+

Modified: felix/sandbox/pderop/dependencymanager-prototype/cnf/localrepo/index.xml
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/cnf/localrepo/index.xml?rev=1626391&r1=1626390&r2=1626391&view=diff
==============================================================================
Binary files - no diff available.

Modified: felix/sandbox/pderop/dependencymanager-prototype/cnf/localrepo/index.xml.sha
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/cnf/localrepo/index.xml.sha?rev=1626391&r1=1626390&r2=1626391&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/cnf/localrepo/index.xml.sha (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/cnf/localrepo/index.xml.sha Sat Sep 20
07:05:49 2014
@@ -1 +1 @@
-56e6d233d5cc33acd3c9604ddb6e409e4869115c533a36e775e426ea842d2eb5
\ No newline at end of file
+164ec71a32a15af90814a6869c9a022c34b370f446af7438e6a3fd3ce7198885
\ No newline at end of file

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.benchmark/bnd.bnd
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.benchmark/bnd.bnd?rev=1626391&r1=1626390&r2=1626391&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.benchmark/bnd.bnd
(original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.benchmark/bnd.bnd
Sat Sep 20 07:05:49 2014
@@ -5,14 +5,14 @@
 -runbundles:  \
 	org.apache.felix.dependencymanager;version=latest,\
 	org.apache.felix.dependencymanager.shell;version=latest,\
-	org.apache.felix.configadmin;version=1.8.1,\
 	org.apache.felix.metatype;version=1.0.10,\
 	org.apache.felix.log;version=1.0.1,\
 	org.apache.felix.gogo.command;version=0.12.0,\
 	org.apache.felix.gogo.shell;version=0.10.0,\
 	org.apache.felix.gogo.runtime;version=0.10.0,\
 	org.apache.felix.scr;version=1.8.2,\
-	org.apache.felix.dependencymanager.benchmark.scenario;version=latest
+	org.apache.felix.dependencymanager.benchmark.scenario;version=latest,\
+	org.apache.felix.configadmin;version=1.8.0
 -runfw: org.apache.felix.framework;version='[4.4.0,4.4.0]'
 
 -sub:  \

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/bnd.bnd
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/bnd.bnd?rev=1626391&r1=1626390&r2=1626391&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/bnd.bnd
(original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/bnd.bnd
Sat Sep 20 07:05:49 2014
@@ -2,11 +2,11 @@
 	org.apache.felix.metatype;version=1.0.4,\
 	org.mockito.mockito-all;version=1.9.0,\
 	junit.osgi,\
-	org.apache.felix.configadmin;version=1.8.1,\
 	org.apache.felix.gogo.runtime;version=0.10.0,\
 	org.apache.felix.dependencymanager;version=latest,\
 	org.apache.felix.dependencymanager.shell;version=latest,\
-	org.apache.felix.log;version=1.0.1
+	org.apache.felix.log;version=1.0.1,\
+	org.apache.felix.configadmin;version=1.8.0
 -runee:JavaSE-1.7
 -runvm:-ea
 -runfw:org.apache.felix.framework

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/bnd.bnd
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/bnd.bnd?rev=1626391&r1=1626390&r2=1626391&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/bnd.bnd
(original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/bnd.bnd
Sat Sep 20 07:05:49 2014
@@ -11,11 +11,11 @@
 	org.apache.felix.dependencymanager.runtime.itest.components;version=latest,\
 	org.apache.felix.dependencymanager.runtime.itest.tests;version=latest,\
 	org.apache.felix.dependencymanager.runtime;version=latest,\
-	org.apache.felix.configadmin;version=1.8.1,\
 	org.apache.felix.metatype;version=1.0.4,\
 	org.apache.felix.gogo.runtime;version=0.10.0,\
 	junit.osgi;version=3.8.2,\
-	org.apache.felix.log;version=1.0.1
+	org.apache.felix.log;version=1.0.1,\
+	org.apache.felix.configadmin;version=1.8.0
 -runee: JavaSE-1.7
 -runfw: org.apache.felix.framework;version='[4.4.0,4.4.0]'
 -runsystempackages: \

Added: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/.classpath
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/.classpath?rev=1626391&view=auto
==============================================================================
Binary file - no diff available.

Propchange: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/.classpath
------------------------------------------------------------------------------
    svn:mime-type = application/xml

Added: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/.gitignore
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/.gitignore?rev=1626391&view=auto
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/.gitignore
(added)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/.gitignore
Sat Sep 20 07:05:49 2014
@@ -0,0 +1,3 @@
+/generated/
+/bin/
+/bin_test/

Added: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/.project
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/.project?rev=1626391&view=auto
==============================================================================
Binary file - no diff available.

Propchange: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/.project
------------------------------------------------------------------------------
    svn:mime-type = application/xml

Added: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/.settings/org.eclipse.jdt.core.prefs
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/.settings/org.eclipse.jdt.core.prefs?rev=1626391&view=auto
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/.settings/org.eclipse.jdt.core.prefs
(added)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/.settings/org.eclipse.jdt.core.prefs
Sat Sep 20 07:05:49 2014
@@ -0,0 +1,11 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.8

Added: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/bnd.bnd
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/bnd.bnd?rev=1626391&view=auto
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/bnd.bnd
(added)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/bnd.bnd
Sat Sep 20 07:05:49 2014
@@ -0,0 +1,33 @@
+Bundle-Version: 1.0.0.${tstamp}
+-buildpath:  \
+	org.apache.felix.dependencymanager;version=latest,\
+	osgi.core;version=4.2,\
+	org.apache.felix.dependencymanager.annotation;version=latest,\
+	osgi.cmpn;version=4.2
+-runfw: org.apache.felix.framework;version='[4.4.0,4.4.0]'
+-runee: OSGi/Minimum-1.1
+-runbundles:  \
+	org.apache.felix.dependencymanager;version=latest,\
+	org.apache.felix.metatype;version=1.0.4,\
+	org.apache.felix.log;version=1.0.1,\
+	org.apache.felix.gogo.command;version=0.12.0,\
+	org.apache.felix.gogo.runtime;version=0.10.0,\
+	org.apache.felix.gogo.shell;version=0.10.0,\
+	org.apache.felix.dependencymanager.shell;version=latest,\
+	org.apache.felix.dependencymanager.runtime;version=latest,\
+	org.apache.felix.dependencymanager.samples.hello;version=latest,\
+	org.apache.felix.dependencymanager.samples.tpool;version=latest,\
+	org.apache.felix.dependencymanager.samples.conf;version=latest,\
+	org.apache.felix.configadmin;version=1.8.0
+Private-Package: \
+	org.apache.felix.dependencymanager.samples.tpool,\
+	org.apache.felix.dependencymanager.samples.hello
+-runproperties:  \
+	org.apache.felix.log.maxSize=100000,\
+	org.apache.felix.dependencymanager.parallel=true,\
+	org.apache.felix.dependencymanager.runtime.log=debug
+-plugin: org.apache.felix.dm.annotation.plugin.bnd.AnnotationPlugin;log=debug;\
+	path:=${workspace}/org.apache.felix.dependencymanager.annotation/generated/org.apache.felix.dependencymanager.annotation.jar
+Bundle-Activator: org.apache.felix.dependencymanager.samples.tpool.Activator
+-sub:  \
+	*.bnd
\ No newline at end of file

Added: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/build.xml
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/build.xml?rev=1626391&view=auto
==============================================================================
Binary file - no diff available.

Propchange: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/build.xml
------------------------------------------------------------------------------
    svn:mime-type = application/xml

Added: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/conf.bnd
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/conf.bnd?rev=1626391&view=auto
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/conf.bnd
(added)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/conf.bnd
Sat Sep 20 07:05:49 2014
@@ -0,0 +1,3 @@
+Private-Package:  \
+	org.apache.felix.dependencymanager.samples.conf
+Bundle-Activator: org.apache.felix.dependencymanager.samples.conf.Activator
\ No newline at end of file

Added: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/hello.bnd
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/hello.bnd?rev=1626391&view=auto
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/hello.bnd
(added)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/hello.bnd
Sat Sep 20 07:05:49 2014
@@ -0,0 +1,3 @@
+Private-Package:  \
+	org.apache.felix.dependencymanager.samples.hello
+Bundle-Activator: org.apache.felix.dependencymanager.samples.hello.Activator
\ No newline at end of file

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

Added: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/conf/Activator.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/conf/Activator.java?rev=1626391&view=auto
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/conf/Activator.java
(added)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/conf/Activator.java
Sat Sep 20 07:05:49 2014
@@ -0,0 +1,23 @@
+package org.apache.felix.dependencymanager.samples.conf;
+
+import org.apache.felix.dm.DependencyActivatorBase;
+import org.apache.felix.dm.DependencyManager;
+import org.osgi.framework.BundleContext;
+import org.osgi.service.cm.ConfigurationAdmin;
+
+public class Activator extends DependencyActivatorBase {
+    @Override
+    public void init(BundleContext context, DependencyManager dm) throws Exception {
+        dm.add(createComponent()
+            .setImplementation(MyComponent.class)
+            .add(createConfigurationDependency()
+                .setPid(MyComponent.class.getName())
+                .setCallback("updated")));
+        
+        dm.add(createComponent()
+            .setImplementation(Configurator.class)
+            .add(createServiceDependency()
+                .setService(ConfigurationAdmin.class)
+                .setRequired(true)));
+    }
+}

Added: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/conf/Configurator.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/conf/Configurator.java?rev=1626391&view=auto
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/conf/Configurator.java
(added)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/conf/Configurator.java
Sat Sep 20 07:05:49 2014
@@ -0,0 +1,30 @@
+package org.apache.felix.dependencymanager.samples.conf;
+
+import java.io.IOException;
+import java.util.Hashtable;
+import java.util.Properties;
+
+import org.osgi.service.cm.Configuration;
+import org.osgi.service.cm.ConfigurationAdmin;
+
+public class Configurator {
+    private volatile ConfigurationAdmin m_ca;
+    Configuration m_conf;
+    
+    public void start() {
+        try {
+            System.out.println("Starting " + this.getClass().getName());
+            m_conf = m_ca.getConfiguration(MyComponent.class.getName(), null);
+            Hashtable props = new Properties();
+            props.put("key", "value");
+            m_conf.update(props);
+        }
+        catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+    
+    public void destroy() throws IOException {
+    	m_conf.delete();  
+    }
+}

Added: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/conf/MyComponent.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/conf/MyComponent.java?rev=1626391&view=auto
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/conf/MyComponent.java
(added)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/conf/MyComponent.java
Sat Sep 20 07:05:49 2014
@@ -0,0 +1,13 @@
+package org.apache.felix.dependencymanager.samples.conf;
+
+import java.util.Dictionary;
+
+public class MyComponent {
+	void updated(Dictionary conf) {
+        System.out.println("Updating " + this.getClass().getName());
+	}
+	
+	void start() {
+        System.out.println("Starting " + this.getClass().getName());
+	}
+}

Added: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/hello/Activator.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/hello/Activator.java?rev=1626391&view=auto
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/hello/Activator.java
(added)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/hello/Activator.java
Sat Sep 20 07:05:49 2014
@@ -0,0 +1,24 @@
+package org.apache.felix.dependencymanager.samples.hello;
+
+import org.apache.felix.dm.DependencyActivatorBase;
+import org.apache.felix.dm.DependencyManager;
+import org.osgi.framework.BundleContext;
+
+/**
+ * Simple Activator with one service consumer and a service provider.
+ */
+public class Activator extends DependencyActivatorBase {
+    @Override
+    public void init(BundleContext ctx, DependencyManager dm) throws Exception {
+        dm.add(createComponent()
+            .setImplementation(ServiceImplementation.class)
+            .setInterface(ServiceInterface.class.getName(), null));
+        
+        dm.add(createComponent()
+            .setImplementation(ServiceConsumer.class)
+            .add(createServiceDependency()
+                .setService(ServiceInterface.class)
+                .setRequired(true)));
+    
+    }
+}

Added: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/hello/ServiceConsumer.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/hello/ServiceConsumer.java?rev=1626391&view=auto
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/hello/ServiceConsumer.java
(added)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/hello/ServiceConsumer.java
Sat Sep 20 07:05:49 2014
@@ -0,0 +1,10 @@
+package org.apache.felix.dependencymanager.samples.hello;
+
+public class ServiceConsumer {
+	volatile ServiceInterface service;
+	
+	public void start() {
+        System.out.println("Starting " + this.getClass().getName());
+		this.service.hello();
+	}
+}

Added: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/hello/ServiceImplementation.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/hello/ServiceImplementation.java?rev=1626391&view=auto
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/hello/ServiceImplementation.java
(added)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/hello/ServiceImplementation.java
Sat Sep 20 07:05:49 2014
@@ -0,0 +1,8 @@
+package org.apache.felix.dependencymanager.samples.hello;
+
+public class ServiceImplementation implements ServiceInterface {
+	@Override
+	public void hello() {
+        System.out.println(this.getClass().getName() + " : Hello");
+	}
+}

Added: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/hello/ServiceInterface.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/hello/ServiceInterface.java?rev=1626391&view=auto
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/hello/ServiceInterface.java
(added)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/hello/ServiceInterface.java
Sat Sep 20 07:05:49 2014
@@ -0,0 +1,5 @@
+package org.apache.felix.dependencymanager.samples.hello;
+
+public interface ServiceInterface {
+	public void hello();
+}

Added: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/tpool/Activator.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/tpool/Activator.java?rev=1626391&view=auto
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/tpool/Activator.java
(added)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/tpool/Activator.java
Sat Sep 20 07:05:49 2014
@@ -0,0 +1,29 @@
+package org.apache.felix.dependencymanager.samples.tpool;
+
+import java.util.Hashtable;
+import java.util.concurrent.Executor;
+import java.util.concurrent.Executors;
+
+import org.apache.felix.dm.DependencyActivatorBase;
+import org.apache.felix.dm.DependencyManager;
+import org.osgi.framework.BundleContext;
+
+/**
+ * Registers a threadpool in the OSGi service registry to enable parallelism.
+ * DependencyManager core will use the threadpool when handling components dependencies and
+ * components lifecycle callbacks.
+ * 
+ * To turn on parallelism, the "org.apache.felix.dependencymanager.parallel" system property
must also be set
+ * to "true".
+ */
+public class Activator extends DependencyActivatorBase {  
+    @Override
+    public void init(BundleContext context, DependencyManager mgr) throws Exception {
+        System.out.println("Declaring ThreadPool for DependencyManager.");
+        Hashtable props = new Hashtable();
+        props.put("target", DependencyManager.THREADPOOL);
+        mgr.add(createComponent()
+            .setInterface(Executor.class.getName(), props)
+            .setImplementation(Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors())));
+    }
+}

Added: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/test/.gitignore
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/test/.gitignore?rev=1626391&view=auto
==============================================================================
    (empty)

Added: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/tpool.bnd
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/tpool.bnd?rev=1626391&view=auto
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/tpool.bnd
(added)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/tpool.bnd
Sat Sep 20 07:05:49 2014
@@ -0,0 +1,3 @@
+Private-Package:  \
+	org.apache.felix.dependencymanager.samples.tpool
+Bundle-Activator: org.apache.felix.dependencymanager.samples.tpool.Activator
\ No newline at end of file

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/bnd.bnd
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/bnd.bnd?rev=1626391&r1=1626390&r2=1626391&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/bnd.bnd
(original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/bnd.bnd
Sat Sep 20 07:05:49 2014
@@ -1,7 +1,7 @@
 -buildpath:  \
 	osgi.core;version=4.2,\
-	org.mockito.mockito-all,\
-	osgi.cmpn;version=4.2
+	osgi.cmpn;version=4.2,\
+	org.mockito.mockito-all;version=1.9
 Private-Package: \
 	org.apache.felix.dm.impl,\
 	org.apache.felix.dm.impl.index,\



Mime
View raw message