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 2012/03/08 16:53:03 UTC
svn commit: r1298442 -
/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/dynamicDecorators/implementations/
Author: werpu
Date: Thu Mar 8 15:53:02 2012
New Revision: 1298442
URL: http://svn.apache.org/viewvc?rev=1298442&view=rev
Log:
EXTSCRIPT-154: Code Rewrite/Refactoring, loading classes now works
Added:
myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/dynamicDecorators/implementations/
myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/dynamicDecorators/implementations/ApplicationProxy.java
- copied, changed from r1297490, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/ApplicationProxy.java
myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/dynamicDecorators/implementations/ELResolverProxy.java
- copied, changed from r1297490, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/ELResolverProxy.java
myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/dynamicDecorators/implementations/FacesContextProxy.java
- copied, changed from r1297490, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/FacesContextProxy.java
myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/dynamicDecorators/implementations/LifefcycleProxy.java
- copied, changed from r1297490, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/LifefcycleProxy.java
myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/dynamicDecorators/implementations/NavigationHandlerProxy.java
- copied, changed from r1297490, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/NavigationHandlerProxy.java
myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/dynamicDecorators/implementations/RenderkitProxy.java
- copied, changed from r1297490, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/RenderkitProxy.java
myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/dynamicDecorators/implementations/ResourceHandlerProxy.java
- copied, changed from r1297490, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/ResourceHandlerProxy.java
myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/dynamicDecorators/implementations/SystemEventListenerProxy.java
- copied, changed from r1297490, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/SystemEventListenerProxy.java
myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/dynamicDecorators/implementations/VariableResolverProxy.java
- copied, changed from r1297490, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/VariableResolverProxy.java
myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/dynamicDecorators/implementations/ViewHandlerProxy.java
- copied, changed from r1297490, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/ViewHandlerProxy.java
Copied: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/dynamicDecorators/implementations/ApplicationProxy.java (from r1297490, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/ApplicationProxy.java)
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/dynamicDecorators/implementations/ApplicationProxy.java?p2=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/dynamicDecorators/implementations/ApplicationProxy.java&p1=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/ApplicationProxy.java&r1=1297490&r2=1298442&rev=1298442&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/ApplicationProxy.java (original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/dynamicDecorators/implementations/ApplicationProxy.java Thu Mar 8 15:53:02 2012
@@ -16,13 +16,10 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.myfaces.extensions.scripting.jsf.dynamicdecorators.implemetations;
+package rewrite.org.apache.myfaces.extensions.scripting.jsf.dynamicdecorators.implementations;
-import org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver;
-import org.apache.myfaces.extensions.scripting.api.Decorated;
-import org.apache.myfaces.extensions.scripting.api.ScriptingConst;
-import org.apache.myfaces.extensions.scripting.core.util.WeavingContext;
-import org.apache.myfaces.extensions.scripting.jsf2.annotation.purged.*;
+import rewrite.org.apache.myfaces.extensions.scripting.core.common.Decorated;
+import rewrite.org.apache.myfaces.extensions.scripting.core.context.WeavingContext;
import javax.el.*;
import javax.faces.FacesException;
@@ -32,11 +29,15 @@ import javax.faces.component.behavior.Be
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.el.*;
-import javax.faces.event.*;
+import javax.faces.event.ActionListener;
+import javax.faces.event.SystemEvent;
+import javax.faces.event.SystemEventListener;
import javax.faces.validator.Validator;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
+import static rewrite.org.apache.myfaces.extensions.scripting.core.common.ScriptingConst.*;
+
/**
* @author Werner Punz
* <p/>
@@ -44,7 +45,8 @@ import java.util.concurrent.ConcurrentHa
* which should resolve our bean issues within a central
* bean processing interceptor
*/
-public class ApplicationProxy extends Application implements Decorated {
+public class ApplicationProxy extends Application implements Decorated
+{
Application _delegate = null;
@@ -60,36 +62,43 @@ public class ApplicationProxy extends Ap
* special data structure to save our
* object -> proxy references
*/
- class EventHandlerProxyEntry {
+ class EventHandlerProxyEntry
+ {
Class event;
Decorated proxy;
- EventHandlerProxyEntry(Class event, Decorated proxy) {
+ EventHandlerProxyEntry(Class event, Decorated proxy)
+ {
this.event = event;
this.proxy = proxy;
}
@SuppressWarnings("unused")
- public Class getEvent() {
+ public Class getEvent()
+ {
return event;
}
@SuppressWarnings("unused")
- public void setEvent(Class event) {
+ public void setEvent(Class event)
+ {
this.event = event;
}
- public Decorated getProxy() {
+ public Decorated getProxy()
+ {
return proxy;
}
@SuppressWarnings("unused")
- public void setProxy(Decorated proxy) {
+ public void setProxy(Decorated proxy)
+ {
this.proxy = proxy;
}
@Override
- public boolean equals(Object o) {
+ public boolean equals(Object o)
+ {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
@@ -100,7 +109,8 @@ public class ApplicationProxy extends Ap
}
@Override
- public int hashCode() {
+ public int hashCode()
+ {
int result = event.hashCode();
result = 31 * result + proxy.getDelegate().getClass().getName().hashCode();
return result;
@@ -127,24 +137,30 @@ public class ApplicationProxy extends Ap
ELResolverProxy finalResolver = null;
- public ApplicationProxy(Application delegate) {
+ public ApplicationProxy(Application delegate)
+ {
_delegate = delegate;
}
- public void addELResolver(ELResolver elResolver) {
+ public void addELResolver(ELResolver elResolver)
+ {
weaveDelegate();
//we do not need a proxy here anymore because
//we drop the beans directly
_delegate.addELResolver(elResolver);
}
- private void weaveDelegate() {
- if (_delegate != null) {
- _delegate = (Application) WeavingContext.getWeaver().reloadScriptingInstance(_delegate, ScriptingConst.ARTIFACT_TYPE_APPLICATION);
+ private void weaveDelegate()
+ {
+ if (_delegate != null)
+ {
+ _delegate = (Application) WeavingContext.getInstance().reload(_delegate,
+ ARTIFACT_TYPE_APPLICATION);
}
}
- public ELResolver getELResolver() {
+ public ELResolver getELResolver()
+ {
weaveDelegate();
ELResolver retVal = _delegate.getELResolver();
@@ -153,12 +169,14 @@ public class ApplicationProxy extends Ap
//TOD add a weaving for resource bundles
- public ResourceBundle getResourceBundle(FacesContext facesContext, String s) throws FacesException, NullPointerException {
+ public ResourceBundle getResourceBundle(FacesContext facesContext, String s) throws FacesException, NullPointerException
+ {
weaveDelegate();
return _delegate.getResourceBundle(facesContext, s);
}
- public UIComponent createComponent(ValueExpression valueExpression, FacesContext facesContext, String componentType) throws FacesException, NullPointerException {
+ public UIComponent createComponent(ValueExpression valueExpression, FacesContext facesContext, String componentType) throws FacesException, NullPointerException
+ {
weaveDelegate();
UIComponent component = _delegate.createComponent(valueExpression, facesContext, componentType);
UIComponent oldComponent = component;
@@ -176,85 +194,100 @@ public class ApplicationProxy extends Ap
* maybe in the long run we can make a decorator here instead
* but for now lets try it this way
*/
- component = (UIComponent) reloadInstance(component, ScriptingConst.ARTIFACT_TYPE_COMPONENT);
+ component = (UIComponent) reloadInstance(component, ARTIFACT_TYPE_COMPONENT);
//we now have to check for an annotation change, but only in case a reload has happened
- if (component.getClass().hashCode() != oldComponent.getClass().hashCode()) {
+ /*<> if (component.getClass().hashCode() != oldComponent.getClass().hashCode())
+ {
return handleAnnotationChange(component, valueExpression, facesContext, componentType);
- }
+ } */
return component;
}
- public ExpressionFactory getExpressionFactory() {
+ public ExpressionFactory getExpressionFactory()
+ {
weaveDelegate();
return _delegate.getExpressionFactory();
}
- public void addELContextListener(ELContextListener elContextListener) {
+ public void addELContextListener(ELContextListener elContextListener)
+ {
weaveDelegate();
- if (WeavingContext.isDynamic(elContextListener.getClass()))
- elContextListener = (ELContextListener) WeavingContext.createMethodReloadingProxyFromObject(elContextListener, ELContextListener.class, ScriptingConst.ARTIFACT_TYPE_ELCONTEXTLISTENER);
+ if (WeavingContext.getInstance().isDynamic(elContextListener.getClass()))
+ elContextListener = (ELContextListener) WeavingContext.getInstance().createMethodReloadingProxyFromObject
+ (elContextListener, ELContextListener.class, ARTIFACT_TYPE_ELCONTEXTLISTENER);
_delegate.addELContextListener(elContextListener);
}
- public void removeELContextListener(ELContextListener elContextListener) {
+ public void removeELContextListener(ELContextListener elContextListener)
+ {
weaveDelegate();
_delegate.removeELContextListener(elContextListener);
}
- public ELContextListener[] getELContextListeners() {
+ public ELContextListener[] getELContextListeners()
+ {
weaveDelegate();
return _delegate.getELContextListeners();
}
- public ActionListener getActionListener() {
+ public ActionListener getActionListener()
+ {
weaveDelegate();
ActionListener retVal = _delegate.getActionListener();
- if (WeavingContext.isDynamic(retVal.getClass()))
- retVal = (ActionListener) WeavingContext.createMethodReloadingProxyFromObject(retVal, ActionListener.class, ScriptingConst.ARTIFACT_TYPE_ACTIONLISTENER);
+ if (WeavingContext.getInstance().isDynamic(retVal.getClass()))
+ retVal = (ActionListener) WeavingContext.createMethodReloadingProxyFromObject(retVal, ActionListener.class, ARTIFACT_TYPE_ACTIONLISTENER);
return retVal;
}
- public void setActionListener(ActionListener actionListener) {
+ public void setActionListener(ActionListener actionListener)
+ {
weaveDelegate();
- if (WeavingContext.isDynamic(actionListener.getClass()))
- actionListener = (ActionListener) WeavingContext.createMethodReloadingProxyFromObject(actionListener, ActionListener.class, ScriptingConst.ARTIFACT_TYPE_ACTIONLISTENER);
+ if (WeavingContext.getInstance().isDynamic(actionListener.getClass()))
+ actionListener = (ActionListener) WeavingContext.createMethodReloadingProxyFromObject(actionListener, ActionListener.class, ARTIFACT_TYPE_ACTIONLISTENER);
_delegate.setActionListener(actionListener);
}
- public Locale getDefaultLocale() {
+ public Locale getDefaultLocale()
+ {
weaveDelegate();
return _delegate.getDefaultLocale();
}
- public void setDefaultLocale(Locale locale) {
+ public void setDefaultLocale(Locale locale)
+ {
weaveDelegate();
_delegate.setDefaultLocale(locale);
}
- public String getDefaultRenderKitId() {
+ public String getDefaultRenderKitId()
+ {
weaveDelegate();
return _delegate.getDefaultRenderKitId();
}
- public void setDefaultRenderKitId(String s) {
+ public void setDefaultRenderKitId(String s)
+ {
weaveDelegate();
_delegate.setDefaultRenderKitId(s);
}
- public String getMessageBundle() {
+ public String getMessageBundle()
+ {
weaveDelegate();
return _delegate.getMessageBundle();
}
- public void setMessageBundle(String s) {
+ public void setMessageBundle(String s)
+ {
weaveDelegate();
_delegate.setMessageBundle(s);
}
- public NavigationHandler getNavigationHandler() {
+ public NavigationHandler getNavigationHandler()
+ {
weaveDelegate();
//defined in the setter to speed things up a little
NavigationHandler retVal = _delegate.getNavigationHandler();
@@ -264,43 +297,50 @@ public class ApplicationProxy extends Ap
return retVal;
}
- public void setNavigationHandler(NavigationHandler navigationHandler) {
+ public void setNavigationHandler(NavigationHandler navigationHandler)
+ {
weaveDelegate();
- if (navigationHandler != null && WeavingContext.isDynamic(navigationHandler.getClass()))
+ if (navigationHandler != null && WeavingContext.getInstance().isDynamic(navigationHandler.getClass()))
navigationHandler = new NavigationHandlerProxy(navigationHandler);
_delegate.setNavigationHandler(navigationHandler);
}
@SuppressWarnings("deprecation")
- public PropertyResolver getPropertyResolver() {
+ public PropertyResolver getPropertyResolver()
+ {
weaveDelegate();
return _delegate.getPropertyResolver();
}
@SuppressWarnings("deprecation")
- public void setPropertyResolver(PropertyResolver propertyResolver) {
+ public void setPropertyResolver(PropertyResolver propertyResolver)
+ {
weaveDelegate();
_delegate.setPropertyResolver(propertyResolver);
}
@SuppressWarnings("deprecation")
- public VariableResolver getVariableResolver() {
+ public VariableResolver getVariableResolver()
+ {
weaveDelegate();
return _delegate.getVariableResolver();
}
@SuppressWarnings("deprecation")
- public void setVariableResolver(VariableResolver variableResolver) {
+ public void setVariableResolver(VariableResolver variableResolver)
+ {
weaveDelegate();
- if(!varResolverAdded) {
+ if (!varResolverAdded)
+ {
variableResolver = new VariableResolverProxy(variableResolver);
varResolverAdded = true;
}
_delegate.setVariableResolver(variableResolver);
}
- public ViewHandler getViewHandler() {
+ public ViewHandler getViewHandler()
+ {
weaveDelegate();
ViewHandler handler = _delegate.getViewHandler();
@@ -310,36 +350,41 @@ public class ApplicationProxy extends Ap
java all our groovy reloading code is lost
hence we have to work with proxies here
*/
- if (WeavingContext.isDynamic(handler.getClass()))
+ if (WeavingContext.getInstance().isDynamic(handler.getClass()))
handler = new ViewHandlerProxy(handler);
return handler;
}
- public void setViewHandler(ViewHandler viewHandler) {
+ public void setViewHandler(ViewHandler viewHandler)
+ {
weaveDelegate();
/*make sure you have the delegates as well in properties*/
- if (WeavingContext.isDynamic(viewHandler.getClass()))
+ if (WeavingContext.getInstance().isDynamic(viewHandler.getClass()))
viewHandler = new ViewHandlerProxy(viewHandler);
_delegate.setViewHandler(viewHandler);
}
- public StateManager getStateManager() {
+ public StateManager getStateManager()
+ {
weaveDelegate();
return _delegate.getStateManager();
}
- public void setStateManager(StateManager stateManager) {
+ public void setStateManager(StateManager stateManager)
+ {
weaveDelegate();
_delegate.setStateManager(stateManager);
}
- public void addComponent(String componentType, String componentClass) {
+ public void addComponent(String componentType, String componentClass)
+ {
weaveDelegate();
_delegate.addComponent(componentType, componentClass);
}
- public UIComponent createComponent(String componentType) throws FacesException {
+ public UIComponent createComponent(String componentType) throws FacesException
+ {
weaveDelegate();
//the components are generated anew very often
//we cannot do an on object weaving here
@@ -350,19 +395,21 @@ public class ApplicationProxy extends Ap
* code, in the renderer we do it on method base
* due to the fact that our renderers are recycled via
* a flyweight pattern*/
- UIComponent component = (UIComponent) reloadInstance(oldComponent, ScriptingConst.ARTIFACT_TYPE_COMPONENT);
+ UIComponent component = (UIComponent) reloadInstance(oldComponent, ARTIFACT_TYPE_COMPONENT);
//we now have to check for an annotation change, but only in case a reload has happened
- if (component.getClass().hashCode() != oldComponent.getClass().hashCode()) {
+ /*<> if (component.getClass().hashCode() != oldComponent.getClass().hashCode())
+ {
return handleAnnotationChange(component, componentType);
- }
+ } */
return component;
}
@SuppressWarnings("deprecation")
- public UIComponent createComponent(ValueBinding valueBinding, FacesContext facesContext, String componentType) throws FacesException {
+ public UIComponent createComponent(ValueBinding valueBinding, FacesContext facesContext, String componentType) throws FacesException
+ {
weaveDelegate();
UIComponent oldComponent = _delegate.createComponent(valueBinding, facesContext, componentType);
@@ -371,22 +418,25 @@ public class ApplicationProxy extends Ap
* code, in the renderer we do it on method base
* due to the fact that our renderers are recycled via
* a flyweight pattern*/
- UIComponent component = (UIComponent) reloadInstance(oldComponent, ScriptingConst.ARTIFACT_TYPE_COMPONENT);
+ UIComponent component = (UIComponent) reloadInstance(oldComponent, ARTIFACT_TYPE_COMPONENT);
//we now have to check for an annotation change, but only in case a reload has happened
- if (component.getClass().hashCode() != oldComponent.getClass().hashCode()) {
+ /*<>if (component.getClass().hashCode() != oldComponent.getClass().hashCode())
+ {
return handleAnnotationChange(component, valueBinding, facesContext, componentType);
- }
+ }*/
return component;
}
- public Iterator<String> getComponentTypes() {
+ public Iterator<String> getComponentTypes()
+ {
weaveDelegate();
return _delegate.getComponentTypes();
}
- public void addConverter(String converterId, String converterClass) {
+ public void addConverter(String converterId, String converterClass)
+ {
weaveDelegate();
/* if (converterClass.equals(PurgedConverter.class.getName())) {
//purged case we do a full rescan
@@ -403,12 +453,14 @@ public class ApplicationProxy extends Ap
_delegate.addConverter(converterId, converterClass);
}
- public void addConverter(Class targetClass, String converterClass) {
+ public void addConverter(Class targetClass, String converterClass)
+ {
weaveDelegate();
_delegate.addConverter(targetClass, converterClass);
}
- public Converter createConverter(String converterId) {
+ public Converter createConverter(String converterId)
+ {
weaveDelegate();
Converter retVal = _delegate.createConverter(converterId);
@@ -420,52 +472,61 @@ public class ApplicationProxy extends Ap
*
* reloading objects at their interception points
*/
- Converter newRetVal = (Converter) reloadInstance(retVal, ScriptingConst.ARTIFACT_TYPE_CONVERTER);
- if (newRetVal != retVal) {
+ Converter newRetVal = (Converter) reloadInstance(retVal, ARTIFACT_TYPE_CONVERTER);
+ if (newRetVal != retVal)
+ {
return _delegate.createConverter(converterId);
}
return retVal;
}
- public Converter createConverter(Class aClass) {
+ public Converter createConverter(Class aClass)
+ {
weaveDelegate();
Converter retVal = _delegate.createConverter(aClass);
- Converter newRetVal = (Converter) reloadInstance(retVal, ScriptingConst.ARTIFACT_TYPE_CONVERTER);
- if (newRetVal != retVal) {
+ Converter newRetVal = (Converter) reloadInstance(retVal, ARTIFACT_TYPE_CONVERTER);
+ if (newRetVal != retVal)
+ {
return _delegate.createConverter(aClass);
}
return retVal;
}
- public Iterator<String> getConverterIds() {
+ public Iterator<String> getConverterIds()
+ {
weaveDelegate();
return _delegate.getConverterIds();
}
- public Iterator<Class<?>> getConverterTypes() {
+ public Iterator<Class<?>> getConverterTypes()
+ {
weaveDelegate();
return _delegate.getConverterTypes();
}
@SuppressWarnings("deprecation")
- public MethodBinding createMethodBinding(String s, Class[] classes) throws ReferenceSyntaxException {
+ public MethodBinding createMethodBinding(String s, Class[] classes) throws ReferenceSyntaxException
+ {
weaveDelegate();
return _delegate.createMethodBinding(s, classes);
}
- public Iterator<Locale> getSupportedLocales() {
+ public Iterator<Locale> getSupportedLocales()
+ {
weaveDelegate();
return _delegate.getSupportedLocales();
}
- public void setSupportedLocales(Collection<Locale> locales) {
+ public void setSupportedLocales(Collection<Locale> locales)
+ {
weaveDelegate();
_delegate.setSupportedLocales(locales);
}
- public void addValidator(String validatorId, String validatorClass) {
+ public void addValidator(String validatorId, String validatorClass)
+ {
weaveDelegate();
/* if (validatorClass.equals(PurgedValidator.class.getName())) {
//purged case we do a full rescane
@@ -482,40 +543,47 @@ public class ApplicationProxy extends Ap
_delegate.addValidator(validatorId, validatorClass);
}
- public Validator createValidator(String validatorId) throws FacesException {
+ public Validator createValidator(String validatorId) throws FacesException
+ {
weaveDelegate();
Validator retVal = _delegate.createValidator(validatorId);
//the validators are recreated every request we do not have to deal with them on method level
- Validator newRetVal = (Validator) reloadInstance(retVal, ScriptingConst.ARTIFACT_TYPE_VALIDATOR);
- if (newRetVal != retVal) {
+ Validator newRetVal = (Validator) reloadInstance(retVal, ARTIFACT_TYPE_VALIDATOR);
+ if (newRetVal != retVal)
+ {
_delegate.createValidator(validatorId);
}
return retVal;
}
- public Iterator<String> getValidatorIds() {
+ public Iterator<String> getValidatorIds()
+ {
weaveDelegate();
return _delegate.getValidatorIds();
}
@SuppressWarnings("deprecation")
- public ValueBinding createValueBinding(String s) throws ReferenceSyntaxException {
+ public ValueBinding createValueBinding(String s) throws ReferenceSyntaxException
+ {
weaveDelegate();
return _delegate.createValueBinding(s);
}
- @Override
- public void addBehavior(String behaviorId, String behaviorClass) {
+
+ /*<> @Override public void addBehavior(String behaviorId, String behaviorClass)
+ {
weaveDelegate();
- if (behaviorClass.equals(PurgedValidator.class.getName())) {
+ if (behaviorClass.equals(PurgedValidator.class.getName()))
+ {
//purged case we do a full rescan
- WeavingContext.getWeaver().fullClassScan();
+ WeavingContext.getInstance().getWeaver().fullClassScan();
Behavior behavior = _delegate.createBehavior(behaviorId);
_behaviors.put(behaviorId, behaviorClass);
- if (behavior instanceof PurgedBehavior) {
+ if (behavior instanceof PurgedBehavior)
+ {
//Null not allowed here, but we set a purged validator to make
//sure that we get errors on the proper level
_delegate.addBehavior(behaviorId, PurgedBehavior.class.getName());
@@ -526,23 +594,26 @@ public class ApplicationProxy extends Ap
}
_delegate.addBehavior(behaviorId, behaviorClass);
- }
+ } */
@Override
- public void addDefaultValidatorId(String validatorId) {
+ public void addDefaultValidatorId(String validatorId)
+ {
weaveDelegate();
_delegate.addDefaultValidatorId(validatorId);
}
@Override
- public Behavior createBehavior(String behaviorId) throws FacesException {
+ public Behavior createBehavior(String behaviorId) throws FacesException
+ {
weaveDelegate();
Behavior retVal = _delegate.createBehavior(behaviorId);
//we might have casts here against one of the parents
//of this object
- Behavior newBehavior = (Behavior) reloadInstance(retVal, ScriptingConst.ARTIFACT_TYPE_BEHAVIOR);
- if (newBehavior != retVal) {
+ Behavior newBehavior = (Behavior) reloadInstance(retVal, ARTIFACT_TYPE_BEHAVIOR);
+ if (newBehavior != retVal)
+ {
return _delegate.createBehavior(behaviorId);
}
@@ -550,7 +621,8 @@ public class ApplicationProxy extends Ap
}
@Override
- public UIComponent createComponent(FacesContext facesContext, Resource resource) {
+ public UIComponent createComponent(FacesContext facesContext, Resource resource)
+ {
weaveDelegate();
UIComponent oldComponent = _delegate.createComponent(facesContext, resource);
@@ -560,19 +632,21 @@ public class ApplicationProxy extends Ap
* code, in the renderer we do it on method base
* due to the fact that our renderers are recycled via
* a flyweight pattern*/
- UIComponent component = (UIComponent) reloadInstance(oldComponent, ScriptingConst.ARTIFACT_TYPE_COMPONENT);
+ UIComponent component = (UIComponent) reloadInstance(oldComponent, ARTIFACT_TYPE_COMPONENT);
//we now have to check for an annotation change, but only in case a reload has happened
- if (component.getClass().hashCode() != oldComponent.getClass().hashCode()) {
+ /*<>if (component.getClass().hashCode() != oldComponent.getClass().hashCode())
+ {
return handleAnnotationChange(component, facesContext, resource);
- }
+ }*/
return component;
}
@Override
- public UIComponent createComponent(FacesContext facesContext, String componentType, String rendererType) {
+ public UIComponent createComponent(FacesContext facesContext, String componentType, String rendererType)
+ {
weaveDelegate();
UIComponent oldComponent = _delegate.createComponent(facesContext, componentType, rendererType);
@@ -581,18 +655,20 @@ public class ApplicationProxy extends Ap
* code, in the renderer we do it on method base
* due to the fact that our renderers are recycled via
* a flyweight pattern*/
- UIComponent component = (UIComponent) reloadInstance(oldComponent, ScriptingConst.ARTIFACT_TYPE_COMPONENT);
+ UIComponent component = (UIComponent) reloadInstance(oldComponent, ARTIFACT_TYPE_COMPONENT);
//we now have to check for an annotation change, but only in case a reload has happened
- if (component.getClass().hashCode() != oldComponent.getClass().hashCode()) {
+ /*<>if (component.getClass().hashCode() != oldComponent.getClass().hashCode())
+ {
return handleAnnotationChange(component, facesContext, componentType, rendererType);
- }
+ } */
return component;
}
@Override
- public UIComponent createComponent(ValueExpression valueExpression, FacesContext facesContext, String s, String s1) {
+ public UIComponent createComponent(ValueExpression valueExpression, FacesContext facesContext, String s, String s1)
+ {
weaveDelegate();
UIComponent oldComponent = _delegate.createComponent(valueExpression, facesContext, s, s1);
@@ -601,48 +677,54 @@ public class ApplicationProxy extends Ap
* code, in the renderer we do it on method base
* due to the fact that our renderers are recycled via
* a flyweight pattern*/
- UIComponent component = (UIComponent) reloadInstance(oldComponent, ScriptingConst.ARTIFACT_TYPE_COMPONENT);
+ UIComponent component = (UIComponent) reloadInstance(oldComponent, ARTIFACT_TYPE_COMPONENT);
//we now have to check for an annotation change, but only in case a reload has happened
- if (component.getClass().hashCode() != oldComponent.getClass().hashCode()) {
+ /*if (component.getClass().hashCode() != oldComponent.getClass().hashCode())
+ {
return handleAnnotationChange(component, valueExpression, facesContext, s, s1);
- }
+ } <>*/
return component;
}
@Override
@SuppressWarnings("unchecked")
- public <T> T evaluateExpressionGet(FacesContext facesContext, String s, Class<? extends T> aClass) throws ELException {
+ public <T> T evaluateExpressionGet(FacesContext facesContext, String s, Class<? extends T> aClass) throws ELException
+ {
weaveDelegate();
//good place for a dynamic reloading check as well
T retVal = _delegate.evaluateExpressionGet(facesContext, s, aClass);
- if (WeavingContext.isDynamic(retVal.getClass()))
- retVal = (T) WeavingContext.getWeaver().reloadScriptingInstance(retVal, ScriptingConst.ARTIFACT_TYPE_MANAGEDBEAN);
+ if (WeavingContext.getInstance().isDynamic(retVal.getClass()))
+ retVal = (T) WeavingContext.getInstance().reload(retVal, ARTIFACT_TYPE_MANAGEDBEAN);
return retVal;
}
@Override
- public Iterator<String> getBehaviorIds() {
+ public Iterator<String> getBehaviorIds()
+ {
weaveDelegate();
return _behaviors.keySet().iterator();
//return _delegate.getBehaviorIds();
}
@Override
- public Map<String, String> getDefaultValidatorInfo() {
+ public Map<String, String> getDefaultValidatorInfo()
+ {
weaveDelegate();
return _delegate.getDefaultValidatorInfo();
}
@Override
- public ProjectStage getProjectStage() {
+ public ProjectStage getProjectStage()
+ {
weaveDelegate();
return _delegate.getProjectStage();
}
@Override
- public ResourceHandler getResourceHandler() {
+ public ResourceHandler getResourceHandler()
+ {
weaveDelegate();
ResourceHandler retVal = _delegate.getResourceHandler();
@@ -657,21 +739,25 @@ public class ApplicationProxy extends Ap
}
@Override
- public void publishEvent(FacesContext facesContext, Class<? extends SystemEvent> eventClass, Class<?> sourceBaseTye, Object source) {
+ public void publishEvent(FacesContext facesContext, Class<? extends SystemEvent> eventClass, Class<?> sourceBaseTye, Object source)
+ {
weaveDelegate();
_delegate.publishEvent(facesContext, eventClass, sourceBaseTye, source);
}
@Override
- public void publishEvent(FacesContext facesContext, Class<? extends SystemEvent> eventClass, Object source) {
+ public void publishEvent(FacesContext facesContext, Class<? extends SystemEvent> eventClass, Object source)
+ {
weaveDelegate();
_delegate.publishEvent(facesContext, eventClass, source);
}
@Override
- public void setResourceHandler(ResourceHandler resourceHandler) {
+ public void setResourceHandler(ResourceHandler resourceHandler)
+ {
weaveDelegate();
- if (WeavingContext.isDynamic(resourceHandler.getClass())) {
+ if (WeavingContext.getInstance().isDynamic(resourceHandler.getClass()))
+ {
ResourceHandler proxy = new ResourceHandlerProxy(resourceHandler);
resourceHandler = proxy;
}
@@ -684,14 +770,17 @@ public class ApplicationProxy extends Ap
}
@Override
- public void subscribeToEvent(Class<? extends SystemEvent> eventClass, Class<?> aClass, SystemEventListener systemEventListener) {
+ public void subscribeToEvent(Class<? extends SystemEvent> eventClass, Class<?> aClass, SystemEventListener systemEventListener)
+ {
weaveDelegate();
systemEventListener = makeEventProxy(eventClass, systemEventListener);
_delegate.subscribeToEvent(eventClass, aClass, systemEventListener);
}
- private SystemEventListener makeEventProxy(Class<? extends SystemEvent> eventClass, SystemEventListener systemEventListener) {
- if (WeavingContext.isDynamic(systemEventListener.getClass())) {
+ private SystemEventListener makeEventProxy(Class<? extends SystemEvent> eventClass, SystemEventListener systemEventListener)
+ {
+ if (WeavingContext.getInstance().isDynamic(systemEventListener.getClass()))
+ {
systemEventListener = new SystemEventListenerProxy(systemEventListener);
EventHandlerProxyEntry entry = new EventHandlerProxyEntry(eventClass, (Decorated) systemEventListener);
_eventHandlerIdx.put(entry, entry);
@@ -700,25 +789,30 @@ public class ApplicationProxy extends Ap
}
@Override
- public void subscribeToEvent(Class<? extends SystemEvent> eventClass, SystemEventListener systemEventListener) {
+ public void subscribeToEvent(Class<? extends SystemEvent> eventClass, SystemEventListener systemEventListener)
+ {
weaveDelegate();
systemEventListener = makeEventProxy(eventClass, systemEventListener);
_delegate.subscribeToEvent(eventClass, systemEventListener);
}
@Override
- public void unsubscribeFromEvent(Class<? extends SystemEvent> eventClass, Class<?> aClass, SystemEventListener systemEventListener) {
+ public void unsubscribeFromEvent(Class<? extends SystemEvent> eventClass, Class<?> aClass, SystemEventListener systemEventListener)
+ {
weaveDelegate();
systemEventListener = resolveEventProxy(eventClass, systemEventListener);
_delegate.unsubscribeFromEvent(eventClass, aClass, systemEventListener);
}
- private SystemEventListener resolveEventProxy(Class<? extends SystemEvent> eventClass, SystemEventListener systemEventListener) {
- if (WeavingContext.isDynamic(systemEventListener.getClass())) {
+ private SystemEventListener resolveEventProxy(Class<? extends SystemEvent> eventClass, SystemEventListener systemEventListener)
+ {
+ if (WeavingContext.getInstance().isDynamic(systemEventListener.getClass()))
+ {
systemEventListener = new SystemEventListenerProxy(systemEventListener);
EventHandlerProxyEntry entry = new EventHandlerProxyEntry(eventClass, (Decorated) systemEventListener);
entry = _eventHandlerIdx.remove(entry);
- if (entry != null) {
+ if (entry != null)
+ {
systemEventListener = (SystemEventListener) entry.getProxy().getDelegate();
}
}
@@ -726,40 +820,49 @@ public class ApplicationProxy extends Ap
}
@Override
- public void unsubscribeFromEvent(Class<? extends SystemEvent> eventClass, SystemEventListener systemEventListener) {
+ public void unsubscribeFromEvent(Class<? extends SystemEvent> eventClass, SystemEventListener systemEventListener)
+ {
weaveDelegate();
systemEventListener = resolveEventProxy(eventClass, systemEventListener);
_delegate.unsubscribeFromEvent(eventClass, systemEventListener);
}
- public Object getDelegate() {
+ public Object getDelegate()
+ {
return _delegate;
}
- private Object reloadInstance(Object instance, int artifactType) {
- if (instance == null) {
+ private Object reloadInstance(Object instance, int artifactType)
+ {
+ if (instance == null)
+ {
return null;
}
- if (WeavingContext.isDynamic(instance.getClass()) && !alreadyWovenInRequest(instance.getClass().getName())) {
- instance = WeavingContext.getWeaver().reloadScriptingInstance(instance, artifactType);
- alreadyWovenInRequest(instance.getClass().getName());
+ if (WeavingContext.getInstance().isDynamic(instance.getClass()))
+ {
+ instance = WeavingContext.getInstance().reload(instance, artifactType);
}
return instance;
}
- private boolean alreadyWovenInRequest(String clazz) {
+ /* private boolean alreadyWovenInRequest(String clazz)
+ {
//portlets now can be enabled thanks to the jsf2 indirections regarding the external context
Map<String, Object> req = WeavingContext.getRequestMap();
- if (req.get(ScriptingConst.SCRIPTING_REQUSINGLETON + clazz) == null) {
- req.put(ScriptingConst.SCRIPTING_REQUSINGLETON + clazz, "");
+ if (req.get(SCRIPTING_REQUSINGLETON + clazz) == null)
+ {
+ req.put(SCRIPTING_REQUSINGLETON + clazz, "");
return false;
}
return true;
- }
+ }*/
- private UIComponent handleAnnotationChange(UIComponent oldComponent, ValueExpression valueExpression, FacesContext facesContext, String componentType) {
+ /*<> private UIComponent handleAnnotationChange(UIComponent oldComponent, ValueExpression valueExpression,
+ FacesContext facesContext, String componentType)
+ {
UIComponent componentToChange = _delegate.createComponent(valueExpression, facesContext, componentType);
- if (componentToChange instanceof PurgedComponent) {
+ if (componentToChange instanceof PurgedComponent)
+ {
WeavingContext.getWeaver().fullClassScan();
//via an additional create component we can check whether a purged component
//was registered after the reload because the annotation has been removed
@@ -768,11 +871,13 @@ public class ApplicationProxy extends Ap
return componentToChange;
}
return oldComponent;
- }
+ } */
- private UIComponent handleAnnotationChange(UIComponent oldComponent, String componentType) {
+ /*<> private UIComponent handleAnnotationChange(UIComponent oldComponent, String componentType)
+ {
UIComponent componentToChange = _delegate.createComponent(componentType);
- if (componentToChange instanceof PurgedComponent) {
+ if (componentToChange instanceof PurgedComponent)
+ {
WeavingContext.getWeaver().fullClassScan();
//via an additional create component we can check whether a purged component
//was registered after the reload because the annotation has been removed
@@ -781,12 +886,15 @@ public class ApplicationProxy extends Ap
return componentToChange;
}
return oldComponent;
- }
+ }*/
- @SuppressWarnings("deprecation")
- private UIComponent handleAnnotationChange(UIComponent oldComponent, ValueBinding valueBinding, FacesContext context, String componentType) {
+
+ /*<>@SuppressWarnings("deprecation") private UIComponent handleAnnotationChange(UIComponent oldComponent, ValueBinding valueBinding,
+ FacesContext context, String componentType)
+ {
UIComponent componentToChange = _delegate.createComponent(valueBinding, context, componentType);
- if (componentToChange instanceof PurgedComponent) {
+ if (componentToChange instanceof PurgedComponent)
+ {
WeavingContext.getWeaver().fullClassScan();
//via an additional create component we can check whether a purged component
//was registered after the reload because the annotation has been removed
@@ -795,11 +903,13 @@ public class ApplicationProxy extends Ap
return componentToChange;
}
return oldComponent;
- }
+ } */
- private UIComponent handleAnnotationChange(UIComponent oldComponent, FacesContext context, Resource resource) {
+ /*<> private UIComponent handleAnnotationChange(UIComponent oldComponent, FacesContext context, Resource resource)
+ {
UIComponent componentToChange = _delegate.createComponent(context, resource);
- if (componentToChange instanceof PurgedComponent) {
+ if (componentToChange instanceof PurgedComponent)
+ {
WeavingContext.getWeaver().fullClassScan();
//via an additional create component we can check whether a purged component
//was registered after the reload because the annotation has been removed
@@ -810,9 +920,11 @@ public class ApplicationProxy extends Ap
return oldComponent;
}
- private UIComponent handleAnnotationChange(UIComponent oldComponent, FacesContext context, String componentType, String rendererType) {
+ private UIComponent handleAnnotationChange(UIComponent oldComponent, FacesContext context, String componentType, String rendererType)
+ {
UIComponent componentToChange = _delegate.createComponent(context, componentType, rendererType);
- if (componentToChange instanceof PurgedComponent) {
+ if (componentToChange instanceof PurgedComponent)
+ {
WeavingContext.getWeaver().fullClassScan();
//via an additional create component we can check whether a purged component
//was registered after the reload because the annotation has been removed
@@ -823,9 +935,11 @@ public class ApplicationProxy extends Ap
return oldComponent;
}
- private UIComponent handleAnnotationChange(UIComponent oldComponent, ValueExpression valueExpression, FacesContext facesContext, String s, String s1) {
+ private UIComponent handleAnnotationChange(UIComponent oldComponent, ValueExpression valueExpression, FacesContext facesContext, String s, String s1)
+ {
UIComponent componentToChange = _delegate.createComponent(valueExpression, facesContext, s, s1);
- if (componentToChange instanceof PurgedComponent) {
+ if (componentToChange instanceof PurgedComponent)
+ {
WeavingContext.getWeaver().fullClassScan();
//via an additional create component we can check whether a purged component
@@ -836,6 +950,6 @@ public class ApplicationProxy extends Ap
return componentToChange;
}
return oldComponent;
- }
+ } */
}
Copied: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/dynamicDecorators/implementations/ELResolverProxy.java (from r1297490, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/ELResolverProxy.java)
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/dynamicDecorators/implementations/ELResolverProxy.java?p2=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/dynamicDecorators/implementations/ELResolverProxy.java&p1=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/ELResolverProxy.java&r1=1297490&r2=1298442&rev=1298442&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/ELResolverProxy.java (original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/dynamicDecorators/implementations/ELResolverProxy.java Thu Mar 8 15:53:02 2012
@@ -16,11 +16,12 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.myfaces.extensions.scripting.jsf.dynamicdecorators.implemetations;
+package rewrite.org.apache.myfaces.extensions.scripting.jsf.dynamicdecorators.implementations;
-import org.apache.myfaces.extensions.scripting.api.Decorated;
-import org.apache.myfaces.extensions.scripting.api.ScriptingConst;
-import org.apache.myfaces.extensions.scripting.core.util.WeavingContext;
+
+import rewrite.org.apache.myfaces.extensions.scripting.core.common.Decorated;
+import rewrite.org.apache.myfaces.extensions.scripting.core.common.ScriptingConst;
+import rewrite.org.apache.myfaces.extensions.scripting.core.context.WeavingContext;
import javax.el.ELContext;
import javax.el.ELException;
@@ -42,7 +43,8 @@ import java.util.logging.Logger;
* The compile and load happens on classloader level
* @deprecated
*/
-public class ELResolverProxy extends ELResolver implements Decorated {
+public class ELResolverProxy extends ELResolver implements Decorated
+{
Logger log = Logger.getLogger(ELResolverProxy.class.getName());
ELResolver _delegate = null;
@@ -54,9 +56,9 @@ public class ELResolverProxy extends ELR
Object retVal = _delegate.getValue(elContext, base, property);
/* Object newRetVal;
- if (retVal != null && WeavingContext.isDynamic(retVal.getClass())) {
+ if (retVal != null && WeavingContext.getInstance().isDynamic(retVal.getClass())) {
- newRetVal = WeavingContext.getWeaver().reloadScriptingInstance(retVal, ScriptingConst.ARTIFACT_TYPE_MANAGEDBEAN);
+ newRetVal = WeavingContext.getInstance().getWeaver().reloadScriptingInstance(retVal, ScriptingConst.ARTIFACT_TYPE_MANAGEDBEAN);
if (newRetVal != retVal) {
setValue(elContext, base, property, newRetVal);
@@ -74,16 +76,18 @@ public class ELResolverProxy extends ELR
public Class<?> getType(ELContext elContext, Object o, Object o1) throws NullPointerException, ELException {
Class<?> retVal = _delegate.getType(elContext, o, o1);
- if (retVal != null && WeavingContext.isDynamic(retVal)) {
- return WeavingContext.getWeaver().reloadScriptingClass(retVal);
+ if (retVal != null && WeavingContext.getInstance().isDynamic(retVal)) {
+ return WeavingContext.getInstance().reloadClass(retVal);
}
return retVal;
}
public void setValue(ELContext elContext, Object base, Object property, Object value) throws NullPointerException, ELException {
//now to more complex relations...
- if (base != null && WeavingContext.isDynamic(base.getClass()) && WeavingContext.isDynamic(value.getClass())) {
- WeavingContext.getRefreshContext().getDependencyRegistry().addDependency(ScriptingConst.ENGINE_TYPE_JSF_ALL, base.getClass().getName(), base.getClass().getName(), value.getClass().getName());
+ //TODO add dependency
+ if (base != null && WeavingContext.getInstance().isDynamic(base.getClass()) && WeavingContext.getInstance().isDynamic(value.getClass())) {
+ WeavingContext.getInstance().addDependency(ScriptingConst.ENGINE_TYPE_JSF_ALL, base.getClass().getName(),
+ value.getClass().getName());
}
_delegate.setValue(elContext, base, property, value);
}
Copied: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/dynamicDecorators/implementations/FacesContextProxy.java (from r1297490, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/FacesContextProxy.java)
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/dynamicDecorators/implementations/FacesContextProxy.java?p2=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/dynamicDecorators/implementations/FacesContextProxy.java&p1=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/FacesContextProxy.java&r1=1297490&r2=1298442&rev=1298442&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/FacesContextProxy.java (original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/dynamicDecorators/implementations/FacesContextProxy.java Thu Mar 8 15:53:02 2012
@@ -16,23 +16,24 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.myfaces.extensions.scripting.jsf.dynamicdecorators.implemetations;
+package rewrite.org.apache.myfaces.extensions.scripting.jsf.dynamicdecorators.implementations;
-import org.apache.myfaces.extensions.scripting.api.Decorated;
-import org.apache.myfaces.extensions.scripting.api.ScriptingConst;
-import org.apache.myfaces.extensions.scripting.core.util.WeavingContext;
-import javax.faces.context.*;
+import rewrite.org.apache.myfaces.extensions.scripting.core.common.Decorated;
+import rewrite.org.apache.myfaces.extensions.scripting.core.common.ScriptingConst;
+import rewrite.org.apache.myfaces.extensions.scripting.core.context.WeavingContext;
+
+import javax.el.ELContext;
import javax.faces.application.Application;
import javax.faces.application.FacesMessage;
import javax.faces.application.ProjectStage;
-import javax.faces.render.RenderKit;
import javax.faces.component.UIViewRoot;
+import javax.faces.context.*;
import javax.faces.event.PhaseId;
-import javax.el.ELContext;
+import javax.faces.render.RenderKit;
import java.util.Iterator;
-import java.util.Map;
import java.util.List;
+import java.util.Map;
/**
* A reloading, weaving faces context
@@ -45,15 +46,17 @@ import java.util.List;
*
* @author Werner Punz
*/
-public class FacesContextProxy extends FacesContext implements Decorated {
+public class FacesContextProxy extends FacesContext implements Decorated
+{
public FacesContext _delegate = null;
private void weaveDelegate() {
//in case of a context destroyed the weaver might be accessed a last time
//but is already null due to having no weaver in the shutdown thread
- if (_delegate != null && WeavingContext.getWeaver() != null)
- _delegate = (FacesContext) WeavingContext.getWeaver().reloadScriptingInstance(_delegate, ScriptingConst.ARTIFACT_TYPE_FACESCONTEXT);
+ if (_delegate != null && WeavingContext.getInstance().isScriptingEnabled())
+ _delegate = (FacesContext) WeavingContext.getInstance().reload(_delegate,
+ ScriptingConst.ARTIFACT_TYPE_FACESCONTEXT);
}
public ELContext getELContext() {
Copied: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/dynamicDecorators/implementations/LifefcycleProxy.java (from r1297490, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/LifefcycleProxy.java)
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/dynamicDecorators/implementations/LifefcycleProxy.java?p2=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/dynamicDecorators/implementations/LifefcycleProxy.java&p1=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/LifefcycleProxy.java&r1=1297490&r2=1298442&rev=1298442&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/LifefcycleProxy.java (original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/dynamicDecorators/implementations/LifefcycleProxy.java Thu Mar 8 15:53:02 2012
@@ -16,29 +16,32 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.myfaces.extensions.scripting.jsf.dynamicdecorators.implemetations;
+package rewrite.org.apache.myfaces.extensions.scripting.jsf.dynamicdecorators.implementations;
-import org.apache.myfaces.extensions.scripting.api.Decorated;
-import org.apache.myfaces.extensions.scripting.api.ScriptingConst;
-import org.apache.myfaces.extensions.scripting.core.util.WeavingContext;
-import javax.faces.lifecycle.Lifecycle;
-import javax.faces.event.PhaseListener;
-import javax.faces.context.FacesContext;
+import rewrite.org.apache.myfaces.extensions.scripting.core.common.Decorated;
+import rewrite.org.apache.myfaces.extensions.scripting.core.common.ScriptingConst;
+import rewrite.org.apache.myfaces.extensions.scripting.core.context.WeavingContext;
+
import javax.faces.FacesException;
+import javax.faces.context.FacesContext;
+import javax.faces.event.PhaseListener;
+import javax.faces.lifecycle.Lifecycle;
/**
* Scripting enabled lifecycle
*
* @author Werner Punz
*/
-public class LifefcycleProxy extends Lifecycle implements Decorated {
+public class LifefcycleProxy extends Lifecycle implements Decorated
+{
Lifecycle _delegate = null;
private void weaveDelegate() {
if (_delegate != null)
- _delegate = (Lifecycle) WeavingContext.getWeaver().reloadScriptingInstance(_delegate, ScriptingConst.ARTIFACT_TYPE_LIFECYCLE);
+ _delegate = (Lifecycle) WeavingContext.getInstance().reload(_delegate,
+ ScriptingConst.ARTIFACT_TYPE_LIFECYCLE);
}
public LifefcycleProxy(Lifecycle delegate) {
@@ -48,7 +51,7 @@ public class LifefcycleProxy extends Lif
public void addPhaseListener(PhaseListener phaseListener) {
weaveDelegate();
/*we can put our object weaving code into the add here*/
- if (WeavingContext.isDynamic(phaseListener.getClass()))
+ if (WeavingContext.getInstance().isDynamic(phaseListener.getClass()))
phaseListener = (PhaseListener) WeavingContext.createMethodReloadingProxyFromObject(phaseListener, PhaseListener.class, ScriptingConst.ARTIFACT_TYPE_PHASELISTENER);
_delegate.addPhaseListener(phaseListener);
Copied: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/dynamicDecorators/implementations/NavigationHandlerProxy.java (from r1297490, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/NavigationHandlerProxy.java)
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/dynamicDecorators/implementations/NavigationHandlerProxy.java?p2=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/dynamicDecorators/implementations/NavigationHandlerProxy.java&p1=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/NavigationHandlerProxy.java&r1=1297490&r2=1298442&rev=1298442&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/NavigationHandlerProxy.java (original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/dynamicDecorators/implementations/NavigationHandlerProxy.java Thu Mar 8 15:53:02 2012
@@ -16,11 +16,11 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.myfaces.extensions.scripting.jsf.dynamicdecorators.implemetations;
+package rewrite.org.apache.myfaces.extensions.scripting.jsf.dynamicdecorators.implementations;
-import org.apache.myfaces.extensions.scripting.api.Decorated;
-import org.apache.myfaces.extensions.scripting.api.ScriptingConst;
-import org.apache.myfaces.extensions.scripting.core.util.WeavingContext;
+import rewrite.org.apache.myfaces.extensions.scripting.core.common.Decorated;
+import rewrite.org.apache.myfaces.extensions.scripting.core.common.ScriptingConst;
+import rewrite.org.apache.myfaces.extensions.scripting.core.context.WeavingContext;
import javax.faces.application.NavigationHandler;
import javax.faces.context.FacesContext;
@@ -30,12 +30,14 @@ import javax.faces.context.FacesContext;
*
* @author Werner Punz
*/
-public class NavigationHandlerProxy extends NavigationHandler implements Decorated {
+public class NavigationHandlerProxy extends NavigationHandler implements Decorated
+{
NavigationHandler _delegate;
private void weaveDelegate() {
- _delegate = (NavigationHandler) WeavingContext.getWeaver().reloadScriptingInstance(_delegate, ScriptingConst.ARTIFACT_TYPE_NAVIGATIONHANDLER);
+ _delegate = (NavigationHandler) WeavingContext.getInstance().reload(_delegate,
+ ScriptingConst.ARTIFACT_TYPE_NAVIGATIONHANDLER);
}
public NavigationHandlerProxy(NavigationHandler delegate) {
Copied: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/dynamicDecorators/implementations/RenderkitProxy.java (from r1297490, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/RenderkitProxy.java)
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/dynamicDecorators/implementations/RenderkitProxy.java?p2=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/dynamicDecorators/implementations/RenderkitProxy.java&p1=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/RenderkitProxy.java&r1=1297490&r2=1298442&rev=1298442&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/RenderkitProxy.java (original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/dynamicDecorators/implementations/RenderkitProxy.java Thu Mar 8 15:53:02 2012
@@ -16,24 +16,22 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.myfaces.extensions.scripting.jsf.dynamicdecorators.implemetations;
+package rewrite.org.apache.myfaces.extensions.scripting.jsf.dynamicdecorators.implementations;
-import org.apache.myfaces.extensions.scripting.api.Decorated;
-import org.apache.myfaces.extensions.scripting.api.ScriptingConst;
-import org.apache.myfaces.extensions.scripting.core.util.WeavingContext;
-import org.apache.myfaces.extensions.scripting.jsf2.annotation.purged.PurgedRenderer;
-import org.apache.myfaces.extensions.scripting.jsf2.annotation.purged.PurgedClientBehaviorRenderer;
-import javax.faces.context.FacesContext;
+import rewrite.org.apache.myfaces.extensions.scripting.core.common.Decorated;
+import rewrite.org.apache.myfaces.extensions.scripting.core.common.ScriptingConst;
+import rewrite.org.apache.myfaces.extensions.scripting.core.context.WeavingContext;
+
+import javax.faces.FacesException;
+import javax.faces.context.ResponseStream;
+import javax.faces.context.ResponseWriter;
+import javax.faces.render.ClientBehaviorRenderer;
import javax.faces.render.RenderKit;
import javax.faces.render.Renderer;
import javax.faces.render.ResponseStateManager;
-import javax.faces.render.ClientBehaviorRenderer;
-import javax.faces.context.ResponseWriter;
-import javax.faces.context.ResponseStream;
-import javax.faces.FacesException;
-import java.io.Writer;
import java.io.OutputStream;
+import java.io.Writer;
import java.util.Iterator;
import java.util.Map;
@@ -44,7 +42,8 @@ import java.util.Map;
*
* @author Werner Punz
*/
-public class RenderkitProxy extends RenderKit implements Decorated {
+public class RenderkitProxy extends RenderKit implements Decorated
+{
RenderKit _delegate = null;
@@ -68,9 +67,9 @@ public class RenderkitProxy extends Rend
Renderer rendr2 = (Renderer) reloadInstance(rendr, ScriptingConst.ARTIFACT_TYPE_RENDERER);
if (rendr != rendr2) {
Renderer tempRenderer = _delegate.getRenderer(componentFamily, rendererType);
- if (tempRenderer instanceof PurgedRenderer) {
+ /**<></>if (tempRenderer instanceof PurgedRenderer) {
return handleAnnotationChange(componentFamily, rendererType);
- }
+ } */
_delegate.addRenderer(componentFamily, rendererType, rendr2);
return rendr2;
@@ -82,9 +81,9 @@ public class RenderkitProxy extends Rend
ClientBehaviorRenderer rendr2;
rendr2 = _delegate.getClientBehaviorRenderer(s);
- if (rendr2 instanceof PurgedClientBehaviorRenderer) {
+ /*<>if (rendr2 instanceof PurgedClientBehaviorRenderer) {
throw new FacesException("Renderer not found");
- }
+ } */
rendr2 = _delegate.getClientBehaviorRenderer(s);
return rendr2;
}
@@ -94,9 +93,9 @@ public class RenderkitProxy extends Rend
//WeavingContext.getWeaver().fullClassScan();
rendr2 = _delegate.getRenderer(s, s1);
- if (rendr2 instanceof PurgedRenderer) {
+ /*<>if (rendr2 instanceof PurgedRenderer) {
throw new FacesException("Renderer not found");
- }
+ }*/
rendr2 = _delegate.getRenderer(s, s1);
return rendr2;
}
@@ -132,9 +131,9 @@ public class RenderkitProxy extends Rend
if (rendr != rendr2) {
rendr2 = _delegate.getClientBehaviorRenderer(s);
- if (rendr2 instanceof PurgedClientBehaviorRenderer) {
+ /*<>if (rendr2 instanceof PurgedClientBehaviorRenderer) {
return handleAnnotationChangeBehaviorRenderer(s);
- }
+ }*/
return rendr2;
}
return rendr;
@@ -163,36 +162,18 @@ public class RenderkitProxy extends Rend
}
private void weaveDelegate() {
- _delegate = (RenderKit) WeavingContext.getWeaver().reloadScriptingInstance(_delegate, ScriptingConst.ARTIFACT_TYPE_RENDERKIT);
+ _delegate = (RenderKit) WeavingContext.getInstance().reload(_delegate, ScriptingConst.ARTIFACT_TYPE_RENDERKIT);
}
private Object reloadInstance(Object instance, int artefactType) {
if (instance == null) {
return null;
}
- if (WeavingContext.isDynamic(instance.getClass()) && !alreadyWovenInRequest(instance.getClass().getName())) {
- alreadyWovenInRequest(instance.getClass().getName());
- instance = WeavingContext.getWeaver().reloadScriptingInstance(instance, artefactType);
-
+ if (WeavingContext.getInstance().isDynamic(instance.getClass()) ) {
+ instance = WeavingContext.getInstance().reload(instance, artefactType);
//now the add should be done properly if possible
}
return instance;
}
- private boolean alreadyWovenInRequest(String clazz) {
- try {//portlets now can be enabled thanks to the jsf2 indirections regarding the external context
-
- //portlets now can be enabled thanks to the jsf2 indirections regarding the external context
- Map<String, Object> req = WeavingContext.getRequestMap();
- if (req.get(ScriptingConst.SCRIPTING_REQUSINGLETON + clazz) == null) {
- req.put(ScriptingConst.SCRIPTING_REQUSINGLETON + clazz, "");
- return false;
- }
- return true;
- } catch (UnsupportedOperationException ex) {
- //still in startup no additional weaving here
- return true;
- }
- }
-
}
Copied: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/dynamicDecorators/implementations/ResourceHandlerProxy.java (from r1297490, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/ResourceHandlerProxy.java)
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/dynamicDecorators/implementations/ResourceHandlerProxy.java?p2=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/dynamicDecorators/implementations/ResourceHandlerProxy.java&p1=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/ResourceHandlerProxy.java&r1=1297490&r2=1298442&rev=1298442&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/ResourceHandlerProxy.java (original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/dynamicDecorators/implementations/ResourceHandlerProxy.java Thu Mar 8 15:53:02 2012
@@ -16,10 +16,10 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.myfaces.extensions.scripting.jsf.dynamicdecorators.implemetations;
+package rewrite.org.apache.myfaces.extensions.scripting.jsf.dynamicdecorators.implementations;
-import org.apache.myfaces.extensions.scripting.core.util.WeavingContext;
import org.apache.myfaces.extensions.scripting.api.ScriptingConst;
+import org.apache.myfaces.extensions.scripting.core.util.WeavingContext;
import javax.faces.application.Resource;
import javax.faces.application.ResourceHandler;
Copied: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/dynamicDecorators/implementations/SystemEventListenerProxy.java (from r1297490, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/SystemEventListenerProxy.java)
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/dynamicDecorators/implementations/SystemEventListenerProxy.java?p2=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/dynamicDecorators/implementations/SystemEventListenerProxy.java&p1=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/SystemEventListenerProxy.java&r1=1297490&r2=1298442&rev=1298442&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/SystemEventListenerProxy.java (original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/dynamicDecorators/implementations/SystemEventListenerProxy.java Thu Mar 8 15:53:02 2012
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.apache.myfaces.extensions.scripting.jsf.dynamicdecorators.implemetations;
+package rewrite.org.apache.myfaces.extensions.scripting.jsf.dynamicdecorators.implementations;
import org.apache.myfaces.extensions.scripting.api.Decorated;
import org.apache.myfaces.extensions.scripting.api.ScriptingConst;
Copied: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/dynamicDecorators/implementations/VariableResolverProxy.java (from r1297490, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/VariableResolverProxy.java)
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/dynamicDecorators/implementations/VariableResolverProxy.java?p2=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/dynamicDecorators/implementations/VariableResolverProxy.java&p1=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/VariableResolverProxy.java&r1=1297490&r2=1298442&rev=1298442&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/VariableResolverProxy.java (original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/dynamicDecorators/implementations/VariableResolverProxy.java Thu Mar 8 15:53:02 2012
@@ -16,15 +16,16 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.myfaces.extensions.scripting.jsf.dynamicdecorators.implemetations;
+package rewrite.org.apache.myfaces.extensions.scripting.jsf.dynamicdecorators.implementations;
-import org.apache.myfaces.extensions.scripting.api.Decorated;
-import org.apache.myfaces.extensions.scripting.api.ScriptingConst;
-import org.apache.myfaces.extensions.scripting.core.util.WeavingContext;
-import javax.faces.context.FacesContext;
-import javax.faces.el.*;
+import rewrite.org.apache.myfaces.extensions.scripting.core.common.Decorated;
+import rewrite.org.apache.myfaces.extensions.scripting.core.common.ScriptingConst;
+import rewrite.org.apache.myfaces.extensions.scripting.core.context.WeavingContext;
+import javax.faces.context.FacesContext;
+import javax.faces.el.EvaluationException;
+import javax.faces.el.VariableResolver;
/**
* objects loaded must
@@ -33,7 +34,8 @@ import javax.faces.el.*;
* @author Werner Punz
*/
@SuppressWarnings("deprecation") //we must suppress it here
-public class VariableResolverProxy extends VariableResolver implements Decorated {
+public class VariableResolverProxy extends VariableResolver implements Decorated
+{
VariableResolver _delegate;
public VariableResolverProxy(VariableResolver delegate) {
@@ -42,8 +44,8 @@ public class VariableResolverProxy exten
public Object resolveVariable(FacesContext facesContext, String s) throws EvaluationException {
Object variable = _delegate.resolveVariable(facesContext, s);
- if (variable != null && WeavingContext.isDynamic(variable.getClass()))
- variable = WeavingContext.getWeaver().reloadScriptingInstance(variable, ScriptingConst.ARTIFACT_TYPE_MANAGEDBEAN);
+ if (variable != null && WeavingContext.getInstance().isDynamic(variable.getClass()))
+ variable = WeavingContext.getInstance().reload(variable, ScriptingConst.ARTIFACT_TYPE_MANAGEDBEAN);
return variable;
}
Copied: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/dynamicDecorators/implementations/ViewHandlerProxy.java (from r1297490, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/ViewHandlerProxy.java)
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/dynamicDecorators/implementations/ViewHandlerProxy.java?p2=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/dynamicDecorators/implementations/ViewHandlerProxy.java&p1=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/ViewHandlerProxy.java&r1=1297490&r2=1298442&rev=1298442&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/ViewHandlerProxy.java (original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/dynamicDecorators/implementations/ViewHandlerProxy.java Thu Mar 8 15:53:02 2012
@@ -16,34 +16,37 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.myfaces.extensions.scripting.jsf.dynamicdecorators.implemetations;
+package rewrite.org.apache.myfaces.extensions.scripting.jsf.dynamicdecorators.implementations;
-import org.apache.myfaces.extensions.scripting.api.Decorated;
-import org.apache.myfaces.extensions.scripting.api.ScriptingConst;
-import org.apache.myfaces.extensions.scripting.core.util.WeavingContext;
+import rewrite.org.apache.myfaces.extensions.scripting.core.common.Decorated;
+import rewrite.org.apache.myfaces.extensions.scripting.core.common.ScriptingConst;
+import rewrite.org.apache.myfaces.extensions.scripting.core.context.WeavingContext;
+
+import javax.faces.FacesException;
import javax.faces.application.ViewHandler;
-import javax.faces.context.FacesContext;
import javax.faces.component.UIViewRoot;
-import javax.faces.FacesException;
+import javax.faces.context.FacesContext;
import javax.faces.view.ViewDeclarationLanguage;
+import java.io.IOException;
+import java.util.List;
import java.util.Locale;
import java.util.Map;
-import java.util.List;
-import java.io.IOException;
/**
* Scripting enabled View Handler
*
* @author Werner Punz
*/
-public class ViewHandlerProxy extends ViewHandler implements Decorated {
+public class ViewHandlerProxy extends ViewHandler implements Decorated
+{
ViewHandler _delegate = null;
private void weaveDelegate() {
if (_delegate != null) {
- _delegate = (ViewHandler) WeavingContext.getWeaver().reloadScriptingInstance(_delegate, ScriptingConst.ARTIFACT_TYPE_VIEWHANDLER);
+ _delegate = (ViewHandler) WeavingContext.getInstance().reload(_delegate,
+ ScriptingConst.ARTIFACT_TYPE_VIEWHANDLER);
}
}