incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r882699 - in /sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl: FactoryCache.java ProcessorManagerImpl.java
Date Fri, 20 Nov 2009 20:02:27 GMT
Author: cziegeler
Date: Fri Nov 20 20:02:26 2009
New Revision: 882699

URL: http://svn.apache.org/viewvc?rev=882699&view=rev
Log:
As factory cache is a private implementation detail there is no need for protected methods
etc.

Modified:
    sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/FactoryCache.java
    sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/ProcessorManagerImpl.java

Modified: sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/FactoryCache.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/FactoryCache.java?rev=882699&r1=882698&r2=882699&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/FactoryCache.java
(original)
+++ sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/FactoryCache.java
Fri Nov 20 20:02:26 2009
@@ -68,19 +68,19 @@
     private static final String PROPERTY_RESOURCE_TYPES = "pipeline.resourceTypes";
 
     /** The logger. */
-    protected static final Logger LOGGER = LoggerFactory.getLogger(FactoryCache.class);
+    private static final Logger LOGGER = LoggerFactory.getLogger(FactoryCache.class);
 
     /** The tracker for generator factories. */
-    protected final HashingServiceTrackerCustomizer<GeneratorFactory> generatorTracker;
+    private final HashingServiceTrackerCustomizer<GeneratorFactory> generatorTracker;
 
     /** The tracker for serializers factories. */
-    protected final HashingServiceTrackerCustomizer<SerializerFactory> serializerTracker;
+    private final HashingServiceTrackerCustomizer<SerializerFactory> serializerTracker;
 
     /** The tracker for transformer factories. */
-    protected final TransformerFactoryServiceTracker<TransformerFactory> transformerTracker;
+    private final TransformerFactoryServiceTracker<TransformerFactory> transformerTracker;
 
     /** The tracker for processor factories. */
-    protected final HashingServiceTrackerCustomizer<ProcessorFactory> processorTracker;
+    private final HashingServiceTrackerCustomizer<ProcessorFactory> processorTracker;
 
     public FactoryCache(final BundleContext context)
     throws InvalidSyntaxException {
@@ -190,7 +190,7 @@
      * @param factories The transformer factories
      * @return The transformer instances
      */
-    protected Transformer[][] createTransformers(final TransformerFactory[][] factories)
{
+    private Transformer[][] createTransformers(final TransformerFactory[][] factories) {
         if ( factories == EMPTY_DOUBLE_ARRAY ) {
             return FactoryCache.EMPTY_DOUBLE_ARRAY;
         }
@@ -219,7 +219,7 @@
     /**
      * This service tracker stores all services into a hash map.
      */
-    protected static class HashingServiceTrackerCustomizer<T> extends ServiceTracker
{
+    private static class HashingServiceTrackerCustomizer<T> extends ServiceTracker
{
 
         /** The services hashed by their name property. */
         private final Map<String, T> services = new ConcurrentHashMap<String, T>();
@@ -268,7 +268,7 @@
         }
     }
 
-    protected static final class TransformerFactoryServiceTracker<T> extends HashingServiceTrackerCustomizer<T>
{
+    private static final class TransformerFactoryServiceTracker<T> extends HashingServiceTrackerCustomizer<T>
{
 
         private String getMode(final ServiceReference ref) {
             final String mode = (String) ref.getProperty(PROPERTY_MODE);
@@ -295,13 +295,6 @@
         }
 
         /**
-         * Is this cache still valid?
-         */
-        public boolean isCacheValid() {
-            return this.cacheIsValid;
-        }
-
-        /**
          * @see org.osgi.util.tracker.ServiceTracker#addingService(org.osgi.framework.ServiceReference)
          */
         public Object addingService(ServiceReference reference) {
@@ -417,7 +410,7 @@
     /**
      * Comparator for service references.
      */
-    protected static final class ServiceReferenceComparator implements Comparator<ServiceReference>
{
+    private static final class ServiceReferenceComparator implements Comparator<ServiceReference>
{
         public static ServiceReferenceComparator INSTANCE = new ServiceReferenceComparator();
 
         public int compare(ServiceReference o1, ServiceReference o2) {
@@ -425,7 +418,7 @@
         }
     }
 
-    protected static final class TransformerFactoryEntry {
+    private static final class TransformerFactoryEntry {
         public final TransformerFactory factory;
 
         private final ProcessorConfiguration configuration;

Modified: sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/ProcessorManagerImpl.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/ProcessorManagerImpl.java?rev=882699&r1=882698&r2=882699&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/ProcessorManagerImpl.java
(original)
+++ sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/ProcessorManagerImpl.java
Fri Nov 20 20:02:26 2009
@@ -102,7 +102,7 @@
     protected void activate(final ComponentContext ctx)
     throws RepositoryException, InvalidSyntaxException {
         this.bundleContext = ctx.getBundleContext();
-        this.factoryCache = this.getFactoryCache(this.bundleContext);
+        this.factoryCache = new FactoryCache(this.bundleContext);
         this.adminSession = this.repository.loginAdministrative(null);
 
         // create array of search paths for actions and constraints
@@ -134,14 +134,6 @@
     }
 
     /**
-     * Get the factory cache
-     */
-    protected FactoryCache getFactoryCache(BundleContext bc)
-    throws InvalidSyntaxException {
-        return new FactoryCache(bc);
-    }
-
-    /**
      * Deactivate this component.
      * @param ctx
      */



Mime
View raw message