myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From we...@apache.org
Subject svn commit: r891262 - in /myfaces/extensions/scripting/trunk: core/core/src/main/java/org/apache/myfaces/scripting/api/ core/core/src/main/java/org/apache/myfaces/scripting/core/ core/core/src/main/java/org/apache/myfaces/scripting/loaders/java/ core/m...
Date Wed, 16 Dec 2009 14:49:42 GMT
Author: werpu
Date: Wed Dec 16 14:49:41 2009
New Revision: 891262

URL: http://svn.apache.org/viewvc?rev=891262&view=rev
Log:
https://issues.apache.org/jira/browse/EXTSCRIPT-33
removed the source annotation scanner on the java side and replaced it with a binary scanner
next step is groovy annotations yiehaa

Modified:
    myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/api/AnnotationScanListener.java
    myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/api/BaseWeaver.java
    myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/api/ScriptingWeaver.java
    myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/core/CoreWeaver.java
    myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/core/DummyWeaver.java
    myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/loaders/java/JavaScriptingWeaver.java
    myfaces/extensions/scripting/trunk/core/myfaces2-extensions/pom.xml
    myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/BaseAnnotationScanListener.java
    myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/BeanImplementationListener.java
    myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/BehaviorImplementationListener.java
    myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/BehaviorRendererImplementationListener.java
    myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/ComponentImplementationListener.java
    myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/ConverterImplementationListener.java
    myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/JavaAnnotationScanner.java
    myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/MapEntityAnnotationScanner.java
    myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/RendererImplementationListener.java
    myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/SingleEntityAnnotationListener.java
    myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/ValidatorImplementationListener.java
    myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/renderer/JavaTestComponent.java
    myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/renderer/JavaTestComponent2.java
    myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/renderer/JavaTestRenderer1.java
    myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/renderer/JavaTestRenderer2.java

Modified: myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/api/AnnotationScanListener.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/api/AnnotationScanListener.java?rev=891262&r1=891261&r2=891262&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/api/AnnotationScanListener.java (original)
+++ myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/api/AnnotationScanListener.java Wed Dec 16 14:49:41 2009
@@ -40,16 +40,7 @@
      */
     public boolean supportsAnnotation(String annotation);
 
-    /**
-     * registers the class within the myfaces runtime system
-     * within a neutral source representation of this class
-     *
-     * @param clazz          the class as neutral definition (currently qdox JavaClass only)
-     * @param annotationName the annotation name
-     * @param params         a map of annotation params
-     */
-    public void registerSource(Object clazz, String annotationName, Map<String, Object> params);
-
+ 
     /**
      * class file registration of the supported annotation
      *

Modified: myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/api/BaseWeaver.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/api/BaseWeaver.java?rev=891262&r1=891261&r2=891262&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/api/BaseWeaver.java (original)
+++ myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/api/BaseWeaver.java Wed Dec 16 14:49:41 2009
@@ -8,6 +8,7 @@
 import org.apache.myfaces.scripting.core.util.FileUtils;
 import org.apache.myfaces.scripting.core.util.ReflectUtil;
 import org.apache.myfaces.scripting.core.util.WeavingContext;
+import org.apache.myfaces.scripting.core.util.ClassUtils;
 import org.apache.myfaces.scripting.refresh.ReloadingMetadata;
 
 import javax.faces.context.FacesContext;
@@ -387,4 +388,29 @@
         ReflectUtil.executeMethod(scopeImpl, "remove", bean.getManagedBeanName());
     }
 
+    /**
+     * Loads a list of possible dynamic classNames
+     * for this scripting engine
+     *
+     * @return a list of classNames which are dynamic classes
+     *         for the current compile state on the filesystem
+     */
+    public Collection<String> loadPossibleDynamicClasses() {
+
+        List<String> scriptPaths = getScriptPaths();
+        List<String> retVal = new LinkedList<String>();
+
+        for (String scriptPath : scriptPaths) {
+            List<File> tmpList = FileUtils.fetchSourceFiles(new File(scriptPath), "*"+getFileEnding());
+            int lenRoot = scriptPath.length();
+            //ok O(n2) but we are lazy for now if this imposes a problem we can flatten the inner loop out
+            for (File sourceFile : tmpList) {
+                String relativeFile = sourceFile.getAbsolutePath().substring(lenRoot+1);
+                String className = ClassUtils.relativeFileToClassName(relativeFile);
+                retVal.add(className);
+            }
+        }
+        return retVal;
+
+    }
 }

Modified: myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/api/ScriptingWeaver.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/api/ScriptingWeaver.java?rev=891262&r1=891261&r2=891262&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/api/ScriptingWeaver.java (original)
+++ myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/api/ScriptingWeaver.java Wed Dec 16 14:49:41 2009
@@ -18,6 +18,8 @@
  */
 package org.apache.myfaces.scripting.api;
 
+import java.util.Collection;
+
 /**
  * @author werpu
  * @date: 15.08.2009
@@ -118,6 +120,12 @@
     public void requestRefresh();
 
 
-   
+    /**
+     * loads a list of possible dynamic classes
+     * for the current given state of the source dirs
+     * 
+     * @return a list of classes representing the current source state
+     */
+    public Collection<String> loadPossibleDynamicClasses();
 
 }

Modified: myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/core/CoreWeaver.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/core/CoreWeaver.java?rev=891262&r1=891261&r2=891262&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/core/CoreWeaver.java (original)
+++ myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/core/CoreWeaver.java Wed Dec 16 14:49:41 2009
@@ -24,6 +24,8 @@
 import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Collection;
