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 2018/06/12 15:04:36 UTC

[sling-ide-tooling] branch master updated: SLING-7630: Created the constructors so that non-OSGi containers can instantiate these services with the necessary references

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 42a964b  SLING-7630: Created the constructors so that non-OSGi containers can instantiate these services with the necessary references
42a964b is described below

commit 42a964b8961c4951f68053b9ac455abadd8595d6
Author: Andreas Schaefer <sc...@me.com>
AuthorDate: Tue Jun 12 08:04:34 2018 -0700

    SLING-7630: Created the constructors so that non-OSGi containers can instantiate these services with the necessary references
---
 .../apache/sling/ide/osgi/impl/HttpOsgiClientFactory.java | 12 ++++++++++++
 .../ide/sync/content/impl/DefaultSyncCommandFactory.java  | 15 ++++++++++++++-
 .../impl/resource/transport/RepositoryFactoryImpl.java    | 12 ++++++++++++
 .../apache/sling/ide/impl/vlt/VltRepositoryFactory.java   | 14 ++++++++++++++
 .../sling/ide/impl/vlt/filter/VltFilterLocator.java       | 12 ++++++++++++
 .../impl/vlt/serialization/VltSerializationManager.java   | 14 ++++++++++++++
 6 files changed, 78 insertions(+), 1 deletion(-)

