sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From o...@apache.org
Subject svn commit: r1659805 - in /sling/trunk/contrib/extensions/urlrewriter: pom.xml src/main/java/org/apache/sling/urlrewriter/internal/SlingUrlRewriteFilter.java
Date Sat, 14 Feb 2015 16:39:53 GMT
Author: olli
Date: Sat Feb 14 16:39:53 2015
New Revision: 1659805

URL: http://svn.apache.org/r1659805
Log:
SLING-3518 add a multipurpose filter based on Tuckey's UrlRewriteFilter

* remove duplicate bundle settings
* require configuration for component
* make filter final

Modified:
    sling/trunk/contrib/extensions/urlrewriter/pom.xml
    sling/trunk/contrib/extensions/urlrewriter/src/main/java/org/apache/sling/urlrewriter/internal/SlingUrlRewriteFilter.java

Modified: sling/trunk/contrib/extensions/urlrewriter/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/urlrewriter/pom.xml?rev=1659805&r1=1659804&r2=1659805&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/urlrewriter/pom.xml (original)
+++ sling/trunk/contrib/extensions/urlrewriter/pom.xml Sat Feb 14 16:39:53 2015
@@ -124,8 +124,6 @@
         <extensions>true</extensions>
         <configuration>
           <instructions>
-            <Bundle-Category>sling</Bundle-Category>
-            <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
             <Export-Package/>
             <Embed-Dependency>
               org.apache.sling.commons.osgi;inline="org/apache/sling/commons/osgi/PropertiesUtil.*"

Modified: sling/trunk/contrib/extensions/urlrewriter/src/main/java/org/apache/sling/urlrewriter/internal/SlingUrlRewriteFilter.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/urlrewriter/src/main/java/org/apache/sling/urlrewriter/internal/SlingUrlRewriteFilter.java?rev=1659805&r1=1659804&r2=1659805&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/urlrewriter/src/main/java/org/apache/sling/urlrewriter/internal/SlingUrlRewriteFilter.java
(original)
+++ sling/trunk/contrib/extensions/urlrewriter/src/main/java/org/apache/sling/urlrewriter/internal/SlingUrlRewriteFilter.java
Sat Feb 14 16:39:53 2015
@@ -37,6 +37,7 @@ import javax.xml.parsers.DocumentBuilder
 import org.apache.commons.io.IOUtils;
 import org.apache.felix.scr.annotations.Activate;
 import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.ConfigurationPolicy;
 import org.apache.felix.scr.annotations.Deactivate;
 import org.apache.felix.scr.annotations.Modified;
 import org.apache.felix.scr.annotations.Properties;
@@ -59,7 +60,8 @@ import org.xml.sax.helpers.DefaultHandle
     label = "Apache Sling URL Rewriter",
     description = "multi-purpose service for altering HTTP requests/responses based on Tuckey's
UrlRewriteFilter",
     immediate = true,
-    metatype = true
+    metatype = true,
+    policy = ConfigurationPolicy.REQUIRE
 )
 @Service
 @Properties({
@@ -68,7 +70,7 @@ import org.xml.sax.helpers.DefaultHandle
     @Property(name = Constants.SERVICE_RANKING, intValue = 0, propertyPrivate = false),
     @Property(name = EngineConstants.SLING_FILTER_SCOPE, value = {EngineConstants.FILTER_SCOPE_REQUEST,
EngineConstants.FILTER_SCOPE_FORWARD})
 })
-public class SlingUrlRewriteFilter implements Filter {
+public final class SlingUrlRewriteFilter implements Filter {
 
     private UrlRewriter rewriter;
 
@@ -101,7 +103,7 @@ public class SlingUrlRewriteFilter imple
         clearRewriter();
     }
 
-    private synchronized void configure(final ComponentContext context) {
+    private void configure(final ComponentContext context) {
         logger.info("configuring URL rewriter");
         final Dictionary properties = context.getProperties();
         final String rules = PropertiesUtil.toString(properties.get(REWRITE_RULES_PARAMETER),
DEFAULT_REWRITE_RULES);



Mime
View raw message