myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From we...@apache.org
Subject svn commit: r1414709 - in /myfaces/extensions/scripting/trunk: extscript-core-root/extscript-cdi/src/main/java/org/apache/myfaces/extensions/scripting/cdi/startup/ extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting...
Date Wed, 28 Nov 2012 14:13:45 GMT
Author: werpu
Date: Wed Nov 28 14:13:41 2012
New Revision: 1414709

URL: http://svn.apache.org/viewvc?rev=1414709&view=rev
Log:
enabling the component tag handler delegate for mojarra and myfaces moving the classloader
handling
 into its own spi

Added:
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/api/ClassLoaderService.java
      - copied, changed from r1414703, myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/src/main/webapp/WEB-INF/java/JavaHello.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/jsf/facelet/TagHandlerDelegateFactoryImpl.java
      - copied, changed from r1414703, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/TagHandlerDelegateFactoryImpl.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/adapters/ClassLoaderServiceImpl.java
      - copied, changed from r1414703, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/common/ClassLoaderUtils.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/resources/META-INF/services/org.apache.myfaces.extensions.scripting.core.api.ClassLoaderService
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/java/org/apache/myfaces/extensions/scripting/jsf/adapters/ClassLoaderServiceImpl.java
      - copied, changed from r1414703, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/common/ClassLoaderUtils.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/resources/META-INF/services/org.apache.myfaces.extensions.scripting.core.api.ClassLoaderService
    myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/src/main/java/JavaHello.java
      - copied, changed from r1414703, myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/src/main/webapp/WEB-INF/java/JavaHello.java
Removed:
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/common/ClassLoaderUtils.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/TagHandlerDelegateFactoryImpl.java
    myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/src/main/webapp/WEB-INF/java/JavaHello.java
Modified:
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-cdi/src/main/java/org/apache/myfaces/extensions/scripting/cdi/startup/StartupExtension.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/common/util/ClassLoaderUtils.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/adapters/MojarraSPI.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/servlet/ClassloaderSetupListener.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/java/org/apache/myfaces/extensions/scripting/jsf/adapters/MyFacesSPI.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/resources/META-INF/faces-config.xml
    myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/pom.xml
    myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/src/main/webapp/WEB-INF/web.xml
    myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/src/main/webapp/helloWorld.xhtml
    myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/faces-config.xml
    myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/blog/BlogEntry.java
    myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/componentTest/JavaTestRenderer1.java
    myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/componentTest/JavaTestRenderer2.java
    myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-extscript-helloworld/src/main/webapp/WEB-INF/web.xml

Modified: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-cdi/src/main/java/org/apache/myfaces/extensions/scripting/cdi/startup/StartupExtension.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-cdi/src/main/java/org/apache/myfaces/extensions/scripting/cdi/startup/StartupExtension.java?rev=1414709&r1=1414708&r2=1414709&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-cdi/src/main/java/org/apache/myfaces/extensions/scripting/cdi/startup/StartupExtension.java
(original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-cdi/src/main/java/org/apache/myfaces/extensions/scripting/cdi/startup/StartupExtension.java
Wed Nov 28 14:13:41 2012
@@ -48,7 +48,11 @@ public class StartupExtension implements
         //the compile runs but not with the daemon thread
         //after that we can load the classes
         //by temporarily plugging in our throw away classloader
-       _classLoaderHolder.set(Thread.currentThread().getContextClassLoader());
+
+        //TODO unify the classloader setup because mojarra cannot handle
+        //changing classloaders, we have to stay on one classloader for the entire system
+        _classLoaderHolder.set(Thread.currentThread().getContextClassLoader());
+
        Thread.currentThread().setContextClassLoader(new CDIThrowAwayClassloader(Thread.currentThread().getContextClassLoader()));
     }
 

