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

[sling-org-apache-sling-discovery-commons] annotated tag org.apache.sling.discovery.commons-1.0.12 created (now dc7f54a)

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

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


      at dc7f54a  (tag)
 tagging 4758c087be9cefac7d541f51f93238ea645b3bfb (commit)
      by Stefan Egli
      on Mon Mar 21 14:21:32 2016 +0000

- Log -----------------------------------------------------------------
org.apache.sling.discovery.commons-1.0.12
-----------------------------------------------------------------------

This annotated tag includes the following new commits:

     new b8fe30c  SLING-4665 : adding patch provided by Timothee Maret, many thanks
     new 7eadb24  svn:ignore updated
     new 5943189  SLING-4685 : adding initial version of ViewStateManager - a shared implementation of TopologyEventListener-handling and sending of events based on activate/deactivate/changing/newView triggers - intended for use by implementors of the discovery.api (not clients of it)
     new f438f9e  SLING-4698 - Set parent.relativePath to empty for all modules
     new 576bc0d  Update svn:ignore
     new f93b193  Update to Sling Parent 23
     new 0035b7d  set parent version to 24 and add empty relativePath where missing
     new e599fa8  Update the main reactor to parent 25
     new 9a31ba9  SLING-5131 : introducing ConsistencyService and an oak-discovery-lite based implementation of it - plus SLING-4697 : support for PROPERTIES_CHANGED added to ViewStateManagerImpl
     new b33eee0  SLING-5131 : re-adding ViewStateManager which for some reason got removed by svn in 1707548
     new bb3d20d  SLING-4697 : support for PROPERTIES_CHANGED in ViewStateManagerImpl tested and thus fixed
     new 0e44e3d  SLING-5173 : introducing discovery.base which is the sharable parts of discovery.impl for discovery.oak - eg it includes topology connectors and base classes - plus it also includes many it-kind tests of discovery.impl
     new 3d923b4  SLING-5173 : rename commons impl packages to base as they are meant for reuse by discovery.impl and discovery.oak - plus avoid using abstract component class with scr annotations - use abstract getters instead - plus some more fine-tuning of log messages - plus make discovery.impl's Config also implement DiscoveryLiteConfig - plus properly handle binds happening before activate in DiscoveryServiceImpl
     new 6dd90e1  SLING-5173 : adding refactored SyncTokenOnlyConsistencyService again
     new dd9150c  SLING-4603 related : some fixes in class structure / syncToken handling
     new cf6bb53  SLING-5173 related : EventFactory renamed to EventHelper - and introduced toShortString() for a few base view classes to shorten and make the log output more readable
     new dcfc44f  SLING-5173 and SLING-4603 related : more syncToken log.info - plus always doing the syncToken thingy, independent of whether any instance left or joined the cluster as otherwise this thing wont work
     new 81a52c9  SLING-5173 : log.info fix
     new 8b4c590  SLING-5094 / SLING-4603 related : cancel ongoing sync explicitly in order to avoid dangerous CHANGED event when changes happen during sync
     new f957528  SLING-5173 : reducing visibility of isDelaying
     new 732f4d6  SLING-5173 : reduce log in cancel when already done
     new e88458a  SLING-4603 : more aggressively clearing the idMap-cache to avoid stale entries on slingId change - plus added getSyncHistory to BaseSyncTokenConsistencyService to allow adding it to the webconsole for debug - plus some cleanup in webconsole wrt discoveryLite info
     new 36ac966  SLING-5173 : introducing a more explicit chain concept for ConsistencyServices than the previous hidden/implicit one: ConsistencyServiceChain
     new 1a36029  SLING-5173 : added simple implementation for findInstances
     new 8d22485  SLING-5173 : added getInstance(slingId) to simplify things
     new 6dd354e  SLING-5173 : introducing a more explicit chain concept for ConsistencyServices than the previous hidden/implicit one: ConsistencyServiceChain
     new df6d865  SLING-5173 : bugfix for leader changes: leader change was treated as a properties change - which was very bad - now it is properly treated as a TOPOLOGY_CHANGED. Note that leader change should not happen in an otherwise unchanged topology - but it can if one instance's discovery.oak bundle for example is restarted, thus getting a lower leaderElectionId. Thus discovery.commons must account for this
     new 3edba1a  SLING-5173 : re-added complete consistency-history after introducing splitting them and using the ConsistencyServiceChain. Probably should be refactored into something slightly nicer though
     new 05027b8  SLING-5173 : minor code cleanup (duplicate logger removed)
     new 2e5938f  SLING-4603 : even more aggressively clearing the idMap-cache to avoid stale entries : now registering an EventHandler that listens on /var/discovery/../idMap and clears the cache on any change therein
     new 11a225d  SLING-4603 : minor fix to previous commit : turns out the path must be /var/xy/idMap not /var/xy/idMap/* as that would apply to children only
     new 5a5f5ee  SLING-5094 / SLING-5173 / SLING-4603 related : ensure that before invoking the ConsistencyService.sync no async events are still in the queue. This is achieved by enqueueing an async event too that once it gets triggered ensures that no async events are left. This mechanism ensures that before the syncToken is written, all TopologyEventListeners have received a TOPOLOGY_CHANGING - and only that guarantees that the syncToken mechanism carries a high guarantee.
     new 26e1a7b  SLING-5094 / SLING-5173 / SLING-4603 related : ensure that before invoking the ConsistencyService.sync no async events are still in the queue. This is achieved by enqueueing an async event too that once it gets triggered ensures that no async events are left. This mechanism ensures that before the syncToken is written, all TopologyEventListeners have received a TOPOLOGY_CHANGING - and only that guarantees that the syncToken mechanism carries a high guarantee.
     new fc2a805  SLING-5191 / SLING-4603 : rename ConsistencyService to ClusterSyncService - plus making timeout/interval values for the same configurable in discovery.oak
     new 032f500  SLING-5094 related : more test stability by adding a wait time of 2sec
     new e5ded77  SLING-5094 / SLING-5191 / SLING-4603 : rename ConsistencyService to ClusterSyncService
     new fdd2176  [maven-release-plugin] prepare release org.apache.sling.discovery.commons-1.0.0
     new 1df7dc1  [maven-release-plugin] prepare for next development iteration
     new 283f6b9  SLING-5214: include millis in testing log formats
     new 5c5f5e8  SLING-5225 : increase wait times to avoid test failure on jenkins due to lower hardware speed
     new 9dcf468  [maven-release-plugin] prepare release org.apache.sling.discovery.commons-1.0.2
     new a5144bc  [maven-release-plugin] prepare for next development iteration
     new d71490a  SLING-5256 : change in localClusterSyncTokenId should always trigger a TOPOLOGY_CHANGED - ensured by adjusting ViewStateManager.onlyDiffersInProperties and DefaultTopologyView.compareTopology accordingly including new tests for both - plus added OakDiscoveryServiceTest.testDescriptorSeqNumChange to verify that discovery.oak now properly detects otherwise-equal topologies when their sequence_number==localClusterSyncTokenId differs (unlikely to happen under normal load sit [...]
     new 0f3c5c8  no-jira : fixed a log.trace message
     new 3529e4f  SLING-5267 : fixed testTwoNodesOneLeaving by making wait times safer, asserting for background-runnable done-state, plus added more logging in case this one is still not perfectly stable on jenkins
     new 8f8aedf  SLING-5282 : calling consistencyService.cancelSync(); in handleDeactivated
     new 7571e2f  [maven-release-plugin] prepare release org.apache.sling.discovery.commons-1.0.4
     new 1cc2db6  [maven-release-plugin] prepare for next development iteration
     new dbdcc68  SLING-5310: adding cancelDelaying to MinEventDelayHandler - plus added a testReactivate test method which checks the scenario described in this ticket. Plus also added somewhat more logging to the HeartbeatHandler to help debugging should something similar reoccur
     new ca87b3d  SLING-5310 : replaced waitForAsyncEvents(4sec) with Thread.sleep(4sec) then another waitForAsyncEvents(2sec) to avoid making the assertion just when the event would yet be triggered
     new be1c2b7  [maven-release-plugin] prepare release org.apache.sling.discovery.commons-1.0.6
     new 51fd2d4  [maven-release-plugin] prepare for next development iteration
     new 4830188  Remove type from bundle dependencies
     new ea02b02  Switch to parent pom 26
     new 8cb4867  SLING-5458 : id can now be null - return null in getViewId in that case
     new c664312  SLING-5458 : when clusterView.getId differs, that must result in a TOPOLOGY_CHANGING/CHANGED sequence - unlike before this fix where it just resulted in a PROPERTIES_CHANGED - which is wrong
     new c29e93e  [maven-release-plugin] prepare release org.apache.sling.discovery.commons-1.0.8
     new ccce69b  [maven-release-plugin] prepare for next development iteration
     new 8468d76  SLING-5464 : fixed regression introduced in onlyDiffersInProperties - and added a proper JUnit test which would have avoided the problem in the first place
     new 6d303d2  [maven-release-plugin] prepare release org.apache.sling.discovery.commons-1.0.10
     new 6e713d1  [maven-release-plugin] prepare for next development iteration
     new c57bb81  SLING-5494 : Discovery InstancesDiff.retained() implementation not according to API doc - Match the API with the implementation - This closes #122 of github pull request of tmaret, many thx
     new 1e2a10d  SLING-5592 : cancel backgroundCheck thread in deactivate for rare cases where it is still running
     new e3d6546  SLING-5620 : upgrade sling.commons.scheduler dependency to 2.4.0
     new 202f5b9  SLING-5621 : adding InitDelayingTopologyEventListener that came up as part of SLING-5560 to discovery.commons
     new 5fdb4c5  [maven-release-plugin] prepare release org.apache.sling.discovery.commons-1.0.12
     new 4758c08  [maven-release-plugin] copy for tag org.apache.sling.discovery.commons-1.0.12

The 67 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-commons] 05/07: SLING-5621 : adding InitDelayingTopologyEventListener that came up as part of SLING-5560 to discovery.commons

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

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

commit 202f5b97b1de750419a3dc5b41b70fa0cc181d51
Author: Stefan Egli <st...@apache.org>
AuthorDate: Mon Mar 21 14:16:26 2016 +0000

    SLING-5621 : adding InitDelayingTopologyEventListener that came up as part of SLING-5560 to discovery.commons
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons@1735979 13f79535-47bb-0310-9956-ffa450edef68
---
 .../commons/InitDelayingTopologyEventListener.java | 244 +++++++++++
 .../sling/discovery/commons/package-info.java      |   2 +-
 .../TestInitDelayingTopologyEventListener.java     | 459 +++++++++++++++++++++
 3 files changed, 704 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/sling/discovery/commons/InitDelayingTopologyEventListener.java b/src/main/java/org/apache/sling/discovery/commons/InitDelayingTopologyEventListener.java
new file mode 100644
index 0000000..4014f80
--- /dev/null
+++ b/src/main/java/org/apache/sling/discovery/commons/InitDelayingTopologyEventListener.java
@@ -0,0 +1,244 @@
+/*
+ * 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.commons;
+
+import java.sql.Date;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import org.apache.sling.commons.scheduler.Scheduler;
+import org.apache.sling.discovery.TopologyEvent;
+import org.apache.sling.discovery.TopologyEvent.Type;
+import org.apache.sling.discovery.TopologyEventListener;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * This listener facade applies a 'startup delay' to a topology event handler,
+ * that is, it allows to specify a startup time during which any topology events
+ * will be queued and processing only starts after this time.
+ * <p>
+ * What happens aFter the startup time depends on what was received during the delay:
+ * <ul>
+ *  <li>if no events were received then this is a no-op</li>
+ *  <li>if the last event received was a CHANGING then this facade
+ *      waits until it receives the next non-CHANGING event (which should
+ *      be the very next), to then simulate an INIT event
+ *      (as the discovery API says the first event received is an INIT event).
+ *      </li>
+ *  <li>if the last event received was not a CHANGING event
+ *      (ie it was an INIT, CHANGED or PROPERTIES), then 
+ *      as soon as the startup time passes this facade will simulate
+ *      an INIT event
+ *      (again, as the discovery API says the first event received is an INIT event)
+ *      </li>
+ * </ul>
+ * Note that users of this facade must call dispose to avoid any async calls
+ * to the delegate after startup, in case they themselves are deactivated!
+ * @since 1.1.0
+ */
+public class InitDelayingTopologyEventListener implements TopologyEventListener {
+
+    /** the logger used by this listener - can be set in the constructor optionally to fit better into user log structure */
+    private final Logger logger;
+
+    /** the delegate which does the actual event processing after delaying **/
+    private final TopologyEventListener delegate;
+
+    /** the sync object used to guard asynchronous discovery events and scheduler callback **/
+    private final Object syncObj = new Object();
+
+    /** the guarded flag indicating whether this listener is active or disposed - used between scheduler callback and dispose **/
+    private final AtomicBoolean active = new AtomicBoolean(false);
+
+    /** flag indicating whether we're still delaying or not **/
+    private boolean delaying = true;
+    
+    /** the last pending delayed event - we only have to keep the last event to support all different cases **/
+    private TopologyEvent pendingDelayedEvent = null;
+
+    /** 
+     * Creates a new init-delaying listener with the given delay, delegate and scheduler.
+     * <p>
+     * For properly disposing the caller should use the dispose method!
+     * @see #dispose()
+     */
+    public InitDelayingTopologyEventListener(final long startupDelay, final TopologyEventListener delegate, final Scheduler scheduler) {
+        this(startupDelay, delegate, scheduler, null);
+    }
+
+    /**
+     * Creates a new init-delaying listener with the given delay, delegate, scheduler and optinoal logger.
+     * <p>
+     * For properly disposing the caller should use the dispose method!
+     * @see #dispose()
+     */
+    public InitDelayingTopologyEventListener(final long startupDelay, final TopologyEventListener delegate, 
+            final Scheduler scheduler, final Logger loggerOrNull) {
+        if ( scheduler == null ) {
+            throw new IllegalArgumentException("scheduler must not be null");
+        }
+        if ( delegate == null ) {
+            throw new IllegalArgumentException("delegate must not be null");
+        }
+        if ( startupDelay <= 0) {
+            throw new IllegalArgumentException("startupDelay must be greater than 0, not " + startupDelay);
+        }
+        this.delegate = delegate;
+        if ( loggerOrNull != null ) {
+            this.logger = loggerOrNull;
+        } else {
+            this.logger = LoggerFactory.getLogger(this.getClass());
+        }
+        final Runnable r = new Runnable() {
+            
+            @Override
+            public void run() {
+                if (InitDelayingTopologyEventListener.this.active.get()) {
+                    // only call afterStartupDelay if we're active
+                    // (to avoid this call if disposed in the meantime)
+                    
+                    // and since after disposing this listener is no longer
+                    // used - ie it is a throw-away - you can create
+                    // such a listener on each activate and dispose it on
+                    // deactivate and you'll be fine.
+
+                    // in any case - time for calling afterStartupDelay here:
+                    afterStartupDelay();
+                }
+            }
+        };
+        
+        // mark this listener as active
+        this.active.set(true);
+
+        // schedule me if you can
+        if ( !scheduler.schedule(r, scheduler.AT(new Date(System.currentTimeMillis() + startupDelay * 1000))) ) {
+            // if for whatever reason scheduling doesn't work, let's run now
+            logger.warn("activate: could not schedule startupDelay handler with scheduler ({}) - "
+                    + "thus starting ({}) immediately", scheduler, delegate);
+            r.run();
+        }
+        // SLING-5560 : at this point either r is invoked immediately or scheduled after the delay
+    }
+    
+    @Override
+    public void handleTopologyEvent(TopologyEvent event) {
+        synchronized ( syncObj ) {
+            if ( this.delaying ) {
+                // when we're delaying, keep hold of the last event
+                // as action afterStartupDelay depends on this last
+                // event
+                this.logger.debug("handleTopologyEvent: delaying processing of received topology event (startup delay active) {}", event);
+                this.pendingDelayedEvent = event;
+                
+                // and we're delaying - so stop processing now and return
+                return;
+            } else if ( this.pendingDelayedEvent != null ) {
+                // this means that while we're no longer delaying we still
+                // have a pending delayed event to process.
+                // more concretely, it means that this event is a CHANGING
+                // event (as the others are treated via an artificial INIT event
+                // in afterStartupDelay).
+                // which means that we must now convert the new event into an INIT
+                // to ensure our code gets an INIT first thing
+                
+                // paranoia check:
+                if ( event.getType() == Type.TOPOLOGY_CHANGING ) {
+                    // this should never happen - but if it does, rinse and repeat
+                    this.pendingDelayedEvent = event;
+                    this.logger.info("handleTopologyEvent: ignoring received topology event of type CHANGING {}", event);
+                    return;
+                } else {
+                    // otherwise we now **convert** the event to an init event
+                    this.pendingDelayedEvent = null;
+                    this.logger.debug("handleTopologyEvent: first stable topology event received after startup delaying. "
+                            + "Simulating an INIT event with this new view: {}", event);
+                    event = new TopologyEvent(Type.TOPOLOGY_INIT, null, event.getNewView());
+                }
+            } else {
+                // otherwise we're no longer delaying nor do we have a pending-backlog.
+                // we can just pass the event through
+                this.logger.debug("handleTopologyEvent: received topology event {}", event);
+            }
+        }
+        // no delaying applicable - call delegate
+        this.delegate.handleTopologyEvent(event);
+    }
+    
+    /**
+     * Marks this listener as no longer active - ensures that it doesn't call the delegate
+     * via any potentially pending scheduler callback.
+     * <p>
+     * Note that after dispose you can *still* call handleTopologyEvent and the events
+     * are passed to the delegate - but those are expected to be 'late' events and not 
+     * really part of the normal game. Hence, the caller must also ensure that the 
+     * handleTopologyEvent method isn't called anymore (which typically is automatically
+     * guaranteed since the caller is typically an osgi service that gets unregistered anyway)
+     */
+    public void dispose() {
+        this.active.set(false);
+    }
+
+    /**
+     * Called via the scheduler callback when the startup delay has passed.
+     * <p>
+     * Hence only called once!
+     */
+    private void afterStartupDelay() {
+        synchronized ( this.syncObj ) {
+            // stop any future delaying
+            this.delaying = false;
+            
+            if ( this.pendingDelayedEvent == null ) {
+                // if no event received while we delayed,
+                // then we don't have to do anything later
+                this.logger.debug("afterStartupDelay: startup delay passed without any events delayed. "
+                        + "So, ready for first upcoming INIT event");
+            } else if ( this.pendingDelayedEvent.getType() == Type.TOPOLOGY_CHANGING ) {
+                // if the last delayed event was CHANGING
+                // then we must convert the next upcoming CHANGED, PROPERTIES
+                // into an INIT
+                
+                // and the way this is done in this class is by leving this
+                // event sit in this.pendingDelayedEvent, for grabs in handleTopologyEvent later
+                this.logger.debug("afterStartupDelay: startup delay passed, pending delayed event was CHANGING. "
+                        + "Waiting for next stable topology event");
+            } else {
+                // otherwise the last delayed event was either an INIT, CHANGED or PROPERTIES
+                // - but in any case we definitely never 
+                // processed any INIT - and our code expects an INIT
+                // as the first event ever..
+                
+                // so we now convert the event into an INIT
+                final TopologyEvent artificialInitEvent = 
+                        new TopologyEvent(Type.TOPOLOGY_INIT, null, this.pendingDelayedEvent.getNewView());
+                
+                this.logger.debug("afterStartupDelay: startup delay passed, last pending delayed event was stable ({}). "
+                        + "Simulating an INIT event with that view: {}", this.pendingDelayedEvent, artificialInitEvent); 
+                this.pendingDelayedEvent = null;
+                
+                // call the delegate.
+                // we must do this call in the synchronized block
+                // to ensure any concurrent new event waits properly
+                // before the INIT is done
+                delegate.handleTopologyEvent(artificialInitEvent);
+            }
+        }
+    }
+}
diff --git a/src/main/java/org/apache/sling/discovery/commons/package-info.java b/src/main/java/org/apache/sling/discovery/commons/package-info.java
index 8ed120a..427fb1a 100644
--- a/src/main/java/org/apache/sling/discovery/commons/package-info.java
+++ b/src/main/java/org/apache/sling/discovery/commons/package-info.java
@@ -22,7 +22,7 @@
  *
  * @version 1.0.0
  */