diff --git a/shared/modules/api/src/main/java/org/apache/sling/ide/osgi/impl/HttpOsgiClientFactory.java b/shared/modules/api/src/main/java/org/apache/sling/ide/osgi/impl/HttpOsgiClientFactory.java
index e8959d2..49285a0 100644
--- a/shared/modules/api/src/main/java/org/apache/sling/ide/osgi/impl/HttpOsgiClientFactory.java
+++ b/shared/modules/api/src/main/java/org/apache/sling/ide/osgi/impl/HttpOsgiClientFactory.java
@@ -29,6 +29,18 @@ public class HttpOsgiClientFactory implements OsgiClientFactory {
     @Reference
     private EventAdmin eventAdmin;
 
+    public HttpOsgiClientFactory() {
+    }
+
+    /**
+     * Constructor to create this instance outside of an OSGi Container
+     *
+     * @param eventAdmin Event Admin for tracing the OSGi Client. If null then there is no tracing.
+     */
+    public HttpOsgiClientFactory(EventAdmin eventAdmin) {
+        bindEventAdmin(eventAdmin);
+    }
+
     public OsgiClient createOsgiClient(RepositoryInfo repositoryInfo) {
         if (eventAdmin != null) {
             return new TracingOsgiClient(new HttpOsgiClient(repositoryInfo), eventAdmin);
diff --git a/shared/modules/api/src/main/java/org/apache/sling/ide/sync/content/impl/DefaultSyncCommandFactory.java b/shared/modules/api/src/main/java/org/apache/sling/ide/sync/content/impl/DefaultSyncCommandFactory.java
index fb4374d..28cb0d2 100644
--- a/shared/modules/api/src/main/java/org/apache/sling/ide/sync/content/impl/DefaultSyncCommandFactory.java
+++ b/shared/modules/api/src/main/java/org/apache/sling/ide/sync/content/impl/DefaultSyncCommandFactory.java
@@ -58,7 +58,20 @@ public class DefaultSyncCommandFactory implements SyncCommandFactory {
     
     @Reference
     private Logger logger;
-   
+
+    public DefaultSyncCommandFactory() {
+    }
+
+    /**
+     * Constructor to create this instance outside of an OSGi Container
+     *
+     * @param serializationManager Serialization Manager to be used which must not be null
+     * @param logger Sling IDE Logger which must not be null
+     */
+    public DefaultSyncCommandFactory(SerializationManager serializationManager, Logger logger) {
+        this.serializationManager = serializationManager;
+        this.logger = logger;
+    }
 
     @Override
     public Command<?> newCommandForRemovedResource(Repository repository, WorkspaceResource resource) throws IOException {
diff --git a/shared/modules/impl-resource/src/main/java/org/apache/sling/ide/impl/resource/transport/RepositoryFactoryImpl.java b/shared/modules/impl-resource/src/main/java/org/apache/sling/ide/impl/resource/transport/RepositoryFactoryImpl.java
index 0753271..ef73e51 100644
--- a/shared/modules/impl-resource/src/main/java/org/apache/sling/ide/impl/resource/transport/RepositoryFactoryImpl.java
+++ b/shared/modules/impl-resource/src/main/java/org/apache/sling/ide/impl/resource/transport/RepositoryFactoryImpl.java
@@ -34,6 +34,18 @@ public class RepositoryFactoryImpl implements RepositoryFactory {
     @Reference
     private EventAdmin eventAdmin;
 
+    public RepositoryFactoryImpl() {
+    }
+
+    /**
+     * Constructor to create this instance outside of an OSGi Container
+     *
+     * @param eventAdmin Event Admin for tracing the Repository. If null then there is no tracing.
+     */
+    public RepositoryFactoryImpl(EventAdmin eventAdmin) {
+        bindEventAdmin(eventAdmin);
+    }
+
     @Override
     public Repository connectRepository(RepositoryInfo repositoryInfo) throws RepositoryException {
         //TODO: currently not doing repository-caching
diff --git a/shared/modules/impl-vlt/src/main/java/org/apache/sling/ide/impl/vlt/VltRepositoryFactory.java b/shared/modules/impl-vlt/src/main/java/org/apache/sling/ide/impl/vlt/VltRepositoryFactory.java
index 760f54f..7d8c1ab 100644
--- a/shared/modules/impl-vlt/src/main/java/org/apache/sling/ide/impl/vlt/VltRepositoryFactory.java
+++ b/shared/modules/impl-vlt/src/main/java/org/apache/sling/ide/impl/vlt/VltRepositoryFactory.java
@@ -43,6 +43,20 @@ public class VltRepositoryFactory implements RepositoryFactory {
     
     private Map<String,VltRepository> repositoryMap = new HashMap<>();
 
+    public VltRepositoryFactory() {
+    }
+
+    /**
+     * Constructor to create this instance outside of an OSGi Container
+     *
+     * @param eventAdmin Event Admin for tracing the OSGi Client. If null then there is no tracing.
+     * @param logger Sling IDE Logger which must not be null
+     */
+    public VltRepositoryFactory(EventAdmin eventAdmin, Logger logger) {
+        bindEventAdmin(eventAdmin);
+        this.logger = logger;
+    }
+
     @Override
     public Repository getRepository(RepositoryInfo repositoryInfo,
             boolean acceptsDisconnectedRepository) throws RepositoryException {
diff --git a/shared/modules/impl-vlt/src/main/java/org/apache/sling/ide/impl/vlt/filter/VltFilterLocator.java b/shared/modules/impl-vlt/src/main/java/org/apache/sling/ide/impl/vlt/filter/VltFilterLocator.java
index c73403e..6b9dac3 100644
--- a/shared/modules/impl-vlt/src/main/java/org/apache/sling/ide/impl/vlt/filter/VltFilterLocator.java
+++ b/shared/modules/impl-vlt/src/main/java/org/apache/sling/ide/impl/vlt/filter/VltFilterLocator.java
@@ -33,6 +33,18 @@ public class VltFilterLocator implements FilterLocator {
     @Reference
     private VaultFsLocator fsLocator;
 
+    public VltFilterLocator() {
+    }
+
+    /**
+     * Constructor to create this instance outside of an OSGi Container
+     *
+     * @param fsLocator Vault Filesystem Locator which must not be null
+     */
+    public VltFilterLocator(VaultFsLocator fsLocator) {
+        bindVaultFsLocator(fsLocator);
+    }
+
     protected void bindVaultFsLocator(VaultFsLocator fsLocator) {
         this.fsLocator = fsLocator;
     }
diff --git a/shared/modules/impl-vlt/src/main/java/org/apache/sling/ide/impl/vlt/serialization/VltSerializationManager.java b/shared/modules/impl-vlt/src/main/java/org/apache/sling/ide/impl/vlt/serialization/VltSerializationManager.java
index 639203e..d98ae8f 100644
--- a/shared/modules/impl-vlt/src/main/java/org/apache/sling/ide/impl/vlt/serialization/VltSerializationManager.java
+++ b/shared/modules/impl-vlt/src/main/java/org/apache/sling/ide/impl/vlt/serialization/VltSerializationManager.java
@@ -90,6 +90,20 @@ public class VltSerializationManager implements SerializationManager {
 
     }
 
+    public VltSerializationManager() {
+    }
+
+    /**
+     * Constructor to create this instance outside of an OSGi Container
+     *
+     * @param logger Sling IDE Logger which must not be null
+     * @param fsLocator Vault File System Locator which must not be null
+     */
+    public VltSerializationManager(Logger logger, VaultFsLocator fsLocator) {
+        this.logger = logger;
+        this.fsLocator = fsLocator;
+    }
+
     @Override
     public void destroy() {
 

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