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/10/18 23:19:38 UTC

[sling-org-apache-sling-discovery-standalone] branch master created (now c9c3806)

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

rombert pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-standalone.git.


      at c9c3806  SLING-7167 Adjust READMEs

This branch includes the following new commits:

     new 304f635  Create new standalone module
     new d937aa7  Create new support module
     new 886d22e  Create new support module
     new cb7c548  Add missing poms
     new 7b5fea3  Update to latest parent pom
     new f85fc07  Use released discovery api
     new 04cc9ad  [maven-release-plugin] prepare release org.apache.sling.discovery.standalone-1.0.0
     new 1e5590b  [maven-release-plugin] prepare for next development iteration
     new 8f8bf14  Update to parent pom 18
     new 12b25ae  Update to parent pom v19
     new 7e6c257  Updated to parent version 20
     new 5d74324  Update to Sling Parent POM 22 with baselining enabled
     new 8c66262  SLING-4505 Relative paths has been set to correct value.
     new e9cfaa2  Remove inherited dependencies
     new 42c8b62  SLING-4698 - Set parent.relativePath to empty for all modules
     new dc0750c  Update to Sling Parent 23
     new 96ca200  set parent version to 24 and add empty relativePath where missing
     new 2db5c7f  Update the main reactor to parent 25
     new 4952781  SLING-5405 : TopologyView contract is not correctly followed on property changes
     new dfe0813  [maven-release-plugin] prepare release org.apache.sling.discovery.standalone-1.0.2
     new c4eeef1  [maven-release-plugin] prepare for next development iteration
     new fe0afed  Switch to parent pom 26
     new c9c3806  SLING-7167 Adjust READMEs

The 23 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-standalone] 17/23: set parent version to 24 and add empty relativePath where missing

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

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-standalone.git

commit 96ca200edefcab10dbeadc17ff8240d76419148e
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Tue Jul 7 08:09:17 2015 +0000

    set parent version to 24 and add empty relativePath where missing
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1689593 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 1b9ff2d..738001d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>23</version>
+        <version>24</version>
         <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-standalone] 15/23: SLING-4698 - Set parent.relativePath to empty for all modules

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

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-standalone.git

commit 42c8b62a419647e66d24093720d2437799d28a6f
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Thu May 7 10:14:40 2015 +0000

    SLING-4698 - Set parent.relativePath to empty for all modules
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1678154 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 2c87a3b..1f72066 100644
--- a/pom.xml
+++ b/pom.xml
@@ -24,7 +24,7 @@
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
         <version>22</version>
-        <relativePath>../../../../parent/pom.xml</relativePath>
+        <relativePath/>
     </parent>
 
     <artifactId>org.apache.sling.discovery.standalone</artifactId>

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

[sling-org-apache-sling-discovery-standalone] 19/23: SLING-5405 : TopologyView contract is not correctly followed on property changes

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

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-standalone.git

commit 49527815be76fec8707c18ad276e397cacdacc3d
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue Dec 29 13:35:14 2015 +0000

    SLING-5405 : TopologyView contract is not correctly followed on property changes
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1722125 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                            |  10 +
 .../discovery/impl/standalone/ClusterViewImpl.java |  49 ++++
 .../impl/standalone/InstanceDescriptionImpl.java   |  67 +++++
 .../impl/standalone/NoClusterDiscoveryService.java | 276 +++++----------------
 .../discovery/impl/standalone/ProviderInfo.java    |  89 +++++++
 .../impl/standalone/TopologyViewImpl.java          |  71 ++++++
 .../standalone/NoClusterDiscoveryServiceTest.java  | 234 +++++++++++++++++
 7 files changed, 584 insertions(+), 212 deletions(-)

diff --git a/pom.xml b/pom.xml
index c2b7c08..7f8f02b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -80,5 +80,15 @@
             <version>1.1.0</version>
             <scope>provided</scope>
         </dependency>
+        
+      <!-- Testing -->
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-simple</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+        </dependency>
     </dependencies>
 </project>
