myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu4...@apache.org
Subject svn commit: r1087577 - in /myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces: config/ config/element/ config/impl/digester/ config/impl/digester/elements/ view/facelets/
Date Fri, 01 Apr 2011 04:22:43 GMT
Author: lu4242
Date: Fri Apr  1 04:22:43 2011
New Revision: 1087577

URL: http://svn.apache.org/viewvc?rev=1087577&view=rev
Log:
MYFACES-3089 Implement FaceletCacheFactory and FaceletCache methods (minimal parsing setup)

Added:
    myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletCacheFactoryImpl.java
Modified:
    myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/config/FacesConfigDispenser.java
    myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java
    myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/config/element/FacesConfigData.java
    myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/config/element/Factory.java
    myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/config/impl/digester/DigesterFacesConfigDispenserImpl.java
    myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/config/impl/digester/DigesterFacesConfigUnmarshallerImpl.java
    myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/config/impl/digester/elements/Factory.java

Modified: myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/config/FacesConfigDispenser.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/config/FacesConfigDispenser.java?rev=1087577&r1=1087576&r2=1087577&view=diff
==============================================================================
--- myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/config/FacesConfigDispenser.java
(original)
+++ myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/config/FacesConfigDispenser.java
Fri Apr  1 04:22:43 2011
@@ -113,4 +113,13 @@ public abstract class FacesConfigDispens
      */
     public abstract void feedVisitContextFactory(String factoryClassName);
 
+    /**
+     * Add another FaceletCacheFactory class name
+     * @since 2.1.0
+     * @param factoryClassName a class name
+     */
+    public void feedFaceletCacheFactory(String factoryClassName)
+    {
+    }
+
 }

Modified: myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java?rev=1087577&r1=1087576&r2=1087577&view=diff
==============================================================================
--- myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java
(original)
+++ myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java
Fri Apr  1 04:22:43 2011
@@ -57,6 +57,7 @@ import org.apache.myfaces.spi.FacesConfi
 import org.apache.myfaces.util.ContainerUtils;
 import org.apache.myfaces.util.ExternalSpecifications;
 import org.apache.myfaces.view.ViewDeclarationLanguageFactoryImpl;
+import org.apache.myfaces.view.facelets.FaceletCacheFactoryImpl;
 import org.apache.myfaces.view.facelets.tag.jsf.TagHandlerDelegateFactoryImpl;
 import org.apache.myfaces.view.facelets.tag.ui.DebugPhaseListener;
 import org.apache.myfaces.webapp.ManagedBeanDestroyerListener;
@@ -134,6 +135,7 @@ public class FacesConfigurator
     private static final String DEFAULT_VIEW_DECLARATION_LANGUAGE_FACTORY = ViewDeclarationLanguageFactoryImpl.class.getName();
     private static final String DEFAULT_EXCEPTION_HANDLER_FACTORY = ExceptionHandlerFactoryImpl.class.getName();
     private static final String DEFAULT_TAG_HANDLER_DELEGATE_FACTORY = TagHandlerDelegateFactoryImpl.class.getName();
+    private static final String DEFAULT_FACELET_CACHE_FACTORY = FaceletCacheFactoryImpl.class.getName();
     private static final String DEFAULT_FACES_CONFIG = "/WEB-INF/faces-config.xml";
 
     private final ExternalContext _externalContext;
@@ -616,6 +618,8 @@ public class FacesConfigurator
                      DEFAULT_VISIT_CONTEXT_FACTORY);
         setFactories(FactoryFinder.VIEW_DECLARATION_LANGUAGE_FACTORY, dispenser.getViewDeclarationLanguageFactoryIterator(),
                      DEFAULT_VIEW_DECLARATION_LANGUAGE_FACTORY);
+        setFactories(FactoryFinder.FACELET_CACHE_FACTORY, dispenser.getFaceletCacheFactoryIterator(),
+                DEFAULT_FACELET_CACHE_FACTORY);        
     }
 
     private void setFactories(String factoryName, Collection<String> factories, String
defaultFactory)

Modified: myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/config/element/FacesConfigData.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/config/element/FacesConfigData.java?rev=1087577&r1=1087576&r2=1087577&view=diff
==============================================================================
--- myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/config/element/FacesConfigData.java
(original)
+++ myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/config/element/FacesConfigData.java
Fri Apr  1 04:22:43 2011
@@ -67,6 +67,16 @@ public abstract class FacesConfigData im
 
     /** @return Iterator over VisitContextFactory factory class names */
     public abstract Collection<String> getVisitContextFactoryIterator();
+    
+    /**
+     * @since 2.1.0 
+     * @return Iterator over FaceletCacheFactory factory class names
+     */
+    public Collection<String> getFaceletCacheFactoryIterator()
+    {
+        return Collections.emptyList();
+    }
+    
 
     /** @return Iterator over ActionListener class names (in reverse order!) */
     public abstract Collection<String> getActionListenerIterator();

Modified: myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/config/element/Factory.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/config/element/Factory.java?rev=1087577&r1=1087576&r2=1087577&view=diff
==============================================================================
--- myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/config/element/Factory.java
(original)
+++ myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/config/element/Factory.java
Fri Apr  1 04:22:43 2011
@@ -19,6 +19,7 @@
 package org.apache.myfaces.config.element;
 
 import java.io.Serializable;