-@Version("1.0.0")
+@Version("1.1.0")
 package org.apache.sling.discovery.commons;
 
 import aQute.bnd.annotation.Version;
diff --git a/src/test/java/org/apache/sling/discovery/commons/TestInitDelayingTopologyEventListener.java b/src/test/java/org/apache/sling/discovery/commons/TestInitDelayingTopologyEventListener.java
new file mode 100644
index 0000000..8f224da
--- /dev/null
+++ b/src/test/java/org/apache/sling/discovery/commons/TestInitDelayingTopologyEventListener.java
@@ -0,0 +1,459 @@
+/*
+ * 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.commons;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+import java.io.Serializable;
+import java.util.Collections;
+import java.util.Date;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Timer;
+import java.util.TimerTask;
+
+import org.apache.sling.commons.scheduler.ScheduleOptions;
+import org.apache.sling.commons.scheduler.Scheduler;
+import org.apache.sling.discovery.ClusterView;
+import org.apache.sling.discovery.InstanceDescription;
+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.junit.Test;
+import org.mockito.Mockito;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class TestInitDelayingTopologyEventListener {
+    
+    private final Logger logger = LoggerFactory.getLogger(this.getClass());
+    
+    class TestListener implements TopologyEventListener {
+
+        private List<TopologyEvent> events = new LinkedList<TopologyEvent>();
+        
+        @Override
+        public void handleTopologyEvent(TopologyEvent event) {
+            synchronized(events) {
+                events.add(event);
+                events.notifyAll();
+            }
+        }
+        
+        public List<TopologyEvent> getEvents() {
+            synchronized(events) {
+                return events;
+            }
+        }
+
+        public void waitForEventCnt(int cnt, long timeout) throws InterruptedException {
+            final long start = System.currentTimeMillis();
+            synchronized(events) {
+                while (events.size() != cnt) {
+                    final long now = System.currentTimeMillis();
+                    final long remaining = (start + timeout) - now;
+                    if (remaining > 0) {
+                        events.wait(remaining);
+                    } else {
+                        fail("did not receive " + cnt + " events within " + timeout + " ms, "
+                                + "but " + events.size());
+                    }
+                }
+            }
+        }
+
+        public void assureEventCnt(int cnt, int timeout) throws InterruptedException {
+            final long start = System.currentTimeMillis();
+            synchronized(events) {
+                while (events.size() == cnt) {
+                    final long now = System.currentTimeMillis();
+                    final long remaining = (start + timeout) - now;
+                    if (remaining > 0) {
+                        events.wait(remaining);
+                    } else {
+                        // success
+                        return;
+                    }
+                }
+                fail("did not receive " + cnt + " events within " + timeout + " ms, "
+                        + "but " + events.size());
+            }
+        }
+    }
+
+    private Scheduler createScheduler() {
+        return new Scheduler() {
+
+            @Override
+            public boolean unschedule(String jobName) {
+                // TODO Auto-generated method stub
+                return false;
+            }
+
+            @Override
+            public boolean schedule(final Object job, ScheduleOptions options) {
+                if ( job instanceof Runnable ) {
+                    final Timer t = new Timer();
+                    t.schedule(new TimerTask() {
+
+                        @Override
+                        public void run() {
+                            ((Runnable)job).run();
+                        }
+                    }, 300);
+                    return true;
+                }
+                return false;
+            }
+
+            @Override
+            public void removeJob(String name) throws NoSuchElementException {
+                // TODO Auto-generated method stub
+
+            }
+
+            @Override
+            public boolean fireJobAt(String name, Object job, Map<String, Serializable> config, Date date, int times,
+                    long period) {
+                // TODO Auto-generated method stub
+                return false;
+            }
+
+            @Override
+            public void fireJobAt(String name, Object job, Map<String, Serializable> config, Date date) throws Exception {
+                // TODO Auto-generated method stub
+
+            }
+
+            @Override
+            public boolean fireJob(Object job, Map<String, Serializable> config, int times, long period) {
+                // TODO Auto-generated method stub
+                return false;
+            }
+
+            @Override
+            public void fireJob(Object job, Map<String, Serializable> config) throws Exception {
+                // TODO Auto-generated method stub
+
+            }
+
+            @Override
+            public void addPeriodicJob(String name, Object job, Map<String, Serializable> config, long period,
+                    boolean canRunConcurrently, boolean startImmediate) throws Exception {
+                // TODO Auto-generated method stub
+
+            }
+
+            @Override
+            public void addPeriodicJob(String name, Object job, Map<String, Serializable> config, long period,
+                    boolean canRunConcurrently) throws Exception {
+                // TODO Auto-generated method stub
+
+            }
+
+            @Override
+            public void addJob(String name, Object job, Map<String, Serializable> config, String schedulingExpression,
+                    boolean canRunConcurrently) throws Exception {
+                // TODO Auto-generated method stub
+
+            }
+
+            @Override
+            public ScheduleOptions NOW(int times, long period) {
+                // TODO Auto-generated method stub
+                return null;
+            }
+
+            @Override
+            public ScheduleOptions NOW() {
+                // TODO Auto-generated method stub
+                return null;
+            }
+
+            @Override
+            public ScheduleOptions EXPR(String expression) {
+                // TODO Auto-generated method stub
+                return null;
+            }
+
+            @Override
+            public ScheduleOptions AT(Date date, int times, long period) {
+                // TODO Auto-generated method stub
+                return null;
+            }
+
+            @Override
+            public ScheduleOptions AT(Date date) {
+                // TODO Auto-generated method stub
+                return null;
+            }
+        };
+    }
+
+    @Test
+    public void testConstructor() throws Exception {
+        final TopologyEventListener delegate = new TopologyEventListener() {
+            
+            @Override
+            public void handleTopologyEvent(TopologyEvent event) {
+                // nothing here atm
+            }
+        };
+        final Scheduler scheduler = createScheduler();
+        try{
+            new InitDelayingTopologyEventListener(-1, delegate, scheduler);
+            fail("should complain");
+        } catch(IllegalArgumentException re) {
+            // ok
+        }
+        try{
+            new InitDelayingTopologyEventListener(0, delegate, scheduler);
+            fail("should complain");
+        } catch(IllegalArgumentException re) {
+            // ok
+        }
+        try{
+            new InitDelayingTopologyEventListener(1, null, scheduler);
+            fail("should complain");
+        } catch(IllegalArgumentException re) {
+            // ok
+        }
+        try{
+            new InitDelayingTopologyEventListener(1, delegate, null);
+            fail("should complain");
+        } catch(IllegalArgumentException re) {
+            // ok
+        }
+        try{
+            new InitDelayingTopologyEventListener(-1, delegate, scheduler, null);
+            fail("should complain");
+        } catch(IllegalArgumentException re) {
+            // ok
+        }
+        try{
+            new InitDelayingTopologyEventListener(0, delegate, scheduler, null);
+            fail("should complain");
+        } catch(IllegalArgumentException re) {
+            // ok
+        }
+        try{
+            new InitDelayingTopologyEventListener(1, null, scheduler, null);
+            fail("should complain");
+        } catch(IllegalArgumentException re) {
+            // ok
+        }
+        try{
+            new InitDelayingTopologyEventListener(1, delegate, null, null);
+            fail("should complain");
+        } catch(IllegalArgumentException re) {
+            // ok
+        }
+        try{
+            new InitDelayingTopologyEventListener(-1, delegate, scheduler, logger);
+            fail("should complain");
+        } catch(IllegalArgumentException re) {
+            // ok
+        }
+        try{
+            new InitDelayingTopologyEventListener(0, delegate, scheduler, logger);
+            fail("should complain");
+        } catch(IllegalArgumentException re) {
+            // ok
+        }
+        try{
+            new InitDelayingTopologyEventListener(1, null, scheduler, logger);
+            fail("should complain");
+        } catch(IllegalArgumentException re) {
+            // ok
+        }
+        try{
+            new InitDelayingTopologyEventListener(1, delegate, null, logger);
+            fail("should complain");
+        } catch(IllegalArgumentException re) {
+            // ok
+        }
+    }
+    
+    private TopologyView createView(boolean current) {
+        final TopologyView view = Mockito.mock(TopologyView.class);
+        Mockito.when(view.isCurrent()).thenReturn(current);
+        final InstanceDescription local = Mockito.mock(InstanceDescription.class);
+        Mockito.when(local.isLeader()).thenReturn(true);
+        Mockito.when(local.isLocal()).thenReturn(true);
+        Mockito.when(local.getSlingId()).thenReturn("id");
+
+        Mockito.when(view.getLocalInstance()).thenReturn(local);
+        final ClusterView localView = Mockito.mock(ClusterView.class);
+        Mockito.when(localView.getId()).thenReturn("1");
+        Mockito.when(localView.getInstances()).thenReturn(Collections.singletonList(local));
+        Mockito.when(view.getClusterViews()).thenReturn(Collections.singleton(localView));
+        Mockito.when(local.getClusterView()).thenReturn(localView);
+
+        return view;
+    }
+
+    private TopologyEvent createEvent(Type type) {
+        TopologyView oldView = createView(false);
+        TopologyView newView = createView(true);
+        switch(type) {
+            case TOPOLOGY_CHANGING : {
+                return new TopologyEvent(type, oldView, null);
+            }
+            case PROPERTIES_CHANGED :
+            case TOPOLOGY_CHANGED : {
+                return new TopologyEvent(type, oldView, newView);
+            }
+            case TOPOLOGY_INIT : {
+                return new TopologyEvent(type, null, newView);
+            }
+            default : {
+                throw new IllegalArgumentException("unknown type: " + type);
+            }
+        }
+    }
+    
+    @Test
+    public void testDisposing() throws Exception {
+        final TestListener delegate = new TestListener();
+        final Scheduler scheduler = createScheduler();
+        InitDelayingTopologyEventListener listener = new InitDelayingTopologyEventListener(1, delegate, scheduler, logger);
+        listener.handleTopologyEvent(createEvent(Type.TOPOLOGY_INIT));
+        delegate.waitForEventCnt(1, 5000);
+        delegate.assureEventCnt(1, 500); // test framework testing :)
+
+        listener = new InitDelayingTopologyEventListener(1, delegate, scheduler, logger);
+        listener.handleTopologyEvent(createEvent(Type.TOPOLOGY_INIT));
+        listener.dispose();
+        delegate.assureEventCnt(1, 1000);
+        delegate.assureEventCnt(1, 500);
+    }
+    
+    @Test
+    public void testNoEvents() throws Exception {
+        final TestListener delegate = new TestListener();
+        final Scheduler scheduler = createScheduler();
+        InitDelayingTopologyEventListener listener = new InitDelayingTopologyEventListener(1, delegate, scheduler, logger);
+        // no events:
+        delegate.assureEventCnt(0, 1500);
+        
+        // then the first init is passed through
+        listener.handleTopologyEvent(createEvent(Type.TOPOLOGY_INIT));
+        delegate.waitForEventCnt(1, 5000);
+        assertEquals(delegate.getEvents().get(0).getType(), Type.TOPOLOGY_INIT);
+
+        doTestAdditionalEventsAfterInit(delegate, listener);
+    }
+
+    private void doTestAdditionalEventsAfterInit(final TestListener delegate, InitDelayingTopologyEventListener listener)
+            throws InterruptedException {
+        // 2nd one too
+        listener.handleTopologyEvent(createEvent(Type.TOPOLOGY_CHANGING));
+        delegate.waitForEventCnt(2, 5000);
+        assertEquals(delegate.getEvents().get(1).getType(), Type.TOPOLOGY_CHANGING);
+
+        // 3rd one too
+        listener.handleTopologyEvent(createEvent(Type.TOPOLOGY_CHANGED));
+        delegate.waitForEventCnt(3, 5000);
+        assertEquals(delegate.getEvents().get(2).getType(), Type.TOPOLOGY_CHANGED);
+
+        // 4th one too
+        listener.handleTopologyEvent(createEvent(Type.PROPERTIES_CHANGED));
+        delegate.waitForEventCnt(4, 5000);
+        assertEquals(delegate.getEvents().get(3).getType(), Type.PROPERTIES_CHANGED);
+
+        // 5th one too
+        listener.handleTopologyEvent(createEvent(Type.TOPOLOGY_CHANGING));
+        delegate.waitForEventCnt(5, 5000);
+        assertEquals(delegate.getEvents().get(4).getType(), Type.TOPOLOGY_CHANGING);
+
+        // 6th one too
+        listener.handleTopologyEvent(createEvent(Type.TOPOLOGY_CHANGED));
+        delegate.waitForEventCnt(6, 5000);
+        assertEquals(delegate.getEvents().get(5).getType(), Type.TOPOLOGY_CHANGED);
+
+    }
+
+    @Test
+    public void testChanging0() throws Exception {
+        final TestListener delegate = new TestListener();
+        final Scheduler scheduler = createScheduler();
+        InitDelayingTopologyEventListener listener = new InitDelayingTopologyEventListener(1, delegate, scheduler, logger);
+        listener.handleTopologyEvent(createEvent(Type.TOPOLOGY_INIT));
+        listener.handleTopologyEvent(createEvent(Type.TOPOLOGY_CHANGING));
+        delegate.assureEventCnt(0, 1000);
+        listener.handleTopologyEvent(createEvent(Type.TOPOLOGY_CHANGED));
+        delegate.waitForEventCnt(1, 5000);
+        assertEquals(delegate.getEvents().get(0).getType(), Type.TOPOLOGY_INIT);
+
+        doTestAdditionalEventsAfterInit(delegate, listener);
+    }
+
+    @Test
+    public void testChanging1() throws Exception {
+        final TestListener delegate = new TestListener();
+        final Scheduler scheduler = createScheduler();
+        InitDelayingTopologyEventListener listener = new InitDelayingTopologyEventListener(1, delegate, scheduler, logger);
+        listener.handleTopologyEvent(createEvent(Type.TOPOLOGY_INIT));
+        listener.handleTopologyEvent(createEvent(Type.TOPOLOGY_CHANGING));
+        listener.handleTopologyEvent(createEvent(Type.TOPOLOGY_CHANGED));
+        listener.handleTopologyEvent(createEvent(Type.TOPOLOGY_CHANGING));
+        listener.handleTopologyEvent(createEvent(Type.TOPOLOGY_CHANGED));
+        listener.handleTopologyEvent(createEvent(Type.TOPOLOGY_CHANGING));
+        delegate.assureEventCnt(0, 1000);
+        listener.handleTopologyEvent(createEvent(Type.TOPOLOGY_CHANGED));
+        delegate.waitForEventCnt(1, 5000);
+        assertEquals(delegate.getEvents().get(0).getType(), Type.TOPOLOGY_INIT);
+
+        doTestAdditionalEventsAfterInit(delegate, listener);
+    }
+
+    @Test
+    public void testChanged() throws Exception {
+        final TestListener delegate = new TestListener();
+        final Scheduler scheduler = createScheduler();
+        InitDelayingTopologyEventListener listener = new InitDelayingTopologyEventListener(1, delegate, scheduler, logger);
+        listener.handleTopologyEvent(createEvent(Type.TOPOLOGY_INIT));
+        listener.handleTopologyEvent(createEvent(Type.TOPOLOGY_CHANGING));
+        listener.handleTopologyEvent(createEvent(Type.TOPOLOGY_CHANGED));
+        delegate.waitForEventCnt(1, 5000);
+        assertEquals(delegate.getEvents().get(0).getType(), Type.TOPOLOGY_INIT);
+
+        doTestAdditionalEventsAfterInit(delegate, listener);
+    }
+
+    @Test
+    public void testProperties() throws Exception {
+        final TestListener delegate = new TestListener();
+        final Scheduler scheduler = createScheduler();
+        InitDelayingTopologyEventListener listener = new InitDelayingTopologyEventListener(1, delegate, scheduler, logger);
+        listener.handleTopologyEvent(createEvent(Type.TOPOLOGY_INIT));
+        listener.handleTopologyEvent(createEvent(Type.TOPOLOGY_CHANGING));
+        listener.handleTopologyEvent(createEvent(Type.TOPOLOGY_CHANGED));
+        listener.handleTopologyEvent(createEvent(Type.PROPERTIES_CHANGED));
+        delegate.waitForEventCnt(1, 5000);
+        assertEquals(delegate.getEvents().get(0).getType(), Type.TOPOLOGY_INIT);
+
+        doTestAdditionalEventsAfterInit(delegate, listener);
+    }
+
+}

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

[sling-org-apache-sling-discovery-commons] 02/07: SLING-5494 : Discovery InstancesDiff.retained() implementation not according to API doc - Match the API with the implementation - This closes #122 of github pull request of tmaret, many thx

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

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

commit c57bb818ecec571c01b1882cec986f5a36d4ad92
Author: Stefan Egli <st...@apache.org>
AuthorDate: Mon Feb 8 15:42:16 2016 +0000

    SLING-5494 : Discovery InstancesDiff.retained() implementation not according to API doc - Match the API with the implementation - This closes #122 of github pull request of tmaret, many thx
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons@1729191 13f79535-47bb-0310-9956-ffa450edef68
---
 src/main/java/org/apache/sling/discovery/commons/InstancesDiff.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/sling/discovery/commons/InstancesDiff.java b/src/main/java/org/apache/sling/discovery/commons/InstancesDiff.java
index 61b2f9c..119d685 100644
--- a/src/main/java/org/apache/sling/discovery/commons/InstancesDiff.java
+++ b/src/main/java/org/apache/sling/discovery/commons/InstancesDiff.java
@@ -205,8 +205,8 @@ public final class InstancesDiff {
      * @param retainFromNewCollection {@code true} in order to retain the instances from the new collection ;
      *                                {@code false} in order to retain the instances from the old collection.
      * @param propertyChanged {@code true} in order to keep only the instances which
-     *                        properties have not changed between the old and new collections ;
-     *                        {@code false} in order to keep only the instances which properties have changed.
+     *                        properties have changed between the old and new collections ;
+     *                        {@code false} in order to keep only the instances which properties have not changed.
      * @return the {@code InstanceCollection} collection containing the {@code InstanceDescription} instances
      *         contained in both views.
      */

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

