portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From woon...@apache.org
Subject svn commit: r1001906 - /portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/rules/impl/HostnameCriterionResolver.java
Date Mon, 27 Sep 2010 20:56:12 GMT
Author: woonsan
Date: Mon Sep 27 20:56:11 2010
New Revision: 1001906

URL: http://svn.apache.org/viewvc?rev=1001906&view=rev
Log:
JS2-1218: Making HostnameCriterionResolver's Rule class Serializable

Modified:
    portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/rules/impl/HostnameCriterionResolver.java

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/rules/impl/HostnameCriterionResolver.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/rules/impl/HostnameCriterionResolver.java?rev=1001906&r1=1001905&r2=1001906&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/rules/impl/HostnameCriterionResolver.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/rules/impl/HostnameCriterionResolver.java
Mon Sep 27 20:56:11 2010
@@ -16,6 +16,7 @@
  */
 package org.apache.jetspeed.profiler.rules.impl;
 
+import java.io.Serializable;
 import java.util.List;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
@@ -33,6 +34,8 @@ import org.apache.jetspeed.request.Reque
 public class HostnameCriterionResolver extends StandardResolver implements
         RuleCriterionResolver
 {
+    private static final long serialVersionUID = 1L;
+    
     private boolean useDotPrefix;
     private List<Rule> hostnameMappingRules;
     
@@ -90,15 +93,15 @@ public class HostnameCriterionResolver e
         return serverName;
     }
 
-    public static class Rule
+    public static class Rule implements Serializable
     {
-        private String pattern;
+        private static final long serialVersionUID = 1L;
+        
         private String replacement;
         private Pattern compiledPattern;        
         
         public Rule(String pattern, String replacement)
         {
-            this.pattern = pattern;
             this.replacement = replacement;
             this.compiledPattern = Pattern.compile(pattern);
         }
@@ -106,10 +109,12 @@ public class HostnameCriterionResolver e
         public String map(String hostname)
         {
             Matcher patternMatcher = compiledPattern.matcher(hostname);
+            
             if (patternMatcher.find())
             {
                 return patternMatcher.replaceAll(replacement);
             }
+            
             return hostname;
         }
     }



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message