+import java.util.Collections;
 import java.util.List;
 
 /**
@@ -45,4 +46,14 @@ public abstract class Factory implements
     public abstract List<String> getTagHandlerDelegateFactory();
 
     public abstract List<String> getVisitContextFactory();
+    
+    /**
+     * 
+     * @since 2.1.0
+     * @return
+     */
+    public List<String> getFaceletCacheFactory()
+    {
+        return Collections.emptyList();
+    }
 }

Modified: myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/config/impl/digester/DigesterFacesConfigDispenserImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/config/impl/digester/DigesterFacesConfigDispenserImpl.java?rev=1087577&r1=1087576&r2=1087577&view=diff
==============================================================================
--- myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/config/impl/digester/DigesterFacesConfigDispenserImpl.java
(original)
+++ myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/config/impl/digester/DigesterFacesConfigDispenserImpl.java
Fri Apr  1 04:22:43 2011
@@ -66,6 +66,7 @@ public class DigesterFacesConfigDispense
     private List<String> renderKitFactories = new ArrayList<String>();
     private List<String> tagHandlerDelegateFactories = new ArrayList<String>();
     private List<String> visitContextFactories = new ArrayList<String>();
+    private List<String> faceletCacheFactories = new ArrayList<String>();
     
     private String defaultRenderKitId;
     private String messageBundle;
@@ -126,6 +127,7 @@ public class DigesterFacesConfigDispense
             renderKitFactories.addAll(factory.getRenderkitFactory());
             tagHandlerDelegateFactories.addAll(factory.getTagHandlerDelegateFactory());
             visitContextFactories.addAll(factory.getVisitContextFactory());
+            faceletCacheFactories.addAll(factory.getFaceletCacheFactory());
         }
 
         components.putAll(config.getComponents());
@@ -666,4 +668,17 @@ public class DigesterFacesConfigDispense
     {
         return faceletsProcessingByFileExtension.get(fileExtension);
     }
+
+    @Override
+    public void feedFaceletCacheFactory(String factoryClassName)
+    {
+        faceletCacheFactories.add(factoryClassName);
+    }
+
+    @Override
+    public Collection<String> getFaceletCacheFactoryIterator()
+    {
+        return faceletCacheFactories;
+    }
+
 }

Modified: myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/config/impl/digester/DigesterFacesConfigUnmarshallerImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/config/impl/digester/DigesterFacesConfigUnmarshallerImpl.java?rev=1087577&r1=1087576&r2=1087577&view=diff
==============================================================================
--- myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/config/impl/digester/DigesterFacesConfigUnmarshallerImpl.java
(original)
+++ myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/config/impl/digester/DigesterFacesConfigUnmarshallerImpl.java
Fri Apr  1 04:22:43 2011
@@ -119,6 +119,10 @@ public class DigesterFacesConfigUnmarsha
         digester.addCallMethod("faces-config/factory/tag-handler-delegate-factory", "addTagHandlerDelegateFactory",
0);
         digester.addCallMethod("faces-config/factory/visit-context-factory", "addVisitContextFactory",
0);
         // 2.0 specific end
+        
+        // 2.1 specific start
+        digester.addCallMethod("faces-config/factory/facelet-cache-factory", "addFaceletCacheFactory",
0);
+        // 2.1 specific end
 
         digester.addObjectCreate("faces-config/factory", Factory.class);
         digester.addSetNext("faces-config/factory", "addFactory");

Modified: myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/config/impl/digester/elements/Factory.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/config/impl/digester/elements/Factory.java?rev=1087577&r1=1087576&r2=1087577&view=diff
==============================================================================
--- myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/config/impl/digester/elements/Factory.java
(original)
+++ myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/config/impl/digester/elements/Factory.java
Fri Apr  1 04:22:43 2011
@@ -37,6 +37,7 @@ public class Factory extends org.apache.
     private List<String> renderKitFactories = new ArrayList<String>();
     private List<String> tagHandlerDelegateFactories = new ArrayList<String>();
     private List<String> visitContextFactories = new ArrayList<String>();
+    private List<String> faceletCacheFactories = new ArrayList<String>();
 
     public void addApplicationFactory(String factory)
     {
@@ -87,6 +88,11 @@ public class Factory extends org.apache.
     {
         visitContextFactories.add(factory);
     }
+    
+    public void addFaceletCacheFactory(String factory)
+    {
+        faceletCacheFactories.add(factory);
+    }
 
     public List<String> getApplicationFactory()
     {
@@ -137,4 +143,11 @@ public class Factory extends org.apache.
     {
         return visitContextFactories;
     }
+
+    @Override
+    public List<String> getFaceletCacheFactory()
+    {
+        return faceletCacheFactories;
+    }
+    
 }

Added: myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletCacheFactoryImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletCacheFactoryImpl.java?rev=1087577&view=auto
==============================================================================
--- myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletCacheFactoryImpl.java
(added)
+++ myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletCacheFactoryImpl.java
Fri Apr  1 04:22:43 2011
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.view.facelets;
+
+import javax.faces.view.facelets.FaceletCache;
+import javax.faces.view.facelets.FaceletCacheFactory;
+
+/**
+ * 
+ * @author Leonardo Uribe
+ * @since 2.1.0
+ *
+ */
+public class FaceletCacheFactoryImpl extends FaceletCacheFactory
+{
+
+    @Override
+    public FaceletCache getFaceletCache()
+    {
+        // TODO IMPLEMENT ME!!!!
+        return null;
+    }
+
+}



Mime
View raw message