[sling-org-apache-sling-discovery-commons] 03/07: SLING-5592 : cancel backgroundCheck thread in deactivate for rare cases where it is still running

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

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

commit 1e2a10d534679543ad5629381abd94c517c9cac9
Author: Stefan Egli <st...@apache.org>
AuthorDate: Tue Mar 8 10:15:57 2016 +0000

    SLING-5592 : cancel backgroundCheck thread in deactivate for rare cases where it is still running
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons@1734045 13f79535-47bb-0310-9956-ffa450edef68
---
 .../commons/providers/spi/base/IdMapService.java     |  2 ++
 .../providers/spi/base/TestOakSyncTokenService.java  | 20 ++++++++++++++++++++
 2 files changed, 22 insertions(+)

diff --git a/src/main/java/org/apache/sling/discovery/commons/providers/spi/base/IdMapService.java b/src/main/java/org/apache/sling/discovery/commons/providers/spi/base/IdMapService.java
index 947e587..7828103 100644
--- a/src/main/java/org/apache/sling/discovery/commons/providers/spi/base/IdMapService.java
+++ b/src/main/java/org/apache/sling/discovery/commons/providers/spi/base/IdMapService.java
@@ -120,6 +120,8 @@ public class IdMapService extends AbstractServiceWithBackgroundCheck implements
             eventHandlerRegistration.unregister();
             eventHandlerRegistration = null;
         }
