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

tmaret pushed a commit to branch SLING-7168
in repository 
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-distribution-core.git

commit 26c217ce80b0f2c29a0132ccbaf48077bdaa6e0c
Author: tmaret <tma...@adobe.com>
AuthorDate: Thu Feb 1 18:01:58 2018 +0100

    SLING-7168 - Allow to implement custom distribution queue
    
    * Export the org.apache.sling.distribution.queue package
    * Export the org.apache.sling.distribution.queue.spi package
    * Export the org.apache.sling.distribution.log.spi package
    * Expose DistributionQueue and DistributionLog as a consumer types
    * Hide DistributionQueueProcessor and DistributionQueueProvider
    * Make the exposed classes final
    * Minor typo cleanups
---
 pom.xml                                                |  5 ++++-
 .../sling/distribution/agent/DistributionAgent.java    |  6 +++---
 .../agent/impl/ForwardDistributionAgentFactory.java    |  2 +-
 .../agent/impl/QueueDistributionAgentFactory.java      |  2 +-
 .../impl/QueueingDistributionPackageProcessor.java     |  2 +-
 .../agent/impl/ReverseDistributionAgentFactory.java    |  2 +-
 .../agent/impl/SimpleDistributionAgent.java            |  8 ++++----
 .../agent/impl/SimpleDistributionAgentFactory.java     |  2 +-
 .../impl/SimpleDistributionAgentQueueProcessor.java    |  4 ++--
 .../agent/impl/SyncDistributionAgentFactory.java       |  2 +-
 .../impl/DefaultDistributionComponentProvider.java     |  2 +-
 .../component/impl/DistributionComponentKind.java      |  2 +-
 .../distribution/log/impl/DefaultDistributionLog.java  |  2 +-
 .../distribution/log/{ => spi}/DistributionLog.java    |  5 ++++-
 .../distribution/{queue => log/spi}/package-info.java  |  4 ++--
 .../monitor/DistributionQueueHealthCheck.java          |  2 +-
 .../monitor/impl/DistributionQueueMBeanImpl.java       |  2 +-
 .../impl/MonitoringDistributionQueueProvider.java      |  6 +++---
 .../packaging/DistributionPackageExporter.java         |  3 ++-
 .../exporter/AgentDistributionPackageExporter.java     |  4 ++--
 .../distribution/queue/DistributionQueueEntry.java     |  2 ++
 .../distribution/queue/DistributionQueueItem.java      |  3 ++-
 .../queue/DistributionQueueItemStatus.java             |  4 +++-
 .../distribution/queue/DistributionQueueStatus.java    |  6 +++++-
 .../distribution/queue/DistributionQueueType.java      |  2 ++
 .../queue/impl/AsyncDeliveryDispatchingStrategy.java   |  1 +
 .../queue/impl/CachingDistributionQueue.java           |  2 +-
 .../impl/DistributionQueueDispatchingStrategy.java     | 10 +++++-----
 .../queue/{ => impl}/DistributionQueueProcessor.java   |  9 ++++++---
 .../queue/{ => impl}/DistributionQueueProvider.java    |  5 ++++-
 .../queue/impl/DistributionQueueWrapper.java           |  2 +-
 .../queue/impl/ErrorQueueDispatchingStrategy.java      |  3 +--
 .../queue/impl/MultipleQueueDispatchingStrategy.java   |  3 +--
 .../queue/impl/PriorityQueueDispatchingStrategy.java   |  1 -
 .../queue/impl/SimpleAgentDistributionQueue.java       |  2 +-
 .../impl/jobhandling/DistributionAgentJobConsumer.java |  2 +-
 .../impl/jobhandling/JobHandlingDistributionQueue.java |  4 ++--
 .../JobHandlingDistributionQueueProvider.java          | 10 +++++-----
 .../queue/impl/simple/SimpleDistributionQueue.java     |  4 ++--
 .../impl/simple/SimpleDistributionQueueCheckpoint.java |  2 +-
 .../impl/simple/SimpleDistributionQueueProcessor.java  |  4 ++--
 .../impl/simple/SimpleDistributionQueueProvider.java   | 10 +++++-----
 .../apache/sling/distribution/queue/package-info.java  |  2 +-
 .../queue/{ => spi}/DistributionQueue.java             | 15 +++++++++++----
 .../distribution/queue/{ => spi}/package-info.java     |  4 ++--
 .../ExtendedDistributionServiceResourceProvider.java   |  4 ++--
 .../servlet/DistributionAgentLogServlet.java           |  2 +-
 .../servlet/DistributionAgentQueueServlet.java         |  4 ++--
 .../impl/QueueingDistributionPackageProcessorTest.java |  2 +-
 .../SimpleDistributionAgentQueueProcessorTest.java     |  2 +-
 .../agent/impl/SimpleDistributionAgentTest.java        |  4 ++--
 .../monitor/DistributionQueueHealthCheckTest.java      | 15 ++++++++-------
 .../monitor/impl/DistributionQueueMBeanTest.java       |  2 +-
 .../impl/AsyncDeliveryDispatchingStrategyTest.java     |  7 ++++---
 .../impl/PriorityQueueDispatchingStrategyTest.java     |  3 +--
 .../impl/SingleQueueDistributionStrategyTest.java      | 18 ++++++++++++------
 .../jobhandling/DistributionAgentJobConsumerTest.java  |  2 +-
 .../JobHandlingDistributionQueueProviderTest.java      |  4 ++--
 .../jobhandling/JobHandlingDistributionQueueTest.java  |  2 +-
 .../simple/SimpleDistributionQueueCheckpointTest.java  |  2 +-
 .../simple/SimpleDistributionQueueProcessorTest.java   |  7 ++++---
 .../simple/SimpleDistributionQueueProviderTest.java    |  4 ++--
 .../queue/impl/simple/SimpleDistributionQueueTest.java | 12 ++++++------
 63 files changed, 156 insertions(+), 119 deletions(-)

diff --git a/pom.xml b/pom.xml
index 8e19597..9a91e6e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -71,7 +71,10 @@
                         <Export-Package>
                             org.apache.sling.distribution.util,
                             org.apache.sling.distribution.common,
-                            org.apache.sling.distribution.serialization
+                            org.apache.sling.distribution.serialization,
+                            org.apache.sling.distribution.queue.spi,
+                            org.apache.sling.distribution.queue,
+                            org.apache.sling.distribution.log.spi
                         </Export-Package>
                         <Import-Package>
                             org.apache.http.nio.*;resolution:=optional,
diff --git 
a/src/main/java/org/apache/sling/distribution/agent/DistributionAgent.java 
b/src/main/java/org/apache/sling/distribution/agent/DistributionAgent.java
index bb71ac4..f64f334 100644
--- a/src/main/java/org/apache/sling/distribution/agent/DistributionAgent.java
+++ b/src/main/java/org/apache/sling/distribution/agent/DistributionAgent.java
@@ -26,8 +26,8 @@ import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.distribution.DistributionRequest;
 import org.apache.sling.distribution.DistributionResponse;
 import org.apache.sling.distribution.common.DistributionException;
-import org.apache.sling.distribution.log.DistributionLog;
-import org.apache.sling.distribution.queue.DistributionQueue;
+import org.apache.sling.distribution.log.spi.DistributionLog;
+import org.apache.sling.distribution.queue.spi.DistributionQueue;
 
 /**
  * A distribution agent is responsible for handling {@link 
org.apache.sling.distribution.DistributionRequest}s.
@@ -51,7 +51,7 @@ public interface DistributionAgent {
      * Get the agent queue with the given name
      *
      * @param name a queue name
-     * @return a {@link org.apache.sling.distribution.queue.DistributionQueue} 
with the given name bound to this agent, if it exists,
+     * @return a {@link DistributionQueue} with the given name bound to this 
agent, if it exists,
      * {@code null} otherwise
      */
     @CheckForNull
diff --git 
a/src/main/java/org/apache/sling/distribution/agent/impl/ForwardDistributionAgentFactory.java
 
b/src/main/java/org/apache/sling/distribution/agent/impl/ForwardDistributionAgentFactory.java
index edf53b6..a5a5ff1 100644
--- 
a/src/main/java/org/apache/sling/distribution/agent/impl/ForwardDistributionAgentFactory.java
+++ 
b/src/main/java/org/apache/sling/distribution/agent/impl/ForwardDistributionAgentFactory.java
@@ -53,7 +53,7 @@ import 
org.apache.sling.distribution.packaging.DistributionPackageExporter;
 import org.apache.sling.distribution.packaging.DistributionPackageImporter;
 import 
org.apache.sling.distribution.packaging.impl.exporter.LocalDistributionPackageExporter;
 import 
org.apache.sling.distribution.packaging.impl.importer.RemoteDistributionPackageImporter;
-import org.apache.sling.distribution.queue.DistributionQueueProvider;
+import org.apache.sling.distribution.queue.impl.DistributionQueueProvider;
 import 
org.apache.sling.distribution.queue.impl.AsyncDeliveryDispatchingStrategy;
 import 
org.apache.sling.distribution.queue.impl.DistributionQueueDispatchingStrategy;
 import org.apache.sling.distribution.queue.impl.ErrorQueueDispatchingStrategy;
diff --git 
a/src/main/java/org/apache/sling/distribution/agent/impl/QueueDistributionAgentFactory.java
 
b/src/main/java/org/apache/sling/distribution/agent/impl/QueueDistributionAgentFactory.java
index df2cd9a..3dff208 100644
--- 
a/src/main/java/org/apache/sling/distribution/agent/impl/QueueDistributionAgentFactory.java
+++ 
b/src/main/java/org/apache/sling/distribution/agent/impl/QueueDistributionAgentFactory.java
@@ -44,7 +44,7 @@ import 
org.apache.sling.distribution.monitor.impl.QueueDistributionAgentMBeanImp
 import org.apache.sling.distribution.packaging.DistributionPackageBuilder;
 import org.apache.sling.distribution.packaging.DistributionPackageExporter;
 import 
org.apache.sling.distribution.packaging.impl.exporter.LocalDistributionPackageExporter;
-import org.apache.sling.distribution.queue.DistributionQueueProvider;
+import org.apache.sling.distribution.queue.impl.DistributionQueueProvider;
 import 
org.apache.sling.distribution.queue.impl.DistributionQueueDispatchingStrategy;
 import 
org.apache.sling.distribution.queue.impl.PriorityQueueDispatchingStrategy;
 import org.apache.sling.distribution.queue.impl.SingleQueueDispatchingStrategy;
diff --git 
a/src/main/java/org/apache/sling/distribution/agent/impl/QueueingDistributionPackageProcessor.java
 
b/src/main/java/org/apache/sling/distribution/agent/impl/QueueingDistributionPackageProcessor.java
index b227719..5dd347f 100644
--- 
a/src/main/java/org/apache/sling/distribution/agent/impl/QueueingDistributionPackageProcessor.java
+++ 
b/src/main/java/org/apache/sling/distribution/agent/impl/QueueingDistributionPackageProcessor.java
@@ -39,7 +39,7 @@ import 
org.apache.sling.distribution.packaging.DistributionPackageProcessor;
 import org.apache.sling.distribution.packaging.impl.DistributionPackageUtils;
 import org.apache.sling.distribution.queue.DistributionQueueItemState;
 import org.apache.sling.distribution.queue.DistributionQueueItemStatus;
-import org.apache.sling.distribution.queue.DistributionQueueProvider;
+import org.apache.sling.distribution.queue.impl.DistributionQueueProvider;
 import 
