You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by we...@apache.org on 2009/08/17 19:52:34 UTC

svn commit: r805073 [2/4] - in /myfaces/extensions/scripting/trunk: ./ core/ core/src/ core/src/main/ core/src/main/groovy/ core/src/main/groovy/org/ core/src/main/groovy/org/apache/ core/src/main/groovy/org/apache/myfaces/ core/src/main/groovy/org/apa...

Added: myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/factories/ScriptingApplicationFactory.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/factories/ScriptingApplicationFactory.java?rev=805073&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/factories/ScriptingApplicationFactory.java (added)
+++ myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/factories/ScriptingApplicationFactory.java Mon Aug 17 17:52:31 2009
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.scripting.jsf.dynamicdecorators.factories;
+
+import org.apache.myfaces.scripting.jsf.dynamicdecorators.implemetations.ApplicationProxy;
+import org.apache.myfaces.scripting.api.Decorated;
+import org.apache.myfaces.scripting.core.util.ProxyUtils;
+
+import javax.faces.application.ApplicationFactory;
+import javax.faces.application.Application;
+
+
+/**
+ * Application factory which introduces
+ * scripting proxies for their artefacts
+ *
+ * Not we use a mix of AOP and helper constructs
+ * to reach the goal to be dynamic.
+ * For most artefacts we just need to
+ * check if the object is a groovy object
+ * and then reload at their connection interfaces
+ *
+ * some artefacts have a longer lifespan and/or are stateless
+ * for those we have to work with reloading AOP 
+ *
+ *
+ * @author Werner Punz
+ */
+public class ScriptingApplicationFactory extends ApplicationFactory implements Decorated {
+
+    ApplicationFactory _delegate;
+    boolean scriptingEnabled = false;
+
+    public ScriptingApplicationFactory(ApplicationFactory delegate) {
+        _delegate = delegate;
+        scriptingEnabled = ProxyUtils.isScriptingEnabled();
+    }
+
+    public Application getApplication() {
+        Application retVal = _delegate.getApplication();  //To change body of implemented methods use File | Settings | File Templates.
+
+        
+        if (scriptingEnabled && !(retVal instanceof ApplicationProxy) )
+            retVal = new ApplicationProxy(retVal);
+
+        return retVal;
+    }
+
+    public void setApplication(Application application) {
+        if (scriptingEnabled && !(application instanceof ApplicationProxy))
+            application = new ApplicationProxy(application);
+
+        _delegate.setApplication(application);
+    }
+
+    public Object getDelegate() {
+        return _delegate;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+}

Propchange: myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/factories/ScriptingApplicationFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/factories/ScriptingApplicationFactory.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Added: myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/factories/ScriptingFacesContextFactory.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/factories/ScriptingFacesContextFactory.java?rev=805073&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/factories/ScriptingFacesContextFactory.java (added)
+++ myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/factories/ScriptingFacesContextFactory.java Mon Aug 17 17:52:31 2009
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.scripting.jsf.dynamicdecorators.factories;
+
+import org.apache.myfaces.scripting.jsf.dynamicdecorators.implemetations.FacesContextProxy;
+import org.apache.myfaces.scripting.api.Decorated;
+import org.apache.myfaces.scripting.core.util.ProxyUtils;
+
+import javax.faces.context.FacesContext;
+import javax.faces.context.FacesContextFactory;
+import javax.faces.lifecycle.Lifecycle;
+import javax.faces.FacesException;
+
+/**
+ * Faces context weaver which builds
+ * our reloading proxy around the current faces context
+ *
+ * @author Werner Punz
+ */
+public class ScriptingFacesContextFactory extends javax.faces.context.FacesContextFactory implements Decorated {
+
+    public FacesContextFactory _delegate;
+    boolean scriptingEnabled = false;
+
+    public ScriptingFacesContextFactory(FacesContextFactory delegate) {
+        _delegate = delegate;
+        scriptingEnabled = ProxyUtils.isScriptingEnabled();
+    }
+
+    public void setDelegate(FacesContextFactory delegate) {
+        _delegate = delegate;
+    }
+
+    public FacesContext getFacesContext(Object o, Object o1, Object o2, Lifecycle lifecycle) throws FacesException {
+        FacesContext retVal = _delegate.getFacesContext(o, o1, o2, lifecycle);  //To change body of implemented methods use File | Settings | File Templates.
+        //TODO check if we weave thise around our original
+        //faces context to bypass our groovy dynamic reflection problems
+        if (scriptingEnabled && !(retVal instanceof FacesContextProxy))
+            return new FacesContextProxy(retVal);
+        return retVal;
+    }
+
+    public Object getDelegate() {
+        return _delegate;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+}

Propchange: myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/factories/ScriptingFacesContextFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/factories/ScriptingFacesContextFactory.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Added: myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/factories/ScriptingLifecycleFactory.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/factories/ScriptingLifecycleFactory.java?rev=805073&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/factories/ScriptingLifecycleFactory.java (added)
+++ myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/factories/ScriptingLifecycleFactory.java Mon Aug 17 17:52:31 2009
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.scripting.jsf.dynamicdecorators.factories;
+
+import org.apache.myfaces.scripting.jsf.dynamicdecorators.implemetations.LifefcycleProxy;
+import org.apache.myfaces.scripting.api.Decorated;
+import org.apache.myfaces.scripting.core.util.ProxyUtils;
+
+import javax.faces.lifecycle.LifecycleFactory;
+import javax.faces.lifecycle.Lifecycle;
+import java.util.Iterator;
+
+/**
+ * Lifecyclefactory which introduces scripting proxies
+ * for their artefacts
+ *
+ * @author Werner Punz
+ */
+public class ScriptingLifecycleFactory extends LifecycleFactory implements Decorated {
+
+    LifecycleFactory _delegate;
+    boolean scriptingEnabled = false;
+
+
+    public ScriptingLifecycleFactory(LifecycleFactory delegate) {
+        _delegate = delegate;
+        scriptingEnabled = ProxyUtils.isScriptingEnabled();
+    }
+
+    public void addLifecycle(String s, Lifecycle lifecycle) {
+        if (scriptingEnabled && !(lifecycle instanceof LifefcycleProxy))
+            lifecycle = new LifefcycleProxy(lifecycle);
+        _delegate.addLifecycle(s, lifecycle);
+    }
+
+    public Lifecycle getLifecycle(String s) {
+        Lifecycle retVal = _delegate.getLifecycle(s);
+        if (scriptingEnabled && !(retVal instanceof LifefcycleProxy))
+            retVal = new LifefcycleProxy(retVal);
+
+        return retVal;
+    }
+
+    public Iterator getLifecycleIds() {
+        return _delegate.getLifecycleIds();
+    }
+
+    public void setDelegate(LifecycleFactory delegate) {
+        this._delegate = delegate;
+    }
+
+    public Object getDelegate() {
+        return _delegate;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+}

Propchange: myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/factories/ScriptingLifecycleFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/factories/ScriptingLifecycleFactory.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Added: myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/factories/ScriptingRenderkitFactory.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/factories/ScriptingRenderkitFactory.java?rev=805073&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/factories/ScriptingRenderkitFactory.java (added)
+++ myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/factories/ScriptingRenderkitFactory.java Mon Aug 17 17:52:31 2009
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.scripting.jsf.dynamicdecorators.factories;
+
+import org.apache.myfaces.scripting.api.Decorated;
+import org.apache.myfaces.scripting.core.util.ProxyUtils;
+import org.apache.myfaces.scripting.jsf.dynamicdecorators.implemetations.RenderkitProxy;
+
+import javax.faces.render.RenderKitFactory;
+import javax.faces.render.RenderKit;
+import javax.faces.context.FacesContext;
+import java.util.Iterator;
+
+/**
+ * Scripting enabled renderkit factory
+ *
+ * @author Werner Punz
+ */
+public class ScriptingRenderkitFactory extends RenderKitFactory implements Decorated {
+
+    boolean scriptingEnabled = false;
+
+    public ScriptingRenderkitFactory(RenderKitFactory delegate) {
+        _delegate = delegate;
+        scriptingEnabled = ProxyUtils.isScriptingEnabled();
+    }
+
+    public void addRenderKit(String s, RenderKit renderKit) {
+        if (renderKit != null && !(renderKit instanceof RenderkitProxy))
+            renderKit = new RenderkitProxy(renderKit);
+
+        _delegate.addRenderKit(s, renderKit);
+    }
+
+    public RenderKit getRenderKit(FacesContext facesContext, String s) {
+        RenderKit retVal = _delegate.getRenderKit(facesContext, s);
+        if (retVal != null && !(retVal instanceof RenderkitProxy))
+            retVal = new RenderkitProxy(retVal);
+        return retVal;
+    }
+
+    public Iterator getRenderKitIds() {
+        return _delegate.getRenderKitIds();
+    }
+
+
+    public void setDelegate(RenderKitFactory delegate) {
+        _delegate = delegate;
+    }
+
+    RenderKitFactory _delegate = null;
+
+    public Object getDelegate() {
+        return _delegate;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+}

Propchange: myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/factories/ScriptingRenderkitFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/factories/ScriptingRenderkitFactory.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Added: myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/implemetations/ApplicationProxy.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/implemetations/ApplicationProxy.java?rev=805073&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/implemetations/ApplicationProxy.java (added)
+++ myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/implemetations/ApplicationProxy.java Mon Aug 17 17:52:31 2009
@@ -0,0 +1,417 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.scripting.jsf.dynamicdecorators.implemetations;
+
+import org.apache.myfaces.scripting.core.util.DynamicClassIdentifier;
+import org.apache.myfaces.scripting.api.Decorated;
+import org.apache.myfaces.scripting.core.util.ProxyUtils;
+import org.apache.myfaces.scripting.jsf.ScriptingConst;
+
+import javax.el.*;
+import javax.faces.FacesException;
+import javax.faces.application.Application;
+import javax.faces.application.NavigationHandler;
+import javax.faces.application.StateManager;
+import javax.faces.application.ViewHandler;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+import javax.faces.el.*;
+import javax.faces.event.ActionListener;
+import javax.faces.validator.Validator;
+import javax.servlet.ServletRequest;
+import java.lang.reflect.Proxy;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.Locale;
+import java.util.ResourceBundle;
+
+/**
+ * our decorating applicstion
+ * which should resolve our bean issues within a central
+ * bean processing interceptor
+ *
+ * @author Werner Punz
+ */
+public class ApplicationProxy extends Application implements Decorated {
+
+    Application _delegate = null;
+
+    private boolean alreadyWovenInRequest(String clazz) {
+        //todo also enable portlets here
+        ServletRequest req = (ServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
+        if (req.getAttribute(ScriptingConst.SCRIPTING_REQUSINGLETON + clazz) == null) {
+            req.setAttribute(ScriptingConst.SCRIPTING_REQUSINGLETON + clazz, "");
+            return false;
+        }
+        return false;
+    }
+
+    //TODO add a proxy for the el resolvers as well
+
+    public void addELResolver(ELResolver elResolver) {
+        weaveDelegate();
+        if (!(elResolver instanceof ELResolverProxy))
+            elResolver = new ELResolverProxy(elResolver);
+        _delegate.addELResolver(elResolver);
+    }
+
+    private void weaveDelegate() {
+        if (_delegate != null) {
+            _delegate = (Application) ProxyUtils.getWeaver().reloadScriptingInstance(_delegate);
+        }    
+    }
+
+    public ELResolver getELResolver() {
+        weaveDelegate();
+        ELResolver retVal = _delegate.getELResolver();
+        if (!(retVal instanceof ELResolverProxy))
+            retVal = new ELResolverProxy(retVal);
+        return retVal;
+
+    }
+
+    //TOD add a weaving for resource bundles
+    public ResourceBundle getResourceBundle(FacesContext facesContext, String s) throws FacesException, NullPointerException {
+        weaveDelegate();
+        return _delegate.getResourceBundle(facesContext, s);
+    }
+
+    public UIComponent createComponent(ValueExpression valueExpression, FacesContext facesContext, String s) throws FacesException, NullPointerException {
+        weaveDelegate();
+        System.out.println("create1");
+        UIComponent component = _delegate.createComponent(valueExpression, facesContext, s);
+
+        /*we are reweaving on the fly because we cannot be sure if
+         * the class is not recycled all the time in the creation
+         * code, in the renderer we do it on method base
+         * due to the fact that our renderers are recycled via
+         * a flyweight pattern
+         *
+         *
+         * Also we cannot proxy here because there is no UIComponent interface
+         * maybe in the long run we can make a decorator here instead
+         * but for now lets try it this way
+         */
+        if (DynamicClassIdentifier.isDynamic(component.getClass()) && !alreadyWovenInRequest(component.toString())) {
+            /*once it was tainted we have to recreate all the time*/
+            component = (UIComponent) ProxyUtils.getWeaver().reloadScriptingInstance(component);
+            alreadyWovenInRequest(component.toString());
+        }
+        return component;
+
+    }
+
+    public ExpressionFactory getExpressionFactory() {
+        weaveDelegate();
+        return _delegate.getExpressionFactory();
+    }
+
+    public void addELContextListener(ELContextListener elContextListener) {
+        weaveDelegate();
+        if (DynamicClassIdentifier.isDynamic(elContextListener.getClass()))
+            elContextListener = (ELContextListener) ProxyUtils.createMethodReloadingProxyFromObject(elContextListener, ELContextListener.class);
+        _delegate.addELContextListener(elContextListener);
+    }
+
+    public void removeELContextListener(ELContextListener elContextListener) {
+        //TODO which el context listener is coming in our normal one
+        //or the reloaded one?
+        weaveDelegate();
+        _delegate.removeELContextListener(elContextListener);
+    }
+
+    public ELContextListener[] getELContextListeners() {
+        weaveDelegate();
+        return _delegate.getELContextListeners();
+    }
+
+    public Object evaluateExpressionGet(FacesContext facesContext, String s, Class aClass) throws ELException {
+        weaveDelegate();
+        //good place for a dynamic reloading check as well
+        Object retVal = _delegate.evaluateExpressionGet(facesContext, s, aClass);
+        if (DynamicClassIdentifier.isDynamic(retVal.getClass()))
+            retVal = ProxyUtils.getWeaver().reloadScriptingInstance(retVal);
+        return retVal;
+    }
+
+    public ActionListener getActionListener() {
+        weaveDelegate();
+        ActionListener retVal = _delegate.getActionListener();
+        if (DynamicClassIdentifier.isDynamic(retVal.getClass()))
+            retVal = (ActionListener) ProxyUtils.createMethodReloadingProxyFromObject(retVal, ActionListener.class);
+        return retVal;
+    }
+
+    public void setActionListener(ActionListener actionListener) {
+        weaveDelegate();
+        if (DynamicClassIdentifier.isDynamic(actionListener.getClass()))
+            actionListener = (ActionListener) ProxyUtils.createMethodReloadingProxyFromObject(actionListener, ActionListener.class);
+        _delegate.setActionListener(actionListener);
+    }
+
+    public Locale getDefaultLocale() {
+        weaveDelegate();
+        return _delegate.getDefaultLocale();
+    }
+
+    public void setDefaultLocale(Locale locale) {
+        weaveDelegate();
+        _delegate.setDefaultLocale(locale);
+    }
+
+    public String getDefaultRenderKitId() {
+        weaveDelegate();
+        return _delegate.getDefaultRenderKitId();
+    }
+
+    public void setDefaultRenderKitId(String s) {
+        weaveDelegate();
+        _delegate.setDefaultRenderKitId(s);
+    }
+
+    public String getMessageBundle() {
+        weaveDelegate();
+        return _delegate.getMessageBundle();
+    }
+
+    public void setMessageBundle(String s) {
+        weaveDelegate();
+        _delegate.setMessageBundle(s);
+    }
+
+    public NavigationHandler getNavigationHandler() {
+        weaveDelegate();
+        //defined in the setter to speed things up a little
+        NavigationHandler retVal = _delegate.getNavigationHandler();
+        if (retVal != null && DynamicClassIdentifier.isDynamic(retVal.getClass()))
+            retVal = new NavigationHandlerProxy(retVal);
+        return retVal;
+    }
+
+    public void setNavigationHandler(NavigationHandler navigationHandler) {
+        weaveDelegate();
+        if (navigationHandler != null && DynamicClassIdentifier.isDynamic(navigationHandler.getClass()))
+            navigationHandler = new NavigationHandlerProxy(navigationHandler);
+        _delegate.setNavigationHandler(navigationHandler);
+    }
+
+    public PropertyResolver getPropertyResolver() {
+        weaveDelegate();
+        return _delegate.getPropertyResolver();
+    }
+
+    public void setPropertyResolver(PropertyResolver propertyResolver) {
+        weaveDelegate();
+        _delegate.setPropertyResolver(propertyResolver);
+    }
+
+    public VariableResolver getVariableResolver() {
+        weaveDelegate();
+        VariableResolver variableResolver = _delegate.getVariableResolver();
+        if (!(variableResolver instanceof VariableResolverProxy))
+            variableResolver = new VariableResolverProxy(variableResolver);
+        return variableResolver;
+    }
+
+    public void setVariableResolver(VariableResolver variableResolver) {
+        weaveDelegate();
+        if (!(variableResolver instanceof VariableResolverProxy))
+            variableResolver = new VariableResolverProxy(variableResolver);
+
+        _delegate.setVariableResolver(variableResolver);
+    }
+
+    public ViewHandler getViewHandler() {
+        weaveDelegate();
+        ViewHandler handler = _delegate.getViewHandler();
+
+        /*
+        We proxy here to emable dynamic reloading for
+        methods in the long run, as soon as we hit
+        java all our groovy reloading code is lost
+        hence we have to work with proxies here
+        */
+        if (DynamicClassIdentifier.isDynamic(handler.getClass()))
+            handler = (ViewHandlerProxy) new ViewHandlerProxy(handler);
+        return handler;
+    }
+
+    public void setViewHandler(ViewHandler viewHandler) {
+        weaveDelegate();
+        /*make sure you have the delegates as well in properties*/
+        if (DynamicClassIdentifier.isDynamic(viewHandler.getClass()))
+            viewHandler = (ViewHandlerProxy) new ViewHandlerProxy(viewHandler);
+
+        _delegate.setViewHandler(viewHandler);
+    }
+
+    public StateManager getStateManager() {
+        weaveDelegate();
+        return _delegate.getStateManager();
+    }
+
+    public void setStateManager(StateManager stateManager) {
+        weaveDelegate();
+        _delegate.setStateManager(stateManager);
+    }
+
+    public void addComponent(String s, String s1) {
+        weaveDelegate();
+        _delegate.addComponent(s, s1);
+    }
+
+    public UIComponent createComponent(String s) throws FacesException {
+        weaveDelegate();
+        //the components are generated anew very often
+        //we cannot do an on object weaving here
+        UIComponent component = _delegate.createComponent(s);
+
+        /*we are reweaving on the fly because we cannot be sure if
+        * the class is not recycled all the time in the creation
+        * code, in the renderer we do it on method base
+        * due to the fact that our renderers are recycled via
+        * a flyweight pattern*/
+        if (DynamicClassIdentifier.isDynamic(component.getClass()) && !alreadyWovenInRequest(component.toString())) {
+            /*once it was tainted we have to recreate all the time*/
+            component = (UIComponent) ProxyUtils.getWeaver().reloadScriptingInstance(component);
+            alreadyWovenInRequest(component.toString());
+        }
+        return component;
+    }
+
+    public UIComponent createComponent(ValueBinding valueBinding, FacesContext facesContext, String s) throws FacesException {
+        weaveDelegate();
+        UIComponent component = _delegate.createComponent(valueBinding, facesContext, s);
+
+        /*we are reweaving on the fly because we cannot be sure if
+     * the class is not recycled all the time in the creation
+     * code, in the renderer we do it on method base
+     * due to the fact that our renderers are recycled via
+     * a flyweight pattern*/
+        if (DynamicClassIdentifier.isDynamic(component.getClass()) && !alreadyWovenInRequest(component.toString())) {
+            /*once it was tainted we have to recreate all the time*/
+            component = (UIComponent) ProxyUtils.getWeaver().reloadScriptingInstance(component);
+            alreadyWovenInRequest(component.toString());
+        }
+        return component;
+    }
+
+    public Iterator<String> getComponentTypes() {
+        weaveDelegate();
+        return _delegate.getComponentTypes();
+    }
+
+    public void addConverter(String s, String s1) {
+        weaveDelegate();
+        _delegate.addConverter(s, s1);
+    }
+
+    public void addConverter(Class aClass, String s) {
+        weaveDelegate();
+        _delegate.addConverter(aClass, s);
+    }
+
+    public Converter createConverter(String s) {
+        weaveDelegate();
+        Converter retVal = _delegate.createConverter(s);
+        /**
+         * since createConverter is called only once
+         * we have to work with method reloading proxies
+         * we cannot use this technique extensively for speed reasons
+         * most of the time it is fine just to work with
+         *
+         * reloading objects at their interception points
+         */
+        if (DynamicClassIdentifier.isDynamic(retVal.getClass())) {
+            retVal = (Converter) ProxyUtils.createMethodReloadingProxyFromObject(retVal, Converter.class);
+
+        }
+
+        return retVal;
+    }
+
+    public Converter createConverter(Class aClass) {
+        weaveDelegate();
+        Converter retVal = _delegate.createConverter(aClass);
+        if (retVal != null && DynamicClassIdentifier.isDynamic(retVal.getClass())) {
+            retVal = (Converter) ProxyUtils.createMethodReloadingProxyFromObject(retVal, Converter.class);
+        }
+
+        return retVal;
+    }
+
+    public Iterator<String> getConverterIds() {
+        weaveDelegate();
+        return _delegate.getConverterIds();
+    }
+
+    public Iterator<Class> getConverterTypes() {
+        weaveDelegate();
+        return _delegate.getConverterTypes();
+    }
+
+    public MethodBinding createMethodBinding(String s, Class[] classes) throws ReferenceSyntaxException {
+        weaveDelegate();
+        return _delegate.createMethodBinding(s, classes);
+    }
+
+    public Iterator<Locale> getSupportedLocales() {
+        weaveDelegate();
+        return _delegate.getSupportedLocales();
+    }
+
+    public void setSupportedLocales(Collection<Locale> locales) {
+        weaveDelegate();
+        _delegate.setSupportedLocales(locales);
+    }
+
+    public void addValidator(String s, String s1) {
+        weaveDelegate();
+        _delegate.addValidator(s, s1);
+    }
+
+    public Validator createValidator(String s) throws FacesException {
+        weaveDelegate();
+        Validator retVal = _delegate.createValidator(s);
+        if (DynamicClassIdentifier.isDynamic(retVal.getClass()) && !Proxy.isProxyClass(retVal.getClass())) {
+            retVal = (Validator) ProxyUtils.createMethodReloadingProxyFromObject(retVal, Validator.class);
+        }
+        return retVal;
+    }
+
+    public Iterator<String> getValidatorIds() {
+        weaveDelegate();
+        return _delegate.getValidatorIds();
+    }
+
+    public ValueBinding createValueBinding(String s) throws ReferenceSyntaxException {
+        weaveDelegate();
+        return _delegate.createValueBinding(s);
+    }
+
+    public ApplicationProxy(Application delegate) {
+        _delegate = delegate;
+    }
+
+
+    public Object getDelegate() {
+        return _delegate;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+}

Propchange: myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/implemetations/ApplicationProxy.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/implemetations/ApplicationProxy.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Added: myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/implemetations/ELResolverProxy.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/implemetations/ELResolverProxy.java?rev=805073&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/implemetations/ELResolverProxy.java (added)
+++ myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/implemetations/ELResolverProxy.java Mon Aug 17 17:52:31 2009
@@ -0,0 +1,91 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.scripting.jsf.dynamicdecorators.implemetations;
+
+import org.apache.myfaces.scripting.core.util.DynamicClassIdentifier;
+import org.apache.myfaces.scripting.api.Decorated;
+import org.apache.myfaces.scripting.core.util.ProxyUtils;
+
+import javax.el.*;
+
+import java.util.Iterator;
+import java.beans.FeatureDescriptor;
+
+/**
+ * EL Resolver which is scripting enabled
+ *
+ * @author Werner Punz
+ */
+public class ELResolverProxy extends ELResolver implements Decorated {
+
+
+    
+    //Map reinstantiated = new HashMap();
+
+
+    public Object getValue(ELContext elContext, Object o, Object o1) throws NullPointerException, PropertyNotFoundException, ELException {
+        Object retVal = _delegate.getValue(elContext, o, o1);
+        if (retVal != null && DynamicClassIdentifier.isDynamic(retVal.getClass())) {
+            Object newRetVal = ProxyUtils.getWeaver().reloadScriptingInstance(retVal); /*once it was tainted or loaded by
+                 our classloader we have to recreate all the time to avoid classloader issues*/
+            if(newRetVal != retVal) {
+                _delegate.setValue(elContext, o, o1, newRetVal);
+            }
+            return newRetVal;
+            //reinstantiated.put(retVal.getClass().getName(), retVal.getClass());
+        }
+
+        return retVal;
+
+    }
+
+    public Class<?> getType(ELContext elContext, Object o, Object o1) throws NullPointerException, PropertyNotFoundException, ELException {
+        Class<?> retVal = _delegate.getType(elContext, o, o1);
+        if (retVal != null && DynamicClassIdentifier.isDynamic((Class)retVal)) {
+            return ProxyUtils.getWeaver().reloadScriptingClass((Class)retVal);
+        }
+        return retVal;
+    }
+
+    public void setValue(ELContext elContext, Object o, Object o1, Object o2) throws NullPointerException, PropertyNotFoundException, PropertyNotWritableException, ELException {
+        _delegate.setValue(elContext, o, o1, o2);
+    }
+
+    public boolean isReadOnly(ELContext elContext, Object o, Object o1) throws NullPointerException, PropertyNotFoundException, ELException {
+        return _delegate.isReadOnly(elContext, o, o1);
+    }
+
+    public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext elContext, Object o) {
+        return _delegate.getFeatureDescriptors(elContext, o);
+    }
+
+    public Class<?> getCommonPropertyType(ELContext elContext, Object o) {
+        return _delegate.getCommonPropertyType(elContext, o);
+    }
+
+    public ELResolverProxy(ELResolver delegate) {
+        _delegate = delegate;
+    }
+
+    ELResolver _delegate = null;
+
+    public Object getDelegate() {
+        return _delegate;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+}

Propchange: myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/implemetations/ELResolverProxy.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/implemetations/ELResolverProxy.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Added: myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/implemetations/FacesContextProxy.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/implemetations/FacesContextProxy.java?rev=805073&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/implemetations/FacesContextProxy.java (added)
+++ myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/implemetations/FacesContextProxy.java Mon Aug 17 17:52:31 2009
@@ -0,0 +1,139 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.scripting.jsf.dynamicdecorators.implemetations;
+
+import org.apache.myfaces.scripting.api.Decorated;
+
+import javax.faces.context.FacesContext;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.ResponseStream;
+import javax.faces.context.ResponseWriter;
+import javax.faces.application.Application;
+import javax.faces.application.FacesMessage;
+import javax.faces.render.RenderKit;
+import javax.faces.component.UIViewRoot;
+import javax.el.ELContext;
+import java.util.Iterator;
+
+/**
+ * A reloading, weaving  faces context
+ * this is needed because groovy fails on
+ * the introspection of the standard java myfaces
+ * faces context due to pending references
+ * of the _impl into the portlet context
+ * not sure if this works in portlets
+ * though
+ *
+ * @author Werner Punz
+ */
+public class FacesContextProxy extends FacesContext implements Decorated {
+
+    public FacesContext _delegate = null;
+
+
+
+    public ELContext getELContext() {
+        return _delegate.getELContext();
+    }
+
+    public Application getApplication() {
+        return _delegate.getApplication();
+    }
+
+    public Iterator<String> getClientIdsWithMessages() {
+        return _delegate.getClientIdsWithMessages();
+    }
+
+    public ExternalContext getExternalContext() {
+        return _delegate.getExternalContext();
+    }
+
+    public FacesMessage.Severity getMaximumSeverity() {
+        return _delegate.getMaximumSeverity();
+    }
+
+    public Iterator<FacesMessage> getMessages() {
+        return _delegate.getMessages();
+    }
+
+    public Iterator<FacesMessage> getMessages(String s) {
+        return _delegate.getMessages(s);
+    }
+
+    public RenderKit getRenderKit() {
+        return _delegate.getRenderKit();
+    }
+
+    public boolean getRenderResponse() {
+        return _delegate.getRenderResponse();
+    }
+
+    public boolean getResponseComplete() {
+        return _delegate.getResponseComplete();
+    }
+
+    public ResponseStream getResponseStream() {
+        return _delegate.getResponseStream();
+    }
+
+    public void setResponseStream(ResponseStream responseStream) {
+        _delegate.setResponseStream(responseStream);
+    }
+
+    public ResponseWriter getResponseWriter() {
+        return _delegate.getResponseWriter();
+    }
+
+    public void setResponseWriter(ResponseWriter responseWriter) {
+        _delegate.setResponseWriter(responseWriter);
+    }
+
+    public UIViewRoot getViewRoot() {
+        return _delegate.getViewRoot();
+    }
+
+    public void setViewRoot(UIViewRoot uiViewRoot) {
+        _delegate.setViewRoot(uiViewRoot);
+    }
+
+    public void addMessage(String s, FacesMessage facesMessage) {
+        _delegate.addMessage(s, facesMessage);
+    }
+
+    public void release() {
+        _delegate.release();
+    }
+
+    public void renderResponse() {
+        _delegate.renderResponse();
+    }
+
+    public void responseComplete() {
+        _delegate.responseComplete();
+    }
+
+
+    public FacesContextProxy(FacesContext delegate) {
+        _delegate = delegate;
+    }
+
+    public Object getDelegate() {
+        return _delegate;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+}

Propchange: myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/implemetations/FacesContextProxy.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/implemetations/FacesContextProxy.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Added: myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/implemetations/LifefcycleProxy.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/implemetations/LifefcycleProxy.java?rev=805073&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/implemetations/LifefcycleProxy.java (added)
+++ myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/implemetations/LifefcycleProxy.java Mon Aug 17 17:52:31 2009
@@ -0,0 +1,83 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.scripting.jsf.dynamicdecorators.implemetations;
+
+import org.apache.myfaces.scripting.core.util.DynamicClassIdentifier;
+import org.apache.myfaces.scripting.api.Decorated;
+import org.apache.myfaces.scripting.core.util.ProxyUtils;
+
+import javax.faces.lifecycle.Lifecycle;
+import javax.faces.event.PhaseListener;
+import javax.faces.context.FacesContext;
+import javax.faces.FacesException;
+
+/**
+ * Scripting enabled lifecycle
+ *
+ * @author Werner Punz
+ */
+public class LifefcycleProxy extends Lifecycle implements Decorated {
+
+ //   GroovyWeaver ProxyUtils.getWeaver() =  ProxyUtils.getWeaver();
+
+    private void weaveDelegate() {
+        if(_delegate != null)
+            _delegate = (Lifecycle) ProxyUtils.getWeaver().reloadScriptingInstance(_delegate);
+    }
+
+
+    public LifefcycleProxy(Lifecycle delegate) {
+        _delegate = delegate;
+    }
+
+    public void addPhaseListener(PhaseListener phaseListener) {
+        weaveDelegate();
+        /*we can put our object weaving code into the add here*/
+        if (DynamicClassIdentifier.isDynamic(phaseListener.getClass()))
+            phaseListener = (PhaseListener)  ProxyUtils.createMethodReloadingProxyFromObject(phaseListener, PhaseListener.class);
+
+        _delegate.addPhaseListener(phaseListener);
+    }
+
+    public void execute(FacesContext facesContext) throws FacesException {
+        weaveDelegate();
+        _delegate.execute(facesContext);
+    }
+
+    public PhaseListener[] getPhaseListeners() {
+        weaveDelegate();
+        return _delegate.getPhaseListeners();
+    }
+
+    public void removePhaseListener(PhaseListener phaseListener) {
+        weaveDelegate();
+        _delegate.removePhaseListener(phaseListener);
+    }
+
+    public void render(FacesContext facesContext) throws FacesException {
+        weaveDelegate();
+        _delegate.render(facesContext);
+    }
+
+    Lifecycle _delegate = null;
+
+    public Object getDelegate() {
+        return _delegate;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+}

Propchange: myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/implemetations/LifefcycleProxy.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/implemetations/LifefcycleProxy.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Added: myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/implemetations/NavigationHandlerProxy.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/implemetations/NavigationHandlerProxy.java?rev=805073&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/implemetations/NavigationHandlerProxy.java (added)
+++ myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/implemetations/NavigationHandlerProxy.java Mon Aug 17 17:52:31 2009
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.scripting.jsf.dynamicdecorators.implemetations;
+
+import org.apache.myfaces.scripting.api.Decorated;
+import org.apache.myfaces.scripting.core.util.ProxyUtils;
+
+import javax.faces.application.NavigationHandler;
+import javax.faces.context.FacesContext;
+
+/**
+ * A reloading navigation handler
+ *
+ * @author Werner Punz
+ */
+public class NavigationHandlerProxy extends NavigationHandler implements Decorated {
+
+
+    
+
+    private void weaveDelegate() {
+        _delegate = (NavigationHandler) ProxyUtils.getWeaver().reloadScriptingInstance(_delegate);
+    }
+
+    public NavigationHandlerProxy(NavigationHandler delegate) {
+        super();
+        _delegate = delegate;
+    }
+
+    public void handleNavigation(FacesContext facesContext, String s, String s1) {
+        weaveDelegate();
+        _delegate.handleNavigation(facesContext, s, s1);
+    }
+
+    NavigationHandler _delegate;
+
+    public Object getDelegate() {
+        return _delegate;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+}

Propchange: myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/implemetations/NavigationHandlerProxy.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/implemetations/NavigationHandlerProxy.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Added: myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/implemetations/RenderkitProxy.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/implemetations/RenderkitProxy.java?rev=805073&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/implemetations/RenderkitProxy.java (added)
+++ myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/implemetations/RenderkitProxy.java Mon Aug 17 17:52:31 2009
@@ -0,0 +1,108 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.scripting.jsf.dynamicdecorators.implemetations;
+
+import org.apache.myfaces.scripting.core.util.DynamicClassIdentifier;
+import org.apache.myfaces.scripting.api.Decorated;
+import org.apache.myfaces.scripting.core.util.ProxyUtils;
+import org.apache.myfaces.scripting.jsf.ScriptingConst;
+
+import javax.faces.context.FacesContext;
+import javax.faces.render.RenderKit;
+import javax.faces.render.Renderer;
+import javax.faces.render.ResponseStateManager;
+import javax.faces.context.ResponseWriter;
+import javax.faces.context.ResponseStream;
+import java.io.Writer;
+import java.io.OutputStream;
+import javax.servlet.ServletRequest;
+
+/**
+ * Weaving renderkit which
+ * acts as a proxy factory for
+ * our internal reloading renerers
+ *
+ * @author Werner Punz
+ */
+public class RenderkitProxy extends RenderKit implements Decorated {
+
+
+
+    private void weaveDelegate() {
+        _delegate = (RenderKit) ProxyUtils.getWeaver().reloadScriptingInstance(_delegate);
+    }
+
+    private boolean alreadyWovenInRequest(String clazz) {
+        //todo also enable portlets here
+       ServletRequest req = (ServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
+        if(req.getAttribute(ScriptingConst.SCRIPTING_REQUSINGLETON+clazz) == null) {
+            req.setAttribute(ScriptingConst.SCRIPTING_REQUSINGLETON+clazz,"");
+            return false;
+        }
+        return true;
+    }
+
+    RenderKit _delegate = null;
+
+
+    public RenderkitProxy(RenderKit delegate) {
+        _delegate = delegate;
+    }
+
+    public void addRenderer(String s, String s1, Renderer renderer) {
+        weaveDelegate();
+        if(DynamicClassIdentifier.isDynamic(renderer.getClass()) && !alreadyWovenInRequest(renderer.toString())) {
+            renderer = (Renderer) ProxyUtils.getWeaver().reloadScriptingInstance(renderer);
+            alreadyWovenInRequest(renderer.toString());
+        }
+
+        _delegate.addRenderer(s, s1, renderer);
+    }
+
+    public Renderer getRenderer(String s, String s1) {
+        weaveDelegate();
+        Renderer retVal = _delegate.getRenderer(s, s1);
+
+        if (retVal != null && DynamicClassIdentifier.isDynamic(retVal.getClass())&& !alreadyWovenInRequest(retVal.toString())) {
+            retVal = (Renderer) ProxyUtils.getWeaver().reloadScriptingInstance(retVal);
+            alreadyWovenInRequest(retVal.toString());
+            _delegate.addRenderer(s,s1,retVal);
+        }
+        return retVal;
+    }
+
+    public ResponseStateManager getResponseStateManager() {
+        weaveDelegate();
+        return _delegate.getResponseStateManager();
+    }
+
+    public ResponseWriter createResponseWriter(Writer writer, String s, String s1) {
+        weaveDelegate();
+        return _delegate.createResponseWriter(writer, s, s1);
+    }
+
+    public ResponseStream createResponseStream(OutputStream outputStream) {
+        weaveDelegate();
+        return _delegate.createResponseStream(outputStream);
+    }
+
+    public Object getDelegate() {
+        return _delegate;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+}

Propchange: myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/implemetations/RenderkitProxy.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/implemetations/RenderkitProxy.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Added: myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/implemetations/VariableResolverProxy.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/implemetations/VariableResolverProxy.java?rev=805073&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/implemetations/VariableResolverProxy.java (added)
+++ myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/implemetations/VariableResolverProxy.java Mon Aug 17 17:52:31 2009
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.scripting.jsf.dynamicdecorators.implemetations;
+
+import org.apache.myfaces.scripting.core.util.DynamicClassIdentifier;
+import org.apache.myfaces.scripting.api.Decorated;
+import org.apache.myfaces.scripting.core.util.ProxyUtils;
+
+import javax.faces.el.VariableResolver;
+import javax.faces.el.EvaluationException;
+import javax.faces.context.FacesContext;
+
+/**
+ * objects loaded must
+ * be checked if a reloading is needed
+ *
+ * @author Werner Punz
+ */
+public class VariableResolverProxy extends VariableResolver implements Decorated {
+    VariableResolver _delegate;
+
+
+
+    public VariableResolverProxy(VariableResolver delegate) {
+        _delegate = delegate;
+    }
+
+    public Object resolveVariable(FacesContext facesContext, String s) throws EvaluationException {
+        Object variable = _delegate.resolveVariable(facesContext, s);
+        if (DynamicClassIdentifier.isDynamic(variable.getClass()))
+            variable = ProxyUtils.getWeaver().reloadScriptingInstance(variable);
+        return variable;
+    }
+
+    public Object getDelegate() {
+        return _delegate;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+}

Propchange: myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/implemetations/VariableResolverProxy.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/implemetations/VariableResolverProxy.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Added: myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/implemetations/ViewHandlerProxy.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/implemetations/ViewHandlerProxy.java?rev=805073&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/implemetations/ViewHandlerProxy.java (added)
+++ myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/implemetations/ViewHandlerProxy.java Mon Aug 17 17:52:31 2009
@@ -0,0 +1,105 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.scripting.jsf.dynamicdecorators.implemetations;
+
+import org.apache.myfaces.scripting.api.Decorated;
+import org.apache.myfaces.scripting.core.util.ProxyUtils;
+
+import javax.faces.application.ViewHandler;
+import javax.faces.context.FacesContext;
+import javax.faces.component.UIViewRoot;
+import javax.faces.FacesException;
+import java.util.Locale;
+import java.io.IOException;
+
+/**
+ * Scripting enabled View Handler
+ *
+ * @author Werner Punz
+ */
+public class ViewHandlerProxy extends ViewHandler implements Decorated {
+
+    
+
+    private void weaveDelegate() {
+        _delegate = (ViewHandler) ProxyUtils.getWeaver().reloadScriptingInstance(_delegate);
+    }
+
+
+    public ViewHandlerProxy(ViewHandler delegate) {
+        _delegate = delegate;
+    }
+
+    public String calculateCharacterEncoding(FacesContext facesContext) {
+        weaveDelegate();
+        return _delegate.calculateCharacterEncoding(facesContext);
+    }
+
+    public Locale calculateLocale(FacesContext facesContext) {
+        weaveDelegate();
+        return _delegate.calculateLocale(facesContext);
+    }
+
+    public String calculateRenderKitId(FacesContext facesContext) {
+        weaveDelegate();
+        return _delegate.calculateRenderKitId(facesContext);
+    }
+
+    public UIViewRoot createView(FacesContext facesContext, String s) {
+        weaveDelegate();
+        return _delegate.createView(facesContext, s);
+    }
+
+    public String getActionURL(FacesContext facesContext, String s) {
+        weaveDelegate();
+        return _delegate.getActionURL(facesContext, s);
+    }
+
+    public String getResourceURL(FacesContext facesContext, String s) {
+        weaveDelegate();
+        return _delegate.getResourceURL(facesContext, s);
+    }
+
+    public void initView(FacesContext facesContext) throws FacesException {
+        weaveDelegate();
+        _delegate.initView(facesContext);
+    }
+
+    public void renderView(FacesContext facesContext, UIViewRoot uiViewRoot) throws IOException, FacesException {
+        weaveDelegate();
+        _delegate.renderView(facesContext, uiViewRoot);
+    }
+
+    public UIViewRoot restoreView(FacesContext facesContext, String s) {
+        weaveDelegate();
+        return _delegate.restoreView(facesContext, s);
+    }
+
+    public void writeState(FacesContext facesContext) throws IOException {
+        weaveDelegate();
+        _delegate.writeState(facesContext);
+    }
+
+    ViewHandler _delegate = null;
+
+
+    public Object getDelegate() {
+        return _delegate;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+}

Propchange: myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/implemetations/ViewHandlerProxy.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/implemetations/ViewHandlerProxy.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Added: myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/servlet/CustomChainLoader.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/servlet/CustomChainLoader.java?rev=805073&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/servlet/CustomChainLoader.java (added)
+++ myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/servlet/CustomChainLoader.java Mon Aug 17 17:52:31 2009
@@ -0,0 +1,63 @@
+package org.apache.myfaces.scripting.servlet;
+
+import org.apache.myfaces.groovyloader.core.GroovyWeaver;
+import org.apache.myfaces.shared_impl.util.ClassLoaderExtension;
+
+import javax.servlet.ServletContext;
+import java.io.File;
+
+public class CustomChainLoader extends ClassLoaderExtension {
+
+    String _classRoot = "";
+    String _groovyRoot = "";
+    String _testRoot = "/Users/werpu/Desktop/myfaces-groovy/core/src/main/groovy/";
+    static GroovyWeaver groovyWeaver = null;
+
+    static public GroovyWeaver getGroovyFactory() {
+        return groovyWeaver;
+    }
+
+    static public void setGroovyFactory(GroovyWeaver groovyWeaver) {
+        groovyWeaver = groovyWeaver;
+    }
+
+
+    public CustomChainLoader(ServletContext servletContext) {
+        this.groovyWeaver = new GroovyWeaver();
+          String contextRoot = servletContext.getRealPath("/WEB-INF/groovy/");
+
+          contextRoot = contextRoot.trim();
+          if(!contextRoot.endsWith("/") && !contextRoot.endsWith("\\"))
+              contextRoot += "/";
+          _groovyRoot = contextRoot;
+
+    }
+
+    public Class forName(String name) {
+
+        if (name.startsWith("java.")) /*the entire java namespace is reserved so no use to do a specific classloading check here*/
+            return null;
+        else if (name.startsWith("com.sun")) /*internal java specific namespace*/
+            return null;
+
+        String groovyClass = name.replaceAll("\\.", "/") + ".groovy";
+        File classFile = new File(_groovyRoot + groovyClass);
+
+        if (classFile.exists()) /*we check the groovy subdir for our class*/
+            return (Class) groovyWeaver.loadScriptingClassFromFile(_groovyRoot + groovyClass);
+
+        classFile = new File(_classRoot + groovyClass);
+        if (classFile.exists()) /*now lets check our class subdir for a groovy file to be loaded*/
+            return (Class) groovyWeaver.loadScriptingClassFromFile(_classRoot + groovyClass);
+
+        /*standard testcase*/
+        classFile = new File(_testRoot + groovyClass);
+
+
+        if (classFile.exists()) /*now lets check our class subdir for a groovy file to be loaded*/
+            return groovyWeaver.loadScriptingClassFromFile(_testRoot + groovyClass);
+
+
+        return null;
+    }
+}
\ No newline at end of file

Propchange: myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/servlet/CustomChainLoader.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/servlet/CustomChainLoader.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Added: myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/servlet/ScriptingServletFilter.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/servlet/ScriptingServletFilter.java?rev=805073&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/servlet/ScriptingServletFilter.java (added)
+++ myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/servlet/ScriptingServletFilter.java Mon Aug 17 17:52:31 2009
@@ -0,0 +1,99 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.scripting.servlet;
+
+import org.apache.myfaces.scripting.core.util.ProxyUtils;
+import org.apache.myfaces.scripting.jsf.ScriptingConst;
+
+
+import javax.servlet.*;
+import java.io.IOException;
+import org.apache.myfaces.groovyloader.core.DelegatingGroovyClassloader;
+
+
+/**
+ * Scripting servlet filter
+ *
+ * @author Werner Punz
+ */
+public class ScriptingServletFilter implements Filter {
+
+     ServletContext context = null;
+
+     public void init(FilterConfig filterConfig) throws ServletException {
+         //To change body of implemented methods use File | Settings | File Templates.
+       //  if (context == null && filterConfig.getServletContext() instanceof StartupServletContextListener)
+             context = filterConfig.getServletContext();
+     }
+
+     public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
+         //
+         Object groovyDynamicLoader = context.getAttribute("GroovyDynamicLoader");
+         if(groovyDynamicLoader != null) {
+             ProxyUtils.setWeaver(groovyDynamicLoader);
+         } else {
+             initClassloader();
+         }
+
+         filterChain.doFilter(servletRequest, servletResponse);
+     }
+
+     public void destroy() {
+         ProxyUtils.clean();
+     }
+
+     /**
+     * main classloader init we can kickstart it only once our context is initialized
+     * we have to recheck because sometimes the myfaces init
+     * might trigger before our init and the filter might get called
+     * before we have our own context classloader in place
+     */
+     protected void initClassloader() {
+         //TODO check whether we have to reinitialize only once
+         if (context == null) return;
+         ClassLoader cls = Thread.currentThread().getContextClassLoader();
+         boolean found = false;
+         do {
+             found = cls instanceof DelegatingGroovyClassloader;
+             cls = cls.getParent();
+         } while (!found && cls != null);
+         if (found) {
+             return;  /*we skip this here because we already have the classloader in place*/
+         }
+
+         /**
+          * We have to do that because many containers
+          * exchange classloaders on the fly and
+          * and sometimes our classloader simply is dropped
+          */
+     
+         //TODO to eliminate the classloader handling we have to add
+         //the static data for our reloader into the context
+         //and then reinitialize the loader constantly
+
+         //we have to make sure that our cleanup thread is not touched by this
+
+
+         ClassLoader newLoader = (ClassLoader) context.getAttribute(ScriptingConst.SCRIPTING_CLASSLOADER);
+         Thread.currentThread().setContextClassLoader(newLoader);
+         //we have to add a remove here because some nio based containers try to serialize the context attributes
+         
+     }
+
+}
\ No newline at end of file

Propchange: myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/servlet/ScriptingServletFilter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/servlet/ScriptingServletFilter.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Added: myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/servlet/StartupServletContextPluginChainLoader.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/servlet/StartupServletContextPluginChainLoader.java?rev=805073&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/servlet/StartupServletContextPluginChainLoader.java (added)
+++ myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/servlet/StartupServletContextPluginChainLoader.java Mon Aug 17 17:52:31 2009
@@ -0,0 +1,34 @@
+package org.apache.myfaces.scripting.servlet;
+
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.myfaces.shared_impl.util.ClassUtils;
+
+import javax.servlet.ServletContextListener;
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContext;
+
+/**
+ * @author werpu
+ * @date: 14.08.2009
+ */
+public class StartupServletContextPluginChainLoader implements ServletContextListener {
+    public void contextInitialized(ServletContextEvent servletContextEvent) {
+        Log log = LogFactory.getLog(this.getClass());
+
+        log.info("Instantiating StartupServletContextPluginChainLoader");
+
+        ServletContext servletContext = servletContextEvent.getServletContext();
+        if (servletContext == null) return;
+
+        CustomChainLoader loader = new CustomChainLoader(servletContext);
+        ClassUtils.addClassLoadingExtension(loader, true);
+        servletContext.setAttribute("GroovyDynamicLoader", loader.getGroovyFactory());
+
+   }
+
+    public void contextDestroyed(ServletContextEvent servletContextEvent) {
+    }
+
+}
\ No newline at end of file

Propchange: myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/servlet/StartupServletContextPluginChainLoader.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/extensions/scripting/trunk/core/src/main/java/org/apache/myfaces/scripting/servlet/StartupServletContextPluginChainLoader.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Added: myfaces/extensions/scripting/trunk/core/src/main/resources/META-INF/faces-config.xml
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/core/src/main/resources/META-INF/faces-config.xml?rev=805073&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/core/src/main/resources/META-INF/faces-config.xml (added)
+++ myfaces/extensions/scripting/trunk/core/src/main/resources/META-INF/faces-config.xml Mon Aug 17 17:52:31 2009
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE faces-config
+        PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
+        "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
+
+<faces-config>
+
+
+</faces-config>
\ No newline at end of file

Propchange: myfaces/extensions/scripting/trunk/core/src/main/resources/META-INF/faces-config.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/extensions/scripting/trunk/core/src/main/resources/META-INF/faces-config.xml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Added: myfaces/extensions/scripting/trunk/core/src/main/resources/META-INF/groovy-webapp.tld_
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/core/src/main/resources/META-INF/groovy-webapp.tld_?rev=805073&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/core/src/main/resources/META-INF/groovy-webapp.tld_ (added)
+++ myfaces/extensions/scripting/trunk/core/src/main/resources/META-INF/groovy-webapp.tld_ Mon Aug 17 17:52:31 2009
@@ -0,0 +1,18 @@
+<!--
+<?xml version = '1.0' encoding = 'windows-1252'?>
+<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
+        "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
+<taglib>
+    <tlib-version>1.0</tlib-version>
+    <jsp-version>2.0</jsp-version>
+    <short-name>web</short-name>
+    <uri>http://org.apache.myfaces.groovytld/tags</uri>
+    <display-name>Groovy TLD</display-name>
+    <description>The automated groovy webapp initialization code</description>
+
+    <listener>
+        <listener-class>net.java.dev.weblets.WebletsContextListener</listener-class>
+    </listener>
+   
+</taglib>
+-->        

Added: myfaces/extensions/scripting/trunk/examples/myfaces-groovy-examples.iml
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/examples/myfaces-groovy-examples.iml?rev=805073&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/examples/myfaces-groovy-examples.iml (added)
+++ myfaces/extensions/scripting/trunk/examples/myfaces-groovy-examples.iml Mon Aug 17 17:52:31 2009
@@ -0,0 +1,164 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module relativePaths="true" MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
+  <component name="FacetManager">
+    <facet type="web" name="Web">
+      <configuration>
+        <descriptors>
+          <deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/src/main/webapp/WEB-INF/web.xml" optional="false" version="2.5" />
+        </descriptors>
+        <webroots>
+          <root url="file://$MODULE_DIR$/src/main/webapp" relative="/" />
+        </webroots>
+        <building>
+          <setting name="EXPLODED_URL" value="file://$MODULE_DIR$/target/myfaces-groovy-examples-1.0-SNAPSHOT" />
+          <setting name="EXPLODED_ENABLED" value="false" />
+          <setting name="JAR_URL" value="file://$MODULE_DIR$/target/myfaces-groovy-examples-1.0-SNAPSHOT.war" />
+          <setting name="JAR_ENABLED" value="true" />
+          <setting name="EXCLUDE_EXPLODED_DIRECTORY" value="true" />
+        </building>
+        <packaging>
+          <containerElement type="module" name="myfaces-groovy-examples">
+            <attribute name="method" value="1" />
+            <attribute name="URI" value="/WEB-INF/classes" />
+          </containerElement>
+          <containerElement type="library" name="Maven: commons-logging:commons-logging:1.0.4" level="project">
+            <attribute name="method" value="1" />
+            <attribute name="URI" value="/WEB-INF/lib/" />
+          </containerElement>
+          <containerElement type="library" name="Maven: commons-lang:commons-lang:2.1" level="project">
+            <attribute name="method" value="1" />
+            <attribute name="URI" value="/WEB-INF/lib/" />
+          </containerElement>
+          <containerElement type="library" name="Maven: commons-validator:commons-validator:1.2.0" level="project">
+            <attribute name="method" value="1" />
+            <attribute name="URI" value="/WEB-INF/lib/" />
+          </containerElement>
+          <containerElement type="library" name="Maven: commons-beanutils:commons-beanutils:1.7.0" level="project">
+            <attribute name="method" value="1" />
+            <attribute name="URI" value="/WEB-INF/lib/" />
+          </containerElement>
+          <containerElement type="library" name="Maven: commons-digester:commons-digester:1.6" level="project">
+            <attribute name="method" value="1" />
+            <attribute name="URI" value="/WEB-INF/lib/" />
+          </containerElement>
+          <containerElement type="library" name="Maven: commons-collections:commons-collections:3.1" level="project">
+            <attribute name="method" value="1" />
+            <attribute name="URI" value="/WEB-INF/lib/" />
+          </containerElement>
+          <containerElement type="library" name="Maven: xml-apis:xml-apis:1.0.b2" level="project">
+            <attribute name="method" value="1" />
+            <attribute name="URI" value="/WEB-INF/lib/" />
+          </containerElement>
+          <containerElement type="library" name="Maven: oro:oro:2.0.8" level="project">
+            <attribute name="method" value="1" />
+            <attribute name="URI" value="/WEB-INF/lib/" />
+          </containerElement>
+          <containerElement type="library" name="Maven: commons-el:commons-el:1.0" level="project">
+            <attribute name="method" value="1" />
+            <attribute name="URI" value="/WEB-INF/lib/" />
+          </containerElement>
+          <containerElement type="library" name="Maven: commons-codec:commons-codec:1.3" level="project">
+            <attribute name="method" value="1" />
+            <attribute name="URI" value="/WEB-INF/lib/" />
+          </containerElement>
+          <containerElement type="library" name="Maven: org.apache.myfaces.tomahawk:tomahawk:1.1.6" level="project">
+            <attribute name="method" value="1" />
+            <attribute name="URI" value="/WEB-INF/lib/" />
+          </containerElement>
+          <containerElement type="library" name="Maven: commons-fileupload:commons-fileupload:1.0" level="project">
+            <attribute name="method" value="1" />
+            <attribute name="URI" value="/WEB-INF/lib/" />
+          </containerElement>
+          <containerElement type="library" name="Maven: org.codehaus.groovy:groovy-all:1.5.6" level="project">
+            <attribute name="method" value="1" />
+            <attribute name="URI" value="/WEB-INF/lib/" />
+          </containerElement>
+          <containerElement type="library" name="Maven: org.apache.ant:ant:1.7.0" level="project">
+            <attribute name="method" value="1" />
+            <attribute name="URI" value="/WEB-INF/lib/" />
+          </containerElement>
+          <containerElement type="library" name="Maven: org.apache.ant:ant-launcher:1.7.0" level="project">
+            <attribute name="method" value="1" />
+            <attribute name="URI" value="/WEB-INF/lib/" />
+          </containerElement>
+          <containerElement type="library" name="Maven: jline:jline:0.9.94" level="project">
+            <attribute name="method" value="1" />
+            <attribute name="URI" value="/WEB-INF/lib/" />
+          </containerElement>
+          <containerElement type="library" name="Maven: velocity:velocity:1.5" level="project">
+            <attribute name="method" value="1" />
+            <attribute name="URI" value="/WEB-INF/lib/" />
+          </containerElement>
+          <containerElement type="module" name="myfaces-groovy-core">
+            <attribute name="method" value="5" />
+            <attribute name="URI" value="/WEB-INF/lib/myfaces-groovy-core-1.0-SNAPSHOT.jar" />
+          </containerElement>
+          <containerElement type="library" name="Maven: org.apache.myfaces.core:myfaces-api:1.2.8-SNAPSHOT" level="project">
+            <attribute name="method" value="1" />
+            <attribute name="URI" value="/WEB-INF/lib/" />
+          </containerElement>
+          <containerElement type="library" name="Maven: org.apache.myfaces.core:myfaces-impl:1.2.8-SNAPSHOT" level="project">
+            <attribute name="method" value="1" />
+            <attribute name="URI" value="/WEB-INF/lib/" />
+          </containerElement>
+          <containerElement type="library" name="Maven: commons-discovery:commons-discovery:0.4" level="project">
+            <attribute name="method" value="1" />
+            <attribute name="URI" value="/WEB-INF/lib/" />
+          </containerElement>
+          <containerElement type="library" name="Maven: javax.portlet:portlet-api:1.0" level="project">
+            <attribute name="method" value="1" />
+            <attribute name="URI" value="/WEB-INF/lib/" />
+          </containerElement>
+          <containerElement type="library" name="Maven: com.sun.facelets:jsf-facelets:1.1.11" level="project">
+            <attribute name="method" value="1" />
+            <attribute name="URI" value="/WEB-INF/lib/" />
+          </containerElement>
+          <containerElement type="library" name="Maven: jstl:jstl:1.2" level="project">
+            <attribute name="method" value="1" />
+            <attribute name="URI" value="/WEB-INF/lib/" />
+          </containerElement>
+        </packaging>
+      </configuration>
+    </facet>
+  </component>
+  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5" inherit-compiler-output="false">
+    <output url="file://$MODULE_DIR$/target/classes" />
+    <output-test url="file://$MODULE_DIR$/target/test-classes" />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/src/main/resources" isTestSource="false" />
+      <excludeFolder url="file://$MODULE_DIR$/target" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="library" name="Maven: javax.el:el-api:1.0" level="project" />
+    <orderEntry type="library" exported="" name="Maven: commons-logging:commons-logging:1.0.4" level="project" />
+    <orderEntry type="library" exported="" name="Maven: commons-lang:commons-lang:2.1" level="project" />
+    <orderEntry type="library" exported="" name="Maven: commons-validator:commons-validator:1.2.0" level="project" />
+    <orderEntry type="library" exported="" name="Maven: commons-beanutils:commons-beanutils:1.7.0" level="project" />
+    <orderEntry type="library" exported="" name="Maven: commons-digester:commons-digester:1.6" level="project" />
+    <orderEntry type="library" exported="" name="Maven: commons-collections:commons-collections:3.1" level="project" />
+    <orderEntry type="library" exported="" name="Maven: xml-apis:xml-apis:1.0.b2" level="project" />
+    <orderEntry type="library" exported="" name="Maven: oro:oro:2.0.8" level="project" />
+    <orderEntry type="library" exported="" name="Maven: commons-el:commons-el:1.0" level="project" />
+    <orderEntry type="library" exported="" name="Maven: commons-codec:commons-codec:1.3" level="project" />
+    <orderEntry type="library" name="Maven: javax.servlet:servlet-api:2.3" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.apache.myfaces.tomahawk:tomahawk:1.1.6" level="project" />
+    <orderEntry type="library" exported="" name="Maven: commons-fileupload:commons-fileupload:1.0" level="project" />
+    <orderEntry type="library" name="Maven: junit:junit:4.0" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.struts.shale:shale-test:1.0.2" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.codehaus.groovy:groovy-all:1.5.6" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.apache.ant:ant:1.7.0" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.apache.ant:ant-launcher:1.7.0" level="project" />
+    <orderEntry type="library" exported="" name="Maven: jline:jline:0.9.94" level="project" />
+    <orderEntry type="library" exported="" name="Maven: velocity:velocity:1.5" level="project" />
+    <orderEntry type="module" module-name="myfaces-groovy-core" exported="" />
+    <orderEntry type="library" exported="" name="Maven: org.apache.myfaces.core:myfaces-api:1.2.8-SNAPSHOT" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.apache.myfaces.core:myfaces-impl:1.2.8-SNAPSHOT" level="project" />
+    <orderEntry type="library" exported="" name="Maven: commons-discovery:commons-discovery:0.4" level="project" />
+    <orderEntry type="library" exported="" name="Maven: javax.portlet:portlet-api:1.0" level="project" />
+    <orderEntry type="library" exported="" name="Maven: com.sun.facelets:jsf-facelets:1.1.11" level="project" />
+    <orderEntry type="library" exported="" name="Maven: jstl:jstl:1.2" level="project" />
+  </component>
+</module>
+