+        // SLING-5592: cancel the potentially running background thread
+        cancelPreviousBackgroundCheck();
     }
     
     private void registerEventHandler() {
diff --git a/src/test/java/org/apache/sling/discovery/commons/providers/spi/base/TestOakSyncTokenService.java b/src/test/java/org/apache/sling/discovery/commons/providers/spi/base/TestOakSyncTokenService.java
index e767571..c692b50 100644
--- a/src/test/java/org/apache/sling/discovery/commons/providers/spi/base/TestOakSyncTokenService.java
+++ b/src/test/java/org/apache/sling/discovery/commons/providers/spi/base/TestOakSyncTokenService.java
@@ -23,6 +23,7 @@ import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
+import java.lang.reflect.Field;
 import java.util.UUID;
 import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReentrantLock;
@@ -38,6 +39,7 @@ import org.apache.sling.discovery.commons.providers.spi.base.AbstractServiceWith
 import org.apache.sling.jcr.api.SlingRepository;
 import org.junit.After;
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -242,4 +244,22 @@ public class TestOakSyncTokenService {
         assertEquals(3, l.countEvents());
     }
     
+    @Test
+    public void testRapidIdMapServiceActivateDeactivate() throws Exception {
+        BackgroundCheckRunnable bgCheckRunnable = getBackgroundCheckRunnable(idMapService1);
+        assertNotNull(bgCheckRunnable);
+        assertFalse(bgCheckRunnable.isDone());
+        idMapService1.deactivate();
+        assertFalse(idMapService1.waitForInit(2500));
+        bgCheckRunnable = getBackgroundCheckRunnable(idMapService1);
+        assertNotNull(bgCheckRunnable);
+        assertTrue(bgCheckRunnable.isDone());
+    }
+    
+    private BackgroundCheckRunnable getBackgroundCheckRunnable(IdMapService idMapService) throws NoSuchFieldException, IllegalAccessException {
+        Field field = idMapService.getClass().getSuperclass().getDeclaredField("backgroundCheckRunnable");
+        field.setAccessible(true);
+        Object backgroundCheckRunnable = field.get(idMapService);
+        return (BackgroundCheckRunnable) backgroundCheckRunnable;
+    }
 }

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