org.apache.sling.distribution.queue.impl.DistributionQueueDispatchingStrategy;
 
 /**
diff --git 
a/src/main/java/org/apache/sling/distribution/agent/impl/ReverseDistributionAgentFactory.java
 
b/src/main/java/org/apache/sling/distribution/agent/impl/ReverseDistributionAgentFactory.java
index 19c25f6..f25d6a9 100644
--- 
a/src/main/java/org/apache/sling/distribution/agent/impl/ReverseDistributionAgentFactory.java
+++ 
b/src/main/java/org/apache/sling/distribution/agent/impl/ReverseDistributionAgentFactory.java
@@ -48,7 +48,7 @@ import 
org.apache.sling.distribution.packaging.DistributionPackageExporter;
 import org.apache.sling.distribution.packaging.DistributionPackageImporter;
 import 
org.apache.sling.distribution.packaging.impl.exporter.RemoteDistributionPackageExporter;
 import 
org.apache.sling.distribution.packaging.impl.importer.LocalDistributionPackageImporter;
-import org.apache.sling.distribution.queue.DistributionQueueProvider;
+import org.apache.sling.distribution.queue.impl.DistributionQueueProvider;
 import 
org.apache.sling.distribution.queue.impl.DistributionQueueDispatchingStrategy;
 import org.apache.sling.distribution.queue.impl.SingleQueueDispatchingStrategy;
 import 
org.apache.sling.distribution.queue.impl.jobhandling.JobHandlingDistributionQueueProvider;
diff --git 
a/src/main/java/org/apache/sling/distribution/agent/impl/SimpleDistributionAgent.java
 
b/src/main/java/org/apache/sling/distribution/agent/impl/SimpleDistributionAgent.java
index 1d97a89..c50fdf2 100644
--- 
a/src/main/java/org/apache/sling/distribution/agent/impl/SimpleDistributionAgent.java
+++ 
b/src/main/java/org/apache/sling/distribution/agent/impl/SimpleDistributionAgent.java
@@ -33,15 +33,15 @@ import 
org.apache.sling.distribution.event.DistributionEventTopics;
 import org.apache.sling.distribution.event.impl.DistributionEventFactory;
 import org.apache.sling.distribution.impl.CompositeDistributionResponse;
 import org.apache.sling.distribution.impl.SimpleDistributionResponse;
-import org.apache.sling.distribution.log.DistributionLog;
+import org.apache.sling.distribution.log.spi.DistributionLog;
 import org.apache.sling.distribution.log.impl.DefaultDistributionLog;
 import org.apache.sling.distribution.packaging.DistributionPackage;
 import org.apache.sling.distribution.packaging.DistributionPackageExporter;
 import org.apache.sling.distribution.packaging.DistributionPackageImporter;
 import org.apache.sling.distribution.packaging.DistributionPackageProcessor;
-import org.apache.sling.distribution.queue.DistributionQueue;
-import org.apache.sling.distribution.queue.DistributionQueueProcessor;
-import org.apache.sling.distribution.queue.DistributionQueueProvider;
+import org.apache.sling.distribution.queue.spi.DistributionQueue;
+import org.apache.sling.distribution.queue.impl.DistributionQueueProcessor;
+import org.apache.sling.distribution.queue.impl.DistributionQueueProvider;
 import org.apache.sling.distribution.queue.DistributionQueueState;
 import 
org.apache.sling.distribution.queue.impl.DistributionQueueDispatchingStrategy;
 import org.apache.sling.distribution.queue.impl.SimpleAgentDistributionQueue;
diff --git 
a/src/main/java/org/apache/sling/distribution/agent/impl/SimpleDistributionAgentFactory.java
 
b/src/main/java/org/apache/sling/distribution/agent/impl/SimpleDistributionAgentFactory.java
index 4cc8ce8..27c236c 100644
--- 
a/src/main/java/org/apache/sling/distribution/agent/impl/SimpleDistributionAgentFactory.java
+++ 
b/src/main/java/org/apache/sling/distribution/agent/impl/SimpleDistributionAgentFactory.java
@@ -42,7 +42,7 @@ import 
org.apache.sling.distribution.monitor.impl.SimpleDistributionAgentMBean;
 import 
org.apache.sling.distribution.monitor.impl.SimpleDistributionAgentMBeanImpl;
 import org.apache.sling.distribution.packaging.DistributionPackageExporter;
 import org.apache.sling.distribution.packaging.DistributionPackageImporter;
-import org.apache.sling.distribution.queue.DistributionQueueProvider;
+import org.apache.sling.distribution.queue.impl.DistributionQueueProvider;
 import 
org.apache.sling.distribution.queue.impl.DistributionQueueDispatchingStrategy;
 import org.apache.sling.distribution.queue.impl.SingleQueueDispatchingStrategy;
 import 
org.apache.sling.distribution.queue.impl.jobhandling.JobHandlingDistributionQueueProvider;
diff --git 
a/src/main/java/org/apache/sling/distribution/agent/impl/SimpleDistributionAgentQueueProcessor.java
 
b/src/main/java/org/apache/sling/distribution/agent/impl/SimpleDistributionAgentQueueProcessor.java
index 11930b8..95dc2e1 100644
--- 
a/src/main/java/org/apache/sling/distribution/agent/impl/SimpleDistributionAgentQueueProcessor.java
+++ 
b/src/main/java/org/apache/sling/distribution/agent/impl/SimpleDistributionAgentQueueProcessor.java
@@ -35,8 +35,8 @@ import 
org.apache.sling.distribution.packaging.impl.DistributionPackageUtils;
 import org.apache.sling.distribution.queue.DistributionQueueEntry;
 import org.apache.sling.distribution.queue.DistributionQueueItem;
 import org.apache.sling.distribution.queue.DistributionQueueItemStatus;
-import org.apache.sling.distribution.queue.DistributionQueueProcessor;
-import org.apache.sling.distribution.queue.DistributionQueueProvider;
+import org.apache.sling.distribution.queue.impl.DistributionQueueProcessor;
+import org.apache.sling.distribution.queue.impl.DistributionQueueProvider;
 import 
org.apache.sling.distribution.queue.impl.DistributionQueueDispatchingStrategy;
 import org.apache.sling.distribution.util.impl.DistributionUtils;
 import org.slf4j.Logger;
diff --git 
a/src/main/java/org/apache/sling/distribution/agent/impl/SyncDistributionAgentFactory.java
 
b/src/main/java/org/apache/sling/distribution/agent/impl/SyncDistributionAgentFactory.java
index 6c4fe28..0506ce0 100644
--- 
a/src/main/java/org/apache/sling/distribution/agent/impl/SyncDistributionAgentFactory.java
+++ 
b/src/main/java/org/apache/sling/distribution/agent/impl/SyncDistributionAgentFactory.java
@@ -36,7 +36,7 @@ import 
org.apache.sling.distribution.packaging.DistributionPackageExporter;
 import org.apache.sling.distribution.packaging.DistributionPackageImporter;
 import 
org.apache.sling.distribution.packaging.impl.exporter.RemoteDistributionPackageExporter;
 import 
org.apache.sling.distribution.packaging.impl.importer.RemoteDistributionPackageImporter;
-import org.apache.sling.distribution.queue.DistributionQueueProvider;
+import org.apache.sling.distribution.queue.impl.DistributionQueueProvider;
 import 
org.apache.sling.distribution.queue.impl.DistributionQueueDispatchingStrategy;
 import org.apache.sling.distribution.queue.impl.ErrorQueueDispatchingStrategy;
 import 
org.apache.sling.distribution.queue.impl.MultipleQueueDispatchingStrategy;
diff --git 
a/src/main/java/org/apache/sling/distribution/component/impl/DefaultDistributionComponentProvider.java
 
b/src/main/java/org/apache/sling/distribution/component/impl/DefaultDistributionComponentProvider.java
index d76091f..5745d38 100644
--- 
a/src/main/java/org/apache/sling/distribution/component/impl/DefaultDistributionComponentProvider.java
+++ 
b/src/main/java/org/apache/sling/distribution/component/impl/DefaultDistributionComponentProvider.java
@@ -36,7 +36,7 @@ import 
org.apache.sling.distribution.agent.impl.DistributionRequestAuthorization
 import org.apache.sling.distribution.packaging.DistributionPackageBuilder;
 import org.apache.sling.distribution.packaging.DistributionPackageExporter;
 import org.apache.sling.distribution.packaging.DistributionPackageImporter;
-import org.apache.sling.distribution.queue.DistributionQueueProvider;
+import org.apache.sling.distribution.queue.impl.DistributionQueueProvider;
 import 
org.apache.sling.distribution.queue.impl.DistributionQueueDispatchingStrategy;
 import 
org.apache.sling.distribution.transport.DistributionTransportSecretProvider;
 import org.apache.sling.distribution.trigger.DistributionTrigger;
diff --git 
a/src/main/java/org/apache/sling/distribution/component/impl/DistributionComponentKind.java
 
b/src/main/java/org/apache/sling/distribution/component/impl/DistributionComponentKind.java
index 3fc19c5..e34a2f0 100644
--- 
a/src/main/java/org/apache/sling/distribution/component/impl/DistributionComponentKind.java
+++ 
b/src/main/java/org/apache/sling/distribution/component/impl/DistributionComponentKind.java
@@ -50,7 +50,7 @@ import 
org.apache.sling.distribution.packaging.impl.exporter.LocalDistributionPa
 import 
org.apache.sling.distribution.packaging.impl.exporter.RemoteDistributionPackageExporterFactory;
 import 
org.apache.sling.distribution.packaging.impl.importer.LocalDistributionPackageImporterFactory;
 import 
org.apache.sling.distribution.packaging.impl.importer.RemoteDistributionPackageImporterFactory;
-import org.apache.sling.distribution.queue.DistributionQueueProvider;
+import org.apache.sling.distribution.queue.impl.DistributionQueueProvider;
 import 
org.apache.sling.distribution.queue.impl.DistributionQueueDispatchingStrategy;
 import 
org.apache.sling.distribution.serialization.impl.vlt.VaultDistributionPackageBuilderFactory;
 import 
org.apache.sling.distribution.transport.DistributionTransportSecretProvider;
diff --git 
a/src/main/java/org/apache/sling/distribution/log/impl/DefaultDistributionLog.java
 
b/src/main/java/org/apache/sling/distribution/log/impl/DefaultDistributionLog.java
index 1c37ed2..488238f 100644
--- 
a/src/main/java/org/apache/sling/distribution/log/impl/DefaultDistributionLog.java
+++ 
b/src/main/java/org/apache/sling/distribution/log/impl/DefaultDistributionLog.java
@@ -27,7 +27,7 @@ import java.util.LinkedList;
 import java.util.List;
 
 import org.apache.sling.distribution.component.impl.DistributionComponentKind;
-import org.apache.sling.distribution.log.DistributionLog;
+import org.apache.sling.distribution.log.spi.DistributionLog;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.slf4j.helpers.FormattingTuple;
diff --git 
a/src/main/java/org/apache/sling/distribution/log/DistributionLog.java 
b/src/main/java/org/apache/sling/distribution/log/spi/DistributionLog.java
similarity index 91%
rename from src/main/java/org/apache/sling/distribution/log/DistributionLog.java
rename to 
src/main/java/org/apache/sling/distribution/log/spi/DistributionLog.java
index 878d4ae..d05a2bb 100644
--- a/src/main/java/org/apache/sling/distribution/log/DistributionLog.java
+++ b/src/main/java/org/apache/sling/distribution/log/spi/DistributionLog.java
@@ -17,14 +17,17 @@
  * under the License.
  */
 
