You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2017/11/07 09:25:18 UTC

[sling-org-apache-sling-discovery-api] annotated tag org.apache.sling.discovery.api-1.0.0 created (now 19b38b8)

This is an automated email from the ASF dual-hosted git repository.

rombert pushed a change to annotated tag org.apache.sling.discovery.api-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-api.git.


      at 19b38b8  (tag)
 tagging 6fb7a58a100396b2d8bbc63f1e683403f5ba2ec5 (commit)
      by Carsten Ziegeler
      on Tue Jul 9 13:08:03 2013 +0000

- Log -----------------------------------------------------------------
org.apache.sling.discovery.api-1.0.0
-----------------------------------------------------------------------

This annotated tag includes the following new commits:

     new d47d840  Add new discovery module
     new f33adec  Move discovery api to a different directory to create a structure as discovery consists of several modules
     new 59f1ac4  Set svn ignore
     new ed21de9  Create own directory for all discovery modules
     new 8bfc63b  Create own directory for all discovery modules
     new 0e6b1ef  Clarify contracts
     new 582ea12  svn:ignore
     new 4a29199  Add standard properties and provide an implementation delivering these properties
     new dec2c41  Rename "own" to "local"
     new 2a2a3e7  Rename DiscoveryAware to TopologyEventListener
     new 57d974d  SLING-2827 : javadoc of Type clarified - plus a source code reformat
     new 5f829a8  SLING-2827 : minor rewordings of javadoc of Type
     new b0584cc  SLING-2827 : a minor javadoc typo
     new 5a71c8a  Move discovery to bundles section
     new e021a7b  Correct reactor pom and update to parent pom 16
     new 4c59ab4  [maven-release-plugin] prepare release org.apache.sling.discovery.api-1.0.0
     new a6fd07a  [maven-release-plugin] rollback the release of org.apache.sling.discovery.api-1.0.0
     new d0efb65  Correct/add scm information
     new df64dab  [maven-release-plugin] prepare release org.apache.sling.discovery.api-1.0.0
     new 423bc76  [maven-release-plugin]  copy for tag org.apache.sling.discovery.api-1.0.0
     new 5cd0f19  [maven-release-plugin] prepare for next development iteration
     new e1e7e01  Create new standalone module
     new ff0fd1d  Create new standalone project
     new a888d83  Create new standalone project
     new 0306312  Create new standalone module
     new 4073ac9  Fix constant
     new 8e87d4d  SLING-2892 and SLING-2901 : added a javadoc note about the fact that the discovery service fails if it detects duplicate sling.id in a cluster
     new 2a04569  [maven-release-plugin] prepare release org.apache.sling.discovery.api-1.0.0
     new 6fb7a58  [maven-release-plugin]  copy for tag org.apache.sling.discovery.api-1.0.0

The 29 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


-- 
To stop receiving notification emails like this one, please contact
['"commits@sling.apache.org" <co...@sling.apache.org>'].

[sling-org-apache-sling-discovery-api] 18/29: Correct/add scm information

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.api-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-api.git

commit d0efb6533687213f8c59d7351b13e1c211a89324
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon May 13 14:47:32 2013 +0000

    Correct/add scm information
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/api@1481895 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pom.xml b/pom.xml
index 67a937c..a7c6cba 100644
--- a/pom.xml
+++ b/pom.xml
@@ -37,9 +37,9 @@
     </description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/discovery/api</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/discovery/api</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/discovery/api</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/api</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/api</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/discovery/api</url>
     </scm>
 
     <build>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-discovery-api] 16/29: [maven-release-plugin] prepare release org.apache.sling.discovery.api-1.0.0

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.api-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-api.git

commit 4c59ab40987342f3f5861c2510fd3c20e2b3a79c
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon May 13 14:43:35 2013 +0000

    [maven-release-plugin] prepare release org.apache.sling.discovery.api-1.0.0
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/api@1481888 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 67a937c..238b1cc 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,7 +29,7 @@
 
     <artifactId>org.apache.sling.discovery.api</artifactId>
     <packaging>bundle</packaging>
-    <version>0.1.0-SNAPSHOT</version>
+    <version>1.0.0</version>
 
     <name>Apache Sling Discovery API</name>
     <description>
@@ -37,9 +37,9 @@
     </description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/discovery/api</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/discovery/api</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/discovery/api</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.discovery.api-1.0.0</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.discovery.api-1.0.0</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.discovery.api-1.0.0</url>
     </scm>
 
     <build>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-discovery-api] 17/29: [maven-release-plugin] rollback the release of org.apache.sling.discovery.api-1.0.0

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.api-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-api.git

commit a6fd07a8148f70ebde5d6147446a684d0fb6c17e
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon May 13 14:45:37 2013 +0000

    [maven-release-plugin] rollback the release of org.apache.sling.discovery.api-1.0.0
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/api@1481890 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 238b1cc..67a937c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,7 +29,7 @@
 
     <artifactId>org.apache.sling.discovery.api</artifactId>
     <packaging>bundle</packaging>
-    <version>1.0.0</version>
+    <version>0.1.0-SNAPSHOT</version>
 
     <name>Apache Sling Discovery API</name>
     <description>
@@ -37,9 +37,9 @@
     </description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.discovery.api-1.0.0</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.discovery.api-1.0.0</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.discovery.api-1.0.0</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/discovery/api</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/discovery/api</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/discovery/api</url>
     </scm>
 
     <build>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-discovery-api] 15/29: Correct reactor pom and update to parent pom 16

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.api-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-api.git

commit e021a7badf4e7ddcd9666a4193b410231a1af432
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Sun May 5 14:38:24 2013 +0000

    Correct reactor pom and update to parent pom 16
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/api@1479333 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index f30d328..67a937c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>15</version>
+        <version>16</version>
         <relativePath>../../../parent/pom.xml</relativePath>
     </parent>
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-discovery-api] 27/29: SLING-2892 and SLING-2901 : added a javadoc note about the fact that the discovery service fails if it detects duplicate sling.id in a cluster

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.api-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-api.git

commit 8e87d4deb3b786fc7e22ce51fcfa9081d87baa45
Author: Stefan Egli <st...@apache.org>
AuthorDate: Tue Jun 4 14:31:14 2013 +0000

    SLING-2892 and SLING-2901 : added a javadoc note about the fact that the discovery service fails if it detects duplicate sling.id in a cluster
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/api@1489459 13f79535-47bb-0310-9956-ffa450edef68
---
 src/main/java/org/apache/sling/discovery/DiscoveryService.java | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/main/java/org/apache/sling/discovery/DiscoveryService.java b/src/main/java/org/apache/sling/discovery/DiscoveryService.java
index 3477650..3ef52f3 100644
--- a/src/main/java/org/apache/sling/discovery/DiscoveryService.java
+++ b/src/main/java/org/apache/sling/discovery/DiscoveryService.java
@@ -24,6 +24,9 @@ package org.apache.sling.discovery;
  * The discovery service is in charge of managing live instances that
  * have announced themselves as being part of a topology view. The exact
  * details of how this announcement occurs is implementation dependent.
+ * <p>
+ * Note that the discovery service fails if it detects a situation
+ * where more than one instance with the same sling.id exists in a cluster. 
  */
 public interface DiscoveryService {
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-discovery-api] 19/29: [maven-release-plugin] prepare release org.apache.sling.discovery.api-1.0.0

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.api-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-api.git

commit df64dab2d1d5b81c3f1b7dadddbfd3cb5556aaa0
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon May 13 14:48:05 2013 +0000

    [maven-release-plugin] prepare release org.apache.sling.discovery.api-1.0.0
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/api@1481897 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index a7c6cba..238b1cc 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,7 +29,7 @@
 
     <artifactId>org.apache.sling.discovery.api</artifactId>
     <packaging>bundle</packaging>
-    <version>0.1.0-SNAPSHOT</version>
+    <version>1.0.0</version>
 
     <name>Apache Sling Discovery API</name>
     <description>
@@ -37,9 +37,9 @@
     </description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/api</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/api</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/discovery/api</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.discovery.api-1.0.0</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.discovery.api-1.0.0</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.discovery.api-1.0.0</url>
     </scm>
 
     <build>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-discovery-api] 12/29: SLING-2827 : minor rewordings of javadoc of Type

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.api-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-api.git

commit 5f829a8790fa3a49f6d8192e7ac773ab0cc19054
Author: Stefan Egli <st...@apache.org>
AuthorDate: Tue Apr 23 09:44:00 2013 +0000

    SLING-2827 : minor rewordings of javadoc of Type
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/discovery/api@1470865 13f79535-47bb-0310-9956-ffa450edef68
---
 .../org/apache/sling/discovery/TopologyEvent.java  | 23 +++++++++++-----------
 1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/src/main/java/org/apache/sling/discovery/TopologyEvent.java b/src/main/java/org/apache/sling/discovery/TopologyEvent.java