[sling-org-apache-sling-discovery-commons] 01/07: [maven-release-plugin] prepare for next development iteration

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

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

commit 6e713d1ff6eebea12c8ce74fa84b6fca06e26c1a
Author: Stefan Egli <st...@apache.org>
AuthorDate: Thu Jan 28 12:53:13 2016 +0000

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

diff --git a/pom.xml b/pom.xml
index 0840706..05a0180 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,15 +29,15 @@
 
     <artifactId>org.apache.sling.discovery.commons</artifactId>
     <packaging>bundle</packaging>
-    <version>1.0.10</version>
+    <version>1.0.11-SNAPSHOT</version>
 
     <name>Apache Sling Discovery Commons</name>
     <description>Common services related to Sling Discovery</description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.discovery.commons-1.0.10</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.discovery.commons-1.0.10</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.discovery.commons-1.0.10</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/discovery/commons</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-commons] 04/07: SLING-5620 : upgrade sling.commons.scheduler dependency to 2.4.0

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

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

commit e3d6546b0ed241c42d52b4d3b18948d60095bfaa
Author: Stefan Egli <st...@apache.org>
AuthorDate: Mon Mar 21 14:01:01 2016 +0000

    SLING-5620 : upgrade sling.commons.scheduler dependency to 2.4.0
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons@1735976 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                            |  2 +-
 .../commons/providers/base/DummyScheduler.java     | 36 ++++++++++++++++++++++
 2 files changed, 37 insertions(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 05a0180..bcadf6c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -80,7 +80,7 @@
         <dependency>
         	<groupId>org.apache.sling</groupId>
         	<artifactId>org.apache.sling.commons.scheduler</artifactId>
-        	<version>2.3.4</version>
+        	<version>2.4.0</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
diff --git a/src/test/java/org/apache/sling/discovery/commons/providers/base/DummyScheduler.java b/src/test/java/org/apache/sling/discovery/commons/providers/base/DummyScheduler.java
index 09ac453..405db7b 100644
--- a/src/test/java/org/apache/sling/discovery/commons/providers/base/DummyScheduler.java
+++ b/src/test/java/org/apache/sling/discovery/commons/providers/base/DummyScheduler.java
@@ -23,6 +23,7 @@ import java.util.Date;
 import java.util.Map;
 import java.util.NoSuchElementException;
 
+import org.apache.sling.commons.scheduler.ScheduleOptions;
 import org.apache.sling.commons.scheduler.Scheduler;
 
 public class DummyScheduler implements Scheduler {
@@ -106,4 +107,39 @@ public class DummyScheduler implements Scheduler {
         failMode = true;
     }
 
+    @Override
+    public boolean schedule(Object job, ScheduleOptions options) {
+        throw new IllegalStateException("not yet impl");
+    }
+
+    @Override
+    public boolean unschedule(String jobName) {
+        throw new IllegalStateException("not yet impl");
+    }
+
+    @Override
+    public ScheduleOptions NOW() {
+        throw new IllegalStateException("not yet impl");
+    }
+
+    @Override
+    public ScheduleOptions NOW(int times, long period) {
+        throw new IllegalStateException("not yet impl");
+    }
+
+    @Override
+    public ScheduleOptions AT(Date date) {
+        throw new IllegalStateException("not yet impl");
+    }
+
+    @Override
+    public ScheduleOptions AT(Date date, int times, long period) {
+        throw new IllegalStateException("not yet impl");
+    }
+
+    @Override
+    public ScheduleOptions EXPR(String expression) {
+        throw new IllegalStateException("not yet impl");
+    }
+
 }

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

[sling-org-apache-sling-discovery-commons] 06/07: [maven-release-plugin] prepare release org.apache.sling.discovery.commons-1.0.12

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

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

commit 5fdb4c52822ab0df12c9f63fb286708ba52db7c5
Author: Stefan Egli <st...@apache.org>
AuthorDate: Mon Mar 21 14:21:18 2016 +0000

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

diff --git a/pom.xml b/pom.xml
index bcadf6c..e459123 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,15 +29,15 @@
 
     <artifactId>org.apache.sling.discovery.commons</artifactId>
     <packaging>bundle</packaging>
-    <version>1.0.11-SNAPSHOT</version>
+    <version>1.0.12</version>
 
     <name>Apache Sling Discovery Commons</name>
     <description>Common services related to Sling Discovery</description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/discovery/commons</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.discovery.commons-1.0.12</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.discovery.commons-1.0.12</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.discovery.commons-1.0.12</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-commons] 07/07: [maven-release-plugin] copy for tag org.apache.sling.discovery.commons-1.0.12

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

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

commit 4758c087be9cefac7d541f51f93238ea645b3bfb
Author: Stefan Egli <st...@apache.org>
AuthorDate: Mon Mar 21 14:21:32 2016 +0000

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

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