diff --git a/src/main/java/org/apache/sling/discovery/impl/standalone/ClusterViewImpl.java b/src/main/java/org/apache/sling/discovery/impl/standalone/ClusterViewImpl.java
new file mode 100644
index 0000000..4d20e25
--- /dev/null
+++ b/src/main/java/org/apache/sling/discovery/impl/standalone/ClusterViewImpl.java
@@ -0,0 +1,49 @@
+/*
+ * 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.standalone;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.sling.discovery.ClusterView;
+import org.apache.sling.discovery.InstanceDescription;
+
+public class ClusterViewImpl implements ClusterView {
+
+    private final InstanceDescription myInstance;
+
+    public ClusterViewImpl(final InstanceDescription myInstance) {
+        this.myInstance = myInstance;
+    }
+
+    @Override
+    public InstanceDescription getLeader() {
+        return myInstance;
+    }
+
+    @Override
+    public List<InstanceDescription> getInstances() {
+        return Collections.singletonList(myInstance);
+    }
+
+    @Override
+    public String getId() {
+        return "0";
+    }
+}
diff --git a/src/main/java/org/apache/sling/discovery/impl/standalone/InstanceDescriptionImpl.java b/src/main/java/org/apache/sling/discovery/impl/standalone/InstanceDescriptionImpl.java
new file mode 100644
index 0000000..96d9b9e
--- /dev/null
+++ b/src/main/java/org/apache/sling/discovery/impl/standalone/InstanceDescriptionImpl.java
@@ -0,0 +1,67 @@
+/*
+ * 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.standalone;
+
+import java.util.Collections;
+import java.util.Map;
+
+import org.apache.sling.discovery.ClusterView;
+import org.apache.sling.discovery.InstanceDescription;
+
+public class InstanceDescriptionImpl implements InstanceDescription {
+
+    private final String id;
+
+    private final Map<String, String> properties;
+
+    public InstanceDescriptionImpl(final String id, final Map<String, String> properties) {
+        this.id = id;
+        this.properties = Collections.unmodifiableMap(properties);
+    }
+
+    @Override
+    public boolean isLocal() {
+        return true;
+    }
+
+    @Override
+    public boolean isLeader() {
+        return true;
+    }
+
+    @Override
+    public String getSlingId() {
+        return id;
+    }
+
+    @Override
+    public String getProperty(final String name) {
+        return properties.get(name);
+    }
+
+    @Override
+    public Map<String, String> getProperties() {
+        return properties;
+    }
+
+    @Override
+    public ClusterView getClusterView() {
+        return new ClusterViewImpl(this);
+    }
+}
diff --git a/src/main/java/org/apache/sling/discovery/impl/standalone/NoClusterDiscoveryService.java b/src/main/java/org/apache/sling/discovery/impl/standalone/NoClusterDiscoveryService.java
index e495e99..209a832 100644
--- a/src/main/java/org/apache/sling/discovery/impl/standalone/NoClusterDiscoveryService.java
+++ b/src/main/java/org/apache/sling/discovery/impl/standalone/NoClusterDiscoveryService.java
@@ -20,15 +20,10 @@ package org.apache.sling.discovery.impl.standalone;
 
 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;
@@ -37,26 +32,22 @@ 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(immediate=true)
+@Component(immediate=true) // immediate as this is component is also handling the listeners
 @Service(value = {DiscoveryService.class})
 public class NoClusterDiscoveryService implements DiscoveryService {
 
@@ -90,9 +81,9 @@ public class NoClusterDiscoveryService implements DiscoveryService {
     /**
      * The current topology view.
      */
-    private TopologyView topologyView;
+    private volatile TopologyViewImpl currentTopologyView;
 
-    private Map<String, String> cachedProperties = new HashMap<String, String>();
+    private volatile Map<String, String> cachedProperties = Collections.emptyMap();
 
     /**
      * Activate this service
@@ -101,96 +92,7 @@ public class NoClusterDiscoveryService implements DiscoveryService {
     @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));
-        }
+        createNewView(Type.TOPOLOGY_INIT, true);
     }
 
     /**
@@ -198,32 +100,55 @@ public class NoClusterDiscoveryService implements DiscoveryService {
      */
     @Deactivate
     protected void deactivate() {
+        synchronized ( lock ) {
+            if ( this.currentTopologyView != null ) {
+                this.currentTopologyView.invalidate();
+                this.currentTopologyView = null;
+            }
+            this.cachedProperties = null;
+        }
         logger.debug("NoClusterDiscoveryService stopped.");
-        this.topologyView = null;
+    }
+
+    private void createNewView(final Type eventType, boolean inform) {
+        final TopologyEventListener[] registeredServices;
+        final TopologyView newView;
+        final TopologyView oldView;
+        synchronized ( lock ) {
+            // invalidate old view
+            if ( this.currentTopologyView != null ) {
+                this.currentTopologyView.invalidate();
+                oldView = currentTopologyView;
+            } else {
+                oldView = null;
+            }
+            final InstanceDescription myInstanceDescription = new InstanceDescriptionImpl(this.settingsService.getSlingId(),
+                    this.cachedProperties);
+            this.currentTopologyView = new TopologyViewImpl(myInstanceDescription);
+            registeredServices = this.listeners;
+            newView = this.currentTopologyView;
+
+            if ( inform ) {
+                for(final TopologyEventListener da: registeredServices) {
+                    da.handleTopologyEvent(new TopologyEvent(eventType, oldView, newView));
+                }
+            }
+        }
     }
 
     /**
      * Bind a new property provider.
      */