index 6b515bd..305dcb9 100644
--- a/src/main/java/org/apache/sling/discovery/TopologyEvent.java
+++ b/src/main/java/org/apache/sling/discovery/TopologyEvent.java
@@ -30,18 +30,17 @@ public class TopologyEvent {
 
     public static enum Type {
         /**
-         * Inform the service about the initial topology state and is only sent
-         * once at bind-time.
-         * <p>
-         * This event type will be the first one a TopologyEventListener
-         * receives.
+         * Informs the service about the initial topology state - this is only 
+         * sent once at bind-time and is the first one a TopologyEventListener
+         * receives (after the implementation bundle was activated).
          */
         TOPOLOGY_INIT,
 
         /**
-         * Inform the service about the fact that a state change was detected in
-         * the topology/cluster and that a voting amongst the members about a
-         * new, valid topology/cluster view has just started.
+         * Informs the service about the fact that a state change was detected in
+         * the topology/cluster and that the new state is in the process of
+         * being discovered. Once the discovery is finished, a TOPOLOGY_CHANGED
+         * is sent with the new topology view.
          * <p>
          * An implementation must always send a TOPOLOGY_CHANGING before a
          * TOPOLOGY_CHANGED.
@@ -49,16 +48,16 @@ public class TopologyEvent {
         TOPOLOGY_CHANGING,
 
         /**
-         * Inform the service about a state change in the topology.
+         * Informs the service about a state change in the topology.
          * <p>
          * A state change includes:
          * <ul>
          * <li>A joining or leaving instance</li>
          * <li>A restart of an instance - or more precisely: when the
          * corresponding implementation bundle is deactivated/activated</li>
-         * <li>A cluster structure changed: either its members or the cluster
-         * view id. The cluster view id changes when an instance joins, leaves
-         * or was restarted (the bundle deactivated/activated)</li>
+         * <li>A cluster structure - either its members or the cluster
+         * view id - changed. The cluster view id changes when an instance joins, 
+         * leaves or was restarted (its bundle deactivated/activated)</li>
          * </ul>
          * <p>
          * Note that tha TOPOLOGY_CHANGED can also include changes in the

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-discovery-api] 06/29: Clarify contracts

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.api-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-api.git

commit 0e6b1ef0043399347a13ca2f1329bfc2c3fb835a
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Apr 15 08:57:46 2013 +0000

    Clarify contracts
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/discovery/api@1467906 13f79535-47bb-0310-9956-ffa450edef68
---
 .../org/apache/sling/discovery/ClusterView.java    | 11 ++++++--
 .../org/apache/sling/discovery/TopologyView.java   | 29 +++++++++++++---------
 .../discovery/impl/NoClusterDiscoveryService.java  | 16 ++++++------
 3 files changed, 35 insertions(+), 21 deletions(-)

diff --git a/src/main/java/org/apache/sling/discovery/ClusterView.java b/src/main/java/org/apache/sling/discovery/ClusterView.java
index a12424d..64744a1 100644
--- a/src/main/java/org/apache/sling/discovery/ClusterView.java
+++ b/src/main/java/org/apache/sling/discovery/ClusterView.java
@@ -35,8 +35,12 @@ public interface ClusterView {
     String getId();
 
     /**
-     * Provides the list of InstanceDescriptions ordered by Sling Id.
-     * @return the list of InstanceDescriptions ordered by Sling Id
+     * Provides the list of InstanceDescriptions with a stable ordering.
+     * <p>
+     * Stable ordering implies that unless an instance leaves the cluster
+     * (due to shutdown/crash/network problems) the instance keeps the
+     * relative position in the list.
+     * @return the list of InstanceDescriptions (with a stable ordering)
      */
     List<InstanceDescription> getInstances();
 
@@ -44,6 +48,9 @@ public interface ClusterView {
 	 * Provides the InstanceDescription belonging to the leader instance.
 	 * <p>
 	 * Every ClusterView is guaranteed to have one and only one leader.
+	 * <p>
+	 * The leader is stable: once a leader is elected it stays leader
+	 * unless it leaves the cluster (due to shutdown/crash/network problems)
 	 * @return the InstanceDescription belonging to the leader instance
 	 */
     InstanceDescription getLeader();
diff --git a/src/main/java/org/apache/sling/discovery/TopologyView.java b/src/main/java/org/apache/sling/discovery/TopologyView.java
index 0e8f1aa..8b95f79 100644
--- a/src/main/java/org/apache/sling/discovery/TopologyView.java
+++ b/src/main/java/org/apache/sling/discovery/TopologyView.java
@@ -20,6 +20,7 @@ package org.apache.sling.discovery;
 
 import java.util.Collection;
 import java.util.List;
+import java.util.Set;
 
 /**
  * A topology view is a cross-cluster list of instances and clusters
@@ -39,30 +40,34 @@ public interface TopologyView {
 	boolean isCurrent();
 
 	/**
-	 * Provides the InstanceDescription belonging to *this* instance.
-	 * @return the InstanceDescription belonging to *this* instance
+	 * Provides the InstanceDescription belonging to <b>this</b> instance.
+	 * @return the InstanceDescription belonging to <b>this</b> instance
 	 */
 	InstanceDescription getOwnInstance();
 
     /**
-     * Provides the list of InstanceDescriptions ordered by Sling Id.
-     * @return the list of InstanceDescriptions ordered by Sling Id or null if there are no instances
+     * Provides the set of InstanceDescriptions in the entire topology,
+     * without any particular order
+     * @return the set of InstanceDescriptions in the entire topology,
+     * without any particular order
      */
-	List<InstanceDescription> getInstances();
+	Set<InstanceDescription> getInstances();
 
 	/**
-	 * Search the current topology for instances which the provided InstancePicker has accepted.
+	 * Searches through this topology and picks those accepted by the provided
+	 * <code>InstanceFilter</code> - and returns them without any particular order
 	 * @param filter the filter to use
-	 * @return the list of InstanceDescriptions which were accepted by the InstanceFilter
+	 * @return the set of InstanceDescriptions which were accepted by the InstanceFilter,
+	 * without any particular order
 	 */
-	List<InstanceDescription> findInstances(InstanceFilter filter);
+	Set<InstanceDescription> findInstances(InstanceFilter filter);
 
     /**
      * Provides the collection of ClusterViews.
      * <p>
-     * Note that all InstanceDescriptions belong to a ClusterView, even if 
-     * they are only a "cluster of 1" (ie not really a cluster).
-     * @return the collection of ClusterViews
+     * Note that all InstanceDescriptions belong to exactly one ClusterView - 
+     * including InstanceDescriptions that form "a cluster of 1"
+     * @return the set of ClusterViews, without any particular order
      */
-	Collection<ClusterView> getClusterViews();
+	Set<ClusterView> getClusterViews();
 }
diff --git a/src/main/java/org/apache/sling/discovery/impl/NoClusterDiscoveryService.java b/src/main/java/org/apache/sling/discovery/impl/NoClusterDiscoveryService.java
index 8f6fd55..555f118 100644
--- a/src/main/java/org/apache/sling/discovery/impl/NoClusterDiscoveryService.java
+++ b/src/main/java/org/apache/sling/discovery/impl/NoClusterDiscoveryService.java
@@ -23,10 +23,12 @@ import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 import org.apache.felix.scr.annotations.Activate;
 import org.apache.felix.scr.annotations.Component;
@@ -133,7 +135,7 @@ public class NoClusterDiscoveryService implements DiscoveryService {
 				return clusters.iterator().next();
 			}
         };
-        final List<InstanceDescription> instances = new ArrayList<InstanceDescription>();
+        final Set<InstanceDescription> instances = new HashSet<InstanceDescription>();
         instances.add(myDescription);
 
         final DiscoveryAware[] registeredServices;
@@ -146,7 +148,7 @@ public class NoClusterDiscoveryService implements DiscoveryService {
                 }
 
                 public List<InstanceDescription> getInstances() {
-                    return instances;
+                    return new LinkedList<InstanceDescription>(instances);
                 }
 
 				public String getId() {
@@ -163,12 +165,12 @@ public class NoClusterDiscoveryService implements DiscoveryService {
     				return true;
     			}
 
-    			public List<InstanceDescription> getInstances() {
+    			public Set<InstanceDescription> getInstances() {
     				return instances;
     			}
 
-    			public List<InstanceDescription> findInstances(InstanceFilter picker) {
-    				List<InstanceDescription> result = new LinkedList<InstanceDescription>();
+    			public Set<InstanceDescription> findInstances(InstanceFilter picker) {
+    				Set<InstanceDescription> result = new HashSet<InstanceDescription>();
     				for (Iterator<InstanceDescription> it = getTopology().getInstances().iterator(); it.hasNext();) {
     					InstanceDescription instance = it.next();
     					if (picker.accept(instance)) {
@@ -178,8 +180,8 @@ public class NoClusterDiscoveryService implements DiscoveryService {
     				return result;
     			}
 
-    			public List<ClusterView> getClusterViews() {
-    				LinkedList<ClusterView> clusters = new LinkedList<ClusterView>();
+    			public Set<ClusterView> getClusterViews() {
+    				Set<ClusterView> clusters = new HashSet<ClusterView>();
     				clusters.add(clusterView);
     				return clusters;
     			}

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-discovery-api] 25/29: Create new standalone module

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.api-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-api.git

commit 03063127bc84e8e052b3166180196012208274cd
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue May 14 08:01:43 2013 +0000

    Create new standalone module
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/api@1482242 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 16 ----------------
 1 file changed, 16 deletions(-)

diff --git a/pom.xml b/pom.xml
index a7f2dd7..a6f875e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -46,10 +46,6 @@
         <plugins>
             <plugin>
                 <groupId>org.apache.felix</groupId>
-                <artifactId>maven-scr-plugin</artifactId>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
                 <artifactId>maven-bundle-plugin</artifactId>
                 <extensions>true</extensions>
             </plugin>
@@ -57,20 +53,8 @@
     </build>
     <dependencies>
         <dependency>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>org.apache.felix.scr.annotations</artifactId>
-        </dependency>
-        <dependency>
             <groupId>biz.aQute</groupId>
             <artifactId>bndlib</artifactId>
         </dependency>
-        <dependency>
-            <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.core</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.compendium</artifactId>
-        </dependency>
     </dependencies>
 </project>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-discovery-api] 24/29: Create new standalone project

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.api-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-api.git

commit a888d83873a2010e37801e319b7396f84adb49cb
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue May 14 07:58:08 2013 +0000

    Create new standalone project
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/api@1482241 13f79535-47bb-0310-9956-ffa450edef68

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-discovery-api] 26/29: Fix constant

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.api-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-api.git

commit 4073ac9b695754170242da7d5aa6126e8ec3a8ed
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue May 21 11:52:27 2013 +0000

    Fix constant
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/api@1484769 13f79535-47bb-0310-9956-ffa450edef68
---
 src/main/java/org/apache/sling/discovery/InstanceDescription.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/sling/discovery/InstanceDescription.java b/src/main/java/org/apache/sling/discovery/InstanceDescription.java
index 0c714a3..5baa752 100644
--- a/src/main/java/org/apache/sling/discovery/InstanceDescription.java
+++ b/src/main/java/org/apache/sling/discovery/InstanceDescription.java
@@ -42,7 +42,7 @@ public interface InstanceDescription {
      * Property containing a description for the instance.
      * The instance should provide this property.
      */
-    String PROPERTY_DESCRIPTION = "org.apache.sling.instance.name";
+    String PROPERTY_DESCRIPTION = "org.apache.sling.instance.description";
 
     /**
      * Property containing endpoints to connect to the instance. The

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-discovery-api] 03/29: Set svn ignore

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.api-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-api.git

commit 59f1ac479715a10d31ff536fdf27d068b36387e1
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Fri Apr 12 08:54:07 2013 +0000

    Set svn ignore
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/discovery-api@1467214 13f79535-47bb-0310-9956-ffa450edef68

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-discovery-api] 08/29: Add standard properties and provide an implementation delivering these properties

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.api-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-api.git

commit 4a29199d6c185ac15fab162b0ee72b8308296fae
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Wed Apr 17 12:59:51 2013 +0000

    Add standard properties and provide an implementation delivering these properties
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/discovery/api@1468881 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                            |   2 -
 .../sling/discovery/InstanceDescription.java       |  23 ++-
 .../apache/sling/discovery/PropertyProvider.java   |   5 +-
 .../discovery/impl/StandardPropertyProvider.java   | 219 +++++++++++++++++++++
 4 files changed, 245 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index a836cdb..f30d328 100644
--- a/pom.xml
+++ b/pom.xml
@@ -63,8 +63,6 @@
         <dependency>
             <groupId>biz.aQute</groupId>
             <artifactId>bndlib</artifactId>
-            <version>1.50.0</version>
-            <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.slf4j</groupId>
diff --git a/src/main/java/org/apache/sling/discovery/InstanceDescription.java b/src/main/java/org/apache/sling/discovery/InstanceDescription.java
index 55e941f..f3ce846 100644
--- a/src/main/java/org/apache/sling/discovery/InstanceDescription.java
+++ b/src/main/java/org/apache/sling/discovery/InstanceDescription.java
@@ -26,11 +26,32 @@ import java.util.Map;
  * <p>
  * Note that all methods are idempotent - they always return the same values
  * on subsequent calls. Rather, on any change new InstanceDescriptions are created.
+ *
+ *
  * @see TopologyView
  */
 public interface InstanceDescription {
 
-	/**
+    /**
+     * Property containing a name for the instance.
+     * The instance should provide this property.
+     */
+    String PROPERTY_NAME = "org.apache.sling.instance.name";
+
+    /**
+     * Property containing a description for the instance.
+     * The instance should provide this property.
+     */
+    String PROPERTY_DESCRIPTION = "org.apache.sling.instance.name";
+
+    /**
+     * Property containing endpoints to connect to the instance. The
+     * value is a comma separated list.
+     * The instance should provide this property.
+     */
+    String PROPERTY_ENDPOINTS = "org.apache.sling.instance.endpoints";
+
+    /**
 	 * Returns the ClusterView of which this instance is part of.
 	 * <p>
 	 * Every instance is part of a ClusterView even if it is standalone.
diff --git a/src/main/java/org/apache/sling/discovery/PropertyProvider.java b/src/main/java/org/apache/sling/discovery/PropertyProvider.java
index 31b4ed3..6e7aa8e 100644
--- a/src/main/java/org/apache/sling/discovery/PropertyProvider.java
+++ b/src/main/java/org/apache/sling/discovery/PropertyProvider.java
@@ -46,7 +46,10 @@ public interface PropertyProvider {
 	 * and broadcast to the <code>TopologyView</code> instances.
 	 * <p>
 	 * These properties are non-persistent and disappear after my own instance goes down.
-	 * @return The value of the property or <code>null</code>
+	 *
+	 * @return The value of the property or <code>null</code>. If the property
+	 *         value can't be provided or if the provider does not support this
+	 *         property, it must return <code>null</code>.
 	 */
 	String getProperty(final String name);
 }
diff --git a/src/main/java/org/apache/sling/discovery/impl/StandardPropertyProvider.java b/src/main/java/org/apache/sling/discovery/impl/StandardPropertyProvider.java
new file mode 100644
index 0000000..798ff0a
--- /dev/null
+++ b/src/main/java/org/apache/sling/discovery/impl/StandardPropertyProvider.java
@@ -0,0 +1,219 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.discovery.impl;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Dictionary;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.felix.scr.annotations.Activate;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Deactivate;
+import org.apache.felix.scr.annotations.Modified;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.ReferenceCardinality;
+import org.apache.felix.scr.annotations.ReferencePolicy;
+import org.apache.sling.discovery.InstanceDescription;
+import org.apache.sling.discovery.PropertyProvider;
+import org.osgi.framework.Constants;
+import org.osgi.framework.ServiceReference;
+import org.osgi.framework.ServiceRegistration;
+import org.osgi.service.component.ComponentContext;
+import org.osgi.service.http.HttpService;
+
+/**
+ * This service provides the standard instance properties (if available)
+ */
+@Component(immediate=true)
+@Reference(referenceInterface=HttpService.class,
+           cardinality=ReferenceCardinality.OPTIONAL_MULTIPLE,
+           policy=ReferencePolicy.DYNAMIC)
+public class StandardPropertyProvider {
+
+    /** Endpoint service registration property from RFC 189 */
+    private static final String REG_PROPERTY_ENDPOINTS = "osgi.http.service.endpoints";
+
+    private volatile long changeCount;
+
+    private String instanceName;
+
+    private String instanceDescription;
+
+    private ServiceRegistration propagationService;
+
+    private final Map<Long, String[]> endpoints = new HashMap<Long, String[]>();
+
+    private String endpointString;
+
+    private Dictionary<String, Object> getRegistrationProperties() {
+        final List<String> names = new ArrayList<String>();
+        if ( this.instanceName != null ) {
+            names.add(InstanceDescription.PROPERTY_NAME);
+        }
+        if ( this.instanceDescription != null ) {
+            names.add(InstanceDescription.PROPERTY_DESCRIPTION);
+        }
+        names.add(InstanceDescription.PROPERTY_ENDPOINTS);
+
+        final StringBuilder sb = new StringBuilder();
+        boolean first = true;
+        synchronized ( this.endpoints ) {
+            for(final String[] points : endpoints.values()) {
+                for(final String point : points) {
+                    if ( first ) {
+                        first = false;
+                    } else {
+                        sb.append(",");
+                    }
+                    sb.append(point);
+                }
+            }
+        }
+        this.endpointString = sb.toString();
+
+        final Dictionary<String, Object> serviceProps = new Hashtable<String, Object>();
+        serviceProps.put(PropertyProvider.PROPERTY_PROPERTIES, names.toArray(new String[names.size()]));
+        // we add a changing property to the service registration
+        // to make sure a modification event is really sent
+        synchronized ( this ) {
+            serviceProps.put("changeCount", this.changeCount++);
+        }
+        return serviceProps;
+    }
+
+    private String getPropertyValue(final ComponentContext bc, final String key) {
+        Object value = bc.getProperties().get(key);
+        if ( value == null ) {
+            value = bc.getBundleContext().getProperty(key);
+        }
+        if ( value != null ) {
+            return value.toString();
+        }
+        return null;
+    }
+
+    @Activate
+    protected void activate(final ComponentContext cc) {
+        this.modified(cc);
+    }
+
+    @Modified
+    protected void modified(final ComponentContext cc) {
+        this.instanceName = this.getPropertyValue(cc, "sling.name");
+        this.instanceDescription = this.getPropertyValue(cc, "sling.description");
+
+        this.propagationService = cc.getBundleContext().registerService(PropertyProvider.class.getName(),
+                new PropertyProvider() {
+
+                    public String getProperty(final String name) {
+                        if ( InstanceDescription.PROPERTY_DESCRIPTION.equals(name) ) {
+                            return instanceDescription;
+                        }
+                        if ( InstanceDescription.PROPERTY_NAME.equals(name) ) {
+                            return instanceName;
+                        }
+                        if ( InstanceDescription.PROPERTY_ENDPOINTS.equals(name) ) {
+                            return endpointString;
+                        }
+                        return null;
+                    }
+                }, this.getRegistrationProperties());
+    }
+
+    @Deactivate
+    protected void deactivate() {
+        if ( this.propagationService != null ) {
+            this.propagationService.unregister();
+            this.propagationService = null;
+        }
+    }
+
+    /**
+     * Bind a http service
+     */
+    protected void bindHttpService(final ServiceReference reference) {
+        final String[] endpointUrls = toStringArray(reference.getProperty(REG_PROPERTY_ENDPOINTS));
+        if ( endpointUrls != null ) {
+            synchronized ( this.endpoints ) {
+                this.endpoints.put((Long)reference.getProperty(Constants.SERVICE_ID), endpointUrls);
+            }
+            if ( this.propagationService != null ) {
+                this.propagationService.setProperties(this.getRegistrationProperties());
+            }
+        }
+    }
+
+    /**
+     * Unbind a http service
+     */
+    protected void unbindHttpService(final ServiceReference reference) {
+        boolean changed = false;
+        synchronized ( this.endpoints ) {
+            if ( this.endpoints.remove(reference.getProperty(Constants.SERVICE_ID)) != null ) {
+                changed = true;
+            }
+        }
+        if ( changed && this.propagationService != null ) {
+            this.propagationService.setProperties(this.getRegistrationProperties());
+        }
+    }
+
+    private String[] toStringArray(final Object propValue) {
+        if (propValue == null) {
+            // no value at all
+            return null;
+
+        } else if (propValue instanceof String) {
+            // single string
+            return new String[] { (String) propValue };
+
+        } else if (propValue instanceof String[]) {
+            // String[]
+            return (String[]) propValue;
+
+        } else if (propValue.getClass().isArray()) {
+            // other array
+            Object[] valueArray = (Object[]) propValue;
+            List<String> values = new ArrayList<String>(valueArray.length);
+            for (Object value : valueArray) {
+                if (value != null) {
+                    values.add(value.toString());
+                }
+            }
+            return values.toArray(new String[values.size()]);
+
+        } else if (propValue instanceof Collection<?>) {
+            // collection
+            Collection<?> valueCollection = (Collection<?>) propValue;
+            List<String> valueList = new ArrayList<String>(valueCollection.size());
+            for (Object value : valueCollection) {
+                if (value != null) {
+                    valueList.add(value.toString());
+                }
+            }
+            return valueList.toArray(new String[valueList.size()]);
+        }
+
+        return null;
+    }
+}

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-discovery-api] 20/29: [maven-release-plugin] copy for tag org.apache.sling.discovery.api-1.0.0

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.api-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-api.git

commit 423bc764a330d06cd94842a123a78bb9f46c5917
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon May 13 14:48:17 2013 +0000

    [maven-release-plugin]  copy for tag org.apache.sling.discovery.api-1.0.0
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.discovery.api-1.0.0@1481899 13f79535-47bb-0310-9956-ffa450edef68

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-discovery-api] 07/29: svn:ignore

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.api-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-api.git

commit 582ea1248f2d2553deae5324ae61b2a70ad1a821
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Mon Apr 15 09:49:30 2013 +0000

    svn:ignore
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/discovery/api@1467918 13f79535-47bb-0310-9956-ffa450edef68

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-discovery-api] 01/29: Add new discovery module

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.api-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-api.git

commit d47d8407e0ed7ecab919f6cf49cda82544d1d2fa
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Fri Apr 12 08:41:51 2013 +0000

    Add new discovery module
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/discovery@1467207 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                            |  82 +++++
 .../org/apache/sling/discovery/ClusterView.java    |  50 +++
 .../org/apache/sling/discovery/DiscoveryAware.java |  60 ++++
 .../apache/sling/discovery/DiscoveryService.java   |  50 +++
 .../sling/discovery/InstanceDescription.java       |  85 +++++
 .../org/apache/sling/discovery/InstanceFilter.java |  37 ++
 .../apache/sling/discovery/PropertyProvider.java   |  52 +++
 .../org/apache/sling/discovery/TopologyEvent.java  | 115 ++++++
 .../org/apache/sling/discovery/TopologyView.java   |  68 ++++
 .../discovery/impl/NoClusterDiscoveryService.java  | 389 +++++++++++++++++++++
 .../org/apache/sling/discovery/package-info.java   |  30 ++
 11 files changed, 1018 insertions(+)

diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..0c33c6a
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.sling</groupId>
+        <artifactId>sling</artifactId>
+        <version>15</version>
+        <relativePath>../../../parent/pom.xml</relativePath>
+    </parent>
+
+    <artifactId>org.apache.sling.discovery.api</artifactId>
+    <packaging>bundle</packaging>
+    <version>0.1.0-SNAPSHOT</version>
+
+    <name>Apache Sling Discovery API</name>
+    <description>
+        Support for topology discovery of instances.
+    </description>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-scr-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <extensions>true</extensions>
+            </plugin>
+        </plugins>
+    </build>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.scr.annotations</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>biz.aQute</groupId>
+            <artifactId>bndlib</artifactId>
+            <version>1.50.0</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.compendium</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.settings</artifactId>
+            <version>1.1.0</version>
+            <scope>provided</scope>
+        </dependency>
+    </dependencies>
+</project>
diff --git a/src/main/java/org/apache/sling/discovery/ClusterView.java b/src/main/java/org/apache/sling/discovery/ClusterView.java
new file mode 100644
index 0000000..a12424d
--- /dev/null
+++ b/src/main/java/org/apache/sling/discovery/ClusterView.java
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.discovery;
+
+import java.util.List;
+
+/**
+ * A ClusterView represents the instances of a cluster that are
+ * up and running and that all can see each other at a certain point in time.
+ * <p>
+ * A ClusterView can also consist of just one single instance.
+ */
+public interface ClusterView {
+
+	/**
+	 * Returns an id of this cluster view
+	 * @return an id of this cluster view
+	 */
+    String getId();
+
+    /**
+     * Provides the list of InstanceDescriptions ordered by Sling Id.
+     * @return the list of InstanceDescriptions ordered by Sling Id
+     */
+    List<InstanceDescription> getInstances();
+
+	/**
+	 * Provides the InstanceDescription belonging to the leader instance.
+	 * <p>
+	 * Every ClusterView is guaranteed to have one and only one leader.
+	 * @return the InstanceDescription belonging to the leader instance
+	 */
+    InstanceDescription getLeader();
+}
diff --git a/src/main/java/org/apache/sling/discovery/DiscoveryAware.java b/src/main/java/org/apache/sling/discovery/DiscoveryAware.java
new file mode 100644
index 0000000..01a3da1
--- /dev/null
+++ b/src/main/java/org/apache/sling/discovery/DiscoveryAware.java
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.discovery;
+
+/**
+ * The <code>DiscoveryAware</code> service interface may be implemented by
+ * components interested in being made aware of the cluster state or changes
+ * thereof.
+ * <p>
+ * Upon registration and whenever changes in the topology occur, this
+ * service is informed.
+ */
+public interface DiscoveryAware {
+
+	/**
+	 * Inform the service about an event in the topology - or in the discovery
+	 * of the topology.
+	 * <p>
+	 * The <code>TopologyEvent</code> contains details about what changed.
+	 * The supported event types are:
+	 * <ul>
+	 *  <li><code>TOPOLOGY_INIT</code> sent when the <code>DiscoveryAware</code>
+	 *  was first bound to the discovery service - represents the initial state
+	 *  of the topology at that time.</li>
+	 *  <li><code>TOPOLOGY_CHANGING</code> sent when the discovery service
+	 *  discovered a change in the topology and has started to settle the change.
+	 *  This event is sent before <code>TOPOLOGY_CHANGED</code> but is optional</li>
+	 *  <li><code>TOPOLOGY_CHANGED</code> sent when the discovery service
+	 *  discovered a change in the topology and has settled it.</li>
+	 *  <li><code>PROPERTIES_CHANGED</code> sent when the one or many properties
+	 *  have changed in an instance in the current topology</li>
+	 * </ul>
+	 * A note on instance restarts: it is currently not a requirement on the
+	 * discovery service to send a TopologyEvent should an instance restart
+	 * occur rapidly (ie within the change detection timeout). A TopologyEvent
+	 * is only sent if the number of instances or any property changes.
+	 * Should there be a requirement to detect a restart in a guaranteed fashion,
+	 * it is always possible to set a particular property (using the PropertyProvider)
+	 * to the instance start time and have others detect a change in that property.
+	 * @param event The topology event
+	 */
+	void handleTopologyEvent(TopologyEvent event);
+
+}
diff --git a/src/main/java/org/apache/sling/discovery/DiscoveryService.java b/src/main/java/org/apache/sling/discovery/DiscoveryService.java
new file mode 100644
index 0000000..e3a4bfd
--- /dev/null
+++ b/src/main/java/org/apache/sling/discovery/DiscoveryService.java
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.discovery;
+
+/**
+ * The discovery service can be used to get the current topology view.
+ * <p>
+ * The discovery service is in charge of managing live instances that
+ * have announced themselves as being part of a topology view. The exact
+ * details of how this announcement occurs is implementation dependent.
+ */
+public interface DiscoveryService {
+
+	/**
+	 * Returns the topology that was last discovered by this service.
+	 * <p>
+	 * If for some reason the service is currently not able to do topology discovery
+	 * it will return the last valid topology marked with <code>false</code> in the call
+	 * to <codeTopologyView.isCurrent()</code>. This is also true if the service
+	 * has noticed a potential change in the topology and is in the process of
+	 * settling the change in the topology (eg with peers, ie voting).
+	 * <p>
+	 * Note that this call is synchronized with <code>DiscoveryAware.handleTopologyEvent()</code>
+	 * calls: ie if calls to <code>DiscoveryAware.handleTopologyEvent()</code> are currently
+	 * ongoing, then the call to this method will block until all <code>DiscoveryAware</code>s
+	 * have been called. Be careful not to cause deadlock situations.
+	 * <p>
+	 * @return the topology that was last discovered by this service. This will never
+	 * be null (ie even if a change in the topology is ongoing at the moment or the
+	 * cluster consists only of the own instance).
+	 */
+    TopologyView getTopology();
+
+}
diff --git a/src/main/java/org/apache/sling/discovery/InstanceDescription.java b/src/main/java/org/apache/sling/discovery/InstanceDescription.java
new file mode 100644
index 0000000..55e941f
--- /dev/null
+++ b/src/main/java/org/apache/sling/discovery/InstanceDescription.java
@@ -0,0 +1,85 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.discovery;
+
+import java.util.Map;
+
+/**
+ * An InstanceDescription represents and contains information about an
+ * instance that is part of a TopologyView.
+ * <p>
+ * Note that all methods are idempotent - they always return the same values
+ * on subsequent calls. Rather, on any change new InstanceDescriptions are created.
+ * @see TopologyView
+ */
+public interface InstanceDescription {
+
+	/**
+	 * Returns the ClusterView of which this instance is part of.
+	 * <p>
+	 * Every instance is part of a ClusterView even if it is standalone.
+	 * @return the ClusterView
+	 */
+    ClusterView getClusterView();
+
+	/**
+	 * If an instance is part of a cluster, it can potentially be a leader of that cluster -
+	 * this information is queried here.
+	 * <p>
+	 * If an instance is not part of a cluster, this method returns true.
+	 * <p>
+	 * Only one instance of a cluster is guaranteed to be the leader at any time.
+	 * This guarantee is provided by this service.
+	 * If the leader goes down, the service elects a new leader and announces it to
+	 * DiscoveryAware listeners.
+	 * @return true if this instance is the - only -  leader in this cluster,
+	 * false if it is one of the slaves, or true if it is not at all part of a cluster
+	 */
+	boolean isLeader();
+
+	/**
+	 * Determines whether this InstanceDescription is representing myself, ie my own instance.
+	 * @return whether this InstanceDescription is representing myself, ie my own instance
+	 */
+	boolean isOwn();
+
+    /**
+     * The identifier of the running Sling instance.
+     */
+    String getSlingId();
+
+    /**
+     * Returns the value of a particular property.
+     * <p>
+     * Note that there are no hard guarantees or requirements as to how quickly
+     * a property is available once it is set on a distant instance.
+     * @param name The property name
+     * @return The value of the property or <code>null</code>
+     * @see DiscoveryService#setProperty(String, String)
+     */
+    String getProperty(final String name);
+
+    /**
+     * Returns a Map containing all properties of this instance.
+     * This method always returns a map, it might be empty. The returned map
+     * is not modifiable.
+     * @return a Map containing all properties of this instance
+     */
+    Map<String,String> getProperties();
+}
diff --git a/src/main/java/org/apache/sling/discovery/InstanceFilter.java b/src/main/java/org/apache/sling/discovery/InstanceFilter.java
new file mode 100644
index 0000000..a6e5a51
--- /dev/null
+++ b/src/main/java/org/apache/sling/discovery/InstanceFilter.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.discovery;
+
+/**
+ * Used to filter InstanceDescriptions in a TopologyView.
+ * <p>
+ * @see DiscoveryService#findInstances(InstanceFilter)
+ */
+public interface InstanceFilter {
+
+	/**
+	 * Returns true if this InstanceFilter selects the given InstanceDescription.
+	 * <p>
+	 * @param instance the InstanceDescription for which to decide if this
+	 * InstanceFilter accepts it or not.
+	 * @return true if this InstanceFilter selects the given InstanceDescription
+	 */
+	boolean accept(InstanceDescription instance);
+
+}
diff --git a/src/main/java/org/apache/sling/discovery/PropertyProvider.java b/src/main/java/org/apache/sling/discovery/PropertyProvider.java
new file mode 100644
index 0000000..31b4ed3
--- /dev/null
+++ b/src/main/java/org/apache/sling/discovery/PropertyProvider.java
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.discovery;
+
+
+/**
+ * The <code>PropertyProvider</code> service interface may be implemented by
+ * components that wish to define properties on the local instance which then
+ * are broadcast to the <code>TopologyView</code> instances.
+ * <p>
+ * The provided properties are registered with the {@link #PROPERTY_PROPERTIES}
+ * service property.
+ * If the set of provided properties changes or one of the provided values
+ * change, the service registration of the provider should be updated.
+ * This avoids periodic polling for changes.
+ */
+public interface PropertyProvider {
+
+    /**
+     * The name of the service registration property containing the names
+     * of the properties provided by this provider.
+     * The value is either a string or an array of strings.
+     * A property name must only contain alphanumeric characters plus <code>.</code>,
+     * <code>_</code>, <code>-</code>.
+     */
+    String PROPERTY_PROPERTIES = "instance.properties";
+
+	/**
+	 * Retrieves a property that is subsequently set on the local instance
+	 * and broadcast to the <code>TopologyView</code> instances.
+	 * <p>
+	 * These properties are non-persistent and disappear after my own instance goes down.
+	 * @return The value of the property or <code>null</code>
+	 */
+	String getProperty(final String name);
+}
diff --git a/src/main/java/org/apache/sling/discovery/TopologyEvent.java b/src/main/java/org/apache/sling/discovery/TopologyEvent.java
new file mode 100644
index 0000000..5f1568f
--- /dev/null
+++ b/src/main/java/org/apache/sling/discovery/TopologyEvent.java
@@ -0,0 +1,115 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.discovery;
+
+/**
+ * A topology event is sent whenever a change in the topology occurs.
+ *
+ * This event object might be extended in the future with new event types
+ * and methods.
+ * @see DiscoveryAware
+ */
+public class TopologyEvent {
+
+	public static enum Type {
+		TOPOLOGY_INIT,      // Inform the service about the initial topology state
+		TOPOLOGY_CHANGING,  // Inform the service about the fact that a state change was detected
+		                    // in the cluster topology and that a voting amongst the members about
+		                    // a new, valid view has just started.
+		                    // Note that implementations might not support this event at all.
+		TOPOLOGY_CHANGED,   // Inform the service about a state change in the cluster topology.
+		PROPERTIES_CHANGED  // one or many properties have been changed on an instance which is part
+		                    // of the topology
+    }
+
+	private final Type type;
+	private final TopologyView oldView;
+	private final TopologyView newView;
+
+	public TopologyEvent(final Type type, final TopologyView oldView, final TopologyView newView) {
+		if (type==null) {
+			throw new IllegalArgumentException("type must not be null");
+		}
+
+		if (type==Type.TOPOLOGY_INIT) {
+			// then oldView is null
+			if (oldView!=null) {
+				throw new IllegalArgumentException("oldView must be null");
+			}
+			// and newView must be not null
+			if (newView==null) {
+				throw new IllegalArgumentException("newView must not be null");
+			}
+		} else if (type==Type.TOPOLOGY_CHANGING) {
+			// then newView is null
+			if (newView!=null) {
+				throw new IllegalArgumentException("newView must be null");
+			}
+			// and oldView must not be null
+			if (oldView==null) {
+				throw new IllegalArgumentException("oldView must not be null");
+			}
+		} else {
+			// in all other cases both oldView and newView must not be null
+			if (oldView==null) {
+				throw new IllegalArgumentException("oldView must not be null");
+			}
+			if (newView==null) {
+				throw new IllegalArgumentException("newView must not be null");
+			}
+		}
+		this.type = type;
+		this.oldView = oldView;
+		this.newView = newView;
+	}
+
+	/**
+	 * Returns the type of this event
+	 * @return the type of this event
+	 */
+	public Type getType() {
+		return type;
+	}
+
+	/**
+	 * Returns the view which was valid up until now.
+	 * <p>
+	 * This is null in case of <code>TOPOLOGY_INIT</code>
+	 * @return the view which was valid up until now, or null in case of a fresh instance start
+	 */
+	public TopologyView getOldView() {
+		return oldView;
+	}
+
+	/**
+	 * Returns the view which is currently (i.e. newly) valid.
+	 * <p>
+	 * This is null in case of <code>TOPOLOGY_CHANGING</code>
+	 * @return the view which is currently valid, or null in case of <code>TOPOLOGY_CHANGING</code>
+	 */
+	public TopologyView getNewView() {
+		return newView;
+	}
+
+    @Override
+    public String toString() {
+        return "TopologyEvent [type=" + type + ", oldView=" + oldView
+                + ", newView=" + newView + "]";
+    }
+}
diff --git a/src/main/java/org/apache/sling/discovery/TopologyView.java b/src/main/java/org/apache/sling/discovery/TopologyView.java
new file mode 100644
index 0000000..0e8f1aa
--- /dev/null
+++ b/src/main/java/org/apache/sling/discovery/TopologyView.java
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.discovery;
+
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * A topology view is a cross-cluster list of instances and clusters
+ * that have announced themselves with the DiscoveryService.
+ *
+ */
+public interface TopologyView {
+
+	/**
+	 * Checks if this TopologyView is currently valid - or if the
+	 * service knows of a topology change just going on (or another
+	 * uncertainty about the topology such as IOException etc)
+	 * @return true if this TopologyView is currently valid, false
+	 * if the service knows of a topology change just going on (or
+	 * another issue with discovery like IOException etc)
+	 */
+	boolean isCurrent();
+
+	/**
+	 * Provides the InstanceDescription belonging to *this* instance.
+	 * @return the InstanceDescription belonging to *this* instance
+	 */
+	InstanceDescription getOwnInstance();
+
+    /**
+     * Provides the list of InstanceDescriptions ordered by Sling Id.
+     * @return the list of InstanceDescriptions ordered by Sling Id or null if there are no instances
+     */
+	List<InstanceDescription> getInstances();
+
+	/**
+	 * Search the current topology for instances which the provided InstancePicker has accepted.
+	 * @param filter the filter to use
+	 * @return the list of InstanceDescriptions which were accepted by the InstanceFilter
+	 */
+	List<InstanceDescription> findInstances(InstanceFilter filter);
+
+    /**
+     * Provides the collection of ClusterViews.
+     * <p>
+     * Note that all InstanceDescriptions belong to a ClusterView, even if 
+     * they are only a "cluster of 1" (ie not really a cluster).
+     * @return the collection of ClusterViews
+     */
+	Collection<ClusterView> getClusterViews();
+}
diff --git a/src/main/java/org/apache/sling/discovery/impl/NoClusterDiscoveryService.java b/src/main/java/org/apache/sling/discovery/impl/NoClusterDiscoveryService.java
new file mode 100644
index 0000000..8f6fd55
--- /dev/null
+++ b/src/main/java/org/apache/sling/discovery/impl/NoClusterDiscoveryService.java
@@ -0,0 +1,389 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.discovery.impl;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.felix.scr.annotations.Activate;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.ConfigurationPolicy;
+import org.apache.felix.scr.annotations.Deactivate;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.ReferenceCardinality;
+import org.apache.felix.scr.annotations.ReferencePolicy;
+import org.apache.felix.scr.annotations.Service;
+import org.apache.sling.discovery.ClusterView;
+import org.apache.sling.discovery.DiscoveryAware;
+import org.apache.sling.discovery.DiscoveryService;
+import org.apache.sling.discovery.InstanceDescription;
+import org.apache.sling.discovery.InstanceFilter;
+import org.apache.sling.discovery.PropertyProvider;
+import org.apache.sling.discovery.TopologyEvent;
+import org.apache.sling.discovery.TopologyEvent.Type;
+import org.apache.sling.discovery.TopologyView;
+import org.apache.sling.settings.SlingSettingsService;
+import org.osgi.framework.Constants;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * This is a simple implementation of the cluster service
+ * which can be used for a cluster less installation.
+ */
+@Component(policy = ConfigurationPolicy.REQUIRE, immediate=true)
+@Service(value = {DiscoveryService.class})
+public class NoClusterDiscoveryService implements DiscoveryService {
+
+    /** The logger. */
+    private final Logger logger = LoggerFactory.getLogger(this.getClass());
+
+    /**
+     * Sling settings service to get the Sling ID and run modes.
+     */
+    @Reference
+    private SlingSettingsService settingsService;
+
+    /**
+     * All cluster aware instances.
+     */
+    @Reference(cardinality = ReferenceCardinality.OPTIONAL_MULTIPLE, policy = ReferencePolicy.DYNAMIC)
+    private DiscoveryAware[] clusterAwares = new DiscoveryAware[0];
+
+    /**
+     * All property providers.
+     */
+    @Reference(cardinality = ReferenceCardinality.OPTIONAL_MULTIPLE, policy = ReferencePolicy.DYNAMIC,
+               referenceInterface=PropertyProvider.class, updated="updatedPropertyProvider")
+    private List<ProviderInfo> providerInfos = new ArrayList<ProviderInfo>();
+
+    /**
+     * Special lock object to sync data structure access
+     */
+    private final Object lock = new Object();
+
+    /**
+     * The current topology view.
+     */
+    private TopologyView topologyView;
+
+    private Map<String, String> cachedProperties = new HashMap<String, String>();
+
+    /**
+     * Activate this service
+     * Create a new description.
+     */
+    @Activate
+    protected void activate() {
+        logger.debug("NoClusterDiscoveryService started.");
+        final InstanceDescription myDescription = new InstanceDescription() {
+
+            public boolean isOwn() {
+                return true;
+            }
+
+            public boolean isLeader() {
+                return true;
+            }
+
+            public String getSlingId() {
+                return settingsService.getSlingId();
+            }
+
+            public String getProperty(final String name) {
+            	synchronized(lock) {
+            		return cachedProperties.get(name);
+            	}
+            }
+
+			public Map<String, String> getProperties() {
+				synchronized(lock) {
+					return Collections.unmodifiableMap(cachedProperties);
+				}
+			}
+
+			public ClusterView getClusterView() {
+				final Collection<ClusterView> clusters = topologyView.getClusterViews();
+				if (clusters==null || clusters.size()==0) {
+					return null;
+				}
+				return clusters.iterator().next();
+			}
+        };
+        final List<InstanceDescription> instances = new ArrayList<InstanceDescription>();
+        instances.add(myDescription);
+
+        final DiscoveryAware[] registeredServices;
+		synchronized ( lock ) {
+            registeredServices = this.clusterAwares;
+            final ClusterView clusterView = new ClusterView() {
+
+                public InstanceDescription getLeader() {
+                    return myDescription;
+                }
+
+                public List<InstanceDescription> getInstances() {
+                    return instances;
+                }
+
+				public String getId() {
+					return "0";
+				}
+            };
+            this.topologyView = new TopologyView() {
+
+    			public InstanceDescription getOwnInstance() {
+    				return myDescription;
+    			}
+
+    			public boolean isCurrent() {
+    				return true;
+    			}
+
+    			public List<InstanceDescription> getInstances() {
+    				return instances;
+    			}
+
+    			public List<InstanceDescription> findInstances(InstanceFilter picker) {
+    				List<InstanceDescription> result = new LinkedList<InstanceDescription>();
+    				for (Iterator<InstanceDescription> it = getTopology().getInstances().iterator(); it.hasNext();) {
+    					InstanceDescription instance = it.next();
+    					if (picker.accept(instance)) {
+    						result.add(instance);
+    					}
+    				}
+    				return result;
+    			}
+
+    			public List<ClusterView> getClusterViews() {
+    				LinkedList<ClusterView> clusters = new LinkedList<ClusterView>();
+    				clusters.add(clusterView);
+    				return clusters;
+    			}
+
+    		};
+        }
+        for(final DiscoveryAware da: registeredServices) {
+        	da.handleTopologyEvent(new TopologyEvent(Type.TOPOLOGY_INIT, null, topologyView));
+        }
+    }
+
+    /**
+     * Deactivate this service.
+     */
+    @Deactivate
+    protected void deactivate() {
+        logger.debug("NoClusterDiscoveryService stopped.");
+        this.topologyView = null;
+    }
+
+    /**
+     * Bind a new property provider.
+     */
+    @SuppressWarnings("unused")
+	private void bindPropertyProvider(final PropertyProvider propertyProvider, final Map<String, Object> props) {
+    	logger.debug("bindPropertyProvider: Binding PropertyProvider {}", propertyProvider);
+
+        final DiscoveryAware[] awares;
+        synchronized (lock) {
+            final ProviderInfo info = new ProviderInfo(propertyProvider, props);
+            this.providerInfos.add(info);
+            Collections.sort(this.providerInfos);
+            this.updatePropertiesCache();
+            if ( this.topologyView == null ) {
+                awares = null;
+            } else {
+                awares = this.clusterAwares;
+            }
+        }
+        if ( awares != null ) {
+            for(final DiscoveryAware da : awares) {
+                da.handleTopologyEvent(new TopologyEvent(Type.PROPERTIES_CHANGED, this.topologyView, this.topologyView));
+            }
+        }
+    }
+
+    /**
+     * Update a property provider.
+     */
+    @SuppressWarnings("unused")
+    private void updatedPropertyProvider(final PropertyProvider propertyProvider, final Map<String, Object> props) {
+        logger.debug("bindPropertyProvider: Updating PropertyProvider {}", propertyProvider);
+
+        this.unbindPropertyProvider(propertyProvider, props, false);
+        this.bindPropertyProvider(propertyProvider, props);
+    }
+
+    /**
+     * Unbind a property provider
+     */
+    @SuppressWarnings("unused")
+	private void unbindPropertyProvider(final PropertyProvider propertyProvider, final Map<String, Object> props) {
+        this.unbindPropertyProvider(propertyProvider, props, true);
+    }
+
+    /**
+     * Unbind a property provider
+     */
+    @SuppressWarnings("unused")
+    private void unbindPropertyProvider(final PropertyProvider propertyProvider,
+            final Map<String, Object> props,
+            final boolean inform) {
+    	logger.debug("unbindPropertyProvider: Releasing PropertyProvider {}", propertyProvider);
+
+    	final DiscoveryAware[] awares;
+        synchronized (lock) {
+            final ProviderInfo info = new ProviderInfo(propertyProvider, props);
+            this.providerInfos.remove(info);
+            this.updatePropertiesCache();
+            if ( this.topologyView == null ) {
+                awares = null;
+            } else {
+                awares = this.clusterAwares;
+            }
+        }
+        if ( inform && awares != null ) {
+            for(final DiscoveryAware da : awares) {
+                da.handleTopologyEvent(new TopologyEvent(Type.PROPERTIES_CHANGED, this.topologyView, this.topologyView));
+            }
+        }
+    }
+
+    private void updatePropertiesCache() {
+        final Map<String, String> newProps = new HashMap<String, String>();
+        for(final ProviderInfo info : this.providerInfos) {
+            newProps.putAll(info.properties);
+        }
+        this.cachedProperties = newProps;
+        if ( this.logger.isDebugEnabled() ) {
+            this.logger.debug("New properties: {}", this.cachedProperties);
+        }
+    }
+
+    @SuppressWarnings("unused")
+    private void bindDiscoveryAware(final DiscoveryAware clusterAware) {
+
+        logger.debug("bindDiscoveryAware: Binding DiscoveryAware {}", clusterAware);
+
+        boolean inform = true;
+        synchronized (lock) {
+            List<DiscoveryAware> currentList = new ArrayList<DiscoveryAware>(
+                Arrays.asList(clusterAwares));
+            currentList.add(clusterAware);
+            this.clusterAwares = currentList.toArray(new DiscoveryAware[currentList.size()]);
+            if ( this.topologyView == null ) {
+                inform = false;
+            }
+        }
+
+        if ( inform ) {
+        	clusterAware.handleTopologyEvent(new TopologyEvent(Type.TOPOLOGY_INIT, null, topologyView));
+        }
+    }
+
+    @SuppressWarnings("unused")
+    private void unbindDiscoveryAware(final DiscoveryAware clusterAware) {
+
+        logger.debug("unbindDiscoveryAware: Releasing DiscoveryAware {}", clusterAware);
+
+        synchronized (lock) {
+            List<DiscoveryAware> currentList = new ArrayList<DiscoveryAware>(
+                Arrays.asList(clusterAwares));
+            currentList.remove(clusterAware);
+            this.clusterAwares = currentList.toArray(new DiscoveryAware[currentList.size()]);
+        }
+    }
+
+    /**
+     * @see DiscoveryService#getTopology()
+     */
+    public TopologyView getTopology() {
+    	return topologyView;
+    }
+
+    /**
+     * Internal class caching some provider infos like service id and ranking.
+     */
+    private final static class ProviderInfo implements Comparable<ProviderInfo> {
+
+        public final PropertyProvider provider;
+        public final int ranking;
+        public final long serviceId;
+        public final Map<String, String> properties = new HashMap<String, String>();
+
+        public ProviderInfo(final PropertyProvider provider, final Map<String, Object> serviceProps) {
+            this.provider = provider;
+            final Object sr = serviceProps.get(Constants.SERVICE_RANKING);
+            if ( sr == null || !(sr instanceof Integer)) {
+                this.ranking = 0;
+            } else {
+                this.ranking = (Integer)sr;
+            }
+            this.serviceId = (Long)serviceProps.get(Constants.SERVICE_ID);
+            final Object namesObj = serviceProps.get(PropertyProvider.PROPERTY_PROPERTIES);
+            if ( namesObj instanceof String ) {
+                final String val = provider.getProperty((String)namesObj);
+                if ( val != null ) {
+                    this.properties.put((String)namesObj, val);
+                }
+            } else if ( namesObj instanceof String[] ) {
+                for(final String name : (String[])namesObj ) {
+                    final String val = provider.getProperty(name);
+                    if ( val != null ) {
+                        this.properties.put(name, val);
+                    }
+                }
+            }
+        }
+
+        /**
+         * @see java.lang.Comparable#compareTo(java.lang.Object)
+         */
+        public int compareTo(final ProviderInfo o) {
+            // Sort by rank in ascending order.
+            if ( this.ranking < o.ranking ) {
+                return -1; // lower rank
+            } else if (this.ranking > o.ranking ) {
+                return 1; // higher rank
+            }
+            // If ranks are equal, then sort by service id in descending order.
+            return (this.serviceId < o.serviceId) ? 1 : -1;
+        }
+
+        @Override
+        public boolean equals(final Object obj) {
+            if ( obj instanceof ProviderInfo ) {
+                return ((ProviderInfo)obj).serviceId == this.serviceId;
+            }
+            return false;
+        }
+
+        @Override
+        public int hashCode() {
+            return provider.hashCode();
+        }
+    }
+}
diff --git a/src/main/java/org/apache/sling/discovery/package-info.java b/src/main/java/org/apache/sling/discovery/package-info.java
new file mode 100644
index 0000000..387bb0f
--- /dev/null
+++ b/src/main/java/org/apache/sling/discovery/package-info.java
@@ -0,0 +1,30 @@
+/*
+ * 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.
+ */
+
+/**
+ * Provides a service to interface which may be implemented by applications
+ * to get notified on cluster topology changes.
+ *
+ * @version 1.0
+ */
+@Version("1.0")
+package org.apache.sling.discovery;
+
+import aQute.bnd.annotation.Version;
+

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-discovery-api] 02/29: Move discovery api to a different directory to create a structure as discovery consists of several modules

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.api-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-api.git

commit f33adec3aa84aa0c24d26162acf91f474189613a
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Fri Apr 12 08:53:18 2013 +0000

    Move discovery api to a different directory to create a structure as discovery consists of several modules
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/discovery-api@1467213 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/pom.xml b/pom.xml
index 0c33c6a..a836cdb 100644
--- a/pom.xml
+++ b/pom.xml
@@ -36,6 +36,12 @@
         Support for topology discovery of instances.
     </description>
 
+    <scm>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/discovery/api</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/discovery/api</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/discovery/api</url>
+    </scm>
+
     <build>
         <plugins>
             <plugin>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-discovery-api] 14/29: Move discovery to bundles section

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.api-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-api.git

commit 5a71c8a17360afa2b81317319057af7abc72eb94
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Sun May 5 10:35:09 2013 +0000

    Move discovery to bundles section
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/api@1479281 13f79535-47bb-0310-9956-ffa450edef68

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-discovery-api] 11/29: SLING-2827 : javadoc of Type clarified - plus a source code reformat

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.api-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-api.git