-package org.apache.sling.distribution.log;
+package org.apache.sling.distribution.log.spi;
 
 import java.util.Collection;
 import java.util.List;
 
+import aQute.bnd.annotation.ConsumerType;
+
 /**
  * The log of a distribution component activity (e.g. a {@link 
org.apache.sling.distribution.agent.DistributionAgent})
  */
+@ConsumerType
 public interface DistributionLog {
 
     /**
diff --git 
a/src/main/java/org/apache/sling/distribution/queue/package-info.java 
b/src/main/java/org/apache/sling/distribution/log/spi/package-info.java
similarity index 92%
copy from src/main/java/org/apache/sling/distribution/queue/package-info.java
copy to src/main/java/org/apache/sling/distribution/log/spi/package-info.java
index 70795e9..71bb8a9 100644
--- a/src/main/java/org/apache/sling/distribution/queue/package-info.java
+++ b/src/main/java/org/apache/sling/distribution/log/spi/package-info.java
@@ -17,8 +17,8 @@
  * under the License.
  */
 
-@Version("0.1.0")
-package org.apache.sling.distribution.queue;
+@Version("0.0.0")
+package org.apache.sling.distribution.log.spi;
 
 import aQute.bnd.annotation.Version;
 
diff --git 
a/src/main/java/org/apache/sling/distribution/monitor/DistributionQueueHealthCheck.java
 
b/src/main/java/org/apache/sling/distribution/monitor/DistributionQueueHealthCheck.java
index 1cfe185..15dc16d 100644
--- 
a/src/main/java/org/apache/sling/distribution/monitor/DistributionQueueHealthCheck.java
+++ 
b/src/main/java/org/apache/sling/distribution/monitor/DistributionQueueHealthCheck.java
@@ -36,7 +36,7 @@ import org.apache.felix.scr.annotations.References;
 import org.apache.felix.scr.annotations.Service;
 import org.apache.sling.commons.osgi.PropertiesUtil;
 import org.apache.sling.distribution.agent.DistributionAgent;
-import org.apache.sling.distribution.queue.DistributionQueue;
+import org.apache.sling.distribution.queue.spi.DistributionQueue;
 import org.apache.sling.distribution.queue.DistributionQueueEntry;
 import org.apache.sling.distribution.queue.DistributionQueueItemStatus;
 import org.apache.sling.hc.api.HealthCheck;
diff --git 
a/src/main/java/org/apache/sling/distribution/monitor/impl/DistributionQueueMBeanImpl.java
 
b/src/main/java/org/apache/sling/distribution/monitor/impl/DistributionQueueMBeanImpl.java
index b73cfcb..7b89582 100644
--- 
a/src/main/java/org/apache/sling/distribution/monitor/impl/DistributionQueueMBeanImpl.java
+++ 
b/src/main/java/org/apache/sling/distribution/monitor/impl/DistributionQueueMBeanImpl.java
@@ -20,7 +20,7 @@ package org.apache.sling.distribution.monitor.impl;
 
 import java.util.Calendar;
 
-import org.apache.sling.distribution.queue.DistributionQueue;
+import org.apache.sling.distribution.queue.spi.DistributionQueue;
 
 /**
  * Default implementation of {@link DistributionQueueMBean}
diff --git 
a/src/main/java/org/apache/sling/distribution/monitor/impl/MonitoringDistributionQueueProvider.java
 
b/src/main/java/org/apache/sling/distribution/monitor/impl/MonitoringDistributionQueueProvider.java
index fe4ab38..b5eed1f 100644
--- 
a/src/main/java/org/apache/sling/distribution/monitor/impl/MonitoringDistributionQueueProvider.java
+++ 
b/src/main/java/org/apache/sling/distribution/monitor/impl/MonitoringDistributionQueueProvider.java
@@ -27,9 +27,9 @@ import java.util.List;
 import java.util.Set;
 
 import org.apache.sling.distribution.common.DistributionException;
-import org.apache.sling.distribution.queue.DistributionQueue;
-import org.apache.sling.distribution.queue.DistributionQueueProcessor;
-import org.apache.sling.distribution.queue.DistributionQueueProvider;
+import org.apache.sling.distribution.queue.spi.DistributionQueue;
+import org.apache.sling.distribution.queue.impl.DistributionQueueProcessor;
+import org.apache.sling.distribution.queue.impl.DistributionQueueProvider;
 import org.apache.sling.distribution.queue.DistributionQueueType;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceRegistration;
diff --git 
a/src/main/java/org/apache/sling/distribution/packaging/DistributionPackageExporter.java
 
b/src/main/java/org/apache/sling/distribution/packaging/DistributionPackageExporter.java
index f0a6f45..38cbc70 100644
--- 
a/src/main/java/org/apache/sling/distribution/packaging/DistributionPackageExporter.java
+++ 
b/src/main/java/org/apache/sling/distribution/packaging/DistributionPackageExporter.java
@@ -25,12 +25,13 @@ import aQute.bnd.annotation.ConsumerType;
 import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.distribution.DistributionRequest;
 import org.apache.sling.distribution.common.DistributionException;
+import org.apache.sling.distribution.queue.spi.DistributionQueue;
 
 /**
  * A {@link DistributionPackageExporter) is responsible of exporting {@link 
DistributionPackage}s from a local or remote
  * Sling instance.
  * Such packages are usually imported by a {@link DistributionPackageImporter} 
or put inside
- * {@link org.apache.sling.distribution.queue.DistributionQueue}s for others 
to consume them.
+ * {@link DistributionQueue }s for others to consume them.
  * Exporting a {@link DistributionPackage} means obtaining that package by 
e.g. directly creating it by bundling local
  * Sling resources, retrieving it from a remote endpoint (by executing an HTTP 
POST request on another Sling
  * instance exposing packages ina queue).
diff --git 
a/src/main/java/org/apache/sling/distribution/packaging/impl/exporter/AgentDistributionPackageExporter.java
 
b/src/main/java/org/apache/sling/distribution/packaging/impl/exporter/AgentDistributionPackageExporter.java
index 160d0ee..0bf46aa 100644
--- 
a/src/main/java/org/apache/sling/distribution/packaging/impl/exporter/AgentDistributionPackageExporter.java
+++ 
b/src/main/java/org/apache/sling/distribution/packaging/impl/exporter/AgentDistributionPackageExporter.java
@@ -25,14 +25,14 @@ import org.apache.sling.distribution.DistributionRequest;
 import org.apache.sling.distribution.DistributionRequestType;
 import org.apache.sling.distribution.agent.DistributionAgent;
 import org.apache.sling.distribution.common.DistributionException;
-import org.apache.sling.distribution.log.DistributionLog;
+import org.apache.sling.distribution.log.spi.DistributionLog;
 import org.apache.sling.distribution.log.impl.DefaultDistributionLog;
 import org.apache.sling.distribution.packaging.DistributionPackageProcessor;
 import org.apache.sling.distribution.packaging.DistributionPackage;
 import org.apache.sling.distribution.packaging.DistributionPackageExporter;
 import org.apache.sling.distribution.packaging.DistributionPackageInfo;
 import org.apache.sling.distribution.packaging.impl.DistributionPackageUtils;
-import org.apache.sling.distribution.queue.DistributionQueue;
+import org.apache.sling.distribution.queue.spi.DistributionQueue;
 import org.apache.sling.distribution.queue.DistributionQueueEntry;
 import org.apache.sling.distribution.queue.DistributionQueueItem;
 import org.apache.sling.distribution.packaging.DistributionPackageBuilder;
diff --git 
a/src/main/java/org/apache/sling/distribution/queue/DistributionQueueEntry.java 
b/src/main/java/org/apache/sling/distribution/queue/DistributionQueueEntry.java
index 8ad111b..806d5ea 100644
--- 
a/src/main/java/org/apache/sling/distribution/queue/DistributionQueueEntry.java
+++ 
b/src/main/java/org/apache/sling/distribution/queue/DistributionQueueEntry.java
@@ -20,6 +20,8 @@ package org.apache.sling.distribution.queue;
 
 import javax.annotation.Nonnull;
 
+import org.apache.sling.distribution.queue.spi.DistributionQueue;
+
 /**
  * an entry in a {@link DistributionQueue}
  */
diff --git 
a/src/main/java/org/apache/sling/distribution/queue/DistributionQueueItem.java 
b/src/main/java/org/apache/sling/distribution/queue/DistributionQueueItem.java
index b22dda1..17bba45 100644
--- 
a/src/main/java/org/apache/sling/distribution/queue/DistributionQueueItem.java
+++ 
b/src/main/java/org/apache/sling/distribution/queue/DistributionQueueItem.java
@@ -24,6 +24,7 @@ import java.util.Map;
 import org.apache.sling.api.resource.ValueMap;
 import org.apache.sling.api.wrappers.ValueMapDecorator;
 import org.apache.sling.distribution.packaging.DistributionPackage;
+import org.apache.sling.distribution.queue.spi.DistributionQueue;
 
 /**
  * An item in a {@link DistributionQueue}
@@ -31,7 +32,7 @@ import 
org.apache.sling.distribution.packaging.DistributionPackage;
  * to keep the package {@link DistributionPackage#createInputStream() stream} 
into
  * the queues.
  */
-public class DistributionQueueItem extends ValueMapDecorator implements 
ValueMap {
+public final class DistributionQueueItem extends ValueMapDecorator implements 
ValueMap {
 
     private final String packageId;
     private final long size;
diff --git 
a/src/main/java/org/apache/sling/distribution/queue/DistributionQueueItemStatus.java
 
b/src/main/java/org/apache/sling/distribution/queue/DistributionQueueItemStatus.java
index 55226bf..95cb786 100644
--- 
a/src/main/java/org/apache/sling/distribution/queue/DistributionQueueItemStatus.java
+++ 
b/src/main/java/org/apache/sling/distribution/queue/DistributionQueueItemStatus.java
@@ -20,10 +20,12 @@ package org.apache.sling.distribution.queue;
 
 import java.util.Calendar;
 
+import org.apache.sling.distribution.queue.spi.DistributionQueue;
+
 /**
  * the current status of a certain item in a {@link DistributionQueue}
  */
-public class DistributionQueueItemStatus {
+public final class DistributionQueueItemStatus {
 
     private final int attempts;
 
diff --git 
a/src/main/java/org/apache/sling/distribution/queue/DistributionQueueStatus.java
 
b/src/main/java/org/apache/sling/distribution/queue/DistributionQueueStatus.java
index f404054..32fe293 100644
--- 
a/src/main/java/org/apache/sling/distribution/queue/DistributionQueueStatus.java
+++ 
b/src/main/java/org/apache/sling/distribution/queue/DistributionQueueStatus.java
@@ -19,6 +19,10 @@
 
 package org.apache.sling.distribution.queue;
 
+import javax.annotation.Nonnull;
+
+import org.apache.sling.distribution.queue.spi.DistributionQueue;
+
 /**
  * The status of a certain {@link DistributionQueue}
  */
@@ -27,7 +31,7 @@ public final class DistributionQueueStatus {
 
     private final DistributionQueueState queueState;
 
-    public DistributionQueueStatus(int itemsCount, DistributionQueueState 
queueState) {
+    public DistributionQueueStatus(int itemsCount, @Nonnull 
DistributionQueueState queueState) {
         this.itemsCount = itemsCount;
         this.queueState = queueState;
     }
diff --git 
a/src/main/java/org/apache/sling/distribution/queue/DistributionQueueType.java 
b/src/main/java/org/apache/sling/distribution/queue/DistributionQueueType.java
index 176ce30..88ea599 100644
--- 
a/src/main/java/org/apache/sling/distribution/queue/DistributionQueueType.java
+++ 
b/src/main/java/org/apache/sling/distribution/queue/DistributionQueueType.java
@@ -18,6 +18,8 @@
  */
 package org.apache.sling.distribution.queue;
 
+import org.apache.sling.distribution.queue.spi.DistributionQueue;
+
 /**
  * the type of {@link DistributionQueue}
  */
diff --git 
a/src/main/java/org/apache/sling/distribution/queue/impl/AsyncDeliveryDispatchingStrategy.java
 
b/src/main/java/org/apache/sling/distribution/queue/impl/AsyncDeliveryDispatchingStrategy.java
index ccdd09c..2903925 100644
--- 
a/src/main/java/org/apache/sling/distribution/queue/impl/AsyncDeliveryDispatchingStrategy.java
+++ 
b/src/main/java/org/apache/sling/distribution/queue/impl/AsyncDeliveryDispatchingStrategy.java
@@ -29,6 +29,7 @@ import 
org.apache.sling.distribution.packaging.impl.DistributionPackageUtils;
 import org.apache.sling.distribution.packaging.impl.ReferencePackage;
 import org.apache.sling.distribution.packaging.impl.SharedDistributionPackage;
 import org.apache.sling.distribution.queue.*;
+import org.apache.sling.distribution.queue.spi.DistributionQueue;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
diff --git 
a/src/main/java/org/apache/sling/distribution/queue/impl/CachingDistributionQueue.java
 
b/src/main/java/org/apache/sling/distribution/queue/impl/CachingDistributionQueue.java
index d0ba734..300a65c 100644
--- 
a/src/main/java/org/apache/sling/distribution/queue/impl/CachingDistributionQueue.java
+++ 
b/src/main/java/org/apache/sling/distribution/queue/impl/CachingDistributionQueue.java
@@ -18,7 +18,7 @@
  */
 package org.apache.sling.distribution.queue.impl;
 
-import org.apache.sling.distribution.queue.DistributionQueue;
+import org.apache.sling.distribution.queue.spi.DistributionQueue;
 import org.apache.sling.distribution.queue.DistributionQueueEntry;
 import org.apache.sling.distribution.queue.DistributionQueueItem;
 import org.apache.sling.distribution.queue.DistributionQueueStatus;
diff --git 
a/src/main/java/org/apache/sling/distribution/queue/impl/DistributionQueueDispatchingStrategy.java
 
b/src/main/java/org/apache/sling/distribution/queue/impl/DistributionQueueDispatchingStrategy.java
index 7f08ff7..de907f9 100644
--- 
a/src/main/java/org/apache/sling/distribution/queue/impl/DistributionQueueDispatchingStrategy.java
+++ 
b/src/main/java/org/apache/sling/distribution/queue/impl/DistributionQueueDispatchingStrategy.java
@@ -25,13 +25,13 @@ import aQute.bnd.annotation.ConsumerType;
 import org.apache.sling.distribution.common.DistributionException;
 import org.apache.sling.distribution.packaging.DistributionPackage;
 import org.apache.sling.distribution.queue.DistributionQueueItemStatus;
-import org.apache.sling.distribution.queue.DistributionQueueProvider;
+import org.apache.sling.distribution.queue.spi.DistributionQueue;
 
 /**
  * a {@link DistributionQueueDispatchingStrategy} implements an algorithm for 
dispatching
  * {@link DistributionPackage}s among the available queues.
  * <p/>
- * Usually a {@link DistributionPackage} will be dispatched to a single {@link 
org.apache.sling.distribution.queue.DistributionQueue}
+ * Usually a {@link DistributionPackage} will be dispatched to a single {@link 
DistributionQueue}
  * but it would also be possible to dispatch the same package to multiple 
queues, resulting in obtaining multiple states
  * (one for each queue) for a certain package.
  */
@@ -41,12 +41,12 @@ public interface DistributionQueueDispatchingStrategy {
 
     /**
      * synchronously distribute a {@link DistributionPackage}
-     * to one or more {@link 
org.apache.sling.distribution.queue.DistributionQueue}s provided by the given 
{@link org.apache.sling.distribution.queue.DistributionQueueProvider}
+     * to one or more {@link DistributionQueue}s provided by the given {@link 
DistributionQueueProvider}
      *
      * @param distributionPackage a {@link DistributionPackage} to distribute
-     * @param queueProvider       the {@link 
org.apache.sling.distribution.queue.DistributionQueueProvider} used to provide 
the queues to be used for the given package
+     * @param queueProvider       the {@link DistributionQueueProvider} used 
to provide the queues to be used for the given package
      * @return an {@link java.lang.Iterable} of {@link 
org.apache.sling.distribution.queue.DistributionQueueItemStatus}s representing
-     * the states of the {@link 
org.apache.sling.distribution.queue.DistributionQueueItem}s added to one or 
more {@link org.apache.sling.distribution.queue.DistributionQueue}s
+     * the states of the {@link 
org.apache.sling.distribution.queue.DistributionQueueItem}s added to one or 
more {@link DistributionQueue}s
      * @throws DistributionException if any internal error happens during 
distribution
      */
     Iterable<DistributionQueueItemStatus> add(@Nonnull DistributionPackage 
distributionPackage, @Nonnull DistributionQueueProvider queueProvider) throws 
DistributionException;
diff --git 
a/src/main/java/org/apache/sling/distribution/queue/DistributionQueueProcessor.java
 
b/src/main/java/org/apache/sling/distribution/queue/impl/DistributionQueueProcessor.java
similarity index 76%
rename from 
src/main/java/org/apache/sling/distribution/queue/DistributionQueueProcessor.java
rename to 
src/main/java/org/apache/sling/distribution/queue/impl/DistributionQueueProcessor.java
index c97a191..5733c07 100644
--- 
a/src/main/java/org/apache/sling/distribution/queue/DistributionQueueProcessor.java
+++ 
b/src/main/java/org/apache/sling/distribution/queue/impl/DistributionQueueProcessor.java
@@ -16,11 +16,14 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.distribution.queue;
+package org.apache.sling.distribution.queue.impl;
 
 import javax.annotation.Nonnull;
 
 import aQute.bnd.annotation.ProviderType;
+import org.apache.sling.distribution.queue.DistributionQueueEntry;
+import org.apache.sling.distribution.queue.DistributionQueueItem;
+import org.apache.sling.distribution.queue.spi.DistributionQueue;
 
 /**
  * Processor of {@link DistributionQueueItem}s
@@ -29,9 +32,9 @@ import aQute.bnd.annotation.ProviderType;
 public interface DistributionQueueProcessor {
 
     /**
-     * Process an item from a certain {@link 
org.apache.sling.distribution.queue.DistributionQueue}
+     * Process an item from a certain {@link DistributionQueue}
      *
-     * @param queueName            the name of the {@link 
org.apache.sling.distribution.queue.DistributionQueue} to be processed
+     * @param queueName            the name of the {@link DistributionQueue} 
to be processed
      * @param queueEntry the {@link 
org.apache.sling.distribution.queue.DistributionQueueEntry} to be processed
      * @return {@code true} if the item was successfully processed, {@code 
false} otherwise
      */
diff --git 
a/src/main/java/org/apache/sling/distribution/queue/DistributionQueueProvider.java
 
b/src/main/java/org/apache/sling/distribution/queue/impl/DistributionQueueProvider.java
similarity index 91%
rename from 
src/main/java/org/apache/sling/distribution/queue/DistributionQueueProvider.java
rename to 
src/main/java/org/apache/sling/distribution/queue/impl/DistributionQueueProvider.java
index e42aa6a..73b2fdf 100644
--- 
a/src/main/java/org/apache/sling/distribution/queue/DistributionQueueProvider.java
+++ 
b/src/main/java/org/apache/sling/distribution/queue/impl/DistributionQueueProvider.java
@@ -16,12 +16,14 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.distribution.queue;
+package org.apache.sling.distribution.queue.impl;
 
 import javax.annotation.Nonnull;
 
 import aQute.bnd.annotation.ProviderType;
 import org.apache.sling.distribution.common.DistributionException;
+import org.apache.sling.distribution.queue.DistributionQueueType;
+import org.apache.sling.distribution.queue.spi.DistributionQueue;
 
 /**
  * A provider for {@link DistributionQueue}s
@@ -44,6 +46,7 @@ public interface DistributionQueueProvider {
      * @param type the type of the queue
      * @return a {@link DistributionQueue}
      */
+    @Nonnull
     DistributionQueue getQueue(@Nonnull String queueName, @Nonnull 
DistributionQueueType type);
 
     /**
diff --git 
a/src/main/java/org/apache/sling/distribution/queue/impl/DistributionQueueWrapper.java
 
b/src/main/java/org/apache/sling/distribution/queue/impl/DistributionQueueWrapper.java
index b5e2fcc..d5551b2 100644
--- 
a/src/main/java/org/apache/sling/distribution/queue/impl/DistributionQueueWrapper.java
+++ 
b/src/main/java/org/apache/sling/distribution/queue/impl/DistributionQueueWrapper.java
@@ -18,7 +18,7 @@
  */
 package org.apache.sling.distribution.queue.impl;
 
-import org.apache.sling.distribution.queue.DistributionQueue;
+import org.apache.sling.distribution.queue.spi.DistributionQueue;
 import org.apache.sling.distribution.queue.DistributionQueueEntry;
 import org.apache.sling.distribution.queue.DistributionQueueItem;
 import org.apache.sling.distribution.queue.DistributionQueueStatus;
diff --git 
a/src/main/java/org/apache/sling/distribution/queue/impl/ErrorQueueDispatchingStrategy.java
 
b/src/main/java/org/apache/sling/distribution/queue/impl/ErrorQueueDispatchingStrategy.java
index 94dcac6..0d7102a 100644
--- 
a/src/main/java/org/apache/sling/distribution/queue/impl/ErrorQueueDispatchingStrategy.java
+++ 
b/src/main/java/org/apache/sling/distribution/queue/impl/ErrorQueueDispatchingStrategy.java
@@ -29,12 +29,11 @@ import java.util.TreeSet;
 import org.apache.sling.distribution.common.DistributionException;
 import org.apache.sling.distribution.packaging.DistributionPackage;
 import org.apache.sling.distribution.packaging.impl.DistributionPackageUtils;
-import org.apache.sling.distribution.queue.DistributionQueue;
+import org.apache.sling.distribution.queue.spi.DistributionQueue;
 import org.apache.sling.distribution.queue.DistributionQueueEntry;
 import org.apache.sling.distribution.queue.DistributionQueueItem;
 import org.apache.sling.distribution.queue.DistributionQueueItemState;
 import org.apache.sling.distribution.queue.DistributionQueueItemStatus;
-import org.apache.sling.distribution.queue.DistributionQueueProvider;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
diff --git 
a/src/main/java/org/apache/sling/distribution/queue/impl/MultipleQueueDispatchingStrategy.java
 
b/src/main/java/org/apache/sling/distribution/queue/impl/MultipleQueueDispatchingStrategy.java
index 8c00f27..a7a3931 100644
--- 
a/src/main/java/org/apache/sling/distribution/queue/impl/MultipleQueueDispatchingStrategy.java
+++ 
b/src/main/java/org/apache/sling/distribution/queue/impl/MultipleQueueDispatchingStrategy.java
@@ -28,11 +28,10 @@ import 
org.apache.sling.distribution.queue.DistributionQueueEntry;
 import org.apache.sling.distribution.packaging.DistributionPackage;
 import org.apache.sling.distribution.packaging.impl.SharedDistributionPackage;
 import org.apache.sling.distribution.packaging.impl.DistributionPackageUtils;
-import org.apache.sling.distribution.queue.DistributionQueue;
+import org.apache.sling.distribution.queue.spi.DistributionQueue;
 import org.apache.sling.distribution.queue.DistributionQueueItem;
 import org.apache.sling.distribution.queue.DistributionQueueItemState;
 import org.apache.sling.distribution.queue.DistributionQueueItemStatus;
-import org.apache.sling.distribution.queue.DistributionQueueProvider;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
diff --git 
a/src/main/java/org/apache/sling/distribution/queue/impl/PriorityQueueDispatchingStrategy.java
 
b/src/main/java/org/apache/sling/distribution/queue/impl/PriorityQueueDispatchingStrategy.java
index 6a3dc1a..964ac01 100644
--- 
a/src/main/java/org/apache/sling/distribution/queue/impl/PriorityQueueDispatchingStrategy.java
+++ 
b/src/main/java/org/apache/sling/distribution/queue/impl/PriorityQueueDispatchingStrategy.java
@@ -21,7 +21,6 @@ package org.apache.sling.distribution.queue.impl;
 import org.apache.sling.distribution.common.DistributionException;
 import org.apache.sling.distribution.packaging.DistributionPackage;
 import org.apache.sling.distribution.queue.DistributionQueueItemStatus;
-import org.apache.sling.distribution.queue.DistributionQueueProvider;
 
 import javax.annotation.Nonnull;
 import java.util.ArrayList;
diff --git 
a/src/main/java/org/apache/sling/distribution/queue/impl/SimpleAgentDistributionQueue.java
 
b/src/main/java/org/apache/sling/distribution/queue/impl/SimpleAgentDistributionQueue.java
index 7d60ba0..f550ccb 100644
--- 
a/src/main/java/org/apache/sling/distribution/queue/impl/SimpleAgentDistributionQueue.java
+++ 
b/src/main/java/org/apache/sling/distribution/queue/impl/SimpleAgentDistributionQueue.java
@@ -19,7 +19,7 @@
 package org.apache.sling.distribution.queue.impl;
 
 
-import org.apache.sling.distribution.queue.DistributionQueue;
+import org.apache.sling.distribution.queue.spi.DistributionQueue;
 import org.apache.sling.distribution.queue.DistributionQueueState;
 import org.apache.sling.distribution.queue.DistributionQueueStatus;
 import org.apache.sling.distribution.queue.DistributionQueueType;
diff --git 
a/src/main/java/org/apache/sling/distribution/queue/impl/jobhandling/DistributionAgentJobConsumer.java
 
b/src/main/java/org/apache/sling/distribution/queue/impl/jobhandling/DistributionAgentJobConsumer.java
index 72841e4..1e2a142 100644
--- 
a/src/main/java/org/apache/sling/distribution/queue/impl/jobhandling/DistributionAgentJobConsumer.java
+++ 
b/src/main/java/org/apache/sling/distribution/queue/impl/jobhandling/DistributionAgentJobConsumer.java
@@ -19,7 +19,7 @@
 package org.apache.sling.distribution.queue.impl.jobhandling;
 
 import org.apache.sling.distribution.queue.DistributionQueueEntry;
-import org.apache.sling.distribution.queue.DistributionQueueProcessor;
+import org.apache.sling.distribution.queue.impl.DistributionQueueProcessor;
 import org.apache.sling.event.jobs.Job;
 import org.apache.sling.event.jobs.consumer.JobConsumer;
 import org.slf4j.Logger;
diff --git 
a/src/main/java/org/apache/sling/distribution/queue/impl/jobhandling/JobHandlingDistributionQueue.java
 
b/src/main/java/org/apache/sling/distribution/queue/impl/jobhandling/JobHandlingDistributionQueue.java
index 3abda50..9a7ee28 100644
--- 
a/src/main/java/org/apache/sling/distribution/queue/impl/jobhandling/JobHandlingDistributionQueue.java
+++ 
b/src/main/java/org/apache/sling/distribution/queue/impl/jobhandling/JobHandlingDistributionQueue.java
@@ -24,7 +24,7 @@ import java.util.Collection;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.sling.distribution.queue.DistributionQueue;
+import org.apache.sling.distribution.queue.spi.DistributionQueue;
 import org.apache.sling.distribution.queue.DistributionQueueEntry;
 import org.apache.sling.distribution.queue.DistributionQueueItem;
 import org.apache.sling.distribution.queue.DistributionQueueItemStatus;
@@ -39,7 +39,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * a {@link org.apache.sling.distribution.queue.DistributionQueue} based on 
Sling Job Handling facilities
+ * a {@link DistributionQueue} based on Sling Job Handling facilities
  */
 public class JobHandlingDistributionQueue implements DistributionQueue {
 
diff --git 
a/src/main/java/org/apache/sling/distribution/queue/impl/jobhandling/JobHandlingDistributionQueueProvider.java
 
b/src/main/java/org/apache/sling/distribution/queue/impl/jobhandling/JobHandlingDistributionQueueProvider.java
index ed4f48a..347db72 100644
--- 
a/src/main/java/org/apache/sling/distribution/queue/impl/jobhandling/JobHandlingDistributionQueueProvider.java
+++ 
b/src/main/java/org/apache/sling/distribution/queue/impl/jobhandling/JobHandlingDistributionQueueProvider.java
@@ -29,9 +29,9 @@ import java.util.List;
 import java.util.Set;
 
 import org.apache.sling.distribution.common.DistributionException;
-import org.apache.sling.distribution.queue.DistributionQueue;
-import org.apache.sling.distribution.queue.DistributionQueueProcessor;
-import org.apache.sling.distribution.queue.DistributionQueueProvider;
+import org.apache.sling.distribution.queue.spi.DistributionQueue;
+import org.apache.sling.distribution.queue.impl.DistributionQueueProcessor;
+import org.apache.sling.distribution.queue.impl.DistributionQueueProvider;
 import org.apache.sling.distribution.queue.DistributionQueueType;
 import org.apache.sling.distribution.queue.impl.CachingDistributionQueue;
 import org.apache.sling.event.impl.jobs.config.ConfigurationConstants;
@@ -46,8 +46,8 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * a queue provider {@link 
org.apache.sling.distribution.queue.DistributionQueueProvider} for sling jobs 
based
- * {@link org.apache.sling.distribution.queue.DistributionQueue}s
+ * a queue provider {@link DistributionQueueProvider} for sling jobs based
+ * {@link DistributionQueue}s
  */
 public class JobHandlingDistributionQueueProvider implements 
DistributionQueueProvider {
 
diff --git 
a/src/main/java/org/apache/sling/distribution/queue/impl/simple/SimpleDistributionQueue.java
 
b/src/main/java/org/apache/sling/distribution/queue/impl/simple/SimpleDistributionQueue.java
index 1bfa49e..3fc7352 100644
--- 
a/src/main/java/org/apache/sling/distribution/queue/impl/simple/SimpleDistributionQueue.java
+++ 
b/src/main/java/org/apache/sling/distribution/queue/impl/simple/SimpleDistributionQueue.java
@@ -28,7 +28,7 @@ import java.util.Queue;
 import java.util.WeakHashMap;
 import java.util.concurrent.LinkedBlockingQueue;
 
-import org.apache.sling.distribution.queue.DistributionQueue;
+import org.apache.sling.distribution.queue.spi.DistributionQueue;
 import org.apache.sling.distribution.queue.DistributionQueueEntry;
 import org.apache.sling.distribution.queue.DistributionQueueItem;
 import org.apache.sling.distribution.queue.DistributionQueueItemState;
@@ -41,7 +41,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * A simple implementation of a {@link 
org.apache.sling.distribution.queue.DistributionQueue}.
+ * A simple implementation of a {@link DistributionQueue}.
  * <p/>
  * Note that, at the moment, this is a transient in memory queue not persisted 
on the repository and
  * therefore not usable for production.
diff --git 
a/src/main/java/org/apache/sling/distribution/queue/impl/simple/SimpleDistributionQueueCheckpoint.java
 
b/src/main/java/org/apache/sling/distribution/queue/impl/simple/SimpleDistributionQueueCheckpoint.java
index c000424..21c5282 100644
--- 
a/src/main/java/org/apache/sling/distribution/queue/impl/simple/SimpleDistributionQueueCheckpoint.java
+++ 
b/src/main/java/org/apache/sling/distribution/queue/impl/simple/SimpleDistributionQueueCheckpoint.java
@@ -25,7 +25,7 @@ import java.util.Collection;
 import java.util.LinkedList;
 
 import org.apache.commons.io.IOUtils;
-import org.apache.sling.distribution.queue.DistributionQueue;
+import org.apache.sling.distribution.queue.spi.DistributionQueue;
 import org.apache.sling.distribution.queue.DistributionQueueEntry;
 import org.apache.sling.distribution.queue.DistributionQueueItem;
 import org.slf4j.Logger;
diff --git 
a/src/main/java/org/apache/sling/distribution/queue/impl/simple/SimpleDistributionQueueProcessor.java
 
b/src/main/java/org/apache/sling/distribution/queue/impl/simple/SimpleDistributionQueueProcessor.java
index ac41222..f4d3074 100644
--- 
a/src/main/java/org/apache/sling/distribution/queue/impl/simple/SimpleDistributionQueueProcessor.java
+++ 
b/src/main/java/org/apache/sling/distribution/queue/impl/simple/SimpleDistributionQueueProcessor.java
@@ -18,9 +18,9 @@
  */
 package org.apache.sling.distribution.queue.impl.simple;
 
-import org.apache.sling.distribution.queue.DistributionQueue;
+import org.apache.sling.distribution.queue.spi.DistributionQueue;
 import org.apache.sling.distribution.queue.DistributionQueueEntry;
-import org.apache.sling.distribution.queue.DistributionQueueProcessor;
+import org.apache.sling.distribution.queue.impl.DistributionQueueProcessor;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
diff --git 
a/src/main/java/org/apache/sling/distribution/queue/impl/simple/SimpleDistributionQueueProvider.java
 
b/src/main/java/org/apache/sling/distribution/queue/impl/simple/SimpleDistributionQueueProvider.java
index e9dde47..4835bed 100644
--- 
a/src/main/java/org/apache/sling/distribution/queue/impl/simple/SimpleDistributionQueueProvider.java
+++ 
b/src/main/java/org/apache/sling/distribution/queue/impl/simple/SimpleDistributionQueueProvider.java
@@ -33,17 +33,17 @@ import org.apache.commons.io.IOUtils;
 import org.apache.commons.io.LineIterator;
 import org.apache.sling.commons.scheduler.ScheduleOptions;
 import org.apache.sling.commons.scheduler.Scheduler;
-import org.apache.sling.distribution.queue.DistributionQueue;
+import org.apache.sling.distribution.queue.spi.DistributionQueue;
 import org.apache.sling.distribution.queue.DistributionQueueItem;
-import org.apache.sling.distribution.queue.DistributionQueueProcessor;
-import org.apache.sling.distribution.queue.DistributionQueueProvider;
+import org.apache.sling.distribution.queue.impl.DistributionQueueProcessor;
+import org.apache.sling.distribution.queue.impl.DistributionQueueProvider;
 import org.apache.sling.distribution.queue.DistributionQueueType;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * a queue provider {@link 
org.apache.sling.distribution.queue.DistributionQueueProvider} for simple in 
memory
- * {@link org.apache.sling.distribution.queue.DistributionQueue}s
+ * a queue provider {@link DistributionQueueProvider} for simple in memory
+ * {@link DistributionQueue}s
  */
 public class SimpleDistributionQueueProvider implements 
DistributionQueueProvider {
 
diff --git 
a/src/main/java/org/apache/sling/distribution/queue/package-info.java 
b/src/main/java/org/apache/sling/distribution/queue/package-info.java
index 70795e9..54a3ee1 100644
--- a/src/main/java/org/apache/sling/distribution/queue/package-info.java
+++ b/src/main/java/org/apache/sling/distribution/queue/package-info.java
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-@Version("0.1.0")
+@Version("0.0.0")
 package org.apache.sling.distribution.queue;
 
 import aQute.bnd.annotation.Version;
diff --git 
a/src/main/java/org/apache/sling/distribution/queue/DistributionQueue.java 
b/src/main/java/org/apache/sling/distribution/queue/spi/DistributionQueue.java
similarity index 85%
rename from 
src/main/java/org/apache/sling/distribution/queue/DistributionQueue.java
rename to 
src/main/java/org/apache/sling/distribution/queue/spi/DistributionQueue.java
index 4cec864..66642d6 100644
--- a/src/main/java/org/apache/sling/distribution/queue/DistributionQueue.java
+++ 
b/src/main/java/org/apache/sling/distribution/queue/spi/DistributionQueue.java
@@ -16,13 +16,18 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.distribution.queue;
+package org.apache.sling.distribution.queue.spi;
 
 import javax.annotation.CheckForNull;
 import javax.annotation.Nonnull;
 
-import aQute.bnd.annotation.ProviderType;
+import aQute.bnd.annotation.ConsumerType;
 import org.apache.sling.distribution.packaging.DistributionPackage;
+import org.apache.sling.distribution.queue.DistributionQueueEntry;
+import org.apache.sling.distribution.queue.DistributionQueueItem;
+import org.apache.sling.distribution.queue.DistributionQueueStatus;
+import org.apache.sling.distribution.queue.DistributionQueueType;
+import org.apache.sling.distribution.queue.impl.DistributionQueueProcessor;
 
 /**
  * A queue is responsible for collecting the {@link DistributionPackage}s
@@ -32,9 +37,9 @@ import 
org.apache.sling.distribution.packaging.DistributionPackage;
  * on that same agent.
  * <p/>
  * The items (packages) in the queue can then get processed according to a FIFO
- * strategy or in parallel, or some other way, via {@link 
org.apache.sling.distribution.queue.DistributionQueueProcessor}s.
+ * strategy or in parallel, or some other way, via {@link 
DistributionQueueProcessor}s.
  */
-@ProviderType
+@ConsumerType
 public interface DistributionQueue {
 
     /**
@@ -52,6 +57,7 @@ public interface DistributionQueue {
      *             to distribute
      * @return the queue entry created for this item or {@code noll} if none 
is created
      */
+    @CheckForNull
     DistributionQueueEntry add(@Nonnull DistributionQueueItem item);
 
     /**
@@ -103,5 +109,6 @@ public interface DistributionQueue {
      * get the type of this queue
      * @return the type
      */
+    @Nonnull
     DistributionQueueType getType();
 }
diff --git 
a/src/main/java/org/apache/sling/distribution/queue/package-info.java 
b/src/main/java/org/apache/sling/distribution/queue/spi/package-info.java
similarity index 92%
copy from src/main/java/org/apache/sling/distribution/queue/package-info.java
copy to src/main/java/org/apache/sling/distribution/queue/spi/package-info.java
index 70795e9..8ccaeac 100644
--- a/src/main/java/org/apache/sling/distribution/queue/package-info.java
+++ b/src/main/java/org/apache/sling/distribution/queue/spi/package-info.java
@@ -17,8 +17,8 @@
  * under the License.
  */
 
-@Version("0.1.0")
-package org.apache.sling.distribution.queue;
+@Version("0.0.0")
+package org.apache.sling.distribution.queue.spi;
 
 import aQute.bnd.annotation.Version;
 
diff --git 
a/src/main/java/org/apache/sling/distribution/resources/impl/ExtendedDistributionServiceResourceProvider.java
 
b/src/main/java/org/apache/sling/distribution/resources/impl/ExtendedDistributionServiceResourceProvider.java
index 2ccdf7c..6d5ae84 100644
--- 
a/src/main/java/org/apache/sling/distribution/resources/impl/ExtendedDistributionServiceResourceProvider.java
+++ 
b/src/main/java/org/apache/sling/distribution/resources/impl/ExtendedDistributionServiceResourceProvider.java
@@ -31,11 +31,11 @@ import 
org.apache.sling.distribution.agent.DistributionAgentState;
 import org.apache.sling.distribution.component.impl.DistributionComponent;
 import org.apache.sling.distribution.component.impl.DistributionComponentKind;
 import 
org.apache.sling.distribution.component.impl.DistributionComponentProvider;
-import org.apache.sling.distribution.log.DistributionLog;
+import org.apache.sling.distribution.log.spi.DistributionLog;
 import org.apache.sling.distribution.queue.impl.ErrorQueueDispatchingStrategy;
 import org.apache.sling.distribution.packaging.DistributionPackageInfo;
 import org.apache.sling.distribution.packaging.impl.DistributionPackageUtils;
-import org.apache.sling.distribution.queue.DistributionQueue;
+import org.apache.sling.distribution.queue.spi.DistributionQueue;
 import org.apache.sling.distribution.queue.DistributionQueueEntry;
 import org.apache.sling.distribution.queue.DistributionQueueItem;
 import org.apache.sling.distribution.queue.DistributionQueueItemStatus;
diff --git 
a/src/main/java/org/apache/sling/distribution/servlet/DistributionAgentLogServlet.java
 
b/src/main/java/org/apache/sling/distribution/servlet/DistributionAgentLogServlet.java
index 6e87484..95ad92b 100644
--- 
a/src/main/java/org/apache/sling/distribution/servlet/DistributionAgentLogServlet.java
+++ 
b/src/main/java/org/apache/sling/distribution/servlet/DistributionAgentLogServlet.java
@@ -27,7 +27,7 @@ import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.SlingHttpServletResponse;
 import org.apache.sling.api.servlets.SlingAllMethodsServlet;
 import org.apache.sling.distribution.DistributionRequest;
-import org.apache.sling.distribution.log.DistributionLog;
+import org.apache.sling.distribution.log.spi.DistributionLog;
 import org.apache.sling.distribution.resources.DistributionResourceTypes;
 import org.apache.sling.distribution.util.RequestUtils;
 import org.slf4j.Logger;
diff --git 
a/src/main/java/org/apache/sling/distribution/servlet/DistributionAgentQueueServlet.java
 
b/src/main/java/org/apache/sling/distribution/servlet/DistributionAgentQueueServlet.java
index cd1c56d..bc0db4e 100644
--- 
a/src/main/java/org/apache/sling/distribution/servlet/DistributionAgentQueueServlet.java
+++ 
b/src/main/java/org/apache/sling/distribution/servlet/DistributionAgentQueueServlet.java
@@ -33,7 +33,7 @@ import 
org.apache.sling.distribution.common.DistributionException;
 import org.apache.sling.distribution.packaging.DistributionPackage;
 import org.apache.sling.distribution.packaging.DistributionPackageInfo;
 import org.apache.sling.distribution.packaging.impl.DistributionPackageUtils;
-import org.apache.sling.distribution.queue.DistributionQueue;
+import org.apache.sling.distribution.queue.spi.DistributionQueue;
 import org.apache.sling.distribution.queue.DistributionQueueEntry;
 import org.apache.sling.distribution.queue.DistributionQueueItem;
 import org.apache.sling.distribution.resources.DistributionResourceTypes;
@@ -43,7 +43,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * Servlet to retrieve a {@link 
org.apache.sling.distribution.queue.DistributionQueue} status.
+ * Servlet to retrieve a {@link DistributionQueue} status.
  */
 @SuppressWarnings("serial")
 @SlingServlet(resourceTypes = 
DistributionResourceTypes.AGENT_QUEUE_RESOURCE_TYPE, methods = {"POST"})
diff --git 
a/src/test/java/org/apache/sling/distribution/agent/impl/QueueingDistributionPackageProcessorTest.java
 
b/src/test/java/org/apache/sling/distribution/agent/impl/QueueingDistributionPackageProcessorTest.java
index c1d6b5e..1820e9d 100644
--- 
a/src/test/java/org/apache/sling/distribution/agent/impl/QueueingDistributionPackageProcessorTest.java
+++ 
b/src/test/java/org/apache/sling/distribution/agent/impl/QueueingDistributionPackageProcessorTest.java
@@ -29,7 +29,7 @@ import 
org.apache.sling.distribution.packaging.DistributionPackage;
 import org.apache.sling.distribution.packaging.DistributionPackageInfo;
 import org.apache.sling.distribution.queue.DistributionQueueItemState;
 import org.apache.sling.distribution.queue.DistributionQueueItemStatus;
-import org.apache.sling.distribution.queue.DistributionQueueProvider;
+import org.apache.sling.distribution.queue.impl.DistributionQueueProvider;
 import 
org.apache.sling.distribution.queue.impl.DistributionQueueDispatchingStrategy;
 import org.junit.Test;
 
diff --git 
a/src/test/java/org/apache/sling/distribution/agent/impl/SimpleDistributionAgentQueueProcessorTest.java
 
b/src/test/java/org/apache/sling/distribution/agent/impl/SimpleDistributionAgentQueueProcessorTest.java
index 378aa51..a96601c 100644
--- 
a/src/test/java/org/apache/sling/distribution/agent/impl/SimpleDistributionAgentQueueProcessorTest.java
+++ 
b/src/test/java/org/apache/sling/distribution/agent/impl/SimpleDistributionAgentQueueProcessorTest.java
@@ -28,7 +28,7 @@ import 
org.apache.sling.distribution.queue.DistributionQueueEntry;
 import org.apache.sling.distribution.queue.DistributionQueueItem;
 import org.apache.sling.distribution.queue.DistributionQueueItemState;
 import org.apache.sling.distribution.queue.DistributionQueueItemStatus;
-import org.apache.sling.distribution.queue.DistributionQueueProvider;
+import org.apache.sling.distribution.queue.impl.DistributionQueueProvider;
 import org.junit.Test;
 
 import static org.mockito.Mockito.mock;
diff --git 
a/src/test/java/org/apache/sling/distribution/agent/impl/SimpleDistributionAgentTest.java
 
b/src/test/java/org/apache/sling/distribution/agent/impl/SimpleDistributionAgentTest.java
index 86c3075..cfbf7e4 100644
--- 
a/src/test/java/org/apache/sling/distribution/agent/impl/SimpleDistributionAgentTest.java
+++ 
b/src/test/java/org/apache/sling/distribution/agent/impl/SimpleDistributionAgentTest.java
@@ -39,11 +39,11 @@ import 
org.apache.sling.distribution.packaging.DistributionPackage;
 import org.apache.sling.distribution.packaging.DistributionPackageExporter;
 import org.apache.sling.distribution.packaging.DistributionPackageImporter;
 import org.apache.sling.distribution.packaging.DistributionPackageInfo;
-import org.apache.sling.distribution.queue.DistributionQueue;
+import org.apache.sling.distribution.queue.spi.DistributionQueue;
 import org.apache.sling.distribution.queue.DistributionQueueItemState;
 import 
org.apache.sling.distribution.queue.impl.DistributionQueueDispatchingStrategy;
 import org.apache.sling.distribution.queue.DistributionQueueItemStatus;
-import org.apache.sling.distribution.queue.DistributionQueueProvider;
+import org.apache.sling.distribution.queue.impl.DistributionQueueProvider;
 import org.apache.sling.distribution.queue.impl.simple.SimpleDistributionQueue;
 import org.apache.sling.distribution.trigger.DistributionRequestHandler;
 import org.apache.sling.distribution.trigger.DistributionTrigger;
diff --git 
a/src/test/java/org/apache/sling/distribution/monitor/DistributionQueueHealthCheckTest.java
 
b/src/test/java/org/apache/sling/distribution/monitor/DistributionQueueHealthCheckTest.java
index 0147c78..68ce1a4 100644
--- 
a/src/test/java/org/apache/sling/distribution/monitor/DistributionQueueHealthCheckTest.java
+++ 
b/src/test/java/org/apache/sling/distribution/monitor/DistributionQueueHealthCheckTest.java
@@ -19,11 +19,14 @@
 package org.apache.sling.distribution.monitor;
 
 import java.util.ArrayList;
+import java.util.Calendar;
 import java.util.Collections;
+import java.util.HashMap;
 import java.util.List;
 
 import org.apache.sling.distribution.agent.DistributionAgent;
-import org.apache.sling.distribution.queue.DistributionQueue;
+import org.apache.sling.distribution.queue.DistributionQueueItemState;
+import org.apache.sling.distribution.queue.spi.DistributionQueue;
 import org.apache.sling.distribution.queue.DistributionQueueEntry;
 import org.apache.sling.distribution.queue.DistributionQueueItem;
 import org.apache.sling.distribution.queue.DistributionQueueItemStatus;
@@ -78,9 +81,8 @@ public class DistributionQueueHealthCheckTest {
 
         distributionQueueHealthCheck.activate(Collections.<String, 
Object>emptyMap());
         DistributionQueue queue = mock(DistributionQueue.class);
-        DistributionQueueItem item = mock(DistributionQueueItem.class);
-        DistributionQueueItemStatus status = 
mock(DistributionQueueItemStatus.class);
-        when(status.getAttempts()).thenReturn(1);
+        DistributionQueueItem item = new DistributionQueueItem("packageId", 
new HashMap<String, Object>());
+        DistributionQueueItemStatus status = new 
DistributionQueueItemStatus(Calendar.getInstance(), 
DistributionQueueItemState.QUEUED, 1, "queueName");
         when(queue.getItem(any(String.class))).thenReturn(new 
DistributionQueueEntry(null, item, status));
         when(queue.getHead()).thenReturn(new DistributionQueueEntry(null, 
item, status));
         DistributionAgent distributionAgent = mock(DistributionAgent.class);
@@ -103,9 +105,8 @@ public class DistributionQueueHealthCheckTest {
 
         distributionQueueHealthCheck.activate(Collections.<String, 
Object>emptyMap());
         DistributionQueue queue = mock(DistributionQueue.class);
-        DistributionQueueItem item = mock(DistributionQueueItem.class);
-        DistributionQueueItemStatus status = 
mock(DistributionQueueItemStatus.class);
-        when(status.getAttempts()).thenReturn(10);
+        DistributionQueueItem item = new DistributionQueueItem("packageId", 
new HashMap<String, Object>());
+        DistributionQueueItemStatus status = new 
DistributionQueueItemStatus(Calendar.getInstance(), 
DistributionQueueItemState.QUEUED, 10, "queueName");
         when(queue.getItem(any(String.class))).thenReturn(new 
DistributionQueueEntry(null, item, status));
         when(queue.getHead()).thenReturn(new DistributionQueueEntry(null, 
item, status));
         DistributionAgent distributionAgent = mock(DistributionAgent.class);
diff --git 
a/src/test/java/org/apache/sling/distribution/monitor/impl/DistributionQueueMBeanTest.java
 
b/src/test/java/org/apache/sling/distribution/monitor/impl/DistributionQueueMBeanTest.java
index 153ba57..1f77dcf 100644
--- 
a/src/test/java/org/apache/sling/distribution/monitor/impl/DistributionQueueMBeanTest.java
+++ 
b/src/test/java/org/apache/sling/distribution/monitor/impl/DistributionQueueMBeanTest.java
@@ -33,7 +33,7 @@ import static org.mockito.Mockito.when;
 import java.util.Calendar;
 import java.util.HashMap;
 
-import org.apache.sling.distribution.queue.DistributionQueue;
+import org.apache.sling.distribution.queue.spi.DistributionQueue;
 import org.apache.sling.distribution.queue.DistributionQueueEntry;
 import org.apache.sling.distribution.queue.DistributionQueueItem;
 import org.apache.sling.distribution.queue.DistributionQueueItemStatus;
diff --git 
a/src/test/java/org/apache/sling/distribution/queue/impl/AsyncDeliveryDispatchingStrategyTest.java
 
b/src/test/java/org/apache/sling/distribution/queue/impl/AsyncDeliveryDispatchingStrategyTest.java
index 41853c5..6447611 100644
--- 
a/src/test/java/org/apache/sling/distribution/queue/impl/AsyncDeliveryDispatchingStrategyTest.java
+++ 
b/src/test/java/org/apache/sling/distribution/queue/impl/AsyncDeliveryDispatchingStrategyTest.java
@@ -25,6 +25,7 @@ import static org.mockito.Matchers.any;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
+import java.util.Calendar;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -33,11 +34,11 @@ import 
org.apache.sling.distribution.common.DistributionException;
 import org.apache.sling.distribution.packaging.DistributionPackage;
 import org.apache.sling.distribution.packaging.DistributionPackageInfo;
 import org.apache.sling.distribution.packaging.impl.SharedDistributionPackage;
-import org.apache.sling.distribution.queue.DistributionQueue;
+import org.apache.sling.distribution.queue.DistributionQueueItemState;
+import org.apache.sling.distribution.queue.spi.DistributionQueue;
 import org.apache.sling.distribution.queue.DistributionQueueEntry;
 import org.apache.sling.distribution.queue.DistributionQueueItem;
 import org.apache.sling.distribution.queue.DistributionQueueItemStatus;
-import org.apache.sling.distribution.queue.DistributionQueueProvider;
 import org.apache.sling.distribution.queue.DistributionQueueState;
 import org.apache.sling.distribution.queue.DistributionQueueStatus;
 import org.junit.Test;
@@ -76,7 +77,7 @@ public class AsyncDeliveryDispatchingStrategyTest {
         // setup queues
         DistributionQueueProvider queueProvider = 
mock(DistributionQueueProvider.class);
         DistributionQueue dq1 = mock(DistributionQueue.class);
-        DistributionQueueItemStatus status = 
mock(DistributionQueueItemStatus.class);
+        DistributionQueueItemStatus status = new 
DistributionQueueItemStatus(Calendar.getInstance(), 
DistributionQueueItemState.QUEUED, 0, "queueName");
         DistributionQueueEntry entry = new DistributionQueueEntry("1242112", 
new DistributionQueueItem(distributionPackage.getId(),
                 new HashMap<String, Object>()), status);
         when(dq1.add(any(DistributionQueueItem.class))).thenReturn(entry);
diff --git 
a/src/test/java/org/apache/sling/distribution/queue/impl/PriorityQueueDispatchingStrategyTest.java
 
b/src/test/java/org/apache/sling/distribution/queue/impl/PriorityQueueDispatchingStrategyTest.java
index 34546c9..4ea08a9 100644
--- 
a/src/test/java/org/apache/sling/distribution/queue/impl/PriorityQueueDispatchingStrategyTest.java
+++ 
b/src/test/java/org/apache/sling/distribution/queue/impl/PriorityQueueDispatchingStrategyTest.java
@@ -21,8 +21,7 @@ package org.apache.sling.distribution.queue.impl;
 import org.apache.sling.distribution.packaging.DistributionPackage;
 import org.apache.sling.distribution.packaging.DistributionPackageInfo;
 import org.apache.sling.distribution.packaging.impl.SharedDistributionPackage;
-import org.apache.sling.distribution.queue.DistributionQueue;
-import org.apache.sling.distribution.queue.DistributionQueueProvider;
+import org.apache.sling.distribution.queue.spi.DistributionQueue;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
diff --git 
a/src/test/java/org/apache/sling/distribution/queue/impl/SingleQueueDistributionStrategyTest.java
 
b/src/test/java/org/apache/sling/distribution/queue/impl/SingleQueueDistributionStrategyTest.java
index a1c7f26..5cc3f0e 100644
--- 
a/src/test/java/org/apache/sling/distribution/queue/impl/SingleQueueDistributionStrategyTest.java
+++ 
b/src/test/java/org/apache/sling/distribution/queue/impl/SingleQueueDistributionStrategyTest.java
@@ -18,14 +18,16 @@
  */
 package org.apache.sling.distribution.queue.impl;
 
+import java.util.Calendar;
+import java.util.HashMap;
 import java.util.Iterator;
 
 import org.apache.sling.distribution.packaging.DistributionPackage;
-import org.apache.sling.distribution.queue.DistributionQueue;
+import org.apache.sling.distribution.queue.DistributionQueueItemState;
+import org.apache.sling.distribution.queue.spi.DistributionQueue;
 import org.apache.sling.distribution.queue.DistributionQueueEntry;
 import org.apache.sling.distribution.queue.DistributionQueueItem;
 import org.apache.sling.distribution.queue.DistributionQueueItemStatus;
-import org.apache.sling.distribution.queue.DistributionQueueProvider;
 import org.junit.Test;
 
 import static org.junit.Assert.assertNotNull;
@@ -46,7 +48,7 @@ public class SingleQueueDistributionStrategyTest {
         DistributionQueueProvider queueProvider = 
mock(DistributionQueueProvider.class);
         DistributionQueue queue = mock(DistributionQueue.class);
         
when(queueProvider.getQueue(DistributionQueueDispatchingStrategy.DEFAULT_QUEUE_NAME)).thenReturn(queue);
-        DistributionQueueItemStatus state = 
mock(DistributionQueueItemStatus.class);
+        DistributionQueueItemStatus state = newDistributionQueueItemStatus();
         when(queue.add(any(DistributionQueueItem.class))).thenReturn(new 
DistributionQueueEntry(null, null, state));
 
         Iterable<DistributionQueueItemStatus> returnedStates = 
singleQueueDistributionStrategy.add(distributionPackage, queueProvider);
@@ -63,9 +65,9 @@ public class SingleQueueDistributionStrategyTest {
         DistributionPackage distributionPackage = 
mock(DistributionPackage.class);
         DistributionQueueProvider queueProvider = 
mock(DistributionQueueProvider.class);
         DistributionQueue queue = mock(DistributionQueue.class);
-        DistributionQueueItem queueItem = mock(DistributionQueueItem.class);
+        DistributionQueueItem queueItem = new 
DistributionQueueItem("packageId", new HashMap<String, Object>());
         
when(queueProvider.getQueue(DistributionQueueDispatchingStrategy.DEFAULT_QUEUE_NAME)).thenReturn(queue);
-        DistributionQueueItemStatus state = 
mock(DistributionQueueItemStatus.class);
+        DistributionQueueItemStatus state = newDistributionQueueItemStatus();
         when(queue.add(queueItem)).thenReturn(new DistributionQueueEntry(null, 
queueItem, state));
         Iterable<DistributionQueueItemStatus> returnedStates = 
singleQueueDistributionStrategy.add(distributionPackage, queueProvider);
         assertNotNull(returnedStates);
@@ -82,7 +84,7 @@ public class SingleQueueDistributionStrategyTest {
         DistributionQueueProvider queueProvider = 
mock(DistributionQueueProvider.class);
         DistributionQueue queue = mock(DistributionQueue.class);
         
when(queueProvider.getQueue(DistributionQueueDispatchingStrategy.DEFAULT_QUEUE_NAME)).thenReturn(queue);
-        DistributionQueueItemStatus state = 
mock(DistributionQueueItemStatus.class);
+        DistributionQueueItemStatus state = newDistributionQueueItemStatus();
 
         when(queue.add(any(DistributionQueueItem.class))).thenReturn(new 
DistributionQueueEntry(null, null, state));
 
@@ -93,4 +95,8 @@ public class SingleQueueDistributionStrategyTest {
         assertTrue(iterator.hasNext());
         assertNotNull(iterator.next());
     }
+
+    private DistributionQueueItemStatus newDistributionQueueItemStatus() {
+        return new DistributionQueueItemStatus(Calendar.getInstance(), 
DistributionQueueItemState.QUEUED, 0, 
DistributionQueueDispatchingStrategy.DEFAULT_QUEUE_NAME);
+    }
 }
diff --git 
a/src/test/java/org/apache/sling/distribution/queue/impl/jobhandling/DistributionAgentJobConsumerTest.java
 
b/src/test/java/org/apache/sling/distribution/queue/impl/jobhandling/DistributionAgentJobConsumerTest.java
index 57e3d61..e7ba3ce 100644
--- 
a/src/test/java/org/apache/sling/distribution/queue/impl/jobhandling/DistributionAgentJobConsumerTest.java
+++ 
b/src/test/java/org/apache/sling/distribution/queue/impl/jobhandling/DistributionAgentJobConsumerTest.java
@@ -19,7 +19,7 @@
 package org.apache.sling.distribution.queue.impl.jobhandling;
 
 import org.apache.sling.distribution.queue.DistributionQueueEntry;
-import org.apache.sling.distribution.queue.DistributionQueueProcessor;
+import org.apache.sling.distribution.queue.impl.DistributionQueueProcessor;
 import org.apache.sling.event.jobs.Job;
 import org.apache.sling.event.jobs.consumer.JobConsumer;
 import org.junit.Test;
diff --git 
a/src/test/java/org/apache/sling/distribution/queue/impl/jobhandling/JobHandlingDistributionQueueProviderTest.java
 
b/src/test/java/org/apache/sling/distribution/queue/impl/jobhandling/JobHandlingDistributionQueueProviderTest.java
index 5dbc2fa..be8ec4f 100644
--- 
a/src/test/java/org/apache/sling/distribution/queue/impl/jobhandling/JobHandlingDistributionQueueProviderTest.java
+++ 
b/src/test/java/org/apache/sling/distribution/queue/impl/jobhandling/JobHandlingDistributionQueueProviderTest.java
@@ -18,8 +18,8 @@
  */
 package org.apache.sling.distribution.queue.impl.jobhandling;
 
-import org.apache.sling.distribution.queue.DistributionQueue;
-import org.apache.sling.distribution.queue.DistributionQueueProcessor;
+import org.apache.sling.distribution.queue.spi.DistributionQueue;
+import org.apache.sling.distribution.queue.impl.DistributionQueueProcessor;
 import org.apache.sling.event.jobs.JobManager;
 import org.apache.sling.event.jobs.QueueConfiguration;
 import org.junit.Test;
diff --git 
a/src/test/java/org/apache/sling/distribution/queue/impl/jobhandling/JobHandlingDistributionQueueTest.java
 
b/src/test/java/org/apache/sling/distribution/queue/impl/jobhandling/JobHandlingDistributionQueueTest.java
index 53c5134..25c0f84 100644
--- 
a/src/test/java/org/apache/sling/distribution/queue/impl/jobhandling/JobHandlingDistributionQueueTest.java
+++ 
b/src/test/java/org/apache/sling/distribution/queue/impl/jobhandling/JobHandlingDistributionQueueTest.java
@@ -23,7 +23,7 @@ import java.util.Map;
 
 import org.apache.sling.distribution.DistributionRequestType;
 import org.apache.sling.distribution.packaging.DistributionPackageInfo;
-import org.apache.sling.distribution.queue.DistributionQueue;
+import org.apache.sling.distribution.queue.spi.DistributionQueue;
 import org.apache.sling.distribution.queue.DistributionQueueItem;
 import org.apache.sling.distribution.queue.DistributionQueueItemState;
 import org.apache.sling.distribution.queue.DistributionQueueItemStatus;
diff --git 
a/src/test/java/org/apache/sling/distribution/queue/impl/simple/SimpleDistributionQueueCheckpointTest.java
 
b/src/test/java/org/apache/sling/distribution/queue/impl/simple/SimpleDistributionQueueCheckpointTest.java
index 62c6917..860fd54 100644
--- 
a/src/test/java/org/apache/sling/distribution/queue/impl/simple/SimpleDistributionQueueCheckpointTest.java
+++ 
b/src/test/java/org/apache/sling/distribution/queue/impl/simple/SimpleDistributionQueueCheckpointTest.java
@@ -28,7 +28,7 @@ import java.util.LinkedList;
 import java.util.Map;
 
 import org.apache.commons.io.FileUtils;
-import org.apache.sling.distribution.queue.DistributionQueue;
+import org.apache.sling.distribution.queue.spi.DistributionQueue;
 import org.apache.sling.distribution.queue.DistributionQueueEntry;
 import org.apache.sling.distribution.queue.DistributionQueueItem;
 import org.apache.sling.distribution.queue.DistributionQueueItemState;
diff --git 
a/src/test/java/org/apache/sling/distribution/queue/impl/simple/SimpleDistributionQueueProcessorTest.java
 
b/src/test/java/org/apache/sling/distribution/queue/impl/simple/SimpleDistributionQueueProcessorTest.java
index bd840dd..56fb555 100644
--- 
a/src/test/java/org/apache/sling/distribution/queue/impl/simple/SimpleDistributionQueueProcessorTest.java
+++ 
b/src/test/java/org/apache/sling/distribution/queue/impl/simple/SimpleDistributionQueueProcessorTest.java
@@ -19,12 +19,13 @@
 package org.apache.sling.distribution.queue.impl.simple;
 
 import java.util.Collection;
+import java.util.HashMap;
 import java.util.LinkedList;
 
-import org.apache.sling.distribution.queue.DistributionQueue;
+import org.apache.sling.distribution.queue.spi.DistributionQueue;
 import org.apache.sling.distribution.queue.DistributionQueueEntry;
 import org.apache.sling.distribution.queue.DistributionQueueItem;
-import org.apache.sling.distribution.queue.DistributionQueueProcessor;
+import org.apache.sling.distribution.queue.impl.DistributionQueueProcessor;
 import org.junit.Test;
 
 import static org.mockito.Mockito.mock;
@@ -63,7 +64,7 @@ public class SimpleDistributionQueueProcessorTest {
         SimpleDistributionQueueProvider queueProvider = 
mock(SimpleDistributionQueueProvider.class);
         Collection<SimpleDistributionQueue> queues = new 
LinkedList<SimpleDistributionQueue>();
         SimpleDistributionQueue queue = mock(SimpleDistributionQueue.class);
-        DistributionQueueItem item = mock(DistributionQueueItem.class);
+        DistributionQueueItem item = new DistributionQueueItem("packageId", 
new HashMap<String, Object>());
         when(queue.getHead()).thenReturn(new DistributionQueueEntry(null, 
item, null)).thenReturn(null);
 
         queues.add(queue);
diff --git 
a/src/test/java/org/apache/sling/distribution/queue/impl/simple/SimpleDistributionQueueProviderTest.java
 
b/src/test/java/org/apache/sling/distribution/queue/impl/simple/SimpleDistributionQueueProviderTest.java
index a6144d8..f2331b3 100644
--- 
a/src/test/java/org/apache/sling/distribution/queue/impl/simple/SimpleDistributionQueueProviderTest.java
+++ 
b/src/test/java/org/apache/sling/distribution/queue/impl/simple/SimpleDistributionQueueProviderTest.java
@@ -23,10 +23,10 @@ import java.io.File;
 import org.apache.commons.io.FileUtils;
 import org.apache.sling.commons.scheduler.ScheduleOptions;
 import org.apache.sling.commons.scheduler.Scheduler;
-import org.apache.sling.distribution.queue.DistributionQueue;
+import org.apache.sling.distribution.queue.spi.DistributionQueue;
 import org.apache.sling.distribution.queue.DistributionQueueEntry;
 import org.apache.sling.distribution.queue.DistributionQueueItem;
-import org.apache.sling.distribution.queue.DistributionQueueProcessor;
+import org.apache.sling.distribution.queue.impl.DistributionQueueProcessor;
 import org.junit.Test;
 
 import static org.junit.Assert.*;
diff --git 
a/src/test/java/org/apache/sling/distribution/queue/impl/simple/SimpleDistributionQueueTest.java
 
b/src/test/java/org/apache/sling/distribution/queue/impl/simple/SimpleDistributionQueueTest.java
index ab35bde..7689f6e 100644
--- 
a/src/test/java/org/apache/sling/distribution/queue/impl/simple/SimpleDistributionQueueTest.java
+++ 
b/src/test/java/org/apache/sling/distribution/queue/impl/simple/SimpleDistributionQueueTest.java
@@ -18,7 +18,9 @@
  */
 package org.apache.sling.distribution.queue.impl.simple;
 
-import org.apache.sling.distribution.queue.DistributionQueue;
+import java.util.HashMap;
+
+import org.apache.sling.distribution.queue.spi.DistributionQueue;
 import org.apache.sling.distribution.queue.DistributionQueueEntry;
 import org.apache.sling.distribution.queue.DistributionQueueItem;
 import org.apache.sling.distribution.queue.DistributionQueueItemStatus;
@@ -40,7 +42,7 @@ public class SimpleDistributionQueueTest {
     @Test
     public void testPackageAddition() throws Exception {
         DistributionQueue queue = new SimpleDistributionQueue("agentName", 
"default");
-        DistributionQueueItem pkg = mock(DistributionQueueItem.class);
+        DistributionQueueItem pkg = new DistributionQueueItem("packageId", new 
HashMap<String, Object>());
         assertNotNull(queue.add(pkg));
         assertFalse(queue.getStatus().isEmpty());
     }
@@ -48,8 +50,7 @@ public class SimpleDistributionQueueTest {
     @Test
     public void testPackageAdditionAndRemoval() throws Exception {
         DistributionQueue queue = new SimpleDistributionQueue("agentName", 
"default");
-        DistributionQueueItem pkg = mock(DistributionQueueItem.class);
-        when(pkg.getPackageId()).thenReturn("id");
+        DistributionQueueItem pkg = new DistributionQueueItem("id", new 
HashMap<String, Object>());
         assertNotNull(queue.add(pkg));
         assertFalse(queue.getStatus().isEmpty());
         assertNotNull(queue.remove(pkg.getPackageId()));
@@ -61,8 +62,7 @@ public class SimpleDistributionQueueTest {
     @Test
     public void testPackageAdditionRetrievalAndRemoval() throws Exception {
         DistributionQueue queue = new SimpleDistributionQueue("agentName", 
"default");
-        DistributionQueueItem pkg = mock(DistributionQueueItem.class);
-        when(pkg.getPackageId()).thenReturn("id");
+        DistributionQueueItem pkg = new DistributionQueueItem("id", new 
HashMap<String, Object>());
         assertNotNull(queue.add(pkg));
         assertFalse(queue.getStatus().isEmpty());
         assertEquals(pkg, queue.getHead().getItem());

-- 
To stop receiving notification emails like this one, please contact
tma...@apache.org.

Reply via email to