Copied: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/api/ClassLoaderService.java
(from r1414703, myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/src/main/webapp/WEB-INF/java/JavaHello.java)
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/api/ClassLoaderService.java?p2=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/api/ClassLoaderService.java&p1=myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/src/main/webapp/WEB-INF/java/JavaHello.java&r1=1414703&r2=1414709&rev=1414709&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/src/main/webapp/WEB-INF/java/JavaHello.java
(original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/api/ClassLoaderService.java
Wed Nov 28 14:13:41 2012
@@ -16,29 +16,21 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-
-
-
-import javax.inject.Named;
+package org.apache.myfaces.extensions.scripting.core.api;
 
 /**
  * @author Werner Punz (latest modification by $Author$)
  * @version $Revision$ $Date$
- *
- * Hello world CDI Java Bean for testing purposes
  */
-@Named
-public class JavaHello
+public interface ClassLoaderService
 {
-    String helloWorld = "Hello world from Java Bean";
-
-    public String getHelloWorld()
-    {
-        return helloWorld;
-    }
-
-    public void setHelloWorld(String helloWorld)
-    {
-        this.helloWorld = helloWorld;
-    }
+    /**
+     * registers a throw away classloader into the system
+     */
+    public  void registerThrowAwayClassloader();
+
+    /**
+     * @return higher priorities override services with lower ones
+     */
+    public int getPriority();
 }

Modified: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/common/util/ClassLoaderUtils.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/common/util/ClassLoaderUtils.java?rev=1414709&r1=1414708&r2=1414709&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/common/util/ClassLoaderUtils.java
(original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/common/util/ClassLoaderUtils.java
Wed Nov 28 14:13:41 2012
@@ -19,6 +19,7 @@
 package org.apache.myfaces.extensions.scripting.core.common.util;
 
 
+import org.apache.myfaces.extensions.scripting.core.api.ClassLoaderService;
 import org.apache.myfaces.extensions.scripting.core.api.WeavingContext;
 
 import java.io.File;
@@ -30,7 +31,9 @@ import java.net.URLDecoder;
 import java.nio.charset.Charset;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Iterator;
 import java.util.List;
+import java.util.ServiceLoader;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
@@ -40,6 +43,23 @@ import java.util.logging.Logger;
  */
 public class ClassLoaderUtils {
 
+    /**
+     * fetches a default classloader service which is responsible of registering
+     * a classloader into the system
+     *
+     * @return  the classloading registration service
+     */
+    public static ClassLoaderService getDefaultClassLoaderService() {
+        Iterator<ClassLoaderService>  serviceIt = ServiceLoader.load(ClassLoaderService.class).iterator();
+        ClassLoaderService finalService = null;
+        while(serviceIt.hasNext()) {
+            ClassLoaderService service = serviceIt.next();
+            if(finalService == null || service.getPriority() > finalService.getPriority())
{
+                finalService = service;
+            }
+        }
+        return finalService;
+    }
 
     // ------------------------------------------ Public methods
 

Copied: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/jsf/facelet/TagHandlerDelegateFactoryImpl.java
(from r1414703, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/TagHandlerDelegateFactoryImpl.java)
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/jsf/facelet/TagHandlerDelegateFactoryImpl.java?p2=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/jsf/facelet/TagHandlerDelegateFactoryImpl.java&p1=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/TagHandlerDelegateFactoryImpl.java&r1=1414703&r2=1414709&rev=1414709&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/TagHandlerDelegateFactoryImpl.java
(original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/jsf/facelet/TagHandlerDelegateFactoryImpl.java
Wed Nov 28 14:13:41 2012
@@ -17,12 +17,16 @@
  * under the License.
  */
 
-package org.apache.myfaces.extensions.scripting.mojarra.facelet;
+package org.apache.myfaces.extensions.scripting.jsf.facelet;
 
 import com.sun.faces.facelets.tag.jsf.BehaviorTagHandlerDelegateImpl;
 import com.sun.faces.facelets.tag.jsf.ConverterTagHandlerDelegateImpl;
 import com.sun.faces.facelets.tag.jsf.ValidatorTagHandlerDelegateImpl;
 import org.apache.myfaces.extensions.scripting.core.api.WeavingContext;
+import org.apache.myfaces.extensions.scripting.mojarra.facelet.ReloadingBehaviorTagHandlerDelegate;
+import org.apache.myfaces.extensions.scripting.mojarra.facelet.ReloadingComponentTagHandlerDelegate;
+import org.apache.myfaces.extensions.scripting.mojarra.facelet.ReloadingConverterTagHandlerDelegate;
+import org.apache.myfaces.extensions.scripting.mojarra.facelet.ReloadingValidatorTagHandlerDelegate;
 
 import javax.faces.view.facelets.BehaviorHandler;
 import javax.faces.view.facelets.ComponentHandler;

Copied: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/adapters/ClassLoaderServiceImpl.java
(from r1414703, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/common/ClassLoaderUtils.java)
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/adapters/ClassLoaderServiceImpl.java?p2=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/adapters/ClassLoaderServiceImpl.java&p1=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/common/ClassLoaderUtils.java&r1=1414703&r2=1414709&rev=1414709&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/common/ClassLoaderUtils.java
(original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/adapters/ClassLoaderServiceImpl.java
Wed Nov 28 14:13:41 2012
@@ -17,8 +17,9 @@
  * under the License.
  */
 
-package org.apache.myfaces.extensions.scripting.mojarra.common;
+package org.apache.myfaces.extensions.scripting.mojarra.adapters;
 
+import org.apache.myfaces.extensions.scripting.core.api.ClassLoaderService;
 import org.apache.myfaces.extensions.scripting.core.engine.ThrowAwayClassloader;
 
 /**
@@ -26,11 +27,13 @@ import org.apache.myfaces.extensions.scr
  * @version $Revision$ $Date$
  */
 
-public class ClassLoaderUtils extends org.apache.myfaces.extensions.scripting.core.common.util.ClassLoaderUtils
+public class ClassLoaderServiceImpl
+        implements ClassLoaderService
 {
     static ClassLoader _oldClassLoader = null;
 
-    public static void registerThrowAwayClassloader()
+
+    static void internalRegisterThrowAwayClassloader()
     {
         //we do not have the luxury of a pluggable classloading extensions like in myfaces
         // instead we have to provide our own classloader which is hooked in from time to
time into the running system
@@ -55,4 +58,15 @@ public class ClassLoaderUtils extends or
         }
     }
 
+    @Override
+    public void registerThrowAwayClassloader()
+    {
+        internalRegisterThrowAwayClassloader();
+    }
+
+    @Override
+    public int getPriority()
+    {
+        return 0;  //default implementation, lowest priority
+    }
 }

Modified: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/adapters/MojarraSPI.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/adapters/MojarraSPI.java?rev=1414709&r1=1414708&r2=1414709&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/adapters/MojarraSPI.java
(original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/adapters/MojarraSPI.java
Wed Nov 28 14:13:41 2012
@@ -25,8 +25,8 @@ import com.sun.faces.mgbean.BeanManager;
 import com.sun.faces.mgbean.ManagedBeanInfo;
 import org.apache.myfaces.extensions.scripting.core.api.ImplementationService;
 import org.apache.myfaces.extensions.scripting.core.api.WeavingContext;
+import org.apache.myfaces.extensions.scripting.core.common.util.ClassLoaderUtils;
 import org.apache.myfaces.extensions.scripting.core.monitor.ClassResource;
-import org.apache.myfaces.extensions.scripting.mojarra.common.ClassLoaderUtils;
 
 import javax.faces.context.FacesContext;
 import javax.servlet.ServletContext;
@@ -51,7 +51,12 @@ public class MojarraSPI implements Imple
     @Override
     public void registerClassloadingExtension(ServletContext context)
     {
-        ClassLoaderUtils.registerThrowAwayClassloader();
+        ClassLoaderUtils.getDefaultClassLoaderService().registerThrowAwayClassloader();
+        /*ClassLoaderServiceImpl utils =
+                ServiceLoader.load(ClassLoaderService.class)
+                        .iterator().next();
+        utils.registerThrowAwayClassloader();  */
+
     }
 
     @Override
@@ -105,8 +110,9 @@ public class MojarraSPI implements Imple
                 }
             }
 
-            for(ManagedBeanInfo info : taintedBeans) {
-               // String scope = info.getScope();
+            for (ManagedBeanInfo info : taintedBeans)
+            {
+                // String scope = info.getScope();
                 //new interface which comes with mojarra 2.2.x
                 manager.removeFromScope(info.getName(), FacesContext.getCurrentInstance());
             }

Modified: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/servlet/ClassloaderSetupListener.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/servlet/ClassloaderSetupListener.java?rev=1414709&r1=1414708&r2=1414709&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/servlet/ClassloaderSetupListener.java
(original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/servlet/ClassloaderSetupListener.java
Wed Nov 28 14:13:41 2012
@@ -19,19 +19,20 @@
 
 package org.apache.myfaces.extensions.scripting.mojarra.servlet;
 
-import org.apache.myfaces.extensions.scripting.mojarra.common.ClassLoaderUtils;
+import org.apache.myfaces.extensions.scripting.core.api.ClassLoaderService;
+import org.apache.myfaces.extensions.scripting.core.common.util.ClassLoaderUtils;
 
-import javax.servlet.Filter;
 import javax.servlet.ServletRequestEvent;
 import javax.servlet.ServletRequestListener;
 import javax.servlet.annotation.WebListener;
+import java.util.ServiceLoader;
 
 /**
  * @author Werner Punz (latest modification by $Author$)
  * @version $Revision$ $Date$
- *
- * This servlet request listener plugs in our throw away classloader
- * which loads the compiled classes on the fly
+ *          <p/>
+ *          This servlet request listener plugs in our throw away classloader
+ *          which loads the compiled classes on the fly
  */
 @WebListener
 public class ClassloaderSetupListener implements ServletRequestListener
@@ -44,6 +45,10 @@ public class ClassloaderSetupListener im
     @Override
     public void requestInitialized(ServletRequestEvent sre)
     {
-        ClassLoaderUtils.registerThrowAwayClassloader();
+        ClassLoaderUtils.getDefaultClassLoaderService().registerThrowAwayClassloader();
+       /* ClassLoaderService utils =
+                ServiceLoader.load(ClassLoaderService.class)
+                        .iterator().next();
+        utils.registerThrowAwayClassloader(); */
     }
 }

Added: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/resources/META-INF/services/org.apache.myfaces.extensions.scripting.core.api.ClassLoaderService
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/resources/META-INF/services/org.apache.myfaces.extensions.scripting.core.api.ClassLoaderService?rev=1414709&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/resources/META-INF/services/org.apache.myfaces.extensions.scripting.core.api.ClassLoaderService
(added)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/resources/META-INF/services/org.apache.myfaces.extensions.scripting.core.api.ClassLoaderService
Wed Nov 28 14:13:41 2012
@@ -0,0 +1 @@
+org.apache.myfaces.extensions.scripting.mojarra.adapters.ClassLoaderServiceImpl
\ No newline at end of file

Copied: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/java/org/apache/myfaces/extensions/scripting/jsf/adapters/ClassLoaderServiceImpl.java
(from r1414703, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/common/ClassLoaderUtils.java)
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/java/org/apache/myfaces/extensions/scripting/jsf/adapters/ClassLoaderServiceImpl.java?p2=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/java/org/apache/myfaces/extensions/scripting/jsf/adapters/ClassLoaderServiceImpl.java&p1=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/common/ClassLoaderUtils.java&r1=1414703&r2=1414709&rev=1414709&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/common/ClassLoaderUtils.java
(original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/java/org/apache/myfaces/extensions/scripting/jsf/adapters/ClassLoaderServiceImpl.java
Wed Nov 28 14:13:41 2012
@@ -17,7 +17,12 @@
  * under the License.
  */
 
-package org.apache.myfaces.extensions.scripting.mojarra.common;
+package org.apache.myfaces.extensions.scripting.jsf.adapters;
+
+/**
+ * @author Werner Punz (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
 
 import org.apache.myfaces.extensions.scripting.core.engine.ThrowAwayClassloader;
 
@@ -26,33 +31,51 @@ import org.apache.myfaces.extensions.scr
  * @version $Revision$ $Date$
  */
 
-public class ClassLoaderUtils extends org.apache.myfaces.extensions.scripting.core.common.util.ClassLoaderUtils
+public class ClassLoaderServiceImpl
+
+        implements org.apache.myfaces.extensions.scripting.core.api.ClassLoaderService
 {
     static ClassLoader _oldClassLoader = null;
 
-    public static void registerThrowAwayClassloader()
+    static void internalRegisterThrowAwayClassloader()
     {
         //we do not have the luxury of a pluggable classloading extensions like in myfaces
         // instead we have to provide our own classloader which is hooked in from time to
time into the running system
         ClassLoader loader = org.apache.myfaces.extensions.scripting.core.common.util.ClassLoaderUtils.getDefaultClassLoader();
         boolean found = false;
         ClassLoader parent = loader;
-        while(parent != null && !found) {
+        while (parent != null && !found)
+        {
             found = parent instanceof ThrowAwayClassloader;
-            if(!found) {
+            if (!found)
+            {
                 parent = parent.getParent();
             }
         }
-        if(found) {
+        if (found)
+        {
             return;
         }
         //in case of an unchanged classloader we can recycle our old throw away classloader
-        if(_oldClassLoader != null && loader.equals(_oldClassLoader.getParent()))
{
+        if (_oldClassLoader != null && loader.equals(_oldClassLoader.getParent()))
+        {
             Thread.currentThread().setContextClassLoader(_oldClassLoader);
-        } else {
+        } else
+        {
             _oldClassLoader = new ThrowAwayClassloader(loader);
             Thread.currentThread().setContextClassLoader(_oldClassLoader);
         }
     }
 
+    @Override
+    public void registerThrowAwayClassloader()
+    {
+        internalRegisterThrowAwayClassloader();
+    }
+
+    @Override
+    public int getPriority()
+    {
+        return 0;  //zero means we easily can override this one
+    }
 }

Modified: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/java/org/apache/myfaces/extensions/scripting/jsf/adapters/MyFacesSPI.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/java/org/apache/myfaces/extensions/scripting/jsf/adapters/MyFacesSPI.java?rev=1414709&r1=1414708&r2=1414709&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/java/org/apache/myfaces/extensions/scripting/jsf/adapters/MyFacesSPI.java
(original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/java/org/apache/myfaces/extensions/scripting/jsf/adapters/MyFacesSPI.java
Wed Nov 28 14:13:41 2012
@@ -41,7 +41,7 @@ public class MyFacesSPI implements Imple
 
     public void registerClassloadingExtension(ServletContext context)
     {
-        CustomChainLoader loader = new CustomChainLoader(context); //ReflectUtil.instantiate("extras.org.apache.myfaces.extensions
+        CustomChainLoader loader = new CustomChainLoader(context);
         // .scripting.servlet" +
         //".CustomChainLoader",
         //new Cast(ServletContext.class, context));

Modified: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/resources/META-INF/faces-config.xml
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/resources/META-INF/faces-config.xml?rev=1414709&r1=1414708&r2=1414709&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/resources/META-INF/faces-config.xml
(original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/resources/META-INF/faces-config.xml
Wed Nov 28 14:13:41 2012
@@ -48,11 +48,10 @@
             org.apache.myfaces.extensions.scripting.jsf.dynamicDecorators.factories.ScriptingRenderkitFactory
         </render-kit-factory>
 
-        <!--
-          <tag-handler-delegate-factory>
-              org.apache.myfaces.extensions.scripting.facelet.TagHandlerDelegateFactoryImpl
-          </tag-handler-delegate-factory>
-        -->
+
+
+
+
     </factory>
     <lifecycle>
         <phase-listener>org.apache.myfaces.extensions.scripting.jsf.startup.RefreshPhaseListener</phase-listener>

Added: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/resources/META-INF/services/org.apache.myfaces.extensions.scripting.core.api.ClassLoaderService
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/resources/META-INF/services/org.apache.myfaces.extensions.scripting.core.api.ClassLoaderService?rev=1414709&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/resources/META-INF/services/org.apache.myfaces.extensions.scripting.core.api.ClassLoaderService
(added)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/resources/META-INF/services/org.apache.myfaces.extensions.scripting.core.api.ClassLoaderService
Wed Nov 28 14:13:41 2012
@@ -0,0 +1 @@
+org.apache.myfaces.extensions.scripting.jsf.adapters.ClassLoaderServiceImpl
\ No newline at end of file

Modified: myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/pom.xml?rev=1414709&r1=1414708&r2=1414709&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/pom.xml (original)
+++ myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/pom.xml Wed Nov 28 14:13:41
2012
@@ -79,25 +79,6 @@
              ext-scripting core+java6 support + myfaces 2 support
          -->
 
-        <dependency>
-            <groupId>org.apache.myfaces.core</groupId>
-            <artifactId>myfaces-api</artifactId>
-            <version>${myfaces2.version}</version>
-            <scope>compile</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.myfaces.core</groupId>
-            <artifactId>myfaces-impl</artifactId>
-            <version>${myfaces2.version}</version>
-            <scope>compile</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.myfaces.extensions.scripting</groupId>
-            <artifactId>extscript-myfaces20-bundle</artifactId>
-            <version>1.0.5-SNAPSHOT</version>
-        </dependency>
 
         <dependency>
             <groupId>org.apache.myfaces.extensions.scripting</groupId>
@@ -166,4 +147,56 @@
         </dependency>
 
     </dependencies>
+
+    <profiles>
+            <profile>
+                <id>mojarra</id>
+                <activation>
+                    <activeByDefault>false</activeByDefault>
+                </activation>
+                <dependencies>
+                     <dependency>
+                         <groupId>jsf</groupId>
+                         <artifactId>jsf</artifactId>
+                         <version>2.2-SNAPSHOT</version>
+                     </dependency>
+
+                     <dependency>
+                         <groupId>org.apache.myfaces.extensions.scripting</groupId>
+                         <artifactId>extscript-mojarra-bundle</artifactId>
+                         <version>1.0.5-SNAPSHOT</version>
+                     </dependency>
+
+                </dependencies>
+            </profile>
+            <profile>
+                <id>myfaces</id>
+                <activation>
+                    <activeByDefault>true</activeByDefault>
+                </activation>
+                <dependencies>
+                    <dependency>
+                        <groupId>org.apache.myfaces.core</groupId>
+                        <artifactId>myfaces-api</artifactId>
+                        <version>${myfaces2.version}</version>
+                        <scope>compile</scope>
+                    </dependency>
+
+                    <dependency>
+                        <groupId>org.apache.myfaces.core</groupId>
+                        <artifactId>myfaces-impl</artifactId>
+                        <version>${myfaces2.version}</version>
+                        <scope>compile</scope>
+                    </dependency>
+
+                    <dependency>
+                        <groupId>org.apache.myfaces.extensions.scripting</groupId>
+                        <artifactId>extscript-myfaces20-bundle</artifactId>
+                        <version>1.0.5-SNAPSHOT</version>
+                    </dependency>
+
+                </dependencies>
+            </profile>
+        </profiles>
+
 </project>

Copied: myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/src/main/java/JavaHello.java
(from r1414703, myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/src/main/webapp/WEB-INF/java/JavaHello.java)
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/src/main/java/JavaHello.java?p2=myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/src/main/java/JavaHello.java&p1=myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/src/main/webapp/WEB-INF/java/JavaHello.java&r1=1414703&r2=1414709&rev=1414709&view=diff
==============================================================================
    (empty)

Modified: myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/src/main/webapp/WEB-INF/web.xml?rev=1414709&r1=1414708&r2=1414709&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/src/main/webapp/WEB-INF/web.xml
(original)
+++ myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/src/main/webapp/WEB-INF/web.xml
Wed Nov 28 14:13:41 2012
@@ -115,11 +115,6 @@
     </listener>
 
 
-    <!-- Listener, to allow Jetty serving MyFaces apps -->
-    <listener>
-        <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
-    </listener>
-
     <!-- Faces Servlet -->
     <servlet>
         <servlet-name>Faces Servlet</servlet-name>

Modified: myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/src/main/webapp/helloWorld.xhtml
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/src/main/webapp/helloWorld.xhtml?rev=1414709&r1=1414708&r2=1414709&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/src/main/webapp/helloWorld.xhtml
(original)
+++ myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/src/main/webapp/helloWorld.xhtml
Wed Nov 28 14:13:41 2012
@@ -27,7 +27,7 @@
 </h:head>
 <h:body>
 
-    <h:outputText value="#{javaHello.helloWorld}" />
+    <h:outputText value="hello: #{javaHello.helloWorld}" />
 
 </h:body>
 </html>

Modified: myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/faces-config.xml
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/faces-config.xml?rev=1414709&r1=1414708&r2=1414709&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/faces-config.xml
(original)
+++ myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/faces-config.xml
Wed Nov 28 14:13:41 2012
@@ -129,4 +129,10 @@
         -->
         <resource-handler>org.apache.myfaces.extensions.scripting.jsf.resources.SourceResourceHandler</resource-handler>
     </application>
+
+    <factory>
+        <tag-handler-delegate-factory>
+             org.apache.myfaces.extensions.scripting.jsf.facelet.TagHandlerDelegateFactoryImpl
+         </tag-handler-delegate-factory>
+    </factory>
 </faces-config>
\ No newline at end of file

Modified: myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/blog/BlogEntry.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/blog/BlogEntry.java?rev=1414709&r1=1414708&r2=1414709&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/blog/BlogEntry.java
(original)
+++ myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/blog/BlogEntry.java
Wed Nov 28 14:13:41 2012
@@ -29,7 +29,7 @@ import javax.faces.bean.RequestScoped;
 public class BlogEntry {
 
 
-    String firstName = "";
+    String firstName = "Werner";
     String lastName = "";
     String topic = "";
     String content = "";

Modified: myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/componentTest/JavaTestRenderer1.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/componentTest/JavaTestRenderer1.java?rev=1414709&r1=1414708&r2=1414709&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/componentTest/JavaTestRenderer1.java
(original)
+++ myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/componentTest/JavaTestRenderer1.java
Wed Nov 28 14:13:41 2012
@@ -35,6 +35,7 @@ import java.util.logging.Logger;
  *          you can move the annotation from one
  *          renderer artifact to the other
  */
+@FacesRenderer(componentFamily = "javax.faces.Input", rendererType = "at.irian.JavaTestRenderer")
 public class JavaTestRenderer1 extends Renderer {
 
     static Logger log = Logger.getLogger(JavaTestRenderer1.class.getName());

Modified: myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/componentTest/JavaTestRenderer2.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/componentTest/JavaTestRenderer2.java?rev=1414709&r1=1414708&r2=1414709&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/componentTest/JavaTestRenderer2.java
(original)
+++ myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/componentTest/JavaTestRenderer2.java
Wed Nov 28 14:13:41 2012
@@ -34,10 +34,10 @@ import java.io.IOException;
  *          This renderer can act as a drag and drop target for the annotation
  *          set in JavaTestRenderer1
  */
-@FacesRenderer(componentFamily = "javax.faces.Input", rendererType = "at.irian.JavaTestRenderer")
+
 public class JavaTestRenderer2 extends Renderer {
 
-    private static final String MSG = "<h2> Hello world ccc from Renderer 2 </h2>";
+    private static final String MSG = "<h2> Hello world ccc from Renderer 2</h2>";
     private static final String MSG2 = "<h3> hello world second var <h3>";
 
 

Modified: myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-extscript-helloworld/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-extscript-helloworld/src/main/webapp/WEB-INF/web.xml?rev=1414709&r1=1414708&r2=1414709&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-extscript-helloworld/src/main/webapp/WEB-INF/web.xml
(original)
+++ myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-extscript-helloworld/src/main/webapp/WEB-INF/web.xml
Wed Nov 28 14:13:41 2012
@@ -129,11 +129,6 @@
         <param-value>org.apache.myfaces.groovyloader.blog</param-value>
     </context-param>
     -->
-    <!--
-    <listener>
-        <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
-    </listener>
-    -->
     <context-param>
         <param-name>javax.faces.PROJECT_STAGE</param-name>
         <param-value>Development</param-value>
@@ -149,17 +144,6 @@
     </context-param>
 
 
-    <!--
-    Note, this servlet filter is vital without it Ext-Scripting will not work,
-    if you do not set it you will get an appropriate warning in the command line
-    -->
-
-    <!-- Listener, to allow Jetty serving MyFaces apps -->
-    <!--
-    <listener>
-        <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
-    </listener>
-    -->
     <!-- Faces Servlet -->
     <servlet>
         <servlet-name>Faces Servlet</servlet-name>



Mime
View raw message