You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by cz...@apache.org on 2015/10/31 11:26:13 UTC
svn commit: r1711588 - in /sling/trunk/bundles:
api/src/main/java/org/apache/sling/spi/resource/provider/
jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/
resourceresolver/src/main/java/org/apache/sling/resourceresolver/imp...
Author: cziegeler
Date: Sat Oct 31 10:26:13 2015
New Revision: 1711588
URL: http://svn.apache.org/viewvc?rev=1711588&view=rev
Log:
SLING-4750 : Rename activate/deactivate to start/stop
Modified:
sling/trunk/bundles/api/src/main/java/org/apache/sling/spi/resource/provider/ResourceProvider.java
sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProvider.java
sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/providers/ResourceProviderHandler.java
sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/providers/tree/PathTree.java
Modified: sling/trunk/bundles/api/src/main/java/org/apache/sling/spi/resource/provider/ResourceProvider.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/api/src/main/java/org/apache/sling/spi/resource/provider/ResourceProvider.java?rev=1711588&r1=1711587&r2=1711588&view=diff
==============================================================================
--- sling/trunk/bundles/api/src/main/java/org/apache/sling/spi/resource/provider/ResourceProvider.java (original)
+++ sling/trunk/bundles/api/src/main/java/org/apache/sling/spi/resource/provider/ResourceProvider.java Sat Oct 31 10:26:13 2015
@@ -56,11 +56,13 @@ import aQute.bnd.annotation.ConsumerType
* with the highest service ranking is used.
* <p>
* If a provider is used in the resource tree, it gets activated through
- * a call of the {@link #activate(ProviderContext)} method. If the
+ * a call of the {@link #start(ProviderContext)} method. If the
* provider is not used anymore within the resource tree, the
- * {@link #deactivate(ProviderContext)} method is called. Whenever
+ * {@link #stop()} method is called. Whenever
* information concerning the provider is changed while the provider
- * is used, the {@link #update(ProviderContext)} method is called.
+ * is used, the {@link #update()} method is called. The provider context
+ * instance which is passed to the {@link #start(ProviderContext} method
+ * contains the updated state.
* <p>
* Some resource providers might require (user) authentication. For example
* the JCR resource provider uses authenticated sessions. If a provider
@@ -232,7 +234,7 @@ public abstract class ResourceProvider<T
* it is used in the resource tree.
* @param ctx The context for this provider.
*/
- public void activate(@Nonnull ProviderContext ctx) {
+ public void start(@Nonnull ProviderContext ctx) {
this.ctx = ctx;
}
@@ -240,7 +242,7 @@ public abstract class ResourceProvider<T
* With a call to this method, the provider implementation is notified
* that it is not used anymore in the resource tree.
*/
- public void deactivate() {
+ public void stop() {
this.ctx = null;
}
Modified: sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProvider.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProvider.java?rev=1711588&r1=1711587&r2=1711588&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProvider.java (original)
+++ sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProvider.java Sat Oct 31 10:26:13 2015
@@ -166,21 +166,21 @@ public class JcrResourceProvider extends
}
@Deactivate
- protected void deactivateComponent() {
+ protected void deactivate() {
unregisterLegacyListener();
}
@Override
- public void activate(final ProviderContext ctx) {
- super.activate(ctx);
+ public void start(final ProviderContext ctx) {
+ super.start(ctx);
registerLegacyListener();
}
@Override
- public void deactivate() {
+ public void stop() {
unregisterLegacyListener();
- super.deactivate();
+ super.stop();
}
@SuppressWarnings("unused")
Modified: sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/providers/ResourceProviderHandler.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/providers/ResourceProviderHandler.java?rev=1711588&r1=1711587&r2=1711588&view=diff
==============================================================================
--- sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/providers/ResourceProviderHandler.java (original)
+++ sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/providers/ResourceProviderHandler.java Sat Oct 31 10:26:13 2015
@@ -48,7 +48,7 @@ public class ResourceProviderHandler imp
public boolean activate() {
this.provider = (ResourceProvider<?>) this.bundleContext.getService(this.info.getServiceReference());
if ( this.provider != null ) {
- this.provider.activate(context);
+ this.provider.start(context);
}
return this.provider != null;
}
@@ -59,7 +59,7 @@ public class ResourceProviderHandler imp
public void deactivate() {
if ( this.provider != null ) {
- this.provider.deactivate();
+ this.provider.stop();
this.provider = null;
this.context.update(null, null);
this.bundleContext.ungetService(this.info.getServiceReference());
Modified: sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/providers/tree/PathTree.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/providers/tree/PathTree.java?rev=1711588&r1=1711587&r2=1711588&view=diff
==============================================================================
--- sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/providers/tree/PathTree.java (original)
+++ sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/providers/tree/PathTree.java Sat Oct 31 10:26:13 2015
@@ -20,8 +20,6 @@ package org.apache.sling.resourceresolve
import static org.apache.commons.lang.StringUtils.split;
-import java.util.ArrayList;
-import java.util.Collections;
import java.util.Iterator;
import java.util.List;
@@ -71,32 +69,6 @@ public class PathTree<T extends Pathable
return result;
}
- public List<T> getMatchingNodes(String path) {
- if (path == null || path.isEmpty() || path.charAt(0) != '/') {
- return Collections.emptyList();
- }
- List<T> values = new ArrayList<T>();
-
- if (root.getValue() != null) {
- values.add(root.getValue());
- }
-
- Node<T> node = root;
- Iterator<String> it = new PathSegmentIterator(path, 1);
- while (it.hasNext()) {
- String segment = it.next();
- node = node.getChild(segment);
- if (node == null) {
- break;
- } else {
- if (node.getValue() != null) {
- values.add(node.getValue());
- }
- }
- }
- return values;
- }
-
public Node<T> getNode(String path) {
if (path == null || path.isEmpty() || path.charAt(0) != '/') {
return null;