You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by jo...@apache.org on 2021/10/29 18:42:21 UTC

[sling-org-apache-sling-api] branch feature/SLING-10895-getPropertyMap created (now 05abf37)

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

joerghoh pushed a change to branch feature/SLING-10895-getPropertyMap
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-api.git.


      at 05abf37  SLING-10895 add getPropertyMap() method

This branch includes the following new commits:

     new 05abf37  SLING-10895 add getPropertyMap() method

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


[sling-org-apache-sling-api] 01/01: SLING-10895 add getPropertyMap() method

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

joerghoh pushed a commit to branch feature/SLING-10895-getPropertyMap
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-api.git

commit 05abf370e74b9d42c8bde11a9c73cdd4870983e0
Author: Joerg Hoh <jh...@adobe.com>
AuthorDate: Fri Oct 29 20:40:42 2021 +0200

    SLING-10895 add getPropertyMap() method
---
 .../org/apache/sling/api/resource/ResourceResolver.java  | 16 ++++++++++++++++
 .../java/org/apache/sling/api/resource/package-info.java |  2 +-
 .../sling/api/wrappers/ResourceResolverWrapper.java      |  5 +++++
 .../java/org/apache/sling/api/wrappers/package-info.java |  2 +-
 4 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/sling/api/resource/ResourceResolver.java b/src/main/java/org/apache/sling/api/resource/ResourceResolver.java
index 03dee38..84ec8e8 100644
--- a/src/main/java/org/apache/sling/api/resource/ResourceResolver.java
+++ b/src/main/java/org/apache/sling/api/resource/ResourceResolver.java
@@ -842,4 +842,20 @@ public interface ResourceResolver extends Adaptable, Closeable {
      */
     Resource move(final String srcAbsPath,
               final String destAbsPath) throws PersistenceException;
+
+    /**
+     * Returns a map to store temporary objects.
+     *
+     * This map is suited to store objects which share the same lifecycle as the
+     * resource resolver. The resource resolver itself does not use this map.
+     *
+     * The resource resolver will clear the map during {@link #close()}, so afterwards the map is empty.
+     * If a stored value implements the {@link #Closeable} interface, the ResourceResolver will invoke the
+     * <code>close()</code> of the value before clearing the map.
+     *
+     * @returns the property map
+     * @since 2.13.0
+     *
+     */
+    public @NotNull Map<String,Object> getPropertyMap();
 }
diff --git a/src/main/java/org/apache/sling/api/resource/package-info.java b/src/main/java/org/apache/sling/api/resource/package-info.java
index 7bd85e6..ac05b61 100644
--- a/src/main/java/org/apache/sling/api/resource/package-info.java
+++ b/src/main/java/org/apache/sling/api/resource/package-info.java
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-@Version("2.12.2")
+@Version("2.13.0")
 package org.apache.sling.api.resource;
 
 import org.osgi.annotation.versioning.Version;
diff --git a/src/main/java/org/apache/sling/api/wrappers/ResourceResolverWrapper.java b/src/main/java/org/apache/sling/api/wrappers/ResourceResolverWrapper.java
index 67c2fbf..61bed6f 100644
--- a/src/main/java/org/apache/sling/api/wrappers/ResourceResolverWrapper.java
+++ b/src/main/java/org/apache/sling/api/wrappers/ResourceResolverWrapper.java
@@ -340,6 +340,11 @@ public class ResourceResolverWrapper implements ResourceResolver {
     public Resource move(String srcAbsPath, String destAbsPath) throws PersistenceException {
         return ResourceResolverResourceWrapper.wrap(this, wrapped.move(srcAbsPath, destAbsPath));
     }
+    
+    @Override
+    public Map<String,Object> getPropertyMap() {
+        return wrapped.getPropertyMap();
+    }
 
     @Override
     public <AdapterType> AdapterType adaptTo(@NotNull Class<AdapterType> type) {
diff --git a/src/main/java/org/apache/sling/api/wrappers/package-info.java b/src/main/java/org/apache/sling/api/wrappers/package-info.java
index 39ff070..8a2b990 100644
--- a/src/main/java/org/apache/sling/api/wrappers/package-info.java
+++ b/src/main/java/org/apache/sling/api/wrappers/package-info.java
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-@Version("2.7.0")
+@Version("2.8.0")
 package org.apache.sling.api.wrappers;
 
 import org.osgi.annotation.versioning.Version;