+import java.util.LinkedList;
 
 /**
  * @author werpu
@@ -134,5 +136,11 @@
         }
     }
 
+    public Collection<String> loadPossibleDynamicClasses() {
+        LinkedList<String> retVal = new LinkedList<String>();
+        for (ScriptingWeaver weaver : _weavers) {
+            retVal.addAll(weaver.loadPossibleDynamicClasses());
+        }
+        return retVal;
+    }
 }
-

Modified: myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/core/DummyWeaver.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/core/DummyWeaver.java?rev=891262&r1=891261&r2=891262&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/core/DummyWeaver.java (original)
+++ myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/core/DummyWeaver.java Wed Dec 16 14:49:41 2009
@@ -23,6 +23,7 @@
 import org.apache.myfaces.scripting.core.util.ClassUtils;
 
 import java.io.Serializable;
+import java.util.Collection;
 
 /**
  * @author Werner Punz (latest modification by $Author$)
@@ -72,7 +73,10 @@
     }
 
     public void requestRefresh() {
-        //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public Collection<String> loadPossibleDynamicClasses() {
+        return null; 
     }
 
 }

Modified: myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/loaders/java/JavaScriptingWeaver.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/loaders/java/JavaScriptingWeaver.java?rev=891262&r1=891261&r2=891262&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/loaders/java/JavaScriptingWeaver.java (original)
+++ myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/loaders/java/JavaScriptingWeaver.java Wed Dec 16 14:49:41 2009
@@ -22,9 +22,7 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.myfaces.scripting.api.*;
-import org.apache.myfaces.scripting.core.util.ReflectUtil;
-import org.apache.myfaces.scripting.core.util.ClassUtils;
-import org.apache.myfaces.scripting.core.util.WeavingContext;
+import org.apache.myfaces.scripting.core.util.*;
 import org.apache.myfaces.scripting.refresh.FileChangedDaemon;
 import org.apache.myfaces.scripting.refresh.ReloadingMetadata;
 import org.apache.myfaces.config.element.ManagedBean;
@@ -36,10 +34,7 @@
 import java.io.File;
 import java.io.Serializable;
 import java.lang.reflect.InvocationTargetException;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-import java.util.HashSet;
+import java.util.*;
 
 /**
  * @author werpu
@@ -82,12 +77,8 @@
         //url classloader at the time myfaces is initialized
         try {
             Class scanner = ClassUtils.getContextClassLoader().loadClass("org.apache.myfaces.scripting.jsf2.annotation.JavaAnnotationScanner");
-            this._scanner = (AnnotationScanner) scanner.newInstance();
+            this._scanner = (AnnotationScanner) ReflectUtil.instantiate(scanner, new Cast(ScriptingWeaver.class, this));
 
-        } catch (IllegalAccessException e) {
-            e.printStackTrace();
-        } catch (InstantiationException e) {
-            e.printStackTrace();
         } catch (ClassNotFoundException e) {
             //we do nothing here
         }
@@ -119,7 +110,7 @@
     @Override
     protected Class loadScriptingClassFromFile(String sourceRoot, String file) {
         //we load the scripting class from the given className
-        if(file.indexOf("TestBean2") != -1) {
+        if (file.indexOf("TestBean2") != -1) {
             System.out.println("debugpoint found");
         }
         File currentClassFile = new File(sourceRoot + File.separator + file);
@@ -145,6 +136,9 @@
             }
             retVal = compiler.compileFile(sourceRoot, classPath, file);
 
+            if(retVal == null) {
+                return retVal;
+            }
         } catch (ClassNotFoundException e) {
             //can be safely ignored
         }
@@ -165,7 +159,7 @@
          * //we only deal with class level reloading here
          * //the deregistration notification should happen on artefact level (which will be the next subtask)
          */
-        if (_scanner != null) {
+        if (_scanner != null && retVal != null) {
             _scanner.scanClass(retVal);
         }
 

Modified: myfaces/extensions/scripting/trunk/core/myfaces2-extensions/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/core/myfaces2-extensions/pom.xml?rev=891262&r1=891261&r2=891262&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/core/myfaces2-extensions/pom.xml (original)
+++ myfaces/extensions/scripting/trunk/core/myfaces2-extensions/pom.xml Wed Dec 16 14:49:41 2009
@@ -47,11 +47,7 @@
             <version>1.8.0</version>
         </dependency>
 
-        <dependency>
-            <groupId>com.thoughtworks.qdox</groupId>
-            <artifactId>qdox</artifactId>
-            <version>1.9.1</version>
-        </dependency>
+       
     </dependencies>
 
     <build>

Modified: myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/BaseAnnotationScanListener.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/BaseAnnotationScanListener.java?rev=891262&r1=891261&r2=891262&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/BaseAnnotationScanListener.java (original)
+++ myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/BaseAnnotationScanListener.java Wed Dec 16 14:49:41 2009
@@ -18,7 +18,6 @@
  */
 package org.apache.myfaces.scripting.jsf2.annotation;
 
-import com.thoughtworks.qdox.model.annotation.AnnotationConstant;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.myfaces.config.RuntimeConfig;
@@ -47,39 +46,6 @@
         return FacesContext.getCurrentInstance().getApplication();
     }
 
-    protected String getAnnotatedStringParam(Map<String, Object> propMap, String key) {
-        Object tempPropVal = propMap.get(key);
-        if(tempPropVal == null) {
-            return null;
-        }
-        if(tempPropVal instanceof String) {
-            return (String) tempPropVal;
-        }
-        AnnotationConstant propVal = (AnnotationConstant) tempPropVal;
-      
-        String val = (String) propVal.getParameterValue();
-        if (val == null) {
-            return null;
-        }
-        val = val.replaceAll("\"", "");
-        return val;
-    }
-
-    protected Boolean getAnnotatedBolleanParam(Map<String, Object> propMap, String key) {
-        AnnotationConstant propVal = (AnnotationConstant) propMap.get(key);
-        if(propVal == null) return null;
-        Boolean val = (Boolean) propVal.getParameterValue();
-        return val;
-    }
-
-    protected Class getAnnotatedClassParam(Map<String, Object> propMap, String key) {
-        AnnotationConstant propVal = (AnnotationConstant) propMap.get(key);
-        if(propVal == null) return null;
-        Class val = (Class) propVal.getParameterValue();
-        return val;
-    }
-
-
     /**
      * unregisters this class in the central registry
      * is triggered if the class itself has been registered previously

Modified: myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/BeanImplementationListener.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/BeanImplementationListener.java?rev=891262&r1=891261&r2=891262&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/BeanImplementationListener.java (original)
+++ myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/BeanImplementationListener.java Wed Dec 16 14:49:41 2009
@@ -18,9 +18,6 @@
  */
 package org.apache.myfaces.scripting.jsf2.annotation;
 
