Author: pete.muir(a)jboss.org
Date: 2009-09-23 14:22:11 -0400 (Wed, 23 Sep 2009)
New Revision: 3768
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/el/AbstractWebBeansELResolver.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/el/ELCreationalContextStack.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/el/WebBeansMethodExpression.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/el/WebBeansValueExpression.java
ri/trunk/version-matrix/pom.xml
Log:
support the situation where the ELContextListener isn't registered
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/el/AbstractWebBeansELResolver.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/webbeans/el/AbstractWebBeansELResolver.java 2009-09-23
18:21:14 UTC (rev 3767)
+++
ri/trunk/impl/src/main/java/org/jboss/webbeans/el/AbstractWebBeansELResolver.java 2009-09-23
18:22:11 UTC (rev 3768)
@@ -16,18 +16,17 @@
*/
package org.jboss.webbeans.el;
+import static org.jboss.webbeans.el.ELCreationalContextStack.getCreationalContextStore;
+
import java.beans.FeatureDescriptor;
import java.util.Iterator;
import java.util.concurrent.Callable;
import javax.el.ELContext;
import javax.el.ELResolver;
-import javax.enterprise.context.spi.Contextual;
-import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.spi.Bean;
import org.jboss.webbeans.BeanManagerImpl;
-import org.jboss.webbeans.Container;
/**
* An EL-resolver against the named beans
@@ -37,18 +36,6 @@
public abstract class AbstractWebBeansELResolver extends ELResolver
{
- private static final Contextual<?> CONTEXTUAL = new Contextual<Object>()
- {
-
- public Object create(CreationalContext<Object> creationalContext)
- {
- return null;
- }
-
- public void destroy(Object instance, CreationalContext<Object>
creationalContext) {}
-
- };
-
protected abstract BeanManagerImpl getManager(ELContext context);
@Override
@@ -151,25 +138,6 @@
public void setValue(ELContext context, Object base, Object property, Object value)
{
}
-
- private static ELCreationalContextStack getCreationalContextStore(ELContext context)
- {
- Object o = context.getContext(ELCreationalContextStack.class);
-
- if (!(o instanceof ELCreationalContextStack))
- {
- ELCreationalContextStack store =
ELCreationalContextStack.addToContext(context);
- o = store;
- }
- ELCreationalContextStack store = (ELCreationalContextStack) o;
- if (store.isEmpty())
- {
- // TODO need to use correct manager for module
- ELCreationalContext<?> creationalContext =
ELCreationalContext.of(Container.instance().deploymentManager().createCreationalContext(CONTEXTUAL));
- store.push(creationalContext);
- }
- return (ELCreationalContextStack) o;
- }
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/el/ELCreationalContextStack.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/webbeans/el/ELCreationalContextStack.java 2009-09-23
18:21:14 UTC (rev 3767)
+++
ri/trunk/impl/src/main/java/org/jboss/webbeans/el/ELCreationalContextStack.java 2009-09-23
18:22:11 UTC (rev 3768)
@@ -3,10 +3,27 @@
import java.util.Stack;
import javax.el.ELContext;
+import javax.enterprise.context.spi.Contextual;
+import javax.enterprise.context.spi.CreationalContext;
+import org.jboss.webbeans.Container;
+
class ELCreationalContextStack extends Stack<ELCreationalContext<?>>
{
+
+ private static final Contextual<?> CONTEXTUAL = new Contextual<Object>()
+ {
+
+ public Object create(CreationalContext<Object> creationalContext)
+ {
+ return null;
+ }
+
+ public void destroy(Object instance, CreationalContext<Object>
creationalContext) {}
+
+ };
+
private static final long serialVersionUID = -57142365866995726L;
public static ELCreationalContextStack addToContext(ELContext context)
@@ -16,4 +33,24 @@
return store;
}
+
+ public static ELCreationalContextStack getCreationalContextStore(ELContext context)
+ {
+ Object o = context.getContext(ELCreationalContextStack.class);
+
+ if (!(o instanceof ELCreationalContextStack))
+ {
+ ELCreationalContextStack store =
ELCreationalContextStack.addToContext(context);
+ o = store;
+ }
+ ELCreationalContextStack store = (ELCreationalContextStack) o;
+ if (store.isEmpty())
+ {
+ // TODO need to use correct manager for module
+ ELCreationalContext<?> creationalContext =
ELCreationalContext.of(Container.instance().deploymentManager().createCreationalContext(CONTEXTUAL));
+ store.push(creationalContext);
+ }
+ return (ELCreationalContextStack) o;
+ }
+
}
\ No newline at end of file
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/el/WebBeansMethodExpression.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/webbeans/el/WebBeansMethodExpression.java 2009-09-23
18:21:14 UTC (rev 3767)
+++
ri/trunk/impl/src/main/java/org/jboss/webbeans/el/WebBeansMethodExpression.java 2009-09-23
18:22:11 UTC (rev 3768)
@@ -16,6 +16,8 @@
*/
package org.jboss.webbeans.el;
+import static org.jboss.webbeans.el.ELCreationalContextStack.getCreationalContextStore;
+
import javax.el.ELContext;
import javax.el.MethodExpression;
import javax.el.MethodInfo;
@@ -92,15 +94,5 @@
creationalContext.release();
}
}
-
- private ELCreationalContextStack getCreationalContextStore(ELContext context)
- {
- Object o = context.getContext(ELCreationalContextStack.class);
- if (!(o instanceof ELCreationalContextStack))
- {
- throw new IllegalStateException("Something went wrong with the ELContext,
expecting a CreationalContextStore to be present, but instead got " + o);
- }
- return (ELCreationalContextStack) o;
- }
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/el/WebBeansValueExpression.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/webbeans/el/WebBeansValueExpression.java 2009-09-23
18:21:14 UTC (rev 3767)
+++
ri/trunk/impl/src/main/java/org/jboss/webbeans/el/WebBeansValueExpression.java 2009-09-23
18:22:11 UTC (rev 3768)
@@ -16,6 +16,8 @@
*/
package org.jboss.webbeans.el;
+import static org.jboss.webbeans.el.ELCreationalContextStack.getCreationalContextStore;
+
import javax.el.ELContext;
import javax.el.ValueExpression;
import javax.enterprise.context.spi.Contextual;
@@ -109,15 +111,5 @@
creationalContext.release();
}
}
-
- private ELCreationalContextStack getCreationalContextStore(ELContext context)
- {
- Object o = context.getContext(ELCreationalContextStack.class);
- if (!(o instanceof ELCreationalContextStack))
- {
- throw new IllegalStateException("Something went wrong with the ELContext,
expecting a CreationalContextStore to be present, but instead got " + o);
- }
- return (ELCreationalContextStack) o;
- }
}
Modified: ri/trunk/version-matrix/pom.xml
===================================================================
--- ri/trunk/version-matrix/pom.xml 2009-09-23 18:21:14 UTC (rev 3767)
+++ ri/trunk/version-matrix/pom.xml 2009-09-23 18:22:11 UTC (rev 3768)
@@ -544,6 +544,11 @@
<version>1.0-beta-3</version>
</plugin>
<plugin>
+ <groupId>com.pyx4j</groupId>
+ <artifactId>maven-junction-plugin</artifactId>
+ <version>1.0.3</version>
+ </plugin>
+ <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.0-beta-1</version>
Show replies by date