incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r1521017 - in /sling/trunk/bundles/scripting: api/src/main/java/org/apache/sling/scripting/api/ core/src/main/java/org/apache/sling/scripting/core/impl/ core/src/test/java/org/apache/sling/scripting/core/impl/
Date Mon, 09 Sep 2013 09:43:56 GMT
Author: bdelacretaz
Date: Mon Sep  9 09:43:56 2013
New Revision: 1521017

URL: http://svn.apache.org/r1521017
Log:
SLING-3038 - move constants to BindingsValuesProvider

Modified:
    sling/trunk/bundles/scripting/api/src/main/java/org/apache/sling/scripting/api/BindingsValuesProvider.java
    sling/trunk/bundles/scripting/api/src/main/java/org/apache/sling/scripting/api/BindingsValuesProvidersByContext.java
    sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/BindingsValuesProvidersByContextImpl.java
    sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/SlingScriptAdapterFactory.java
    sling/trunk/bundles/scripting/core/src/test/java/org/apache/sling/scripting/core/impl/BindingsValuesProvidersByContextIT.java

Modified: sling/trunk/bundles/scripting/api/src/main/java/org/apache/sling/scripting/api/BindingsValuesProvider.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/scripting/api/src/main/java/org/apache/sling/scripting/api/BindingsValuesProvider.java?rev=1521017&r1=1521016&r2=1521017&view=diff
==============================================================================
--- sling/trunk/bundles/scripting/api/src/main/java/org/apache/sling/scripting/api/BindingsValuesProvider.java
(original)
+++ sling/trunk/bundles/scripting/api/src/main/java/org/apache/sling/scripting/api/BindingsValuesProvider.java
Mon Sep  9 09:43:56 2013
@@ -26,6 +26,17 @@ import javax.script.Bindings;
  */
 public interface BindingsValuesProvider {
 
+    /** The name of the multi-value service property that defines the context(s) to which

+     *  a BindingsValuesProvider applies. This service property is optional, if not set
+     *  the default value is {@link @DEFAULT_CONTEXT}  
+     */
+    String CONTEXT = "context";
+    
+    /** The default value of the CONTEXT service property, used for compatibility with
+     *  previous versions of this bundle that didn't require it. 
+     */
+    String DEFAULT_CONTEXT = "request";
+    
     /**
      * Add objects to the Bindings object. The Bindings
      * object passed to this method does not support replacing

Modified: sling/trunk/bundles/scripting/api/src/main/java/org/apache/sling/scripting/api/BindingsValuesProvidersByContext.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/scripting/api/src/main/java/org/apache/sling/scripting/api/BindingsValuesProvidersByContext.java?rev=1521017&r1=1521016&r2=1521017&view=diff
==============================================================================
--- sling/trunk/bundles/scripting/api/src/main/java/org/apache/sling/scripting/api/BindingsValuesProvidersByContext.java
(original)
+++ sling/trunk/bundles/scripting/api/src/main/java/org/apache/sling/scripting/api/BindingsValuesProvidersByContext.java
Mon Sep  9 09:43:56 2013
@@ -29,16 +29,6 @@ import org.apache.sling.scripting.api.Bi
  *  */
 public interface BindingsValuesProvidersByContext {
     
-    /** The name of the multi-value service property that defines the context(s) to which

-     *  a BindingsValuesProvider applies. 
-     */
-    String CONTEXT = "context";
-    
-    /** The default value of the CONTEXT service property, used for compatibility with
-     *  previous versions of this bundle that didn't require it. 
-     */
-    String DEFAULT_CONTEXT = "request";
-    
     /** Retrieve the current {@link BindingsValuesProvider} for
      *  the supplied ScriptEngineFactory and context.
      *  

Modified: sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/BindingsValuesProvidersByContextImpl.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/BindingsValuesProvidersByContextImpl.java?rev=1521017&r1=1521016&r2=1521017&view=diff
==============================================================================
--- sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/BindingsValuesProvidersByContextImpl.java
(original)
+++ sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/BindingsValuesProvidersByContextImpl.java
Mon Sep  9 09:43:56 2013
@@ -18,6 +18,9 @@
  */
 package org.apache.sling.scripting.core.impl;
 
+import static org.apache.sling.scripting.api.BindingsValuesProvider.CONTEXT;
+import static org.apache.sling.scripting.api.BindingsValuesProvider.DEFAULT_CONTEXT;
+
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;

Modified: sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/SlingScriptAdapterFactory.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/SlingScriptAdapterFactory.java?rev=1521017&r1=1521016&r2=1521017&view=diff
==============================================================================
--- sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/SlingScriptAdapterFactory.java
(original)
+++ sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/SlingScriptAdapterFactory.java
Mon Sep  9 09:43:56 2013
@@ -54,7 +54,7 @@ public class SlingScriptAdapterFactory i
     private BundleContext bundleContext;
 
     /** The context string to use to select BindingsValuesProviders */
-    public static final String BINDINGS_CONTEXT = BindingsValuesProvidersByContext.DEFAULT_CONTEXT;
+    public static final String BINDINGS_CONTEXT = BindingsValuesProvider.DEFAULT_CONTEXT;
 
     /**
      * The service cache for script execution.

Modified: sling/trunk/bundles/scripting/core/src/test/java/org/apache/sling/scripting/core/impl/BindingsValuesProvidersByContextIT.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/scripting/core/src/test/java/org/apache/sling/scripting/core/impl/BindingsValuesProvidersByContextIT.java?rev=1521017&r1=1521016&r2=1521017&view=diff
==============================================================================
--- sling/trunk/bundles/scripting/core/src/test/java/org/apache/sling/scripting/core/impl/BindingsValuesProvidersByContextIT.java
(original)
+++ sling/trunk/bundles/scripting/core/src/test/java/org/apache/sling/scripting/core/impl/BindingsValuesProvidersByContextIT.java
Mon Sep  9 09:43:56 2013
@@ -108,7 +108,7 @@ public class BindingsValuesProvidersByCo
     private Dictionary<String, Object> getProperties(String context, String engineName)
{
         final Dictionary<String, Object> props = new Hashtable<String, Object>();
         if(context != null) {
-            props.put(BindingsValuesProvidersByContext.CONTEXT, context.split(","));
+            props.put(BindingsValuesProvider.CONTEXT, context.split(","));
         }
         if(engineName != null) {
             props.put(ScriptEngine.NAME, engineName);



Mime
View raw message