-import com.thoughtworks.qdox.model.Annotation;
-import com.thoughtworks.qdox.model.JavaClass;
-import com.thoughtworks.qdox.model.JavaField;
 import org.apache.myfaces.config.RuntimeConfig;
 import org.apache.myfaces.config.element.NavigationRule;
 import org.apache.myfaces.config.impl.digester.elements.ManagedBean;
@@ -97,72 +94,7 @@
         mbean.setScope(scope);
     }
 
-    /**
-     * reregistration strategy:
-     * <p/>
-     * managed properties have changed
-     * or class has changed
-     * or class does not exist at all
-     *
-     * @param sourceClass
-     * @param annotationName
-     * @param params
-     */
-    public void registerSource(Object sourceClass, String annotationName, Map<String, Object> params) {
-        JavaClass clazz = (JavaClass) sourceClass;
-
-        RuntimeConfig config = getRuntimeConfig();
-        //TODO has to register still needed we have it in the runtime config anyway?
-        String beanName = getAnnotatedStringParam(params, "name");
-        if (!hasToReregister(beanName, clazz)) {
-            return;
-        }
-
-        ManagedBean mbean = new ManagedBean();
-        mbean.setBeanClass(clazz.getFullyQualifiedName());
-        mbean.setName(beanName);
-        handleManagedproperties(mbean, fields(clazz));
-        _alreadyRegistered.put(beanName, mbean);
-        //find the scope
-        resolveScope(clazz, mbean);
-
-        config.addManagedBean(beanName, mbean);
-
-        WeavingContext.getEventProcessor().dispatchEvent(new BeanLoadedEvent(clazz.getFullyQualifiedName(), beanName));
-    }
-
-    private void resolveScope(JavaClass clazz, ManagedBean mbean) {
-        Annotation[] anns = clazz.getAnnotations();
-
-        for (Annotation ann : anns) {
-            String scopeType = ann.getType().getValue();
-
-            if (scopeType.equals(RequestScoped.class.getName())) {
-                mbean.setScope("request");
-                break;
-            } else if (scopeType.equals(SessionScoped.class.getName())) {
-                mbean.setScope(SCOPE_SESSION);
-                break;
-            } else if (scopeType.equals(ApplicationScoped.class.getName())) {
-                mbean.setScope(SCOPE_APPLICATION);
-                break;
-            } else if (scopeType.equals(ViewScoped.class.getName())) {
-                mbean.setScope(SCOPE_VIEW);
-                break;
-            } else if (scopeType.equals(NoneScoped.class.getName())) {
-                mbean.setScope(SCOPE_NONE);
-                break;
-            } else if (scopeType.equals(CustomScoped.class.getName())) {
-                //TODO find out how to handle custom scope values
-                mbean.setScope(SCOPE_CUSTOM);
-                break;
-            }
-        }
-
-        if (mbean.getManagedBeanScope() == null) {
-            mbean.setScope(SCOPE_NONE);
-        }
-    }
+   
 
     private void handleManagedpropertiesCompiled(ManagedBean mbean, Field[] fields) {
         for (Field field : fields) {
@@ -194,57 +126,7 @@
         }
     }
 
-    private void handleManagedproperties(ManagedBean mbean, JavaField[] fields) {
-        for (JavaField field : fields) {
-            Annotation[] annotations = field.getAnnotations();
-            if (annotations != null && annotations.length > 0) {
-                //TODO debug this out
-                for (Annotation ann : annotations) {
-                    if (ann.getType().getValue().equals(javax.faces.bean.ManagedProperty.class.getName())) {
-                        org.apache.myfaces.config.impl.digester.elements.ManagedProperty managedProperty =
-                                new org.apache.myfaces.config.impl.digester.elements.ManagedProperty();
-                        String name = getAnnotatedStringParam(ann.getPropertyMap(), "name");
-
-                        if (log.isDebugEnabled()) {
-                            log.debug("  Field '" + field.getName()
-                                      + "' has a @ManagedProperty annotation");
-                        }
-
-                        if ((name == null) || "".equals(name)) {
-                            name = field.getName();
-                        }
-                        managedProperty.setPropertyName(name);
-                        managedProperty.setPropertyClass(field.getType().getValue()); // FIXME - primitives, arrays, etc.
-                        managedProperty.setValue((String) ann.getPropertyMap().get("value"));
-                        mbean.addProperty(managedProperty);
-                        WeavingContext.getEventProcessor().dispatchEvent(new ManagedPropertyLoadedEvent(field.getType().getValue(), name));
-                    }
-                }
-            }
-        }
-    }
 