commit 57d974d5635cbd70e97681083064b65abffbf09a
Author: Stefan Egli <st...@apache.org>
AuthorDate: Tue Apr 23 09:37:15 2013 +0000

    SLING-2827 : javadoc of Type clarified - plus a source code reformat
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/discovery/api@1470861 13f79535-47bb-0310-9956-ffa450edef68
---
 .../org/apache/sling/discovery/TopologyEvent.java  | 194 +++++++++++++--------
 1 file changed, 119 insertions(+), 75 deletions(-)

diff --git a/src/main/java/org/apache/sling/discovery/TopologyEvent.java b/src/main/java/org/apache/sling/discovery/TopologyEvent.java
index fb9bcdd..6b515bd 100644
--- a/src/main/java/org/apache/sling/discovery/TopologyEvent.java
+++ b/src/main/java/org/apache/sling/discovery/TopologyEvent.java
@@ -20,92 +20,136 @@ package org.apache.sling.discovery;
 
 /**
  * A topology event is sent whenever a change in the topology occurs.
- *
- * This event object might be extended in the future with new event types
- * and methods.
+ * 
+ * This event object might be extended in the future with new event types and
+ * methods.
+ * 
  * @see TopologyEventListener
  */
 public class TopologyEvent {
 
-	public static enum Type {
-		TOPOLOGY_INIT,      // Inform the service about the initial topology state
-		TOPOLOGY_CHANGING,  // Inform the service about the fact that a state change was detected
-		                    // in the cluster topology and that a voting amongst the members about
-		                    // a new, valid view has just started.
-		                    // Note that implementations might not support this event at all.
-		TOPOLOGY_CHANGED,   // Inform the service about a state change in the cluster topology.
-		PROPERTIES_CHANGED  // one or many properties have been changed on an instance which is part
-		                    // of the topology
+    public static enum Type {
+        /**
+         * Inform the service about the initial topology state and is only sent
+         * once at bind-time.
+         * <p>
+         * This event type will be the first one a TopologyEventListener
+         * receives.
+         */
+        TOPOLOGY_INIT,
+
+        /**
+         * Inform the service about the fact that a state change was detected in
+         * the topology/cluster and that a voting amongst the members about a
+         * new, valid topology/cluster view has just started.
+         * <p>
+         * An implementation must always send a TOPOLOGY_CHANGING before a
+         * TOPOLOGY_CHANGED.
+         */
+        TOPOLOGY_CHANGING,
+
+        /**
+         * Inform the service about a state change in the topology.
+         * <p>
+         * A state change includes:
+         * <ul>
+         * <li>A joining or leaving instance</li>
+         * <li>A restart of an instance - or more precisely: when the
+         * corresponding implementation bundle is deactivated/activated</li>
+         * <li>A cluster structure changed: either its members or the cluster
+         * view id. The cluster view id changes when an instance joins, leaves
+         * or was restarted (the bundle deactivated/activated)</li>
+         * </ul>
+         * <p>
+         * Note that tha TOPOLOGY_CHANGED can also include changes in the
+         * properties!
+         */
+        TOPOLOGY_CHANGED,
+
+        /**
+         * One or many properties have been changed on an instance which is part
+         * of the topology.
+         * <p>
+         * This event is sent when otherwise the topology remains identical.
+         */
+        PROPERTIES_CHANGED
+
     }
 
-	private final Type type;
-	private final TopologyView oldView;
-	private final TopologyView newView;
+    private final Type type;
+    private final TopologyView oldView;
+    private final TopologyView newView;
 
-	public TopologyEvent(final Type type, final TopologyView oldView, final TopologyView newView) {
-		if (type==null) {
-			throw new IllegalArgumentException("type must not be null");
-		}
+    public TopologyEvent(final Type type, final TopologyView oldView,
+            final TopologyView newView) {
+        if (type == null) {
+            throw new IllegalArgumentException("type must not be null");
+        }
 
-		if (type==Type.TOPOLOGY_INIT) {
-			// then oldView is null
-			if (oldView!=null) {
-				throw new IllegalArgumentException("oldView must be null");
-			}
-			// and newView must be not null
-			if (newView==null) {
-				throw new IllegalArgumentException("newView must not be null");
-			}
-		} else if (type==Type.TOPOLOGY_CHANGING) {
-			// then newView is null
-			if (newView!=null) {
-				throw new IllegalArgumentException("newView must be null");
-			}
-			// and oldView must not be null
-			if (oldView==null) {
-				throw new IllegalArgumentException("oldView must not be null");
-			}
-		} else {
-			// in all other cases both oldView and newView must not be null
-			if (oldView==null) {
-				throw new IllegalArgumentException("oldView must not be null");
-			}
-			if (newView==null) {
-				throw new IllegalArgumentException("newView must not be null");
-			}
-		}
-		this.type = type;
-		this.oldView = oldView;
-		this.newView = newView;
-	}
+        if (type == Type.TOPOLOGY_INIT) {
+            // then oldView is null
+            if (oldView != null) {
+                throw new IllegalArgumentException("oldView must be null");
+            }
+            // and newView must be not null
+            if (newView == null) {
+                throw new IllegalArgumentException("newView must not be null");
+            }
+        } else if (type == Type.TOPOLOGY_CHANGING) {
+            // then newView is null
+            if (newView != null) {
+                throw new IllegalArgumentException("newView must be null");
+            }
+            // and oldView must not be null
+            if (oldView == null) {
+                throw new IllegalArgumentException("oldView must not be null");
+            }
+        } else {
+            // in all other cases both oldView and newView must not be null
+            if (oldView == null) {
+                throw new IllegalArgumentException("oldView must not be null");
+            }
+            if (newView == null) {
+                throw new IllegalArgumentException("newView must not be null");
+            }
+        }
+        this.type = type;
+        this.oldView = oldView;
+        this.newView = newView;
+    }
 
-	/**
-	 * Returns the type of this event
-	 * @return the type of this event
-	 */
-	public Type getType() {
-		return type;
-	}
+    /**
+     * Returns the type of this event
+     * 
+     * @return the type of this event
+     */
+    public Type getType() {
+        return type;
+    }
 
-	/**
-	 * Returns the view which was valid up until now.
-	 * <p>
-	 * This is null in case of <code>TOPOLOGY_INIT</code>
-	 * @return the view which was valid up until now, or null in case of a fresh instance start
-	 */
-	public TopologyView getOldView() {
-		return oldView;
-	}
+    /**
+     * Returns the view which was valid up until now.
+     * <p>
+     * This is null in case of <code>TOPOLOGY_INIT</code>
+     * 
+     * @return the view which was valid up until now, or null in case of a fresh
+     *         instance start
+     */
+    public TopologyView getOldView() {
+        return oldView;
+    }
 
-	/**
-	 * Returns the view which is currently (i.e. newly) valid.
-	 * <p>
-	 * This is null in case of <code>TOPOLOGY_CHANGING</code>
-	 * @return the view which is currently valid, or null in case of <code>TOPOLOGY_CHANGING</code>
-	 */
-	public TopologyView getNewView() {
-		return newView;
-	}
+    /**
+     * Returns the view which is currently (i.e. newly) valid.
+     * <p>
+     * This is null in case of <code>TOPOLOGY_CHANGING</code>
+     * 
+     * @return the view which is currently valid, or null in case of
+     *         <code>TOPOLOGY_CHANGING</code>
+     */
+    public TopologyView getNewView() {
+        return newView;
+    }
 
     @Override
     public String toString() {

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-discovery-api] 09/29: Rename "own" to "local"

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.api-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-api.git

commit dec2c41f714d6682a884b5ff4477a5efc581f394
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Wed Apr 17 13:29:05 2013 +0000

    Rename "own" to "local"
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/discovery/api@1468904 13f79535-47bb-0310-9956-ffa450edef68
---
 src/main/java/org/apache/sling/discovery/DiscoveryService.java      | 2 +-
 src/main/java/org/apache/sling/discovery/InstanceDescription.java   | 6 +++---
 src/main/java/org/apache/sling/discovery/PropertyProvider.java      | 2 +-
 src/main/java/org/apache/sling/discovery/TopologyView.java          | 6 ++----
 .../org/apache/sling/discovery/impl/NoClusterDiscoveryService.java  | 4 ++--
 5 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/src/main/java/org/apache/sling/discovery/DiscoveryService.java b/src/main/java/org/apache/sling/discovery/DiscoveryService.java
index e3a4bfd..6e655d0 100644
--- a/src/main/java/org/apache/sling/discovery/DiscoveryService.java
+++ b/src/main/java/org/apache/sling/discovery/DiscoveryService.java
@@ -43,7 +43,7 @@ public interface DiscoveryService {
 	 * <p>
 	 * @return the topology that was last discovered by this service. This will never
 	 * be null (ie even if a change in the topology is ongoing at the moment or the
-	 * cluster consists only of the own instance).
+	 * cluster consists only of the local instance).
 	 */
     TopologyView getTopology();
 
diff --git a/src/main/java/org/apache/sling/discovery/InstanceDescription.java b/src/main/java/org/apache/sling/discovery/InstanceDescription.java
index f3ce846..4e471f2 100644
--- a/src/main/java/org/apache/sling/discovery/InstanceDescription.java
+++ b/src/main/java/org/apache/sling/discovery/InstanceDescription.java
@@ -75,10 +75,10 @@ public interface InstanceDescription {
 	boolean isLeader();
 
 	/**
-	 * Determines whether this InstanceDescription is representing myself, ie my own instance.
-	 * @return whether this InstanceDescription is representing myself, ie my own instance
+	 * Determines whether this InstanceDescription is representing the local instance.
+	 * @return whether this InstanceDescription is representing the local instance.
 	 */
-	boolean isOwn();
+	boolean isLocal();
 
     /**
      * The identifier of the running Sling instance.
diff --git a/src/main/java/org/apache/sling/discovery/PropertyProvider.java b/src/main/java/org/apache/sling/discovery/PropertyProvider.java
index 6e7aa8e..2fa21f8 100644
--- a/src/main/java/org/apache/sling/discovery/PropertyProvider.java
+++ b/src/main/java/org/apache/sling/discovery/PropertyProvider.java
@@ -45,7 +45,7 @@ public interface PropertyProvider {
 	 * Retrieves a property that is subsequently set on the local instance
 	 * and broadcast to the <code>TopologyView</code> instances.
 	 * <p>
-	 * These properties are non-persistent and disappear after my own instance goes down.
+	 * These properties are non-persistent and disappear after the local instance goes down.
 	 *
 	 * @return The value of the property or <code>null</code>. If the property
 	 *         value can't be provided or if the provider does not support this
diff --git a/src/main/java/org/apache/sling/discovery/TopologyView.java b/src/main/java/org/apache/sling/discovery/TopologyView.java
index 8b95f79..cc143ce 100644
--- a/src/main/java/org/apache/sling/discovery/TopologyView.java
+++ b/src/main/java/org/apache/sling/discovery/TopologyView.java
@@ -18,8 +18,6 @@
  */
 package org.apache.sling.discovery;
 
-import java.util.Collection;
-import java.util.List;
 import java.util.Set;
 
 /**
@@ -43,7 +41,7 @@ public interface TopologyView {
 	 * Provides the InstanceDescription belonging to <b>this</b> instance.
 	 * @return the InstanceDescription belonging to <b>this</b> instance
 	 */
-	InstanceDescription getOwnInstance();
+	InstanceDescription getLocalInstance();
 
     /**
      * Provides the set of InstanceDescriptions in the entire topology,
@@ -65,7 +63,7 @@ public interface TopologyView {
     /**
      * Provides the collection of ClusterViews.
      * <p>
-     * Note that all InstanceDescriptions belong to exactly one ClusterView - 
+     * Note that all InstanceDescriptions belong to exactly one ClusterView -
      * including InstanceDescriptions that form "a cluster of 1"
      * @return the set of ClusterViews, without any particular order
      */
diff --git a/src/main/java/org/apache/sling/discovery/impl/NoClusterDiscoveryService.java b/src/main/java/org/apache/sling/discovery/impl/NoClusterDiscoveryService.java
index 555f118..dfb6976 100644
--- a/src/main/java/org/apache/sling/discovery/impl/NoClusterDiscoveryService.java
+++ b/src/main/java/org/apache/sling/discovery/impl/NoClusterDiscoveryService.java
@@ -103,7 +103,7 @@ public class NoClusterDiscoveryService implements DiscoveryService {
         logger.debug("NoClusterDiscoveryService started.");
         final InstanceDescription myDescription = new InstanceDescription() {
 
-            public boolean isOwn() {
+            public boolean isLocal() {
                 return true;
             }
 
@@ -157,7 +157,7 @@ public class NoClusterDiscoveryService implements DiscoveryService {
             };
             this.topologyView = new TopologyView() {
 
-    			public InstanceDescription getOwnInstance() {
+    			public InstanceDescription getLocalInstance() {
     				return myDescription;
     			}
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-discovery-api] 28/29: [maven-release-plugin] prepare release org.apache.sling.discovery.api-1.0.0

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.api-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-api.git

commit 2a04569911e7f1163ac31978a37e65d280034dbf
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue Jul 9 13:07:52 2013 +0000

    [maven-release-plugin] prepare release org.apache.sling.discovery.api-1.0.0
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/api@1501242 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index a6f875e..79bb295 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,7 +29,7 @@
 
     <artifactId>org.apache.sling.discovery.api</artifactId>
     <packaging>bundle</packaging>
-    <version>1.0.1-SNAPSHOT</version>
+    <version>1.0.0</version>
 
     <name>Apache Sling Discovery API</name>
     <description>
@@ -37,9 +37,9 @@
     </description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/api</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/api</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/discovery/api</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.discovery.api-1.0.0</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.discovery.api-1.0.0</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.discovery.api-1.0.0</url>
     </scm>
 
     <build>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-discovery-api] 22/29: Create new standalone module

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.api-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-api.git

commit e1e7e0159c1e3877f614086adbf4dc66317958d1
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue May 14 07:47:45 2013 +0000

    Create new standalone module
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/api@1482239 13f79535-47bb-0310-9956-ffa450edef68
---
 .../discovery/impl/NoClusterDiscoveryService.java  | 392 ---------------------
 .../discovery/impl/StandardPropertyProvider.java   | 219 ------------
 2 files changed, 611 deletions(-)

diff --git a/src/main/java/org/apache/sling/discovery/impl/NoClusterDiscoveryService.java b/src/main/java/org/apache/sling/discovery/impl/NoClusterDiscoveryService.java
deleted file mode 100644
index cfb3c6b..0000000
--- a/src/main/java/org/apache/sling/discovery/impl/NoClusterDiscoveryService.java
+++ /dev/null
@@ -1,392 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.sling.discovery.impl;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.felix.scr.annotations.Activate;
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.ConfigurationPolicy;
-import org.apache.felix.scr.annotations.Deactivate;
-import org.apache.felix.scr.annotations.Reference;
-import org.apache.felix.scr.annotations.ReferenceCardinality;
-import org.apache.felix.scr.annotations.ReferencePolicy;
-import org.apache.felix.scr.annotations.Service;
-import org.apache.sling.discovery.ClusterView;
-import org.apache.sling.discovery.DiscoveryService;
-import org.apache.sling.discovery.InstanceDescription;
-import org.apache.sling.discovery.InstanceFilter;
-import org.apache.sling.discovery.PropertyProvider;
-import org.apache.sling.discovery.TopologyEvent;
-import org.apache.sling.discovery.TopologyEvent.Type;
-import org.apache.sling.discovery.TopologyEventListener;
-import org.apache.sling.discovery.TopologyView;
-import org.apache.sling.settings.SlingSettingsService;
-import org.osgi.framework.Constants;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * This is a simple implementation of the discovery service
- * which can be used for a cluster less installation (= single instance).
- * It is disabled by default and can be enabled through a OSGi configuration.
- */
-@Component(policy = ConfigurationPolicy.REQUIRE, immediate=true)
-@Service(value = {DiscoveryService.class})
-public class NoClusterDiscoveryService implements DiscoveryService {
-
-    /** The logger. */
-    private final Logger logger = LoggerFactory.getLogger(this.getClass());
-
-    /**
-     * Sling settings service to get the Sling ID and run modes.
-     */
-    @Reference
-    private SlingSettingsService settingsService;
-
-    /**
-     * All topology event listeners.
-     */
-    @Reference(cardinality = ReferenceCardinality.OPTIONAL_MULTIPLE, policy = ReferencePolicy.DYNAMIC)
-    private TopologyEventListener[] listeners = new TopologyEventListener[0];
-
-    /**
-     * All property providers.
-     */
-    @Reference(cardinality = ReferenceCardinality.OPTIONAL_MULTIPLE, policy = ReferencePolicy.DYNAMIC,
-               referenceInterface=PropertyProvider.class, updated="updatedPropertyProvider")
-    private List<ProviderInfo> providerInfos = new ArrayList<ProviderInfo>();
-
-    /**
-     * Special lock object to sync data structure access
-     */
-    private final Object lock = new Object();
-
-    /**
-     * The current topology view.
-     */
-    private TopologyView topologyView;
-
-    private Map<String, String> cachedProperties = new HashMap<String, String>();
-
-    /**
-     * Activate this service
-     * Create a new description.
-     */
-    @Activate
-    protected void activate() {
-        logger.debug("NoClusterDiscoveryService started.");
-        final InstanceDescription myDescription = new InstanceDescription() {
-
-            public boolean isLocal() {
-                return true;
-            }
-
-            public boolean isLeader() {
-                return true;
-            }
-
-            public String getSlingId() {
-                return settingsService.getSlingId();
-            }
-
-            public String getProperty(final String name) {
-            	synchronized(lock) {
-            		return cachedProperties.get(name);
-            	}
-            }
-
-			public Map<String, String> getProperties() {
-				synchronized(lock) {
-					return Collections.unmodifiableMap(cachedProperties);
-				}
-			}
-
-			public ClusterView getClusterView() {
-				final Collection<ClusterView> clusters = topologyView.getClusterViews();
-				if (clusters==null || clusters.size()==0) {
-					return null;
-				}
-				return clusters.iterator().next();
-			}
-        };
-        final Set<InstanceDescription> instances = new HashSet<InstanceDescription>();
-        instances.add(myDescription);
-
-        final TopologyEventListener[] registeredServices;
-		synchronized ( lock ) {
-            registeredServices = this.listeners;
-            final ClusterView clusterView = new ClusterView() {
-
-                public InstanceDescription getLeader() {
-                    return myDescription;
-                }
-
-                public List<InstanceDescription> getInstances() {
-                    return new LinkedList<InstanceDescription>(instances);
-                }
-
-				public String getId() {
-					return "0";
-				}
-            };
-            this.topologyView = new TopologyView() {
-
-    			public InstanceDescription getLocalInstance() {
-    				return myDescription;
-    			}
-
-    			public boolean isCurrent() {
-    				return true;
-    			}
-
-    			public Set<InstanceDescription> getInstances() {
-    				return instances;
-    			}
-
-    			public Set<InstanceDescription> findInstances(InstanceFilter picker) {
-    				Set<InstanceDescription> result = new HashSet<InstanceDescription>();
-    				for (Iterator<InstanceDescription> it = getTopology().getInstances().iterator(); it.hasNext();) {
-    					InstanceDescription instance = it.next();
-    					if (picker.accept(instance)) {
-    						result.add(instance);
-    					}
-    				}
-    				return result;
-    			}
-
-    			public Set<ClusterView> getClusterViews() {
-    				Set<ClusterView> clusters = new HashSet<ClusterView>();
-    				clusters.add(clusterView);
-    				return clusters;
-    			}
-
-    		};
-        }
-        for(final TopologyEventListener da: registeredServices) {
-        	da.handleTopologyEvent(new TopologyEvent(Type.TOPOLOGY_INIT, null, topologyView));
-        }
-    }
-
-    /**
-     * Deactivate this service.
-     */
-    @Deactivate
-    protected void deactivate() {
-        logger.debug("NoClusterDiscoveryService stopped.");
-        this.topologyView = null;
-    }
-
-    /**
-     * Bind a new property provider.
-     */
-    @SuppressWarnings("unused")
-	private void bindPropertyProvider(final PropertyProvider propertyProvider, final Map<String, Object> props) {
-    	logger.debug("bindPropertyProvider: Binding PropertyProvider {}", propertyProvider);
-
-        final TopologyEventListener[] awares;
-        synchronized (lock) {
-            final ProviderInfo info = new ProviderInfo(propertyProvider, props);
-            this.providerInfos.add(info);
-            Collections.sort(this.providerInfos);
-            this.updatePropertiesCache();
-            if ( this.topologyView == null ) {
-                awares = null;
-            } else {
-                awares = this.listeners;
-            }
-        }
-        if ( awares != null ) {
-            for(final TopologyEventListener da : awares) {
-                da.handleTopologyEvent(new TopologyEvent(Type.PROPERTIES_CHANGED, this.topologyView, this.topologyView));
-            }
-        }
-    }
-
-    /**
-     * Update a property provider.
-     */
-    @SuppressWarnings("unused")
-    private void updatedPropertyProvider(final PropertyProvider propertyProvider, final Map<String, Object> props) {
-        logger.debug("bindPropertyProvider: Updating PropertyProvider {}", propertyProvider);
-
-        this.unbindPropertyProvider(propertyProvider, props, false);
-        this.bindPropertyProvider(propertyProvider, props);
-    }
-
-    /**
-     * Unbind a property provider
-     */
-    @SuppressWarnings("unused")
-	private void unbindPropertyProvider(final PropertyProvider propertyProvider, final Map<String, Object> props) {
-        this.unbindPropertyProvider(propertyProvider, props, true);
-    }
-
-    /**
-     * Unbind a property provider
-     */
-    @SuppressWarnings("unused")
-    private void unbindPropertyProvider(final PropertyProvider propertyProvider,
-            final Map<String, Object> props,
-            final boolean inform) {
-    	logger.debug("unbindPropertyProvider: Releasing PropertyProvider {}", propertyProvider);
-
-    	final TopologyEventListener[] awares;
-        synchronized (lock) {
-            final ProviderInfo info = new ProviderInfo(propertyProvider, props);
-            this.providerInfos.remove(info);
-            this.updatePropertiesCache();
-            if ( this.topologyView == null ) {
-                awares = null;
-            } else {
-                awares = this.listeners;
-            }
-        }
-        if ( inform && awares != null ) {
-            for(final TopologyEventListener da : awares) {
-                da.handleTopologyEvent(new TopologyEvent(Type.PROPERTIES_CHANGED, this.topologyView, this.topologyView));
-            }
-        }
-    }
-
-    private void updatePropertiesCache() {
-        final Map<String, String> newProps = new HashMap<String, String>();
-        for(final ProviderInfo info : this.providerInfos) {
-            newProps.putAll(info.properties);
-        }
-        this.cachedProperties = newProps;
-        if ( this.logger.isDebugEnabled() ) {
-            this.logger.debug("New properties: {}", this.cachedProperties);
-        }
-    }
-
-    @SuppressWarnings("unused")
-    private void bindTopologyEventListener(final TopologyEventListener clusterAware) {
-
-        logger.debug("bindTopologyEventListener: Binding TopologyEventListener {}", clusterAware);
-
-        boolean inform = true;
-        synchronized (lock) {
-            List<TopologyEventListener> currentList = new ArrayList<TopologyEventListener>(
-                Arrays.asList(listeners));
-            currentList.add(clusterAware);
-            this.listeners = currentList.toArray(new TopologyEventListener[currentList.size()]);
-            if ( this.topologyView == null ) {
-                inform = false;
-            }
-        }
-
-        if ( inform ) {
-        	clusterAware.handleTopologyEvent(new TopologyEvent(Type.TOPOLOGY_INIT, null, topologyView));
-        }
-    }
-
-    @SuppressWarnings("unused")
-    private void unbindTopologyEventListener(final TopologyEventListener clusterAware) {
-
-        logger.debug("unbindTopologyEventListener: Releasing TopologyEventListener {}", clusterAware);
-
-        synchronized (lock) {
-            List<TopologyEventListener> currentList = new ArrayList<TopologyEventListener>(
-                Arrays.asList(listeners));
-            currentList.remove(clusterAware);
-            this.listeners = currentList.toArray(new TopologyEventListener[currentList.size()]);
-        }
-    }
-
-    /**
-     * @see DiscoveryService#getTopology()
-     */
-    public TopologyView getTopology() {
-    	return topologyView;
-    }
-
-    /**
-     * Internal class caching some provider infos like service id and ranking.
-     */
-    private final static class ProviderInfo implements Comparable<ProviderInfo> {
-
-        public final PropertyProvider provider;
-        public final int ranking;
-        public final long serviceId;
-        public final Map<String, String> properties = new HashMap<String, String>();
-
-        public ProviderInfo(final PropertyProvider provider, final Map<String, Object> serviceProps) {
-            this.provider = provider;
-            final Object sr = serviceProps.get(Constants.SERVICE_RANKING);
-            if ( sr == null || !(sr instanceof Integer)) {
-                this.ranking = 0;
-            } else {
-                this.ranking = (Integer)sr;
-            }
-            this.serviceId = (Long)serviceProps.get(Constants.SERVICE_ID);
-            final Object namesObj = serviceProps.get(PropertyProvider.PROPERTY_PROPERTIES);
-            if ( namesObj instanceof String ) {
-                final String val = provider.getProperty((String)namesObj);
-                if ( val != null ) {
-                    this.properties.put((String)namesObj, val);
-                }
-            } else if ( namesObj instanceof String[] ) {
-                for(final String name : (String[])namesObj ) {
-                    final String val = provider.getProperty(name);
-                    if ( val != null ) {
-                        this.properties.put(name, val);
-                    }
-                }
-            }
-        }
-
-        /**
-         * @see java.lang.Comparable#compareTo(java.lang.Object)
-         */
-        public int compareTo(final ProviderInfo o) {
-            // Sort by rank in ascending order.
-            if ( this.ranking < o.ranking ) {
-                return -1; // lower rank
-            } else if (this.ranking > o.ranking ) {
-                return 1; // higher rank
-            }
-            // If ranks are equal, then sort by service id in descending order.
-            return (this.serviceId < o.serviceId) ? 1 : -1;
-        }
-
-        @Override
-        public boolean equals(final Object obj) {
-            if ( obj instanceof ProviderInfo ) {
-                return ((ProviderInfo)obj).serviceId == this.serviceId;
-            }
-            return false;
-        }
-
-        @Override
-        public int hashCode() {
-            return provider.hashCode();
-        }
-    }
-}
diff --git a/src/main/java/org/apache/sling/discovery/impl/StandardPropertyProvider.java b/src/main/java/org/apache/sling/discovery/impl/StandardPropertyProvider.java
deleted file mode 100644
index 798ff0a..0000000
--- a/src/main/java/org/apache/sling/discovery/impl/StandardPropertyProvider.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.sling.discovery.impl;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Dictionary;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.felix.scr.annotations.Activate;
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Deactivate;
-import org.apache.felix.scr.annotations.Modified;
-import org.apache.felix.scr.annotations.Reference;
-import org.apache.felix.scr.annotations.ReferenceCardinality;
-import org.apache.felix.scr.annotations.ReferencePolicy;
-import org.apache.sling.discovery.InstanceDescription;
-import org.apache.sling.discovery.PropertyProvider;
-import org.osgi.framework.Constants;
-import org.osgi.framework.ServiceReference;
-import org.osgi.framework.ServiceRegistration;
-import org.osgi.service.component.ComponentContext;
-import org.osgi.service.http.HttpService;
-
-/**
- * This service provides the standard instance properties (if available)
- */
-@Component(immediate=true)
-@Reference(referenceInterface=HttpService.class,
-           cardinality=ReferenceCardinality.OPTIONAL_MULTIPLE,
-           policy=ReferencePolicy.DYNAMIC)
-public class StandardPropertyProvider {
-
-    /** Endpoint service registration property from RFC 189 */
-    private static final String REG_PROPERTY_ENDPOINTS = "osgi.http.service.endpoints";
-
-    private volatile long changeCount;
-
-    private String instanceName;
-
-    private String instanceDescription;
-
-    private ServiceRegistration propagationService;
-
-    private final Map<Long, String[]> endpoints = new HashMap<Long, String[]>();
-
-    private String endpointString;
-
-    private Dictionary<String, Object> getRegistrationProperties() {
-        final List<String> names = new ArrayList<String>();
-        if ( this.instanceName != null ) {
-            names.add(InstanceDescription.PROPERTY_NAME);
-        }
-        if ( this.instanceDescription != null ) {
-            names.add(InstanceDescription.PROPERTY_DESCRIPTION);
-        }
-        names.add(InstanceDescription.PROPERTY_ENDPOINTS);
-
-        final StringBuilder sb = new StringBuilder();
-        boolean first = true;
-        synchronized ( this.endpoints ) {
-            for(final String[] points : endpoints.values()) {
-                for(final String point : points) {
-                    if ( first ) {
-                        first = false;
-                    } else {
-                        sb.append(",");
-                    }
-                    sb.append(point);
-                }
-            }
-        }
-        this.endpointString = sb.toString();
-
-        final Dictionary<String, Object> serviceProps = new Hashtable<String, Object>();
-        serviceProps.put(PropertyProvider.PROPERTY_PROPERTIES, names.toArray(new String[names.size()]));
-        // we add a changing property to the service registration
-        // to make sure a modification event is really sent
-        synchronized ( this ) {
-            serviceProps.put("changeCount", this.changeCount++);
-        }
-        return serviceProps;
-    }
-
-    private String getPropertyValue(final ComponentContext bc, final String key) {
-        Object value = bc.getProperties().get(key);
-        if ( value == null ) {
-            value = bc.getBundleContext().getProperty(key);
-        }
-        if ( value != null ) {
-            return value.toString();
-        }
-        return null;
-    }
-
-    @Activate
-    protected void activate(final ComponentContext cc) {
-        this.modified(cc);
-    }
-
-    @Modified
-    protected void modified(final ComponentContext cc) {
-        this.instanceName = this.getPropertyValue(cc, "sling.name");
-        this.instanceDescription = this.getPropertyValue(cc, "sling.description");
-
-        this.propagationService = cc.getBundleContext().registerService(PropertyProvider.class.getName(),
-                new PropertyProvider() {
-
-                    public String getProperty(final String name) {
-                        if ( InstanceDescription.PROPERTY_DESCRIPTION.equals(name) ) {
-                            return instanceDescription;
-                        }
-                        if ( InstanceDescription.PROPERTY_NAME.equals(name) ) {
-                            return instanceName;
-                        }
-                        if ( InstanceDescription.PROPERTY_ENDPOINTS.equals(name) ) {
-                            return endpointString;
-                        }
-                        return null;
-                    }
-                }, this.getRegistrationProperties());
-    }
-
-    @Deactivate
-    protected void deactivate() {
-        if ( this.propagationService != null ) {
-            this.propagationService.unregister();
-            this.propagationService = null;
-        }
-    }
-
-    /**
-     * Bind a http service
-     */
-    protected void bindHttpService(final ServiceReference reference) {
-        final String[] endpointUrls = toStringArray(reference.getProperty(REG_PROPERTY_ENDPOINTS));
-        if ( endpointUrls != null ) {
-            synchronized ( this.endpoints ) {
-                this.endpoints.put((Long)reference.getProperty(Constants.SERVICE_ID), endpointUrls);
-            }
-            if ( this.propagationService != null ) {
-                this.propagationService.setProperties(this.getRegistrationProperties());
-            }
-        }
-    }
-
-    /**
-     * Unbind a http service
-     */
-    protected void unbindHttpService(final ServiceReference reference) {
-        boolean changed = false;
-        synchronized ( this.endpoints ) {
-            if ( this.endpoints.remove(reference.getProperty(Constants.SERVICE_ID)) != null ) {
-                changed = true;
-            }
-        }
-        if ( changed && this.propagationService != null ) {
-            this.propagationService.setProperties(this.getRegistrationProperties());
-        }
-    }
-
-    private String[] toStringArray(final Object propValue) {
-        if (propValue == null) {
-            // no value at all
-            return null;
-
-        } else if (propValue instanceof String) {
-            // single string
-            return new String[] { (String) propValue };
-
-        } else if (propValue instanceof String[]) {
-            // String[]
-            return (String[]) propValue;
-
-        } else if (propValue.getClass().isArray()) {
-            // other array
-            Object[] valueArray = (Object[]) propValue;
-            List<String> values = new ArrayList<String>(valueArray.length);
-            for (Object value : valueArray) {
-                if (value != null) {
-                    values.add(value.toString());
-                }
-            }
-            return values.toArray(new String[values.size()]);
-
-        } else if (propValue instanceof Collection<?>) {
-            // collection
-            Collection<?> valueCollection = (Collection<?>) propValue;
-            List<String> valueList = new ArrayList<String>(valueCollection.size());
-            for (Object value : valueCollection) {
-                if (value != null) {
-                    valueList.add(value.toString());
-                }
-            }
-            return valueList.toArray(new String[valueList.size()]);
-        }
-
-        return null;
-    }
-}

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-discovery-api] 10/29: Rename DiscoveryAware to TopologyEventListener

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.api-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-api.git

commit 2a2a3e75899b319244c7ae6c9d454f1ccc4b8268
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Apr 22 08:56:00 2013 +0000

    Rename DiscoveryAware to TopologyEventListener
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/discovery/api@1470413 13f79535-47bb-0310-9956-ffa450edef68
---
 .../apache/sling/discovery/DiscoveryService.java   |  6 +--
 .../sling/discovery/InstanceDescription.java       |  2 +-
 .../org/apache/sling/discovery/TopologyEvent.java  |  2 +-
 ...coveryAware.java => TopologyEventListener.java} |  9 ++--
 .../discovery/impl/NoClusterDiscoveryService.java  | 49 +++++++++++-----------
 5 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/src/main/java/org/apache/sling/discovery/DiscoveryService.java b/src/main/java/org/apache/sling/discovery/DiscoveryService.java
index 6e655d0..3477650 100644
--- a/src/main/java/org/apache/sling/discovery/DiscoveryService.java
+++ b/src/main/java/org/apache/sling/discovery/DiscoveryService.java
@@ -36,9 +36,9 @@ public interface DiscoveryService {
 	 * has noticed a potential change in the topology and is in the process of
 	 * settling the change in the topology (eg with peers, ie voting).
 	 * <p>
-	 * Note that this call is synchronized with <code>DiscoveryAware.handleTopologyEvent()</code>
-	 * calls: ie if calls to <code>DiscoveryAware.handleTopologyEvent()</code> are currently
-	 * ongoing, then the call to this method will block until all <code>DiscoveryAware</code>s
+	 * Note that this call is synchronized with <code>TopologyEventListener.handleTopologyEvent()</code>
+	 * calls: ie if calls to <code>TopologyEventListener.handleTopologyEvent()</code> are currently
+	 * ongoing, then the call to this method will block until all <code>TopologyEventListener</code>s
 	 * have been called. Be careful not to cause deadlock situations.
 	 * <p>
 	 * @return the topology that was last discovered by this service. This will never
diff --git a/src/main/java/org/apache/sling/discovery/InstanceDescription.java b/src/main/java/org/apache/sling/discovery/InstanceDescription.java
index 4e471f2..0c714a3 100644
--- a/src/main/java/org/apache/sling/discovery/InstanceDescription.java
+++ b/src/main/java/org/apache/sling/discovery/InstanceDescription.java
@@ -68,7 +68,7 @@ public interface InstanceDescription {
 	 * Only one instance of a cluster is guaranteed to be the leader at any time.
 	 * This guarantee is provided by this service.
 	 * If the leader goes down, the service elects a new leader and announces it to
-	 * DiscoveryAware listeners.
+	 * TopologyEventListener listeners.
 	 * @return true if this instance is the - only -  leader in this cluster,
 	 * false if it is one of the slaves, or true if it is not at all part of a cluster
 	 */
diff --git a/src/main/java/org/apache/sling/discovery/TopologyEvent.java b/src/main/java/org/apache/sling/discovery/TopologyEvent.java
index 5f1568f..fb9bcdd 100644
--- a/src/main/java/org/apache/sling/discovery/TopologyEvent.java
+++ b/src/main/java/org/apache/sling/discovery/TopologyEvent.java
@@ -23,7 +23,7 @@ package org.apache.sling.discovery;
  *
  * This event object might be extended in the future with new event types
  * and methods.
- * @see DiscoveryAware
+ * @see TopologyEventListener
  */
 public class TopologyEvent {
 
diff --git a/src/main/java/org/apache/sling/discovery/DiscoveryAware.java b/src/main/java/org/apache/sling/discovery/TopologyEventListener.java
similarity index 89%
rename from src/main/java/org/apache/sling/discovery/DiscoveryAware.java
rename to src/main/java/org/apache/sling/discovery/TopologyEventListener.java
index 01a3da1..aed95c6 100644
--- a/src/main/java/org/apache/sling/discovery/DiscoveryAware.java
+++ b/src/main/java/org/apache/sling/discovery/TopologyEventListener.java
@@ -19,14 +19,13 @@
 package org.apache.sling.discovery;
 
 /**
- * The <code>DiscoveryAware</code> service interface may be implemented by
- * components interested in being made aware of the cluster state or changes
- * thereof.
+ * The <code>TopologyEventListener</code> service interface may be implemented by
+ * components interested in being made aware of changes in the topology.
  * <p>
  * Upon registration and whenever changes in the topology occur, this
  * service is informed.
  */
-public interface DiscoveryAware {
+public interface TopologyEventListener {
 
 	/**
 	 * Inform the service about an event in the topology - or in the discovery
@@ -35,7 +34,7 @@ public interface DiscoveryAware {
 	 * The <code>TopologyEvent</code> contains details about what changed.
 	 * The supported event types are:
 	 * <ul>
-	 *  <li><code>TOPOLOGY_INIT</code> sent when the <code>DiscoveryAware</code>
+	 *  <li><code>TOPOLOGY_INIT</code> sent when the <code>TopologyEventListener</code>
 	 *  was first bound to the discovery service - represents the initial state
 	 *  of the topology at that time.</li>
 	 *  <li><code>TOPOLOGY_CHANGING</code> sent when the discovery service
diff --git a/src/main/java/org/apache/sling/discovery/impl/NoClusterDiscoveryService.java b/src/main/java/org/apache/sling/discovery/impl/NoClusterDiscoveryService.java
index dfb6976..cfb3c6b 100644
--- a/src/main/java/org/apache/sling/discovery/impl/NoClusterDiscoveryService.java
+++ b/src/main/java/org/apache/sling/discovery/impl/NoClusterDiscoveryService.java
@@ -39,13 +39,13 @@ import org.apache.felix.scr.annotations.ReferenceCardinality;
 import org.apache.felix.scr.annotations.ReferencePolicy;
 import org.apache.felix.scr.annotations.Service;
 import org.apache.sling.discovery.ClusterView;
-import org.apache.sling.discovery.DiscoveryAware;
 import org.apache.sling.discovery.DiscoveryService;
 import org.apache.sling.discovery.InstanceDescription;
 import org.apache.sling.discovery.InstanceFilter;
 import org.apache.sling.discovery.PropertyProvider;
 import org.apache.sling.discovery.TopologyEvent;
 import org.apache.sling.discovery.TopologyEvent.Type;
+import org.apache.sling.discovery.TopologyEventListener;
 import org.apache.sling.discovery.TopologyView;
 import org.apache.sling.settings.SlingSettingsService;
 import org.osgi.framework.Constants;
@@ -53,8 +53,9 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * This is a simple implementation of the cluster service
- * which can be used for a cluster less installation.
+ * This is a simple implementation of the discovery service
+ * which can be used for a cluster less installation (= single instance).
+ * It is disabled by default and can be enabled through a OSGi configuration.
  */
 @Component(policy = ConfigurationPolicy.REQUIRE, immediate=true)
 @Service(value = {DiscoveryService.class})
@@ -70,10 +71,10 @@ public class NoClusterDiscoveryService implements DiscoveryService {
     private SlingSettingsService settingsService;
 
     /**
-     * All cluster aware instances.
+     * All topology event listeners.
      */
     @Reference(cardinality = ReferenceCardinality.OPTIONAL_MULTIPLE, policy = ReferencePolicy.DYNAMIC)
-    private DiscoveryAware[] clusterAwares = new DiscoveryAware[0];
+    private TopologyEventListener[] listeners = new TopologyEventListener[0];
 
     /**
      * All property providers.
@@ -138,9 +139,9 @@ public class NoClusterDiscoveryService implements DiscoveryService {
         final Set<InstanceDescription> instances = new HashSet<InstanceDescription>();
         instances.add(myDescription);
 
-        final DiscoveryAware[] registeredServices;
+        final TopologyEventListener[] registeredServices;
 		synchronized ( lock ) {
-            registeredServices = this.clusterAwares;
+            registeredServices = this.listeners;
             final ClusterView clusterView = new ClusterView() {
 
                 public InstanceDescription getLeader() {
@@ -188,7 +189,7 @@ public class NoClusterDiscoveryService implements DiscoveryService {
 
     		};
         }
-        for(final DiscoveryAware da: registeredServices) {
+        for(final TopologyEventListener da: registeredServices) {
         	da.handleTopologyEvent(new TopologyEvent(Type.TOPOLOGY_INIT, null, topologyView));
         }
     }
@@ -209,7 +210,7 @@ public class NoClusterDiscoveryService implements DiscoveryService {
 	private void bindPropertyProvider(final PropertyProvider propertyProvider, final Map<String, Object> props) {
     	logger.debug("bindPropertyProvider: Binding PropertyProvider {}", propertyProvider);
 
-        final DiscoveryAware[] awares;
+        final TopologyEventListener[] awares;
         synchronized (lock) {
             final ProviderInfo info = new ProviderInfo(propertyProvider, props);
             this.providerInfos.add(info);
@@ -218,11 +219,11 @@ public class NoClusterDiscoveryService implements DiscoveryService {
             if ( this.topologyView == null ) {
                 awares = null;
             } else {
-                awares = this.clusterAwares;
+                awares = this.listeners;
             }
         }
         if ( awares != null ) {
-            for(final DiscoveryAware da : awares) {
+            for(final TopologyEventListener da : awares) {
                 da.handleTopologyEvent(new TopologyEvent(Type.PROPERTIES_CHANGED, this.topologyView, this.topologyView));
             }
         }
@@ -256,7 +257,7 @@ public class NoClusterDiscoveryService implements DiscoveryService {
             final boolean inform) {
     	logger.debug("unbindPropertyProvider: Releasing PropertyProvider {}", propertyProvider);
 
-    	final DiscoveryAware[] awares;
+    	final TopologyEventListener[] awares;
         synchronized (lock) {
             final ProviderInfo info = new ProviderInfo(propertyProvider, props);
             this.providerInfos.remove(info);
@@ -264,11 +265,11 @@ public class NoClusterDiscoveryService implements DiscoveryService {
             if ( this.topologyView == null ) {
                 awares = null;
             } else {
-                awares = this.clusterAwares;
+                awares = this.listeners;
             }
         }
         if ( inform && awares != null ) {
-            for(final DiscoveryAware da : awares) {
+            for(final TopologyEventListener da : awares) {
                 da.handleTopologyEvent(new TopologyEvent(Type.PROPERTIES_CHANGED, this.topologyView, this.topologyView));
             }
         }
@@ -286,16 +287,16 @@ public class NoClusterDiscoveryService implements DiscoveryService {
     }
 
     @SuppressWarnings("unused")
-    private void bindDiscoveryAware(final DiscoveryAware clusterAware) {
+    private void bindTopologyEventListener(final TopologyEventListener clusterAware) {
 
-        logger.debug("bindDiscoveryAware: Binding DiscoveryAware {}", clusterAware);
+        logger.debug("bindTopologyEventListener: Binding TopologyEventListener {}", clusterAware);
 
         boolean inform = true;
         synchronized (lock) {
-            List<DiscoveryAware> currentList = new ArrayList<DiscoveryAware>(
-                Arrays.asList(clusterAwares));
+            List<TopologyEventListener> currentList = new ArrayList<TopologyEventListener>(
+                Arrays.asList(listeners));
             currentList.add(clusterAware);
-            this.clusterAwares = currentList.toArray(new DiscoveryAware[currentList.size()]);
+            this.listeners = currentList.toArray(new TopologyEventListener[currentList.size()]);
             if ( this.topologyView == null ) {
                 inform = false;
             }
@@ -307,15 +308,15 @@ public class NoClusterDiscoveryService implements DiscoveryService {
     }
 
     @SuppressWarnings("unused")
-    private void unbindDiscoveryAware(final DiscoveryAware clusterAware) {
+    private void unbindTopologyEventListener(final TopologyEventListener clusterAware) {
 
-        logger.debug("unbindDiscoveryAware: Releasing DiscoveryAware {}", clusterAware);
+        logger.debug("unbindTopologyEventListener: Releasing TopologyEventListener {}", clusterAware);
 
         synchronized (lock) {
-            List<DiscoveryAware> currentList = new ArrayList<DiscoveryAware>(
-                Arrays.asList(clusterAwares));
+            List<TopologyEventListener> currentList = new ArrayList<TopologyEventListener>(
+                Arrays.asList(listeners));
             currentList.remove(clusterAware);
-            this.clusterAwares = currentList.toArray(new DiscoveryAware[currentList.size()]);
+            this.listeners = currentList.toArray(new TopologyEventListener[currentList.size()]);
         }
     }
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-discovery-api] 05/29: Create own directory for all discovery modules

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.api-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-api.git

commit 8bfc63be8095243b6559561a40f0b8e048ebca7f
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Fri Apr 12 08:57:12 2013 +0000

    Create own directory for all discovery modules
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/discovery/api@1467217 13f79535-47bb-0310-9956-ffa450edef68

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-discovery-api] 13/29: SLING-2827 : a minor javadoc typo

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.api-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-api.git

commit b0584cc507cbc01fc5007d339d8c9e3f9c805184
Author: Stefan Egli <st...@apache.org>
AuthorDate: Tue Apr 23 09:49:10 2013 +0000

    SLING-2827 : a minor javadoc typo
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/discovery/api@1470867 13f79535-47bb-0310-9956-ffa450edef68
---
 src/main/java/org/apache/sling/discovery/TopologyEvent.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/sling/discovery/TopologyEvent.java b/src/main/java/org/apache/sling/discovery/TopologyEvent.java
index 305dcb9..65dc13f 100644
--- a/src/main/java/org/apache/sling/discovery/TopologyEvent.java
+++ b/src/main/java/org/apache/sling/discovery/TopologyEvent.java
@@ -60,7 +60,7 @@ public class TopologyEvent {
          * leaves or was restarted (its bundle deactivated/activated)</li>
          * </ul>
          * <p>
-         * Note that tha TOPOLOGY_CHANGED can also include changes in the
+         * Note that a TOPOLOGY_CHANGED can also include changes in the
          * properties!
          */
         TOPOLOGY_CHANGED,

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-discovery-api] 23/29: Create new standalone project

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.api-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-api.git

commit ff0fd1dd5d8e101dcf814d57981678e2d80c1ead
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue May 14 07:56:49 2013 +0000

    Create new standalone project
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/api@1482240 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/pom.xml b/pom.xml
index c65b3e3..a7f2dd7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -65,10 +65,6 @@
             <artifactId>bndlib</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-api</artifactId>
-        </dependency>
-        <dependency>
             <groupId>org.osgi</groupId>
             <artifactId>org.osgi.core</artifactId>
         </dependency>
@@ -76,11 +72,5 @@
             <groupId>org.osgi</groupId>
             <artifactId>org.osgi.compendium</artifactId>
         </dependency>
-        <dependency>
-            <groupId>org.apache.sling</groupId>
-            <artifactId>org.apache.sling.settings</artifactId>
-            <version>1.1.0</version>
-            <scope>provided</scope>
-        </dependency>
     </dependencies>
 </project>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-discovery-api] 29/29: [maven-release-plugin] copy for tag org.apache.sling.discovery.api-1.0.0

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.api-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-api.git

commit 6fb7a58a100396b2d8bbc63f1e683403f5ba2ec5
Merge: 423bc76 2a04569
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue Jul 9 13:08:03 2013 +0000

    [maven-release-plugin]  copy for tag org.apache.sling.discovery.api-1.0.0
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.discovery.api-1.0.0@1501243 13f79535-47bb-0310-9956-ffa450edef68

 pom.xml                                            |  26 --
 .../apache/sling/discovery/DiscoveryService.java   |   3 +
 .../sling/discovery/InstanceDescription.java       |   2 +-
 .../discovery/impl/NoClusterDiscoveryService.java  | 392 ---------------------
 .../discovery/impl/StandardPropertyProvider.java   | 219 ------------
 5 files changed, 4 insertions(+), 638 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-discovery-api] 04/29: Create own directory for all discovery modules

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.api-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-api.git

commit ed21de9d4b2784c6b8946f59f94bafe09dc7b3d8
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Fri Apr 12 08:55:16 2013 +0000

    Create own directory for all discovery modules
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/discovery/discovery-api@1467216 13f79535-47bb-0310-9956-ffa450edef68

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-discovery-api] 21/29: [maven-release-plugin] prepare for next development iteration

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.api-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-api.git

commit 5cd0f19a29941759738240719528a7de91eacbc9
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon May 13 14:48:25 2013 +0000

    [maven-release-plugin] prepare for next development iteration
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/api@1481900 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 238b1cc..c65b3e3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,7 +29,7 @@
 
     <artifactId>org.apache.sling.discovery.api</artifactId>
     <packaging>bundle</packaging>
-    <version>1.0.0</version>
+    <version>1.0.1-SNAPSHOT</version>
 
     <name>Apache Sling Discovery API</name>
     <description>
@@ -37,9 +37,9 @@
     </description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.discovery.api-1.0.0</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.discovery.api-1.0.0</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.discovery.api-1.0.0</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/api</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/api</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/discovery/api</url>
     </scm>
 
     <build>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.