-    @SuppressWarnings("unused")
-	private void bindPropertyProvider(final PropertyProvider propertyProvider, final Map<String, Object> props) {
-    	logger.debug("bindPropertyProvider: Binding PropertyProvider {}", propertyProvider);
+    private void bindPropertyProvider(final PropertyProvider propertyProvider, final Map<String, Object> props) {
+    	logger.debug("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));
+            if ( this.currentTopologyView != null ) {
+                this.createNewView(Type.PROPERTIES_CHANGED, true);
             }
         }
     }
@@ -233,10 +158,12 @@ public class NoClusterDiscoveryService implements DiscoveryService {
      */
     @SuppressWarnings("unused")
     private void updatedPropertyProvider(final PropertyProvider propertyProvider, final Map<String, Object> props) {
-        logger.debug("bindPropertyProvider: Updating PropertyProvider {}", propertyProvider);
+        logger.debug("Updating PropertyProvider {}", propertyProvider);
 
-        this.unbindPropertyProvider(propertyProvider, props, false);
-        this.bindPropertyProvider(propertyProvider, props);
+        synchronized (lock) {
+            this.unbindPropertyProvider(propertyProvider, props, false);
+            this.bindPropertyProvider(propertyProvider, props);
+        }
     }
 
     /**
@@ -250,30 +177,24 @@ public class NoClusterDiscoveryService implements DiscoveryService {
     /**
      * 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);
+    	logger.debug("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));
+            if ( this.currentTopologyView != null ) {
+                this.createNewView(Type.PROPERTIES_CHANGED, inform);
             }
         }
     }
 
+    /**
+     * Update the properties cache.
+     */
     private void updatePropertiesCache() {
         final Map<String, String> newProps = new HashMap<String, String>();
         for(final ProviderInfo info : this.providerInfos) {
@@ -286,35 +207,28 @@ public class NoClusterDiscoveryService implements DiscoveryService {
     }
 
     @SuppressWarnings("unused")
-    private void bindTopologyEventListener(final TopologyEventListener clusterAware) {
-
-        logger.debug("bindTopologyEventListener: Binding TopologyEventListener {}", clusterAware);
+    private void bindTopologyEventListener(final TopologyEventListener listener) {
+        logger.debug("Binding TopologyEventListener {}", listener);
 
         boolean inform = true;
         synchronized (lock) {
-            List<TopologyEventListener> currentList = new ArrayList<TopologyEventListener>(
+            final List<TopologyEventListener> currentList = new ArrayList<TopologyEventListener>(
                 Arrays.asList(listeners));
-            currentList.add(clusterAware);
+            currentList.add(listener);
             this.listeners = currentList.toArray(new TopologyEventListener[currentList.size()]);
-            if ( this.topologyView == null ) {
-                inform = false;
+            if ( this.currentTopologyView != null ) {
+                listener.handleTopologyEvent(new TopologyEvent(Type.TOPOLOGY_INIT, null, this.currentTopologyView));
             }
         }
-
-        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);
+    private void unbindTopologyEventListener(final TopologyEventListener listener) {
+        logger.debug("Releasing TopologyEventListener {}", listener);
 
         synchronized (lock) {
-            List<TopologyEventListener> currentList = new ArrayList<TopologyEventListener>(
-                Arrays.asList(listeners));
-            currentList.remove(clusterAware);
+            final List<TopologyEventListener> currentList = new ArrayList<TopologyEventListener>(Arrays.asList(listeners));
+            currentList.remove(listener);
             this.listeners = currentList.toArray(new TopologyEventListener[currentList.size()]);
         }
     }
@@ -322,70 +236,8 @@ public class NoClusterDiscoveryService implements DiscoveryService {
     /**
      * @see DiscoveryService#getTopology()
      */
+    @Override
     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();
-        }
+    	return this.currentTopologyView;
     }
 }
diff --git a/src/main/java/org/apache/sling/discovery/impl/standalone/ProviderInfo.java b/src/main/java/org/apache/sling/discovery/impl/standalone/ProviderInfo.java
new file mode 100644
index 0000000..ed10061
--- /dev/null
+++ b/src/main/java/org/apache/sling/discovery/impl/standalone/ProviderInfo.java
@@ -0,0 +1,89 @@
+/*
+ * 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.standalone;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.sling.discovery.PropertyProvider;
+import org.osgi.framework.Constants;
+
+/**
+ * Internal class caching some provider infos like service id and ranking.
+ */
+public 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)
+     */
+    @Override
+    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/standalone/TopologyViewImpl.java b/src/main/java/org/apache/sling/discovery/impl/standalone/TopologyViewImpl.java
new file mode 100644
index 0000000..e76ecf7
--- /dev/null
+++ b/src/main/java/org/apache/sling/discovery/impl/standalone/TopologyViewImpl.java
@@ -0,0 +1,71 @@
+/*
+ * 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.standalone;
+
+import java.util.Collections;
+import java.util.Set;
+
+import org.apache.sling.discovery.ClusterView;
+import org.apache.sling.discovery.InstanceDescription;
+import org.apache.sling.discovery.InstanceFilter;
+import org.apache.sling.discovery.TopologyView;
+
+public class TopologyViewImpl implements TopologyView {
+
+    private volatile boolean current = true;
+
+    private final InstanceDescription myInstance;
+
+    public TopologyViewImpl(final InstanceDescription myInstance) {
+        this.myInstance = myInstance;
+    }
+
+    @Override
+    public InstanceDescription getLocalInstance() {
+        return myInstance;
+    }
+
+    @Override
+    public boolean isCurrent() {
+        return current;
+    }
+
+    public void invalidate() {
+        this.current = false;
+    }
+
+    @Override
+    public Set<InstanceDescription> getInstances() {
+        return Collections.singleton(this.myInstance);
+    }
+
+    @Override
+    public Set<InstanceDescription> findInstances(final InstanceFilter picker) {
+        if ( picker.accept(this.myInstance) ) {
+            return getInstances();
+        }
+        return Collections.emptySet();
+    }
+
+    @Override
+    public Set<ClusterView> getClusterViews() {
+        final ClusterView clusterView = new ClusterViewImpl(myInstance);
+        return Collections.singleton(clusterView);
+    }
+}
diff --git a/src/test/java/org/apache/sling/discovery/impl/standalone/NoClusterDiscoveryServiceTest.java b/src/test/java/org/apache/sling/discovery/impl/standalone/NoClusterDiscoveryServiceTest.java
new file mode 100644
index 0000000..7247d60
--- /dev/null
+++ b/src/test/java/org/apache/sling/discovery/impl/standalone/NoClusterDiscoveryServiceTest.java
@@ -0,0 +1,234 @@
+/*
+ * 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.standalone;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.sling.discovery.DiscoveryService;
+import org.apache.sling.discovery.PropertyProvider;
+import org.apache.sling.discovery.TopologyEvent;
+import org.apache.sling.discovery.TopologyEventListener;
+import org.apache.sling.settings.SlingSettingsService;
+import org.junit.Test;
+import org.osgi.framework.Constants;
+
+public class NoClusterDiscoveryServiceTest {
+
+    private void invoke(final Object obj, final String methodName) {
+        invoke(obj, methodName, null, null);
+    }
+
+    private void invoke(final Object obj, final String methodName, final Class[] params, final Object[] args) {
+        try {
+            final Method activate = obj.getClass().getDeclaredMethod(methodName, params);
+            activate.setAccessible(true);
+            activate.invoke(obj, args);
+        } catch (final Exception e) {
+            throw new RuntimeException("Unable to invoke method " + methodName + " on " + obj, e);
+        }
+    }
+
+    private Object setField(final Object obj, final String fieldName, final Object value) {
+        Class<?> clazz = obj.getClass();
+        while ( clazz != null ) {
+            try {
+                final Field field = clazz.getDeclaredField(fieldName);
+                field.setAccessible(true);
+
+                field.set(obj, value);
+                return null;
+            } catch ( final Exception ignore ) {
+                // ignore
+            }
+            clazz = clazz.getSuperclass();
+        }
+        throw new RuntimeException("Field " + fieldName + " not found on object " + obj);
+    }
+
+    private DiscoveryService createService(final boolean activate) {
+        final DiscoveryService service = new NoClusterDiscoveryService();
+
+        setField(service, "settingsService", new SlingSettingsService() {
+
+            @Override
+            public String getSlingId() {
+                return "my-sling-id";
+            }
+
+            @Override
+            public String getSlingHomePath() {
+                return null;
+            }
+
+            @Override
+            public URL getSlingHome() {
+                return null;
+            }
+
+            @Override
+            public Set<String> getRunModes() {
+                return null;
+            }
+
+            @Override
+            public String getAbsolutePathWithinSlingHome(String relativePath) {
+                return null;
+            }
+        });
+        if ( activate ) {
+            invoke(service, "activate");
+        }
+
+        return service;
+    }
+
+    @Test public void testBasics() throws Exception {
+        final DiscoveryService service = this.createService(true);
+
+        assertNotNull(service.getTopology());
+        assertTrue(service.getTopology().isCurrent());
+
+        invoke(service, "deactivate");
+
+        assertNull(service.getTopology());
+    }
+
+    @Test public void testListenerAfter() throws Exception {
+        final DiscoveryService service = this.createService(true);
+
+        final List<TopologyEvent> events = new ArrayList<TopologyEvent>();
+
+        final TopologyEventListener listener = new TopologyEventListener() {
+
+            @Override
+            public void handleTopologyEvent(final TopologyEvent event) {
+                events.add(event);
+            }
+        };
+        invoke(service, "bindTopologyEventListener", new Class[] {TopologyEventListener.class}, new Object[] {listener});
+        assertEquals(1, events.size());
+        assertEquals(TopologyEvent.Type.TOPOLOGY_INIT, events.get(0).getType());
+        assertNotNull(events.get(0).getNewView());
+        assertNull(events.get(0).getOldView());
+    }
+
+    @Test public void testListenerBefore() throws Exception {
+        final DiscoveryService service = this.createService(false);
+
+        final List<TopologyEvent> events = new ArrayList<TopologyEvent>();
+
+        final TopologyEventListener listener = new TopologyEventListener() {
+
+            @Override
+            public void handleTopologyEvent(final TopologyEvent event) {
+                events.add(event);
+            }
+        };
+        invoke(service, "bindTopologyEventListener", new Class[] {TopologyEventListener.class}, new Object[] {listener});
+        assertEquals(0, events.size());
+
+        invoke(service, "activate");
+        assertEquals(1, events.size());
+        assertEquals(TopologyEvent.Type.TOPOLOGY_INIT, events.get(0).getType());
+        assertNotNull(events.get(0).getNewView());
+        assertNull(events.get(0).getOldView());
+    }
+
+    @Test public void testPropertyChanges() throws Exception {
+        final DiscoveryService service = this.createService(true);
+
+        final List<TopologyEvent> events = new ArrayList<TopologyEvent>();
+
+        final TopologyEventListener listener = new TopologyEventListener() {
+
+            @Override
+            public void handleTopologyEvent(final TopologyEvent event) {
+                events.add(event);
+            }
+        };
+        invoke(service, "bindTopologyEventListener", new Class[] {TopologyEventListener.class}, new Object[] {listener});
+        events.clear();
+
+        final PropertyProvider provider = new PropertyProvider() {
+
+            @Override
+            public String getProperty(final String name) {
+                if ( "a".equals(name) ) {
+                    return "1";
+                }
+                if ( "b".equals(name) ) {
+                    return "2";
+                }
+                if ( "c".equals(name) ) {
+                    return "3";
+                }
+                return null;
+            }
+        };
+        final Map<String, Object> properties = new HashMap<String, Object>();
+        properties.put(PropertyProvider.PROPERTY_PROPERTIES, new String[] {"a", "b", "c"});
+        properties.put(Constants.SERVICE_ID, 1L);
+
+        invoke(service, "bindPropertyProvider", new Class[] {PropertyProvider.class, Map.class}, new Object[] {provider, properties});
+
+        assertEquals(1, events.size());
+        assertEquals(TopologyEvent.Type.PROPERTIES_CHANGED, events.get(0).getType());
+        assertNotNull(events.get(0).getNewView());
+        assertTrue(events.get(0).getNewView().isCurrent());
+        assertNotNull(events.get(0).getOldView());
+        assertFalse(events.get(0).getOldView().isCurrent());
+
+        // test properties
+        assertEquals("1", events.get(0).getNewView().getLocalInstance().getProperty("a"));
+        assertEquals("2", events.get(0).getNewView().getLocalInstance().getProperty("b"));
+        assertEquals("3", events.get(0).getNewView().getLocalInstance().getProperty("c"));
+        assertNull(events.get(0).getOldView().getLocalInstance().getProperty("a"));
+        assertNull(events.get(0).getOldView().getLocalInstance().getProperty("b"));
+        assertNull(events.get(0).getOldView().getLocalInstance().getProperty("c"));
+
+        events.clear();
+        invoke(service, "unbindPropertyProvider", new Class[] {PropertyProvider.class, Map.class}, new Object[] {provider, properties});
+        assertEquals(1, events.size());
+        assertEquals(TopologyEvent.Type.PROPERTIES_CHANGED, events.get(0).getType());
+        assertNotNull(events.get(0).getNewView());
+        assertTrue(events.get(0).getNewView().isCurrent());
+        assertNotNull(events.get(0).getOldView());
+        assertFalse(events.get(0).getOldView().isCurrent());
+
+        assertEquals("1", events.get(0).getOldView().getLocalInstance().getProperty("a"));
+        assertEquals("2", events.get(0).getOldView().getLocalInstance().getProperty("b"));
+        assertEquals("3", events.get(0).getOldView().getLocalInstance().getProperty("c"));
+        assertNull(events.get(0).getNewView().getLocalInstance().getProperty("a"));
+        assertNull(events.get(0).getNewView().getLocalInstance().getProperty("b"));
+        assertNull(events.get(0).getNewView().getLocalInstance().getProperty("c"));
+    }
+}

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

[sling-org-apache-sling-discovery-standalone] 18/23: Update the main reactor to parent 25

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

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-standalone.git

commit 2db5c7f8ac0753a82f713a6c4a494d372d5e57c8
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Mon Oct 5 10:03:45 2015 +0000

    Update the main reactor to parent 25
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1706780 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 738001d..c2b7c08 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>24</version>
+        <version>25</version>
         <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-standalone] 02/23: Create new support module

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

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-standalone.git

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

    Create new support module
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1482243 13f79535-47bb-0310-9956-ffa450edef68
---
 .../sling/discovery/impl/standalone/NoClusterDiscoveryService.java   | 5 ++---
 .../sling/discovery/impl/standalone/StandardPropertyProvider.java    | 2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/apache/sling/discovery/impl/standalone/NoClusterDiscoveryService.java b/src/main/java/org/apache/sling/discovery/impl/standalone/NoClusterDiscoveryService.java
index cfb3c6b..e495e99 100644
--- a/src/main/java/org/apache/sling/discovery/impl/standalone/NoClusterDiscoveryService.java
+++ b/src/main/java/org/apache/sling/discovery/impl/standalone/NoClusterDiscoveryService.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.discovery.impl;
+package org.apache.sling.discovery.impl.standalone;
 
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -32,7 +32,6 @@ 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;
@@ -57,7 +56,7 @@ import org.slf4j.LoggerFactory;
  * 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)
+@Component(immediate=true)
 @Service(value = {DiscoveryService.class})
 public class NoClusterDiscoveryService implements DiscoveryService {
 
diff --git a/src/main/java/org/apache/sling/discovery/impl/standalone/StandardPropertyProvider.java b/src/main/java/org/apache/sling/discovery/impl/standalone/StandardPropertyProvider.java
index 798ff0a..dacdb7a 100644
--- a/src/main/java/org/apache/sling/discovery/impl/standalone/StandardPropertyProvider.java
+++ b/src/main/java/org/apache/sling/discovery/impl/standalone/StandardPropertyProvider.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.discovery.impl;
+package org.apache.sling.discovery.impl.standalone;
 
 import java.util.ArrayList;
 import java.util.Collection;

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

[sling-org-apache-sling-discovery-standalone] 14/23: Remove inherited dependencies

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

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-standalone.git

commit e9cfaa215b50404eddfe6fd8e5f79a6ed8d2dc76
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Apr 27 14:08:35 2015 +0000

    Remove inherited dependencies
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1676270 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/pom.xml b/pom.xml
index 08a9c70..2c87a3b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -57,14 +57,6 @@
     </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.slf4j</groupId>
             <artifactId>slf4j-api</artifactId>
         </dependency>

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

[sling-org-apache-sling-discovery-standalone] 04/23: Add missing poms

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

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-standalone.git

commit cb7c548a2c2e855d633984d16689ed6b36b43b26
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue May 14 10:56:24 2013 +0000

    Add missing poms
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1482297 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 92 insertions(+)

diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..f71ab11
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,92 @@
+<?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>16</version>
+        <relativePath>../../../parent/pom.xml</relativePath>
+    </parent>
+
+    <artifactId>org.apache.sling.discovery.standalone</artifactId>
+    <packaging>bundle</packaging>
+    <version>0.0.1-SNAPSHOT</version>
+
+    <name>Apache Sling Discovery Standalone Implementation</name>
+    <description>
+        Implementation of the discovery API for standalone instances
+    </description>
+
+    <scm>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/standalone</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/standalone</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/discovery/standalone</url>
+    </scm>
+
+    <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>
+        </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.discovery.api</artifactId>
+            <version>1.0.1-SNAPSHOT</version>
+            <scope>provided</scope>
+        </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-standalone] 21/23: [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 branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-standalone.git

commit c4eeef198b9a07e86000d6274c4f638f5aa3ba9b
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue Dec 29 13:37:06 2015 +0000

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

diff --git a/pom.xml b/pom.xml
index d9caea5..c703e1b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,7 +29,7 @@
 
     <artifactId>org.apache.sling.discovery.standalone</artifactId>
     <packaging>bundle</packaging>
-    <version>1.0.2</version>
+    <version>1.0.3-SNAPSHOT</version>
 
     <name>Apache Sling Discovery Standalone Implementation</name>
     <description>
@@ -37,9 +37,9 @@
     </description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.discovery.standalone-1.0.2</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.discovery.standalone-1.0.2</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.discovery.standalone-1.0.2</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/standalone</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/standalone</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/discovery/standalone</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-standalone] 22/23: Switch to parent pom 26

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

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-standalone.git

commit fe0afed43ae3552ddeae1812345294710b15a5e8
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Sun Jan 3 14:07:46 2016 +0000

    Switch to parent pom 26
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1722720 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index c703e1b..80d3527 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>25</version>
+        <version>26</version>
         <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-standalone] 20/23: [maven-release-plugin] prepare release org.apache.sling.discovery.standalone-1.0.2

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

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-standalone.git

commit dfe0813c1042ee155328e9a9dcfa2e62b6a518ea
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue Dec 29 13:36:51 2015 +0000

    [maven-release-plugin] prepare release org.apache.sling.discovery.standalone-1.0.2
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1722126 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/pom.xml b/pom.xml
index 7f8f02b..d9caea5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -24,12 +24,12 @@
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
         <version>25</version>
-        <relativePath/>
+        <relativePath />
     </parent>
 
     <artifactId>org.apache.sling.discovery.standalone</artifactId>
     <packaging>bundle</packaging>
-    <version>1.0.1-SNAPSHOT</version>
+    <version>1.0.2</version>
 
     <name>Apache Sling Discovery Standalone Implementation</name>
     <description>
@@ -37,9 +37,9 @@
     </description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/standalone</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/standalone</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/discovery/standalone</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.discovery.standalone-1.0.2</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.discovery.standalone-1.0.2</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.discovery.standalone-1.0.2</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-standalone] 13/23: SLING-4505 Relative paths has been set to correct value.

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

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-standalone.git

commit 8c662622d2991f7c9eb9ab918c1b52d059a2eba1
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Mon Mar 16 13:22:00 2015 +0000

    SLING-4505 Relative paths has been set to correct value.
    
    Submitted-By: Petr_Shypila <pe...@sap.com>
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1666984 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 984b851..08a9c70 100644
--- a/pom.xml
+++ b/pom.xml
@@ -24,7 +24,7 @@
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
         <version>22</version>
-        <relativePath>../../../parent/pom.xml</relativePath>
+        <relativePath>../../../../parent/pom.xml</relativePath>
     </parent>
 
     <artifactId>org.apache.sling.discovery.standalone</artifactId>

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

[sling-org-apache-sling-discovery-standalone] 09/23: Update to parent pom 18

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

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-standalone.git

commit 8f8bf1431245a6b7def831442a0f51b8084f6224
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Fri Sep 6 12:15:57 2013 +0000

    Update to parent pom 18
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1520554 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 5d10fa1..089c32c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>17</version>
+        <version>18</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-standalone] 10/23: Update to parent pom v19

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

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-standalone.git

commit 12b25aea532fc6d5339e2c4ddddf602df7fd32b4
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Mar 31 14:39:20 2014 +0000

    Update to parent pom v19
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1583337 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 089c32c..659a105 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>18</version>
+        <version>19</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-standalone] 03/23: Create new support module

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

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-standalone.git

commit 886d22eaa11650da33fb9d2cf6a01f6fd1f52a11
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue May 14 08:09:45 2013 +0000

    Create new support module
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1482245 13f79535-47bb-0310-9956-ffa450edef68
---
 .../impl/standalone/StandardPropertyProvider.java  | 219 ---------------------
 1 file changed, 219 deletions(-)

diff --git a/src/main/java/org/apache/sling/discovery/impl/standalone/StandardPropertyProvider.java b/src/main/java/org/apache/sling/discovery/impl/standalone/StandardPropertyProvider.java
deleted file mode 100644
index dacdb7a..0000000
--- a/src/main/java/org/apache/sling/discovery/impl/standalone/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.standalone;
-
-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-standalone] 12/23: Update to Sling Parent POM 22 with baselining enabled

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

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-standalone.git

commit 5d7432433a370506ddcdece9227868ee4d29fc6b
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Wed Oct 1 06:57:44 2014 +0000

    Update to Sling Parent POM 22 with baselining enabled
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1628622 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 35f27a7..984b851 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>20</version>
+        <version>22</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-standalone] 06/23: Use released discovery api

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

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-standalone.git

commit f85fc07f5f2e2ef76a71718170a19cc24b07b5ad
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Fri Jul 19 07:11:07 2013 +0000

    Use released discovery api
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1504792 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index f7cc47f..8f5f417 100644
--- a/pom.xml
+++ b/pom.xml
@@ -79,7 +79,7 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.discovery.api</artifactId>
-            <version>1.0.1-SNAPSHOT</version>
+            <version>1.0.0</version>
             <scope>provided</scope>
         </dependency>
         <dependency>

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

[sling-org-apache-sling-discovery-standalone] 01/23: 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 branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-standalone.git

commit 304f635bac146ecd91a40ded6ebd69f698e91fcf
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@1482239 13f79535-47bb-0310-9956-ffa450edef68
---
 .../impl/standalone/NoClusterDiscoveryService.java | 392 +++++++++++++++++++++
 .../impl/standalone/StandardPropertyProvider.java  | 219 ++++++++++++
 2 files changed, 611 insertions(+)

diff --git a/src/main/java/org/apache/sling/discovery/impl/standalone/NoClusterDiscoveryService.java b/src/main/java/org/apache/sling/discovery/impl/standalone/NoClusterDiscoveryService.java
new file mode 100644
index 0000000..cfb3c6b
--- /dev/null
+++ b/src/main/java/org/apache/sling/discovery/impl/standalone/NoClusterDiscoveryService.java
@@ -0,0 +1,392 @@
+/*
+ * 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/standalone/StandardPropertyProvider.java b/src/main/java/org/apache/sling/discovery/impl/standalone/StandardPropertyProvider.java
new file mode 100644
index 0000000..798ff0a
--- /dev/null
+++ b/src/main/java/org/apache/sling/discovery/impl/standalone/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-standalone] 11/23: Updated to parent version 20

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

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-standalone.git

commit 7e6c2572e7097a761e03a72effdfb94dad8e83d0
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Fri Aug 1 19:16:26 2014 +0000

    Updated to parent version 20
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1615208 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 659a105..35f27a7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>19</version>
+        <version>20</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-standalone] 07/23: [maven-release-plugin] prepare release org.apache.sling.discovery.standalone-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 branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-standalone.git

commit 04cc9ad8f6c4917a14f8bf4c5f6a093961583211
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Fri Aug 9 07:04:19 2013 +0000

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

diff --git a/pom.xml b/pom.xml
index 8f5f417..8a4cd68 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,7 +29,7 @@
 
     <artifactId>org.apache.sling.discovery.standalone</artifactId>
     <packaging>bundle</packaging>
-    <version>0.0.1-SNAPSHOT</version>
+    <version>1.0.0</version>
 
     <name>Apache Sling Discovery Standalone Implementation</name>
     <description>
@@ -37,9 +37,9 @@
     </description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/standalone</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/standalone</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/discovery/standalone</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.discovery.standalone-1.0.0</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.discovery.standalone-1.0.0</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.discovery.standalone-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-standalone] 05/23: Update to latest parent pom

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

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-standalone.git

commit 7b5fea36a9d179de6dadd65f533b554273921516
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Fri Jul 19 07:04:15 2013 +0000

    Update to latest parent pom
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1504788 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index f71ab11..f7cc47f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>16</version>
+        <version>17</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-standalone] 16/23: Update to Sling Parent 23

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

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-standalone.git

commit dc0750c2411c357556b38c4ad2e7a96b7b357285
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Thu Jun 25 13:08:16 2015 +0000

    Update to Sling Parent 23
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1687500 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 1f72066..1b9ff2d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>22</version>
+        <version>23</version>
         <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-standalone] 08/23: [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 branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-standalone.git

commit 1e5590bfdc753353c7b653a4961ab646ddac4a6b
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Fri Aug 9 07:04:50 2013 +0000

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

diff --git a/pom.xml b/pom.xml
index 8a4cd68..5d10fa1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,7 +29,7 @@
 
     <artifactId>org.apache.sling.discovery.standalone</artifactId>
     <packaging>bundle</packaging>
-    <version>1.0.0</version>
+    <version>1.0.1-SNAPSHOT</version>
 
     <name>Apache Sling Discovery Standalone Implementation</name>
     <description>
@@ -37,9 +37,9 @@
     </description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.discovery.standalone-1.0.0</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.discovery.standalone-1.0.0</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.discovery.standalone-1.0.0</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/standalone</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/standalone</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/discovery/standalone</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-standalone] 23/23: SLING-7167 Adjust READMEs

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

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-standalone.git

commit c9c3806e202144a345c2f73026a18da11e009dc7
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Tue Oct 3 09:21:20 2017 +0000

    SLING-7167 Adjust READMEs
    
    add missing README
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1810688 13f79535-47bb-0310-9956-ffa450edef68
---
 README.md | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/README.md b/README.md
new file mode 100644
index 0000000..863407d
--- /dev/null
+++ b/README.md
@@ -0,0 +1,3 @@
+# Apache Sling Discovery Standalone Implementation
+
+This module is part of the [Apache Sling](https://sling.apache.org) project.

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