-    /**
-     * <p>Return an array of all <code>Field</code>s reflecting declared
-     * fields in this class, or in any superclass other than
-     * <code>java.lang.Object</code>.</p>
-     *
-     * @param clazz Class to be analyzed
-     */
-
-    private JavaField[] fields(JavaClass clazz) {
-
-        Map<String, JavaField> fields = new HashMap<String, JavaField>();
-        do {
-            for (JavaField field : clazz.getFields()) {
-                if (!fields.containsKey(field.getName())) {
-                    fields.put(field.getName(), field);
-                }
-            }
-        } while ((clazz = clazz.getSuperJavaClass()) != null && !clazz.getName().equals("java.lang.Object"));
-        return fields.values().toArray(new JavaField[fields.size()]);
-
-    }
 
     /**
      * <p>Return an array of all <code>Field</code>s reflecting declared
@@ -272,23 +154,7 @@
         return mbean == null || !mbean.getManagedBeanClassName().equals(clazz.getName());
     }
 
-    /**
-     * simple check we do not check for the contents of the managed property here
-     * This is somewhat a simplification does not drag down the managed property handling
-     * speed too much
-     * <p/>
-     * TODO we have to find a way to enable the checking on managed property level
-     * so that we can replace the meta data on the fly (probably by extending the interface)
-     * for first registration this is enough
-     *
-     * @param name
-     * @param clazz
-     * @return
-     */
-    protected boolean hasToReregister(String name, JavaClass clazz) {
-        ManagedBean mbean = (ManagedBean) _alreadyRegistered.get(name);
-        return mbean == null || !mbean.getManagedBeanClassName().equals(clazz.getFullyQualifiedName());
-    }
+
 
     @SuppressWarnings("unchecked")
     public void purge(String className) {

Modified: myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/BehaviorImplementationListener.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/BehaviorImplementationListener.java?rev=891262&r1=891261&r2=891262&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/BehaviorImplementationListener.java (original)
+++ myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/BehaviorImplementationListener.java Wed Dec 16 14:49:41 2009
@@ -19,7 +19,6 @@
 package org.apache.myfaces.scripting.jsf2.annotation;
 
 
-import com.thoughtworks.qdox.model.JavaClass;
 import org.apache.myfaces.scripting.api.AnnotationScanListener;
 import org.apache.myfaces.scripting.jsf2.annotation.purged.PurgedComponent;
 import org.apache.myfaces.scripting.jsf2.annotation.purged.PurgedBehavior;
@@ -50,13 +49,7 @@
         getApplication().addBehavior(val, clazz.getName());
     }
 
-    protected void addEntity(JavaClass clazz, String val) {
-        if (log.isTraceEnabled()) {
-            log.trace("addBehavior (" + val + ","
-                      + clazz.getFullyQualifiedName() + ")");
-        }
-        getApplication().addBehavior(val, clazz.getFullyQualifiedName());
-    }
+    
 
     @Override
     public void purge(String className) {

Modified: myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/BehaviorRendererImplementationListener.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/BehaviorRendererImplementationListener.java?rev=891262&r1=891261&r2=891262&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/BehaviorRendererImplementationListener.java (original)
+++ myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/BehaviorRendererImplementationListener.java Wed Dec 16 14:49:41 2009
@@ -18,7 +18,6 @@
  */
 package org.apache.myfaces.scripting.jsf2.annotation;
 
-import com.thoughtworks.qdox.model.JavaClass;
 import org.apache.myfaces.scripting.jsf2.annotation.purged.PurgedClientBehaviorRenderer;
 
 import javax.faces.FactoryFinder;
@@ -102,17 +101,7 @@
         getApplication().addConverter(entry.getRendererType(), clazz.getName());
     }
 
-    @Override
-    protected void addEntity(JavaClass clazz, Map<String, Object> params) {
-        String value = getAnnotatedStringParam(params, PAR_RENDERERTYPE);
-        String renderKitId = getAnnotatedStringParam(params, PAR_RENDERKITID);
-
-        AnnotationEntry entry = new AnnotationEntry(value, renderKitId);
-        _alreadyRegistered.put(clazz.getFullyQualifiedName(), entry);
-
-        getApplication().addConverter(entry.getRendererType(), clazz.getFullyQualifiedName());
-    }
-
+   
     @Override
     protected boolean hasToReregister(Map params, Class clazz) {
         String value = (String) params.get(PAR_RENDERERTYPE);
@@ -128,20 +117,6 @@
         return alreadyRegistered.equals(entry);
     }
 
-    @Override
-    protected boolean hasToReregister(Map params, JavaClass clazz) {
-        String value = getAnnotatedStringParam(params, PAR_RENDERERTYPE);
-        String renderKitId = getAnnotatedStringParam(params, PAR_RENDERKITID);
-
-        AnnotationEntry entry = new AnnotationEntry(value, renderKitId);
-
-        AnnotationEntry alreadyRegistered = (AnnotationEntry) _alreadyRegistered.get(clazz.getFullyQualifiedName());
-        if (alreadyRegistered == null) {
-            return true;
-        }
-
-        return !alreadyRegistered.equals(entry);
-    }
 
     public boolean supportsAnnotation(String annotation) {
         return annotation.equals(FacesBehaviorRenderer.class.getName());

Modified: myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/ComponentImplementationListener.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/ComponentImplementationListener.java?rev=891262&r1=891261&r2=891262&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/ComponentImplementationListener.java (original)
+++ myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/ComponentImplementationListener.java Wed Dec 16 14:49:41 2009
@@ -18,7 +18,6 @@
  */
 package org.apache.myfaces.scripting.jsf2.annotation;
 
-import com.thoughtworks.qdox.model.JavaClass;
 import org.apache.myfaces.scripting.api.AnnotationScanListener;
 import org.apache.myfaces.scripting.core.util.WeavingContext;
 import org.apache.myfaces.scripting.jsf2.annotation.purged.PurgedComponent;
@@ -54,16 +53,7 @@
         _alreadyRegistered.put(clazz.getName(), val);
     }
 
-    protected void addEntity(JavaClass clazz, String val) {
-        if (log.isTraceEnabled()) {
-            log.trace("addComponent(" + val + ","
-                      + clazz.getFullyQualifiedName() + ")");
-        }
-        WeavingContext.getWeaver().loadScriptingClassFromName(clazz.getFullyQualifiedName());
-        getApplication().addComponent(val, clazz.getFullyQualifiedName());
-        _alreadyRegistered.put(clazz.getFullyQualifiedName(), val);
-    }
-
+   
     @Override
     public void purge(String className) {
         super.purge(className);

Modified: myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/ConverterImplementationListener.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/ConverterImplementationListener.java?rev=891262&r1=891261&r2=891262&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/ConverterImplementationListener.java (original)
+++ myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/ConverterImplementationListener.java Wed Dec 16 14:49:41 2009
@@ -18,14 +18,11 @@
  */
 package org.apache.myfaces.scripting.jsf2.annotation;
 
-import com.thoughtworks.qdox.model.JavaClass;
 import org.apache.myfaces.scripting.api.AnnotationScanListener;
-import org.apache.myfaces.scripting.jsf2.annotation.purged.PurgedRenderer;
 import org.apache.myfaces.scripting.jsf2.annotation.purged.PurgedConverter;
 
-import javax.faces.convert.FacesConverter;
-import javax.faces.render.RenderKit;
 import javax.faces.application.Application;
+import javax.faces.convert.FacesConverter;
 import java.util.Map;
 
 /**
@@ -43,6 +40,7 @@
         Class forClass;
 
         AnnotationEntry(String value, Class forClass) {
+
             this.value = value;
             this.forClass = forClass;
         }
@@ -86,7 +84,7 @@
     }
 
     public ConverterImplementationListener() {
-        super();
+         super(PAR_VALUE, PAR_DEFAULT);
     }
 
     @Override
@@ -100,16 +98,6 @@
         getApplication().addConverter(entry.getValue(), clazz.getName());
     }
 
-    @Override
-    protected void addEntity(JavaClass clazz, Map<String, Object> params) {
-        String value = getAnnotatedStringParam(params, PAR_VALUE);
-        Class forClass = getAnnotatedClassParam(params, PAR_DEFAULT);
-
-        AnnotationEntry entry = new AnnotationEntry(value, forClass);
-        _alreadyRegistered.put(clazz.getFullyQualifiedName(), entry);
-
-        getApplication().addConverter(entry.getValue(), clazz.getFullyQualifiedName());
-    }
 
     @Override
     protected boolean hasToReregister(Map params, Class clazz) {
@@ -126,20 +114,7 @@
         return alreadyRegistered.equals(entry);
     }
 
-    @Override
-    protected boolean hasToReregister(Map params, JavaClass clazz) {
-        String value = getAnnotatedStringParam(params, PAR_VALUE);
-        Class forClass = getAnnotatedClassParam(params, PAR_DEFAULT);
-
-        AnnotationEntry entry = new AnnotationEntry(value, forClass);
-
-        AnnotationEntry alreadyRegistered = (AnnotationEntry) _alreadyRegistered.get(clazz.getFullyQualifiedName());
-        if (alreadyRegistered == null) {
-            return true;
-        }
-
-        return !alreadyRegistered.equals(entry);
-    }
+   
 
     public boolean supportsAnnotation(String annotation) {
         return annotation.equals(FacesConverter.class.getName());

Modified: myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/JavaAnnotationScanner.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/JavaAnnotationScanner.java?rev=891262&r1=891261&r2=891262&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/JavaAnnotationScanner.java (original)
+++ myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/JavaAnnotationScanner.java Wed Dec 16 14:49:41 2009
@@ -18,12 +18,9 @@
  */
 package org.apache.myfaces.scripting.jsf2.annotation;
 
-import com.thoughtworks.qdox.JavaDocBuilder;
-import com.thoughtworks.qdox.model.Annotation;
-import com.thoughtworks.qdox.model.JavaClass;
-import com.thoughtworks.qdox.model.JavaSource;
 import org.apache.myfaces.scripting.api.AnnotationScanListener;
 import org.apache.myfaces.scripting.api.AnnotationScanner;
+import org.apache.myfaces.scripting.api.ScriptingWeaver;
 import org.apache.myfaces.scripting.core.util.WeavingContext;
 
 import java.io.File;
@@ -46,11 +43,14 @@
 public class JavaAnnotationScanner extends BaseAnnotationScanListener implements AnnotationScanner {
 
     List<AnnotationScanListener> _listeners = new LinkedList<AnnotationScanListener>();
-    JavaDocBuilder _builder = new JavaDocBuilder();
+
     Map<String, String> _registeredAnnotations = new HashMap<String, String>();
     LinkedList<String> _sourcePaths = new LinkedList<String>();
     private static final String JAVAX_FACES = "javax.faces";
 
+    ScriptingWeaver _weaver = null;
+
+
     public JavaAnnotationScanner() {
         initDefaultListeners();
     }
@@ -63,23 +63,17 @@
         initDefaultListeners();
     }
 
-    public void addScanPath(String sourcePath) {
-        _sourcePaths.addFirst(sourcePath);
+
+    public JavaAnnotationScanner(ScriptingWeaver weaver) {
+        _weaver = weaver;
+         initDefaultListeners();
     }
 
-    Collection<Annotation> filterAnnotations(Annotation[] anns) {
-        List<Annotation> retVal = new ArrayList<Annotation>(anns.length);
-        if (anns == null) {
-            return retVal;
-        }
-        for (Annotation ann : anns) {
-            if (ann.getType().getValue().startsWith(JAVAX_FACES)) {
-                retVal.add(ann);
-            }
-        }
-        return retVal;
+    public void addScanPath(String sourcePath) {
+        _sourcePaths.addFirst(sourcePath);
     }
 
+   
     Collection<java.lang.annotation.Annotation> filterAnnotations(java.lang.annotation.Annotation[] anns) {
         List<java.lang.annotation.Annotation> retVal = new ArrayList<java.lang.annotation.Annotation>(anns.length);
         if (anns == null) {
@@ -95,9 +89,8 @@
     }
 
     public void scanClass(Class clazz) {
-        //java.lang.annotation.Annotation[] anns = clazz.getAnnotations();
-
         java.lang.annotation.Annotation[] anns = clazz.getAnnotations();
+
         Collection<java.lang.annotation.Annotation> annCol = filterAnnotations(anns);
         if (!annCol.isEmpty()) {
             addOrMoveAnnotations(clazz);
@@ -105,20 +98,7 @@
             removeAnnotations(clazz);
         }
     }
-
-
-    private void initSourcePaths() {
-        _builder = new JavaDocBuilder();
-        for (String sourcePath : _sourcePaths) {
-            File source = new File(sourcePath);
-            if (source.exists()) {
-
-                _builder.addSourceTree(source);
-
-            }
-        }
-    }
-
+   
     private void initDefaultListeners() {
         _listeners.add(new BeanImplementationListener());
         _listeners.add(new BehaviorImplementationListener());
@@ -133,6 +113,23 @@
      * on the found data
      */
     public void scanPaths() {
+        //TODO move this over to a binary scan system
+        //https://issues.apache.org/jira/browse/EXTSCRIPT-33
+        for(String className : _weaver.loadPossibleDynamicClasses()) {
+            Class clazz = _weaver.loadScriptingClassFromName(className);
+            //called already by loadScriptingClassFromName
+            /*if(clazz != null) {
+               java.lang.annotation.Annotation[] anns = clazz.getAnnotations();
+                if (anns != null && anns.length > 0) {
+                    addOrMoveAnnotations(clazz);
+                } else {
+                    removeAnnotations(clazz);
+                }
+            }*/
+        }
+
+
+        /*
         initSourcePaths();
         JavaSource[] sources = _builder.getSources();
         for (JavaSource source : sources) {
@@ -146,32 +143,9 @@
                 }
             }
 
-        }
+        }*/
     }
 
-    /**
-     * add or moves a class level annotation
-     * to a new place
-     *
-     * @param clazz
-     * @param anns
-     */
-    private void addOrMoveAnnotations(JavaClass clazz, Annotation[] anns) {
-        for (Annotation ann : anns) {
-            for (AnnotationScanListener listener : _listeners) {
-                if (listener.supportsAnnotation(ann.getType().getValue())) {
-                    listener.registerSource(
-                            clazz, ann.getType().getValue(), ann.getPropertyMap());
-
-                    _registeredAnnotations.put(clazz.getFullyQualifiedName(), ann.getType().getValue());
-                    ReloadingMetadata metaData = WeavingContext.getFileChangedDaemon().getClassMap().get(clazz.getFullyQualifiedName());
-                    if (metaData != null) {
-                        metaData.setAnnotated(true);
-                    }
-                }
-            }
-        }
-    }
 
     /**
      * add or moves a class level annotation
@@ -204,27 +178,6 @@
      *
      * @param clazz
      */
-    private void removeAnnotations(JavaClass clazz) {
-        String registeredAnnotation = _registeredAnnotations.get(clazz.getFullyQualifiedName());
-        if (registeredAnnotation != null) {
-            for (AnnotationScanListener listener : _listeners) {
-                if (listener.supportsAnnotation(registeredAnnotation)) {
-                    listener.purge(clazz.getFullyQualifiedName());
-                    _registeredAnnotations.remove(clazz.getFullyQualifiedName());
-                    WeavingContext.getEventProcessor().dispatchEvent(new AnnotatedArtefactRemovedEvent(clazz.getFullyQualifiedName()));
-                    WeavingContext.getFileChangedDaemon().getClassMap().remove(clazz.getFullyQualifiedName());
-                }
-            }
-        }
-    }
-
-    /**
-     * use case annotation removed
-     * we have to entirely remove the annotation
-     * from our internal registry and the myfaces registry
-     *
-     * @param clazz
-     */
     private void removeAnnotations(Class clazz) {
         String registeredAnnotation = _registeredAnnotations.get(clazz.getName());
         if (registeredAnnotation != null) {
@@ -239,22 +192,7 @@
     }
 
 
-    /**
-     * use case annotation moved
-     * we have to remove the annotation from the myfaces registry of the old
-     * listeners place, the new entry is done in the first step add or move
-     *
-     * @param clazz
-     * @param ann
-     * @param listener
-     */
-    private void annotationMoved(JavaClass clazz, Annotation ann, AnnotationScanListener listener) {
-        //case class exists but it has been moved to anoter annotation
-        String registeredAnnotation = _registeredAnnotations.get(clazz.getFullyQualifiedName());
-        if (registeredAnnotation != null && registeredAnnotation.equals(ann.getType().getValue())) {
-            removeAnnotations(clazz);
-        }
-    }
+  
 
     private void annotationMoved(Class clazz, java.lang.annotation.Annotation ann, AnnotationScanListener listener) {
         //case class exists but it has been moved to anoter annotation

Modified: myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/MapEntityAnnotationScanner.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/MapEntityAnnotationScanner.java?rev=891262&r1=891261&r2=891262&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/MapEntityAnnotationScanner.java (original)
+++ myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/MapEntityAnnotationScanner.java Wed Dec 16 14:49:41 2009
@@ -18,7 +18,6 @@
  */
 package org.apache.myfaces.scripting.jsf2.annotation;
 
-import com.thoughtworks.qdox.model.JavaClass;
 import org.apache.myfaces.scripting.api.AnnotationScanListener;
 import org.apache.myfaces.scripting.core.util.ReflectUtil;
 
@@ -41,14 +40,6 @@
     }
 
 
-    public void registerSource(Object sourceClass, String annotationName, Map<String, Object> params) {
-        JavaClass clazz = (JavaClass) sourceClass;
-        if (hasToReregister(params, clazz)) {
-            addEntity(clazz, params);
-        }
-
-    }
-
     public void register(Class clazz, Annotation annotation) {
 
         Map<String, Object> parms = new HashMap<String, Object>(_annotationParms.length);
@@ -65,23 +56,8 @@
 
     protected abstract void addEntity(Class clazz, Map<String, Object> params);
 
-    protected abstract void addEntity(JavaClass clazz, Map<String, Object> params);
 
     protected abstract boolean hasToReregister(Map params, Class clazz);
 
-    /**
-     * simple check we do not check for the contents of the managed property here
-     * This is somewhat a simplification does not drag down the managed property handling
-     * speed too much
-     * <p/>
-     * TODO we have to find a way to enable the checking on managed property level
-     * so that we can replace the meta data on the fly (probably by extending the interface)
-     * for first registration this is enough
-     *
-     * @param params
-     * @param clazz
-     * @return
-     */
-    protected abstract boolean hasToReregister(Map params, JavaClass clazz);
 
 }

Modified: myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/RendererImplementationListener.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/RendererImplementationListener.java?rev=891262&r1=891261&r2=891262&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/RendererImplementationListener.java (original)
+++ myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/RendererImplementationListener.java Wed Dec 16 14:49:41 2009
@@ -18,9 +18,7 @@
  */
 package org.apache.myfaces.scripting.jsf2.annotation;
 
-import com.thoughtworks.qdox.model.JavaClass;
 import org.apache.myfaces.scripting.api.AnnotationScanListener;
-import org.apache.myfaces.scripting.core.util.WeavingContext;
 import org.apache.myfaces.scripting.jsf2.annotation.purged.PurgedRenderer;
 
 import javax.faces.FactoryFinder;
@@ -103,8 +101,8 @@
 
     @Override
     protected void addEntity(Class clazz, Map<String, Object> params) {
-        String value = (String) getAnnotatedStringParam(params, PAR_FAMILY);
-        String theDefault = (String) getAnnotatedStringParam(params, PAR_RENDERERTYPE);
+        String value = (String) params.get(PAR_FAMILY);
+        String theDefault = (String) params.get(PAR_RENDERERTYPE);
 
         String renderKitId = getRenderKitId(params);
         RenderKit renderKit = getRenderkit(renderKitId);
@@ -131,36 +129,7 @@
         return (RenderKitFactory) FactoryFinder.getFactory(FactoryFinder.RENDER_KIT_FACTORY);
     }
 
-    @Override
-    protected void addEntity(JavaClass clazz, Map<String, Object> params) {
-        String value = getAnnotatedStringParam(params, PAR_FAMILY);
-        String theDefault = getAnnotatedStringParam(params, PAR_RENDERERTYPE);
-
-        String renderKitId = getRenderKitId(params);
-        RenderKit renderKit = getRenderkit(renderKitId);
-        AnnotationEntry entry = new AnnotationEntry(value, theDefault, renderKitId);
-        _alreadyRegistered.put(clazz.getName(), entry);
-
-        if (renderKit == null) {
-            log.error("addEntity(): Renderkit with id " + renderKitId + " not found ");
-            return;
-        }
-
-        if (log.isTraceEnabled()) {
-            log.trace("addRenderer(" + renderKitId + ", "
-                      + entry.getComponentFamily() + ", " + entry.getRendererType()
-                      + ", " + clazz.getFullyQualifiedName() + ")");
-        }
 
-        try {
-            //recompile the class here because we cannot deal with the renderer otherwise
-            renderKit.addRenderer(getAnnotatedStringParam(params,PAR_FAMILY), getAnnotatedStringParam(params, PAR_RENDERERTYPE), (Renderer) WeavingContext.getWeaver().loadScriptingClassFromName(clazz.getFullyQualifiedName()).newInstance());
-        } catch (InstantiationException e) {
-            log.error(e);
-        } catch (IllegalAccessException e) {
-            log.error(e);
-        }
-    }
 
 
     @Override
@@ -179,21 +148,7 @@
         return alreadyRegistered.equals(entry);
     }
 
-    @Override
-    protected boolean hasToReregister(Map params, JavaClass clazz) {
-        String value = getAnnotatedStringParam(params, PAR_FAMILY);
-        String theDefault = (String) getAnnotatedStringParam(params, PAR_RENDERERTYPE);
-        String renderKitId = (String) getAnnotatedStringParam(params, PAR_RENDERKITID);
-
-        AnnotationEntry entry = new AnnotationEntry(value, theDefault, renderKitId);
-
-        AnnotationEntry alreadyRegistered = (AnnotationEntry) _alreadyRegistered.get(clazz.getFullyQualifiedName());
-        if (alreadyRegistered != null) {
-            return !alreadyRegistered.equals(entry);
-        }
-
-        return true;
-    }
+  
 
 
     private String getRenderKitId(Map<String, Object> params) {

Modified: myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/SingleEntityAnnotationListener.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/SingleEntityAnnotationListener.java?rev=891262&r1=891261&r2=891262&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/SingleEntityAnnotationListener.java (original)
+++ myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/SingleEntityAnnotationListener.java Wed Dec 16 14:49:41 2009
@@ -18,7 +18,6 @@
  */
 package org.apache.myfaces.scripting.jsf2.annotation;
 
-import com.thoughtworks.qdox.model.JavaClass;
 import org.apache.myfaces.scripting.api.AnnotationScanListener;
 import org.apache.myfaces.scripting.core.util.ReflectUtil;
 
@@ -33,14 +32,7 @@
 public abstract class SingleEntityAnnotationListener extends BaseAnnotationScanListener implements AnnotationScanListener {
     String _entityParamValue = null;
 
-    public void registerSource(Object sourceClass, String annotationName, Map<String, Object> params) {
-        JavaClass clazz = (JavaClass) sourceClass;
-        String val = getAnnotatedStringParam(params, _entityParamValue);
-        if (hasToReregister(val, clazz)) {
-            addEntity(clazz, val);
-        }
-    }
-
+    
     public void register(Class clazz, Annotation annotation) {
 
         String val = (String) ReflectUtil.executeMethod(annotation, _entityParamValue);
@@ -52,30 +44,13 @@
 
     protected abstract void addEntity(Class clazz, String val);
 
-    protected abstract void addEntity(JavaClass clazz, String val);
-
+ 
 
     protected boolean hasToReregister(String name, Class clazz) {
         String componentClass = (String) _alreadyRegistered.get(name);
         return componentClass == null || !componentClass.equals(clazz.getName());
     }
 
-    /**
-     * simple check we do not check for the contents of the managed property here
-     * This is somewhat a simplification does not drag down the managed property handling
-     * speed too much
-     * <p/>
-     * TODO we have to find a way to enable the checking on managed property level
-     * so that we can replace the meta data on the fly (probably by extending the interface)
-     * for first registration this is enough
-     *
-     * @param name
-     * @param clazz
-     * @return
-     */
-    protected boolean hasToReregister(String name, JavaClass clazz) {
-        String componentClass = (String) _alreadyRegistered.get(name);
-        return componentClass == null || !componentClass.equals(clazz.getFullyQualifiedName());
-    }
+    
 
 }

Modified: myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/ValidatorImplementationListener.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/ValidatorImplementationListener.java?rev=891262&r1=891261&r2=891262&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/ValidatorImplementationListener.java (original)
+++ myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf2/annotation/ValidatorImplementationListener.java Wed Dec 16 14:49:41 2009
@@ -18,7 +18,6 @@
  */
 package org.apache.myfaces.scripting.jsf2.annotation;
 
-import com.thoughtworks.qdox.model.JavaClass;
 import org.apache.myfaces.scripting.api.AnnotationScanListener;
 import org.apache.myfaces.scripting.jsf2.annotation.purged.PurgedValidator;
 
@@ -107,16 +106,7 @@
         getApplication().addValidator(entry.getValue(), clazz.getName());
     }
 
-    @Override
-    protected void addEntity(JavaClass clazz, Map<String, Object> params) {
-        String value = getAnnotatedStringParam(params, PAR_VALUE);
-        Boolean theDefault = getAnnotatedBolleanParam(params, PAR_DEFAULT);
-
-        AnnotationEntry entry = new AnnotationEntry(value, theDefault);
-        _alreadyRegistered.put(clazz.getFullyQualifiedName(), entry);
-
-        getApplication().addValidator(entry.getValue(), clazz.getFullyQualifiedName());
-    }
+   
 
     @Override
     protected boolean hasToReregister(Map params, Class clazz) {
@@ -133,21 +123,7 @@
         return alreadyRegistered.equals(entry);
     }
 
-    @Override
-    protected boolean hasToReregister(Map params, JavaClass clazz) {
-        String value = getAnnotatedStringParam(params, PAR_VALUE);
-        Boolean theDefault = getAnnotatedBolleanParam(params, PAR_DEFAULT);
-
-        AnnotationEntry entry = new AnnotationEntry(value, theDefault);
-
-        AnnotationEntry alreadyRegistered = (AnnotationEntry) _alreadyRegistered.get(clazz.getFullyQualifiedName());
-        if (alreadyRegistered == null) {
-            return true;
-        }
-
-        return alreadyRegistered.equals(entry);
-    }
-
+    
 
     @Override
     public void purge(String className) {

Modified: myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/renderer/JavaTestComponent.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/renderer/JavaTestComponent.java?rev=891262&r1=891261&r2=891262&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/renderer/JavaTestComponent.java (original)
+++ myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/renderer/JavaTestComponent.java Wed Dec 16 14:49:41 2009
@@ -29,7 +29,7 @@
 /**
  * Simple component to be picked up by
  */
-
+@FacesComponent("at.irian.JavaTestComponent")
 public class JavaTestComponent extends UIInput implements Markable {
 
     enum PropertyKeys {

Modified: myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/renderer/JavaTestComponent2.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/renderer/JavaTestComponent2.java?rev=891262&r1=891261&r2=891262&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/renderer/JavaTestComponent2.java (original)
+++ myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/renderer/JavaTestComponent2.java Wed Dec 16 14:49:41 2009
@@ -25,7 +25,6 @@
  * @author Werner Punz (latest modification by $Author$)
  * @version $Revision$ $Date$
  */
-@FacesComponent("at.irian.JavaTestComponent")
 public class JavaTestComponent2 extends UIInput implements Markable {
 
     public JavaTestComponent2() {

Modified: myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/renderer/JavaTestRenderer1.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/renderer/JavaTestRenderer1.java?rev=891262&r1=891261&r2=891262&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/renderer/JavaTestRenderer1.java (original)
+++ myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/renderer/JavaTestRenderer1.java Wed Dec 16 14:49:41 2009
@@ -42,12 +42,13 @@
  * the annotation is dynamic you can change it on the fly or move it from one
  * class to the other
  */
-  @FacesRenderer(componentFamily = "javax.faces.Input", rendererType = "at.irian.JavaTestRenderer")
+ @FacesRenderer(componentFamily = "javax.faces.Input", rendererType = "at.irian.JavaTestRenderer")
+ 
   public class JavaTestRenderer1 extends HtmlTextRendererBase {
 
     static Log log = LogFactory.getLog(JavaTestRenderer1.class);
 
-    private static final String MSG2 = " Hello world from Renderer 1  ";
+    private static final String MSG2 = " Hello world from Renderer 1   ";
 
     public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
         super.encodeBegin(context, component);

Modified: myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/renderer/JavaTestRenderer2.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/renderer/JavaTestRenderer2.java?rev=891262&r1=891261&r2=891262&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/renderer/JavaTestRenderer2.java (original)
+++ myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/renderer/JavaTestRenderer2.java Wed Dec 16 14:49:41 2009
@@ -32,7 +32,6 @@
  * @author Werner Punz (latest modification by $Author$)
  * @version $Revision$ $Date$
  */
- 
 public class JavaTestRenderer2 extends HtmlTextareaRendererBase {
 
     private static final String MSG = "Hello world from Renderer 2  ";



Mime
View raw message