Author: shane.bryzak(a)jboss.com
Date: 2009-10-08 01:51:23 -0400 (Thu, 08 Oct 2009)
New Revision: 3893
Added:
ri/trunk/impl/src/main/java/org/jboss/weld/bootstrap/WeldBootstrap.java
ri/trunk/impl/src/main/java/org/jboss/weld/el/AbstractWeldELResolver.java
ri/trunk/impl/src/main/java/org/jboss/weld/el/WeldELContextListener.java
ri/trunk/impl/src/main/java/org/jboss/weld/el/WeldELResolver.java
ri/trunk/impl/src/main/java/org/jboss/weld/el/WeldExpressionFactory.java
ri/trunk/impl/src/main/java/org/jboss/weld/el/WeldMethodExpression.java
ri/trunk/impl/src/main/java/org/jboss/weld/el/WeldValueExpression.java
ri/trunk/impl/src/main/java/org/jboss/weld/jsf/WeldPhaseListener.java
ri/trunk/impl/src/main/java/org/jboss/weld/servlet/WeldListener.java
ri/trunk/spi/src/main/java/org/jboss/weld/manager/api/WeldManager.java
ri/trunk/tests/src/main/java/org/jboss/weld/test/AbstractWeldTest.java
Removed:
ri/trunk/impl/src/main/java/org/jboss/weld/bootstrap/WebBeansBootstrap.java
ri/trunk/impl/src/main/java/org/jboss/weld/el/AbstractWebBeansELResolver.java
ri/trunk/impl/src/main/java/org/jboss/weld/el/WebBeansELContextListener.java
ri/trunk/impl/src/main/java/org/jboss/weld/el/WebBeansELResolver.java
ri/trunk/impl/src/main/java/org/jboss/weld/el/WebBeansExpressionFactory.java
ri/trunk/impl/src/main/java/org/jboss/weld/el/WebBeansMethodExpression.java
ri/trunk/impl/src/main/java/org/jboss/weld/el/WebBeansValueExpression.java
ri/trunk/impl/src/main/java/org/jboss/weld/jsf/WebBeansPhaseListener.java
ri/trunk/impl/src/main/java/org/jboss/weld/servlet/WebBeansListener.java
ri/trunk/spi/src/main/java/org/jboss/weld/manager/api/WebBeansManager.java
ri/trunk/tests/src/main/java/org/jboss/weld/test/AbstractWebBeansTest.java
Modified:
ri/trunk/dist/readme.txt
ri/trunk/dist/release-process.txt
ri/trunk/dist/versions.properties
ri/trunk/eclipse-code-formatter-profile.xml
ri/trunk/embedded-tck-runner/src/test/debug-resources/META-INF/jboss-test-harness.properties
ri/trunk/impl/src/main/java/org/jboss/weld/BeanManagerImpl.java
ri/trunk/jboss-as/build.properties
ri/trunk/jboss-tck-runner/src/test/debug-resources/META-INF/jboss-test-harness.properties
ri/trunk/spi/src/main/java/org/jboss/weld/bootstrap/api/Bootstrap.java
ri/trunk/spi/src/main/java/org/jboss/weld/bootstrap/api/Singleton.java
ri/trunk/spi/src/main/java/org/jboss/weld/bootstrap/api/helpers/ForwardingBootstrap.java
ri/trunk/spi/src/test/java/org/jboss/weld/bootstrap/api/test/MockBootstrap.java
ri/trunk/tests/src/main/java/org/jboss/weld/mock/MockServletLifecycle.java
ri/trunk/tests/src/main/java/org/jboss/weld/mock/el/EL.java
ri/trunk/tests/src/test/debug-resources/META-INF/jboss-test-harness.properties
ri/trunk/tests/src/test/java/org/jboss/weld/test/examples/ExampleTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/examples/MockExampleTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/activities/ActivitiesTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/activities/child/SameBeanTypeInChildActivityTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/activities/current/ELCurrentActivityTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/activities/current/EventCurrentActivityTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/activities/current/InactiveScopeTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/activities/current/InjectedManagerCurrentActivityTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/activities/current/InstanceCurrentActivityTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/activities/current/JndiManagerCurrentActivityTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/activities/current/NonNormalScopeTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/annotated/DeclaringTypeTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/annotated/ExampleTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/annotated/decoration/AnnotatedTypeDecoratorTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/bootstrap/DiscoverFailsBootstrapTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/bootstrap/multipleEnterprise/BootstrapTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/bootstrap/multipleEnterpriseAndSimple/BootstrapTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/bootstrap/multipleSimple/BootstrapTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/bootstrap/singleEnterprise/BootstrapTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/bootstrap/singleProducerMethod/BootstrapTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/bootstrap/singleSimple/BootstrapTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/context/ApplicationScopedTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/context/ContextTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/context/ParameterizedTypeScopedTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/context/PassivatingContextTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/decorator/simple/SimpleDecoratorTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/definition/ELResolverTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/definition/StereotypesTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/environments/servlet/ServletLifecycleTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/NewEnterpriseBeanTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/annotatedItem/ClassAnnotatedItemTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/enterprise/EnterpriseBeanTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/event/SimpleEventTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/event/tx/AbstractHtmlUnitTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/exceptions/ExceptionHandlingTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/named/NamedBeanWithBindingTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/newsimple/NewSimpleBeanTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/producer/field/ParameterizedProducerTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/producer/method/DisposalMethodOnOtherBeanNotResolvedTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/producer/method/ManagerProducerTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/producer/method/NamedProducerTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/producer/method/NamedProducerWithBindingTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/producer/method/NullProducerTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/proxy/ProxyTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/proxy/enterprise/EnterpriseBeanProxyTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/interceptor/ejb/EnterpriseBeanInterceptionTests.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/interceptor/ejb3model/Ejb3InterceptionModelTests.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/interceptor/simple/SimpleInterceptorTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/lookup/LookupInstanceTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/lookup/Wbri256Test.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/lookup/circular/CircularDependencyTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/lookup/wbri279/Wbri279Test.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/lookup/wbri293/ContextualReferenceTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/manager/EjbDescriptorLookupTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/manager/ManagerTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/noncontextual/ExampleTest.java
Log:
source code refactorings
Modified: ri/trunk/dist/readme.txt
===================================================================
--- ri/trunk/dist/readme.txt 2009-10-08 05:29:40 UTC (rev 3892)
+++ ri/trunk/dist/readme.txt 2009-10-08 05:51:23 UTC (rev 3893)
@@ -2,7 +2,7 @@
------------
Java Contexts and Dependency Injection (JSR-299) is a new Java standard for
-dependency injection and contextual lifecycle management. Web Beans is the
+dependency injection and contextual lifecycle management. Weld is the
reference implementation of JSR-299.
This distribution, as a whole, is licensed under the terms of the Apache Public
@@ -12,10 +12,10 @@
doc/
-- The Reference guide, take a look at doc/en-US/html/index.html for getting
- started using Web Beans and the facilities offered by JSR-299.
+ started using Weld and the facilities offered by JSR-299.
examples/
- -- The Web Beans examples, the examples are described in more detail in the
+ -- The Weld examples, the examples are described in more detail in the
reference guide
jboss-as/
@@ -25,5 +25,5 @@
lib/
-- Libraries, for building the examples
-lib/webbeans
- -- Web Beans binary, source and javadoc jars
+lib/weld
+ -- Weld binary, source and javadoc jars
Modified: ri/trunk/dist/release-process.txt
===================================================================
--- ri/trunk/dist/release-process.txt 2009-10-08 05:29:40 UTC (rev 3892)
+++ ri/trunk/dist/release-process.txt 2009-10-08 05:51:23 UTC (rev 3893)
@@ -1,4 +1,4 @@
-Release process for Web Beans RI
+Release process for Weld
--------------------------------
* Run the testsuite and examples
@@ -10,7 +10,7 @@
* Check the tags
* Build the maven artifacts using release:perform in all locations
* Verify the checkout of the tag
-* Release the webbeans-ri-int for jbossas if necessary
+* Release the weld-ri-int for jbossas if necessary
* Edit the checkout of the tag, and alter the versions in jboss-as/build.properties to
released versions
* Edit the checkout of the tag, and alter the versions of all poms under examples to be
the released versions
* Checkin tag changes
Modified: ri/trunk/dist/versions.properties
===================================================================
--- ri/trunk/dist/versions.properties 2009-10-08 05:29:40 UTC (rev 3892)
+++ ri/trunk/dist/versions.properties 2009-10-08 05:51:23 UTC (rev 3893)
@@ -1,6 +1,6 @@
jsr299.version=1.0.0-SNAPSHOT
-webbeans.version=1.0.0-SNAPSHOT
-webbeans.servlet.version=1.0.0-SNAPSHOT
-webbeans.logger.version=1.0.0-SNAPSHOT
-webbeans.wicket.version=1.0.0-SNAPSHOT
-webbeans.se.version=1.0.0-SNAPSHOT
+weld.version=1.0.0-SNAPSHOT
+weld.servlet.version=1.0.0-SNAPSHOT
+weld.logger.version=1.0.0-SNAPSHOT
+weld.wicket.version=1.0.0-SNAPSHOT
+weld.se.version=1.0.0-SNAPSHOT
Modified: ri/trunk/eclipse-code-formatter-profile.xml
===================================================================
--- ri/trunk/eclipse-code-formatter-profile.xml 2009-10-08 05:29:40 UTC (rev 3892)
+++ ri/trunk/eclipse-code-formatter-profile.xml 2009-10-08 05:51:23 UTC (rev 3893)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"
standalone="no"?>
<profiles version="11">
-<profile kind="CodeFormatterProfile" name="WebBeans"
version="11">
+<profile kind="CodeFormatterProfile" name="Weld"
version="11">
<setting
id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags"
value="insert"/>
<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation"
value="insert"/>
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters"
value="do not insert"/>
Modified:
ri/trunk/embedded-tck-runner/src/test/debug-resources/META-INF/jboss-test-harness.properties
===================================================================
---
ri/trunk/embedded-tck-runner/src/test/debug-resources/META-INF/jboss-test-harness.properties 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/embedded-tck-runner/src/test/debug-resources/META-INF/jboss-test-harness.properties 2009-10-08
05:51:23 UTC (rev 3893)
@@ -1,5 +1,5 @@
# Configuration for running incontainer tests from your IDE
-# Alter the path webbeans accordingly (relative from the tck/impl dir)
+# Alter the path weld accordingly (relative from the tck/impl dir)
org.jboss.testharness.standalone=false
org.jboss.testharness.container.extraConfigurationDir=../../weld/jboss-as
org.jboss.testharness.container.forceRestart=false
Modified: ri/trunk/impl/src/main/java/org/jboss/weld/BeanManagerImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/BeanManagerImpl.java 2009-10-08 05:29:40
UTC (rev 3892)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/BeanManagerImpl.java 2009-10-08 05:51:23
UTC (rev 3893)
@@ -67,14 +67,14 @@
import org.jboss.weld.ejb.EjbDescriptors;
import org.jboss.weld.ejb.spi.EjbDescriptor;
import org.jboss.weld.el.Namespace;
-import org.jboss.weld.el.WebBeansELResolver;
-import org.jboss.weld.el.WebBeansExpressionFactory;
+import org.jboss.weld.el.WeldELResolver;
+import org.jboss.weld.el.WeldExpressionFactory;
import org.jboss.weld.introspector.WBAnnotated;
import org.jboss.weld.literal.AnyLiteral;
import org.jboss.weld.literal.DefaultLiteral;
import org.jboss.weld.log.Log;
import org.jboss.weld.log.Logging;
-import org.jboss.weld.manager.api.WebBeansManager;
+import org.jboss.weld.manager.api.WeldManager;
import org.jboss.weld.metadata.cache.MetaAnnotationStore;
import org.jboss.weld.metadata.cache.ScopeModel;
import org.jboss.weld.resolution.NameBasedResolver;
@@ -100,7 +100,7 @@
import com.google.common.collect.Multimaps;
/**
- * Implementation of the Web Beans Manager.
+ * Implementation of the Weld Manager.
*
* Essentially a singleton for registering Beans, Contexts, Observers,
* Interceptors etc. as well as providing resolution
@@ -108,7 +108,7 @@
* @author Pete Muir
* @author Marius Bogoevici
*/
-public class BeanManagerImpl implements WebBeansManager, Serializable
+public class BeanManagerImpl implements WeldManager, Serializable
{
@@ -222,7 +222,7 @@
private transient final TypeSafeResolver<? extends Resolvable,
InterceptorImpl<?>> interceptorResolver;
private transient final TypeSafeResolver<? extends Resolvable,
ObserverMethod<?,?>> observerResolver;
private transient final NameBasedResolver nameBasedResolver;
- private transient final ELResolver webbeansELResolver;
+ private transient final ELResolver weldELResolver;
private transient Namespace rootNamespace;
/*
@@ -428,7 +428,7 @@
this.interceptorResolver = new TypeSafeInterceptorResolver(this,
createDynamicAccessibleIterable(Transform.INTERCEPTOR_BEAN));
this.observerResolver = new TypeSafeObserverResolver(this,
createDynamicAccessibleIterable(Transform.EVENT_OBSERVER));
this.nameBasedResolver = new NameBasedResolver(this,
createDynamicAccessibleIterable(Transform.BEAN));
- this.webbeansELResolver = new WebBeansELResolver(this);
+ this.weldELResolver = new WeldELResolver(this);
this.childActivities = new CopyOnWriteArraySet<BeanManagerImpl>();
this.currentInjectionPoint = new ThreadLocal<Stack<InjectionPoint>>()
@@ -1363,12 +1363,12 @@
public ELResolver getELResolver()
{
- return webbeansELResolver;
+ return weldELResolver;
}
public ExpressionFactory wrapExpressionFactory(ExpressionFactory expressionFactory)
{
- return new WebBeansExpressionFactory(expressionFactory);
+ return new WeldExpressionFactory(expressionFactory);
}
public <T> WBCreationalContext<T>
createCreationalContext(Contextual<T> contextual)
Deleted: ri/trunk/impl/src/main/java/org/jboss/weld/bootstrap/WebBeansBootstrap.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/bootstrap/WebBeansBootstrap.java 2009-10-08
05:29:40 UTC (rev 3892)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/bootstrap/WebBeansBootstrap.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -1,439 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed 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.jboss.weld.bootstrap;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-import java.util.Map.Entry;
-
-import javax.enterprise.inject.spi.BeforeBeanDiscovery;
-import javax.enterprise.inject.spi.BeforeShutdown;
-import javax.enterprise.inject.spi.Extension;
-
-import org.jboss.weld.BeanManagerImpl;
-import org.jboss.weld.Container;
-import org.jboss.weld.ContextualStore;
-import org.jboss.weld.DefinitionException;
-import org.jboss.weld.DeploymentException;
-import org.jboss.weld.Validator;
-import org.jboss.weld.bean.builtin.ManagerBean;
-import org.jboss.weld.bootstrap.api.Bootstrap;
-import org.jboss.weld.bootstrap.api.Environment;
-import org.jboss.weld.bootstrap.api.Lifecycle;
-import org.jboss.weld.bootstrap.api.Service;
-import org.jboss.weld.bootstrap.api.ServiceRegistry;
-import org.jboss.weld.bootstrap.api.helpers.ServiceRegistries;
-import org.jboss.weld.bootstrap.api.helpers.SimpleServiceRegistry;
-import org.jboss.weld.bootstrap.events.AfterBeanDiscoveryImpl;
-import org.jboss.weld.bootstrap.events.AfterDeploymentValidationImpl;
-import org.jboss.weld.bootstrap.events.BeforeBeanDiscoveryImpl;
-import org.jboss.weld.bootstrap.events.BeforeShutdownImpl;
-import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
-import org.jboss.weld.bootstrap.spi.Deployment;
-import org.jboss.weld.context.AbstractApplicationContext;
-import org.jboss.weld.context.ApplicationContext;
-import org.jboss.weld.context.ContextLifecycle;
-import org.jboss.weld.context.ConversationContext;
-import org.jboss.weld.context.DependentContext;
-import org.jboss.weld.context.RequestContext;
-import org.jboss.weld.context.SessionContext;
-import org.jboss.weld.context.SingletonContext;
-import org.jboss.weld.context.api.BeanStore;
-import org.jboss.weld.ejb.EJBApiAbstraction;
-import org.jboss.weld.ejb.EjbDescriptors;
-import org.jboss.weld.jsf.JsfApiAbstraction;
-import org.jboss.weld.log.Log;
-import org.jboss.weld.log.Logging;
-import org.jboss.weld.metadata.TypeStore;
-import org.jboss.weld.metadata.cache.MetaAnnotationStore;
-import org.jboss.weld.persistence.PersistenceApiAbstraction;
-import org.jboss.weld.resources.ClassTransformer;
-import org.jboss.weld.resources.DefaultResourceLoader;
-import org.jboss.weld.resources.spi.ResourceLoader;
-import org.jboss.weld.servlet.ServletApiAbstraction;
-import org.jboss.weld.transaction.spi.TransactionServices;
-import org.jboss.weld.util.serviceProvider.ServiceLoader;
-import org.jboss.weld.ws.WSApiAbstraction;
-
-/**
- * Common bootstrapping functionality that is run at application startup and
- * detects and register beans
- *
- * @author Pete Muir
- */
-public class WebBeansBootstrap implements Bootstrap
-{
-
- /**
- *
- * A Deployment visitor which can find the transitive closure of Bean
- * Deployment Archives
- *
- * @author pmuir
- *
- */
- private static class DeploymentVisitor
- {
-
- private final BeanManagerImpl deploymentManager;
- private final Environment environment;
- private final Deployment deployment;
- private final ExtensionBeanDeployerEnvironment extensionBeanDeployerEnvironment;
-
- public DeploymentVisitor(BeanManagerImpl deploymentManager, Environment
environment, Deployment deployment, ExtensionBeanDeployerEnvironment
extensionBeanDeployerEnvironment)
- {
- this.deploymentManager = deploymentManager;
- this.environment = environment;
- this.deployment = deployment;
- this.extensionBeanDeployerEnvironment = extensionBeanDeployerEnvironment;
- }
-
- public Map<BeanDeploymentArchive, BeanDeployment> visit()
- {
- Set<BeanDeploymentArchive> seenBeanDeploymentArchives = new
HashSet<BeanDeploymentArchive>();
- Map<BeanDeploymentArchive, BeanDeployment>
managerAwareBeanDeploymentArchives = new HashMap<BeanDeploymentArchive,
BeanDeployment>();
- for (BeanDeploymentArchive archvive : deployment.getBeanDeploymentArchives())
- {
- visit(archvive, managerAwareBeanDeploymentArchives,
seenBeanDeploymentArchives);
- }
- return managerAwareBeanDeploymentArchives;
- }
-
- private BeanDeployment visit(BeanDeploymentArchive beanDeploymentArchive,
Map<BeanDeploymentArchive, BeanDeployment> managerAwareBeanDeploymentArchives,
Set<BeanDeploymentArchive> seenBeanDeploymentArchives)
- {
- // Check that the required services are specified
- verifyServices(beanDeploymentArchive.getServices(),
environment.getRequiredBeanDeploymentArchiveServices());
-
- // Check the id is not null
- if (beanDeploymentArchive.getId() == null)
- {
- throw new IllegalArgumentException("BeanDeploymentArchive must not be
null " + beanDeploymentArchive);
- }
-
- // Create the BeanDeployment and attach
- BeanDeployment parent = new BeanDeployment(beanDeploymentArchive,
deploymentManager, deployment, extensionBeanDeployerEnvironment,
deployment.getServices());
- managerAwareBeanDeploymentArchives.put(beanDeploymentArchive, parent);
- seenBeanDeploymentArchives.add(beanDeploymentArchive);
- for (BeanDeploymentArchive archive :
beanDeploymentArchive.getBeanDeploymentArchives())
- {
- // Cut any circularties
- if (!seenBeanDeploymentArchives.contains(archive))
- {
- BeanDeployment child = visit(archive, managerAwareBeanDeploymentArchives,
seenBeanDeploymentArchives);
- parent.getBeanManager().addAccessibleBeanManager(child.getBeanManager());
- }
- }
- return parent;
- }
-
- }
-
- // The log provider
- private static Log log = Logging.getLog(WebBeansBootstrap.class);
-
- static
- {
- log.info("Web Beans " + getVersion());
- }
-
- // The Web Beans manager
- private BeanManagerImpl deploymentManager;
- private Map<BeanDeploymentArchive, BeanDeployment> beanDeployments;
- private Environment environment;
- private Deployment deployment;
- private ExtensionBeanDeployerEnvironment extensionBeanDeployerEnvironment;
-
- public Bootstrap startContainer(Environment environment, Deployment deployment,
BeanStore applicationBeanStore)
- {
- synchronized (this)
- {
- if (deployment == null)
- {
- throw new IllegalArgumentException("Must start the container with a
deployment");
- }
- if (!deployment.getServices().contains(ResourceLoader.class))
- {
- deployment.getServices().add(ResourceLoader.class, new
DefaultResourceLoader());
- }
-
- verifyServices(deployment.getServices(),
environment.getRequiredDeploymentServices());
-
- if (!deployment.getServices().contains(TransactionServices.class))
- {
- log.info("Transactional services not available. Injection of @Current
UserTransaction not available. Transactional observers will be invoked
synchronously.");
- }
- // TODO Reinstate if we can find a good way to detect.
-// if (!deployment.getServices().contains(EjbServices.class))
-// {
-// log.info("EJB services not available. Session beans will be simple
beans, CDI-style injection into non-contextual EJBs, injection of remote EJBs and
injection of @EJB in simple beans will not be available");
-// }
-// if (!deployment.getServices().contains(JpaInjectionServices.class))
-// {
-// log.info("JPA services not available. Injection of @PersistenceContext
will not occur. Entity beans will be discovered as simple beans.");
-// }
-// if (!deployment.getServices().contains(ResourceInjectionServices.class))
-// {
-// log.info("@Resource injection not available.");
-// }
- if (applicationBeanStore == null)
- {
- throw new IllegalStateException("No application context BeanStore
set");
- }
-
- this.deployment = deployment;
- ServiceRegistry implementationServices =
getImplementationServices(deployment.getServices().get(ResourceLoader.class));
-
- deployment.getServices().addAll(implementationServices.entrySet());
-
- ServiceRegistry deploymentServices = new SimpleServiceRegistry();
- deploymentServices.add(ClassTransformer.class,
implementationServices.get(ClassTransformer.class));
- deploymentServices.add(MetaAnnotationStore.class,
implementationServices.get(MetaAnnotationStore.class));
- deploymentServices.add(TypeStore.class,
implementationServices.get(TypeStore.class));
-
- this.environment = environment;
- this.deploymentManager = BeanManagerImpl.newRootManager("deployment",
deploymentServices);
-
- Container.initialize(deploymentManager,
ServiceRegistries.unmodifiableServiceRegistry(deployment.getServices()));
-
- createContexts();
- initializeContexts();
- // Start the application context
-
Container.instance().deploymentServices().get(ContextLifecycle.class).beginApplication(applicationBeanStore);
-
- this.extensionBeanDeployerEnvironment = new
ExtensionBeanDeployerEnvironment(EjbDescriptors.EMPTY, deploymentManager);
-
- DeploymentVisitor deploymentVisitor = new DeploymentVisitor(deploymentManager,
environment, deployment, extensionBeanDeployerEnvironment);
- beanDeployments = deploymentVisitor.visit();
-
- return this;
- }
- }
-
- private ServiceRegistry getImplementationServices(ResourceLoader resourceLoader)
- {
- ServiceRegistry services = new SimpleServiceRegistry();
- services.add(EJBApiAbstraction.class, new EJBApiAbstraction(resourceLoader));
- services.add(JsfApiAbstraction.class, new JsfApiAbstraction(resourceLoader));
- services.add(PersistenceApiAbstraction.class, new
PersistenceApiAbstraction(resourceLoader));
- services.add(WSApiAbstraction.class, new WSApiAbstraction(resourceLoader));
- services.add(ServletApiAbstraction.class, new
ServletApiAbstraction(resourceLoader));
- // Temporary workaround to provide context for building annotated class
- // TODO expose AnnotatedClass on SPI and allow container to provide impl of this
via ResourceLoader
- services.add(Validator.class, new Validator());
- services.add(TypeStore.class, new TypeStore());
- services.add(ClassTransformer.class, new
ClassTransformer(services.get(TypeStore.class)));
- services.add(MetaAnnotationStore.class, new
MetaAnnotationStore(services.get(ClassTransformer.class)));
- services.add(ContextualStore.class, new ContextualStore());
- return services;
- }
-
- public BeanManagerImpl getManager(BeanDeploymentArchive beanDeploymentArchive)
- {
- if (beanDeployments.containsKey(beanDeploymentArchive))
- {
- return beanDeployments.get(beanDeploymentArchive).getBeanManager();
- }
- else
- {
- return null;
- }
- }
-
- public Bootstrap startInitialization()
- {
- synchronized (this)
- {
- if (deploymentManager == null)
- {
- throw new IllegalStateException("Manager has not been
initialized");
- }
-
- ExtensionBeanDeployer extensionBeanDeployer = new
ExtensionBeanDeployer(deploymentManager, extensionBeanDeployerEnvironment);
- extensionBeanDeployer.addExtensions(ServiceLoader.load(Extension.class));
- extensionBeanDeployer.createBeans().deploy();
-
- // Add the Deployment BeanManager Bean to the Deployment BeanManager
- deploymentManager.addBean(new ManagerBean(deploymentManager));
-
- fireBeforeBeanDiscoveryEvent();
- }
- return this;
- }
-
- public Bootstrap deployBeans()
- {
- synchronized (this)
- {
- for (Entry<BeanDeploymentArchive, BeanDeployment> entry :
beanDeployments.entrySet())
- {
- entry.getValue().deployBeans(environment);
- }
- fireAfterBeanDiscoveryEvent();
- log.debug("Web Beans initialized. Validating beans.");
- }
- return this;
- }
-
- public Bootstrap validateBeans()
- {
- synchronized (this)
- {
- for (Entry<BeanDeploymentArchive, BeanDeployment> entry :
beanDeployments.entrySet())
- {
-
deployment.getServices().get(Validator.class).validateDeployment(entry.getValue().getBeanManager(),
entry.getValue().getBeanDeployer().getEnvironment());
- }
- fireAfterDeploymentValidationEvent();
- }
- return this;
- }
-
- public Bootstrap endInitialization()
- {
- synchronized (this)
- {
- // Register the managers so external requests can handle them
- Container.instance().putBeanDeployments(beanDeployments);
- Container.instance().setInitialized(true);
- }
- return this;
- }
-
- private void fireBeforeBeanDiscoveryEvent()
- {
- BeforeBeanDiscovery event = new BeforeBeanDiscoveryImpl(deploymentManager,
deployment, beanDeployments, extensionBeanDeployerEnvironment);
- try
- {
- deploymentManager.fireEvent(event);
- }
- catch (Exception e)
- {
- throw new DefinitionException(e);
- }
- }
-
- private void fireBeforeShutdownEvent()
- {
- BeforeShutdown event = new BeforeShutdownImpl();
- try
- {
- deploymentManager.fireEvent(event);
- }
- catch (Exception e)
- {
- throw new DeploymentException(e);
- }
- }
-
- private void fireAfterBeanDiscoveryEvent()
- {
- AfterBeanDiscoveryImpl event = new AfterBeanDiscoveryImpl(deploymentManager,
deployment, beanDeployments, extensionBeanDeployerEnvironment);
- try
- {
- deploymentManager.fireEvent(event);
- }
- catch (Exception e)
- {
- event.addDefinitionError(e);
- }
-
- if (event.getDefinitionErrors().size() > 0)
- {
- // FIXME communicate all the captured definition errors in this exception
- throw new DefinitionException(event.getDefinitionErrors().get(0));
- }
- }
-
- private void fireAfterDeploymentValidationEvent()
- {
- AfterDeploymentValidationImpl event = new AfterDeploymentValidationImpl();
-
- try
- {
- deploymentManager.fireEvent(event);
- }
- catch (Exception e)
- {
- event.addDeploymentProblem(e);
- }
-
- if (event.getDeploymentProblems().size() > 0)
- {
- // FIXME communicate all the captured deployment problems in this exception
- throw new DeploymentException(event.getDeploymentProblems().get(0));
- }
- }
-
- /**
- * Gets version information
- *
- * @return The implementation version from the Bootstrap class package.
- */
- public static String getVersion()
- {
- Package pkg = WebBeansBootstrap.class.getPackage();
- return pkg != null ? pkg.getImplementationVersion() : null;
- }
-
- protected void initializeContexts()
- {
- Lifecycle lifecycle = deployment.getServices().get(ContextLifecycle.class);
- deploymentManager.addContext(lifecycle.getDependentContext());
- deploymentManager.addContext(lifecycle.getRequestContext());
- deploymentManager.addContext(lifecycle.getConversationContext());
- deploymentManager.addContext(lifecycle.getSessionContext());
- deploymentManager.addContext(lifecycle.getApplicationContext());
- deploymentManager.addContext(lifecycle.getSingletonContext());
- }
-
- protected void createContexts()
- {
- AbstractApplicationContext applicationContext = new ApplicationContext();
- AbstractApplicationContext singletonContext = new SingletonContext();
- SessionContext sessionContext = new SessionContext();
- ConversationContext conversationContext = new ConversationContext();
- RequestContext requestContext = new RequestContext();
- DependentContext dependentContext = new DependentContext();
-
- deployment.getServices().add(ContextLifecycle.class, new
ContextLifecycle(applicationContext, singletonContext, sessionContext,
conversationContext, requestContext, dependentContext));
- }
-
- public void shutdown()
- {
- try
- {
- fireBeforeShutdownEvent();
- }
- finally
- {
-
Container.instance().deploymentServices().get(ContextLifecycle.class).endApplication();
- }
- }
-
- protected static void verifyServices(ServiceRegistry services, Set<Class<?
extends Service>> requiredServices)
- {
- for (Class<? extends Service> serviceType : requiredServices)
- {
- if (!services.contains(serviceType))
- {
- throw new IllegalStateException("Required service " +
serviceType.getName() + " has not been specified");
- }
- }
- }
-
-}
Copied: ri/trunk/impl/src/main/java/org/jboss/weld/bootstrap/WeldBootstrap.java (from rev
3879, ri/trunk/impl/src/main/java/org/jboss/weld/bootstrap/WebBeansBootstrap.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/bootstrap/WeldBootstrap.java
(rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/bootstrap/WeldBootstrap.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -0,0 +1,439 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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.jboss.weld.bootstrap;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.Map.Entry;
+
+import javax.enterprise.inject.spi.BeforeBeanDiscovery;
+import javax.enterprise.inject.spi.BeforeShutdown;
+import javax.enterprise.inject.spi.Extension;
+
+import org.jboss.weld.BeanManagerImpl;
+import org.jboss.weld.Container;
+import org.jboss.weld.ContextualStore;
+import org.jboss.weld.DefinitionException;
+import org.jboss.weld.DeploymentException;
+import org.jboss.weld.Validator;
+import org.jboss.weld.bean.builtin.ManagerBean;
+import org.jboss.weld.bootstrap.api.Bootstrap;
+import org.jboss.weld.bootstrap.api.Environment;
+import org.jboss.weld.bootstrap.api.Lifecycle;
+import org.jboss.weld.bootstrap.api.Service;
+import org.jboss.weld.bootstrap.api.ServiceRegistry;
+import org.jboss.weld.bootstrap.api.helpers.ServiceRegistries;
+import org.jboss.weld.bootstrap.api.helpers.SimpleServiceRegistry;
+import org.jboss.weld.bootstrap.events.AfterBeanDiscoveryImpl;
+import org.jboss.weld.bootstrap.events.AfterDeploymentValidationImpl;
+import org.jboss.weld.bootstrap.events.BeforeBeanDiscoveryImpl;
+import org.jboss.weld.bootstrap.events.BeforeShutdownImpl;
+import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
+import org.jboss.weld.bootstrap.spi.Deployment;
+import org.jboss.weld.context.AbstractApplicationContext;
+import org.jboss.weld.context.ApplicationContext;
+import org.jboss.weld.context.ContextLifecycle;
+import org.jboss.weld.context.ConversationContext;
+import org.jboss.weld.context.DependentContext;
+import org.jboss.weld.context.RequestContext;
+import org.jboss.weld.context.SessionContext;
+import org.jboss.weld.context.SingletonContext;
+import org.jboss.weld.context.api.BeanStore;
+import org.jboss.weld.ejb.EJBApiAbstraction;
+import org.jboss.weld.ejb.EjbDescriptors;
+import org.jboss.weld.jsf.JsfApiAbstraction;
+import org.jboss.weld.log.Log;
+import org.jboss.weld.log.Logging;
+import org.jboss.weld.metadata.TypeStore;
+import org.jboss.weld.metadata.cache.MetaAnnotationStore;
+import org.jboss.weld.persistence.PersistenceApiAbstraction;
+import org.jboss.weld.resources.ClassTransformer;
+import org.jboss.weld.resources.DefaultResourceLoader;
+import org.jboss.weld.resources.spi.ResourceLoader;
+import org.jboss.weld.servlet.ServletApiAbstraction;
+import org.jboss.weld.transaction.spi.TransactionServices;
+import org.jboss.weld.util.serviceProvider.ServiceLoader;
+import org.jboss.weld.ws.WSApiAbstraction;
+
+/**
+ * Common bootstrapping functionality that is run at application startup and
+ * detects and register beans
+ *
+ * @author Pete Muir
+ */
+public class WeldBootstrap implements Bootstrap
+{
+
+ /**
+ *
+ * A Deployment visitor which can find the transitive closure of Bean
+ * Deployment Archives
+ *
+ * @author pmuir
+ *
+ */
+ private static class DeploymentVisitor
+ {
+
+ private final BeanManagerImpl deploymentManager;
+ private final Environment environment;
+ private final Deployment deployment;
+ private final ExtensionBeanDeployerEnvironment extensionBeanDeployerEnvironment;
+
+ public DeploymentVisitor(BeanManagerImpl deploymentManager, Environment
environment, Deployment deployment, ExtensionBeanDeployerEnvironment
extensionBeanDeployerEnvironment)
+ {
+ this.deploymentManager = deploymentManager;
+ this.environment = environment;
+ this.deployment = deployment;
+ this.extensionBeanDeployerEnvironment = extensionBeanDeployerEnvironment;
+ }
+
+ public Map<BeanDeploymentArchive, BeanDeployment> visit()
+ {
+ Set<BeanDeploymentArchive> seenBeanDeploymentArchives = new
HashSet<BeanDeploymentArchive>();
+ Map<BeanDeploymentArchive, BeanDeployment>
managerAwareBeanDeploymentArchives = new HashMap<BeanDeploymentArchive,
BeanDeployment>();
+ for (BeanDeploymentArchive archvive : deployment.getBeanDeploymentArchives())
+ {
+ visit(archvive, managerAwareBeanDeploymentArchives,
seenBeanDeploymentArchives);
+ }
+ return managerAwareBeanDeploymentArchives;
+ }
+
+ private BeanDeployment visit(BeanDeploymentArchive beanDeploymentArchive,
Map<BeanDeploymentArchive, BeanDeployment> managerAwareBeanDeploymentArchives,
Set<BeanDeploymentArchive> seenBeanDeploymentArchives)
+ {
+ // Check that the required services are specified
+ verifyServices(beanDeploymentArchive.getServices(),
environment.getRequiredBeanDeploymentArchiveServices());
+
+ // Check the id is not null
+ if (beanDeploymentArchive.getId() == null)
+ {
+ throw new IllegalArgumentException("BeanDeploymentArchive must not be
null " + beanDeploymentArchive);
+ }
+
+ // Create the BeanDeployment and attach
+ BeanDeployment parent = new BeanDeployment(beanDeploymentArchive,
deploymentManager, deployment, extensionBeanDeployerEnvironment,
deployment.getServices());
+ managerAwareBeanDeploymentArchives.put(beanDeploymentArchive, parent);
+ seenBeanDeploymentArchives.add(beanDeploymentArchive);
+ for (BeanDeploymentArchive archive :
beanDeploymentArchive.getBeanDeploymentArchives())
+ {
+ // Cut any circularties
+ if (!seenBeanDeploymentArchives.contains(archive))
+ {
+ BeanDeployment child = visit(archive, managerAwareBeanDeploymentArchives,
seenBeanDeploymentArchives);
+ parent.getBeanManager().addAccessibleBeanManager(child.getBeanManager());
+ }
+ }
+ return parent;
+ }
+
+ }
+
+ // The log provider
+ private static Log log = Logging.getLog(WeldBootstrap.class);
+
+ static
+ {
+ log.info("Web Beans " + getVersion());
+ }
+
+ // The Web Beans manager
+ private BeanManagerImpl deploymentManager;
+ private Map<BeanDeploymentArchive, BeanDeployment> beanDeployments;
+ private Environment environment;
+ private Deployment deployment;
+ private ExtensionBeanDeployerEnvironment extensionBeanDeployerEnvironment;
+
+ public Bootstrap startContainer(Environment environment, Deployment deployment,
BeanStore applicationBeanStore)
+ {
+ synchronized (this)
+ {
+ if (deployment == null)
+ {
+ throw new IllegalArgumentException("Must start the container with a
deployment");
+ }
+ if (!deployment.getServices().contains(ResourceLoader.class))
+ {
+ deployment.getServices().add(ResourceLoader.class, new
DefaultResourceLoader());
+ }
+
+ verifyServices(deployment.getServices(),
environment.getRequiredDeploymentServices());
+
+ if (!deployment.getServices().contains(TransactionServices.class))
+ {
+ log.info("Transactional services not available. Injection of @Current
UserTransaction not available. Transactional observers will be invoked
synchronously.");
+ }
+ // TODO Reinstate if we can find a good way to detect.
+// if (!deployment.getServices().contains(EjbServices.class))
+// {
+// log.info("EJB services not available. Session beans will be simple
beans, CDI-style injection into non-contextual EJBs, injection of remote EJBs and
injection of @EJB in simple beans will not be available");
+// }
+// if (!deployment.getServices().contains(JpaInjectionServices.class))
+// {
+// log.info("JPA services not available. Injection of @PersistenceContext
will not occur. Entity beans will be discovered as simple beans.");
+// }
+// if (!deployment.getServices().contains(ResourceInjectionServices.class))
+// {
+// log.info("@Resource injection not available.");
+// }
+ if (applicationBeanStore == null)
+ {
+ throw new IllegalStateException("No application context BeanStore
set");
+ }
+
+ this.deployment = deployment;
+ ServiceRegistry implementationServices =
getImplementationServices(deployment.getServices().get(ResourceLoader.class));
+
+ deployment.getServices().addAll(implementationServices.entrySet());
+
+ ServiceRegistry deploymentServices = new SimpleServiceRegistry();
+ deploymentServices.add(ClassTransformer.class,
implementationServices.get(ClassTransformer.class));
+ deploymentServices.add(MetaAnnotationStore.class,
implementationServices.get(MetaAnnotationStore.class));
+ deploymentServices.add(TypeStore.class,
implementationServices.get(TypeStore.class));
+
+ this.environment = environment;
+ this.deploymentManager = BeanManagerImpl.newRootManager("deployment",
deploymentServices);
+
+ Container.initialize(deploymentManager,
ServiceRegistries.unmodifiableServiceRegistry(deployment.getServices()));
+
+ createContexts();
+ initializeContexts();
+ // Start the application context
+
Container.instance().deploymentServices().get(ContextLifecycle.class).beginApplication(applicationBeanStore);
+
+ this.extensionBeanDeployerEnvironment = new
ExtensionBeanDeployerEnvironment(EjbDescriptors.EMPTY, deploymentManager);
+
+ DeploymentVisitor deploymentVisitor = new DeploymentVisitor(deploymentManager,
environment, deployment, extensionBeanDeployerEnvironment);
+ beanDeployments = deploymentVisitor.visit();
+
+ return this;
+ }
+ }
+
+ private ServiceRegistry getImplementationServices(ResourceLoader resourceLoader)
+ {
+ ServiceRegistry services = new SimpleServiceRegistry();
+ services.add(EJBApiAbstraction.class, new EJBApiAbstraction(resourceLoader));
+ services.add(JsfApiAbstraction.class, new JsfApiAbstraction(resourceLoader));
+ services.add(PersistenceApiAbstraction.class, new
PersistenceApiAbstraction(resourceLoader));
+ services.add(WSApiAbstraction.class, new WSApiAbstraction(resourceLoader));
+ services.add(ServletApiAbstraction.class, new
ServletApiAbstraction(resourceLoader));
+ // Temporary workaround to provide context for building annotated class
+ // TODO expose AnnotatedClass on SPI and allow container to provide impl of this
via ResourceLoader
+ services.add(Validator.class, new Validator());
+ services.add(TypeStore.class, new TypeStore());
+ services.add(ClassTransformer.class, new
ClassTransformer(services.get(TypeStore.class)));
+ services.add(MetaAnnotationStore.class, new
MetaAnnotationStore(services.get(ClassTransformer.class)));
+ services.add(ContextualStore.class, new ContextualStore());
+ return services;
+ }
+
+ public BeanManagerImpl getManager(BeanDeploymentArchive beanDeploymentArchive)
+ {
+ if (beanDeployments.containsKey(beanDeploymentArchive))
+ {
+ return beanDeployments.get(beanDeploymentArchive).getBeanManager();
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public Bootstrap startInitialization()
+ {
+ synchronized (this)
+ {
+ if (deploymentManager == null)
+ {
+ throw new IllegalStateException("Manager has not been
initialized");
+ }
+
+ ExtensionBeanDeployer extensionBeanDeployer = new
ExtensionBeanDeployer(deploymentManager, extensionBeanDeployerEnvironment);
+ extensionBeanDeployer.addExtensions(ServiceLoader.load(Extension.class));
+ extensionBeanDeployer.createBeans().deploy();
+
+ // Add the Deployment BeanManager Bean to the Deployment BeanManager
+ deploymentManager.addBean(new ManagerBean(deploymentManager));
+
+ fireBeforeBeanDiscoveryEvent();
+ }
+ return this;
+ }
+
+ public Bootstrap deployBeans()
+ {
+ synchronized (this)
+ {
+ for (Entry<BeanDeploymentArchive, BeanDeployment> entry :
beanDeployments.entrySet())
+ {
+ entry.getValue().deployBeans(environment);
+ }
+ fireAfterBeanDiscoveryEvent();
+ log.debug("Web Beans initialized. Validating beans.");
+ }
+ return this;
+ }
+
+ public Bootstrap validateBeans()
+ {
+ synchronized (this)
+ {
+ for (Entry<BeanDeploymentArchive, BeanDeployment> entry :
beanDeployments.entrySet())
+ {
+
deployment.getServices().get(Validator.class).validateDeployment(entry.getValue().getBeanManager(),
entry.getValue().getBeanDeployer().getEnvironment());
+ }
+ fireAfterDeploymentValidationEvent();
+ }
+ return this;
+ }
+
+ public Bootstrap endInitialization()
+ {
+ synchronized (this)
+ {
+ // Register the managers so external requests can handle them
+ Container.instance().putBeanDeployments(beanDeployments);
+ Container.instance().setInitialized(true);
+ }
+ return this;
+ }
+
+ private void fireBeforeBeanDiscoveryEvent()
+ {
+ BeforeBeanDiscovery event = new BeforeBeanDiscoveryImpl(deploymentManager,
deployment, beanDeployments, extensionBeanDeployerEnvironment);
+ try
+ {
+ deploymentManager.fireEvent(event);
+ }
+ catch (Exception e)
+ {
+ throw new DefinitionException(e);
+ }
+ }
+
+ private void fireBeforeShutdownEvent()
+ {
+ BeforeShutdown event = new BeforeShutdownImpl();
+ try
+ {
+ deploymentManager.fireEvent(event);
+ }
+ catch (Exception e)
+ {
+ throw new DeploymentException(e);
+ }
+ }
+
+ private void fireAfterBeanDiscoveryEvent()
+ {
+ AfterBeanDiscoveryImpl event = new AfterBeanDiscoveryImpl(deploymentManager,
deployment, beanDeployments, extensionBeanDeployerEnvironment);
+ try
+ {
+ deploymentManager.fireEvent(event);
+ }
+ catch (Exception e)
+ {
+ event.addDefinitionError(e);
+ }
+
+ if (event.getDefinitionErrors().size() > 0)
+ {
+ // FIXME communicate all the captured definition errors in this exception
+ throw new DefinitionException(event.getDefinitionErrors().get(0));
+ }
+ }
+
+ private void fireAfterDeploymentValidationEvent()
+ {
+ AfterDeploymentValidationImpl event = new AfterDeploymentValidationImpl();
+
+ try
+ {
+ deploymentManager.fireEvent(event);
+ }
+ catch (Exception e)
+ {
+ event.addDeploymentProblem(e);
+ }
+
+ if (event.getDeploymentProblems().size() > 0)
+ {
+ // FIXME communicate all the captured deployment problems in this exception
+ throw new DeploymentException(event.getDeploymentProblems().get(0));
+ }
+ }
+
+ /**
+ * Gets version information
+ *
+ * @return The implementation version from the Bootstrap class package.
+ */
+ public static String getVersion()
+ {
+ Package pkg = WeldBootstrap.class.getPackage();
+ return pkg != null ? pkg.getImplementationVersion() : null;
+ }
+
+ protected void initializeContexts()
+ {
+ Lifecycle lifecycle = deployment.getServices().get(ContextLifecycle.class);
+ deploymentManager.addContext(lifecycle.getDependentContext());
+ deploymentManager.addContext(lifecycle.getRequestContext());
+ deploymentManager.addContext(lifecycle.getConversationContext());
+ deploymentManager.addContext(lifecycle.getSessionContext());
+ deploymentManager.addContext(lifecycle.getApplicationContext());
+ deploymentManager.addContext(lifecycle.getSingletonContext());
+ }
+
+ protected void createContexts()
+ {
+ AbstractApplicationContext applicationContext = new ApplicationContext();
+ AbstractApplicationContext singletonContext = new SingletonContext();
+ SessionContext sessionContext = new SessionContext();
+ ConversationContext conversationContext = new ConversationContext();
+ RequestContext requestContext = new RequestContext();
+ DependentContext dependentContext = new DependentContext();
+
+ deployment.getServices().add(ContextLifecycle.class, new
ContextLifecycle(applicationContext, singletonContext, sessionContext,
conversationContext, requestContext, dependentContext));
+ }
+
+ public void shutdown()
+ {
+ try
+ {
+ fireBeforeShutdownEvent();
+ }
+ finally
+ {
+
Container.instance().deploymentServices().get(ContextLifecycle.class).endApplication();
+ }
+ }
+
+ protected static void verifyServices(ServiceRegistry services, Set<Class<?
extends Service>> requiredServices)
+ {
+ for (Class<? extends Service> serviceType : requiredServices)
+ {
+ if (!services.contains(serviceType))
+ {
+ throw new IllegalStateException("Required service " +
serviceType.getName() + " has not been specified");
+ }
+ }
+ }
+
+}
Deleted: ri/trunk/impl/src/main/java/org/jboss/weld/el/AbstractWebBeansELResolver.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/weld/el/AbstractWebBeansELResolver.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/el/AbstractWebBeansELResolver.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -1,143 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed 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.jboss.weld.el;
-
-import static org.jboss.weld.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.inject.spi.Bean;
-
-import org.jboss.weld.BeanManagerImpl;
-
-/**
- * An EL-resolver against the named beans
- *
- * @author Pete Muir
- */
-public abstract class AbstractWebBeansELResolver extends ELResolver
-{
-
- protected abstract BeanManagerImpl getManager(ELContext context);
-
- @Override
- public Class<?> getCommonPropertyType(ELContext context, Object base)
- {
- return null;
- }
-
- @Override
- public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context,
Object base)
- {
- return null;
- }
-
- @Override
- public Class<?> getType(ELContext context, Object base, Object property)
- {
- return null;
- }
-
- @Override
- public Object getValue(final ELContext context, Object base, Object property)
- {
- if (property != null)
- {
- String propertyString = property.toString();
- Namespace namespace = null;
- if (base == null)
- {
- if (getManager(context).getRootNamespace().contains(propertyString))
- {
- context.setPropertyResolved(true);
- return getManager(context).getRootNamespace().get(propertyString);
- }
- }
- else if (base instanceof Namespace)
- {
- namespace = (Namespace) base;
- // We're definitely the responsible party
- context.setPropertyResolved(true);
- if (namespace.contains(propertyString))
- {
- // There is a child namespace
- return namespace.get(propertyString);
- }
- }
- else
- {
- // let the standard EL resolver chain handle the property
- return null;
- }
- final String name;
- if (namespace != null)
- {
- // Try looking in the manager for a bean
- name = namespace.qualifyName(propertyString);
- }
- else
- {
- name = propertyString;
- }
- Object value = null;
- try
- {
- final Bean<?> bean =
getManager(context).resolve(getManager(context).getBeans(name));
- final ELCreationalContext<?> creationalContext =
getCreationalContextStore(context).peek();
- if (bean != null)
- {
- value = creationalContext.putIfAbsent(bean, new Callable<Object>()
- {
-
- public Object call() throws Exception
- {
- return getManager(context).getReference(bean, creationalContext);
- }
-
- });
- }
- }
- catch (Exception e)
- {
- throw new RuntimeException("Error resolving property " +
propertyString + " against base " + base, e);
- }
- if (value != null)
- {
- context.setPropertyResolved(true);
- return value;
- }
- }
- return null;
- }
-
- @Override
- public boolean isReadOnly(ELContext context, Object base, Object property)
- {
- return false;
- }
-
- @Override
- public void setValue(ELContext context, Object base, Object property, Object value)
- {
- }
-
-}
-
Copied: ri/trunk/impl/src/main/java/org/jboss/weld/el/AbstractWeldELResolver.java (from
rev 3879, ri/trunk/impl/src/main/java/org/jboss/weld/el/AbstractWebBeansELResolver.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/el/AbstractWeldELResolver.java
(rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/el/AbstractWeldELResolver.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -0,0 +1,143 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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.jboss.weld.el;
+
+import static org.jboss.weld.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.inject.spi.Bean;
+
+import org.jboss.weld.BeanManagerImpl;
+
+/**
+ * An EL-resolver against the named beans
+ *
+ * @author Pete Muir
+ */
+public abstract class AbstractWeldELResolver extends ELResolver
+{
+
+ protected abstract BeanManagerImpl getManager(ELContext context);
+
+ @Override
+ public Class<?> getCommonPropertyType(ELContext context, Object base)
+ {
+ return null;
+ }
+
+ @Override
+ public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context,
Object base)
+ {
+ return null;
+ }
+
+ @Override
+ public Class<?> getType(ELContext context, Object base, Object property)
+ {
+ return null;
+ }
+
+ @Override
+ public Object getValue(final ELContext context, Object base, Object property)
+ {
+ if (property != null)
+ {
+ String propertyString = property.toString();
+ Namespace namespace = null;
+ if (base == null)
+ {
+ if (getManager(context).getRootNamespace().contains(propertyString))
+ {
+ context.setPropertyResolved(true);
+ return getManager(context).getRootNamespace().get(propertyString);
+ }
+ }
+ else if (base instanceof Namespace)
+ {
+ namespace = (Namespace) base;
+ // We're definitely the responsible party
+ context.setPropertyResolved(true);
+ if (namespace.contains(propertyString))
+ {
+ // There is a child namespace
+ return namespace.get(propertyString);
+ }
+ }
+ else
+ {
+ // let the standard EL resolver chain handle the property
+ return null;
+ }
+ final String name;
+ if (namespace != null)
+ {
+ // Try looking in the manager for a bean
+ name = namespace.qualifyName(propertyString);
+ }
+ else
+ {
+ name = propertyString;
+ }
+ Object value = null;
+ try
+ {
+ final Bean<?> bean =
getManager(context).resolve(getManager(context).getBeans(name));
+ final ELCreationalContext<?> creationalContext =
getCreationalContextStore(context).peek();
+ if (bean != null)
+ {
+ value = creationalContext.putIfAbsent(bean, new Callable<Object>()
+ {
+
+ public Object call() throws Exception
+ {
+ return getManager(context).getReference(bean, creationalContext);
+ }
+
+ });
+ }
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException("Error resolving property " +
propertyString + " against base " + base, e);
+ }
+ if (value != null)
+ {
+ context.setPropertyResolved(true);
+ return value;
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public boolean isReadOnly(ELContext context, Object base, Object property)
+ {
+ return false;
+ }
+
+ @Override
+ public void setValue(ELContext context, Object base, Object property, Object value)
+ {
+ }
+
+}
+
Deleted: ri/trunk/impl/src/main/java/org/jboss/weld/el/WebBeansELContextListener.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/weld/el/WebBeansELContextListener.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/el/WebBeansELContextListener.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -1,37 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed 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.jboss.weld.el;
-
-import javax.el.ELContextEvent;
-import javax.el.ELContextListener;
-
-/**
- * Responsible for pushing the CreationalContext stack into the ELContext which
- * is later populated by our expression wrappers
- *
- * @author pmuir
- *
- */
-public class WebBeansELContextListener implements ELContextListener
-{
-
- public void contextCreated(ELContextEvent contextEvent)
- {
- ELCreationalContextStack.addToContext(contextEvent.getELContext());
- }
-
-}
Deleted: ri/trunk/impl/src/main/java/org/jboss/weld/el/WebBeansELResolver.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/el/WebBeansELResolver.java 2009-10-08
05:29:40 UTC (rev 3892)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/el/WebBeansELResolver.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -1,43 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed 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.jboss.weld.el;
-
-import javax.el.ELContext;
-
-import org.jboss.weld.BeanManagerImpl;
-
-/**
- * @author pmuir
- *
- */
-public class WebBeansELResolver extends AbstractWebBeansELResolver
-{
-
- private final BeanManagerImpl beanManager;
-
- public WebBeansELResolver(BeanManagerImpl beanManager)
- {
- this.beanManager = beanManager;
- }
-
- @Override
- protected BeanManagerImpl getManager(ELContext context)
- {
- return beanManager;
- }
-
-}
Deleted: ri/trunk/impl/src/main/java/org/jboss/weld/el/WebBeansExpressionFactory.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/weld/el/WebBeansExpressionFactory.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/el/WebBeansExpressionFactory.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -1,64 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed 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.jboss.weld.el;
-
-import javax.el.ELContext;
-import javax.el.ExpressionFactory;
-import javax.el.MethodExpression;
-import javax.el.ValueExpression;
-
-import org.jboss.weld.util.el.ForwardingExpressionFactory;
-
-/**
- * @author pmuir
- *
- */
-public class WebBeansExpressionFactory extends ForwardingExpressionFactory
-{
-
- private final ExpressionFactory delegate;
-
- public WebBeansExpressionFactory(ExpressionFactory expressionFactory)
- {
- if (expressionFactory == null)
- {
- throw new IllegalArgumentException("Cannot pass null
expressionFactory");
- }
- this.delegate = expressionFactory;
- }
-
- @Override
- protected ExpressionFactory delegate()
- {
- return delegate;
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public ValueExpression createValueExpression(ELContext context, String expression,
Class expectedType)
- {
- return new WebBeansValueExpression(super.createValueExpression(context, expression,
expectedType));
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public MethodExpression createMethodExpression(ELContext context, String expression,
Class expectedReturnType, Class[] expectedParamTypes)
- {
- return new WebBeansMethodExpression(super.createMethodExpression(context,
expression, expectedReturnType, expectedParamTypes));
- }
-
-}
Deleted: ri/trunk/impl/src/main/java/org/jboss/weld/el/WebBeansMethodExpression.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/el/WebBeansMethodExpression.java 2009-10-08
05:29:40 UTC (rev 3892)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/el/WebBeansMethodExpression.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -1,98 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed 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.jboss.weld.el;
-
-import static org.jboss.weld.el.ELCreationalContextStack.getCreationalContextStore;
-
-import javax.el.ELContext;
-import javax.el.MethodExpression;
-import javax.el.MethodInfo;
-import javax.enterprise.context.spi.Contextual;
-import javax.enterprise.context.spi.CreationalContext;
-
-import org.jboss.weld.Container;
-import org.jboss.weld.util.el.ForwardingMethodExpression;
-
-/**
- * @author pmuir
- *
- */
-public class WebBeansMethodExpression extends ForwardingMethodExpression
-{
-
- private static final long serialVersionUID = 7070020110515571744L;
-
- 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 final MethodExpression delegate;
-
- public WebBeansMethodExpression(MethodExpression delegate)
- {
- this.delegate = delegate;
- }
-
- @Override
- protected MethodExpression delegate()
- {
- return delegate;
- }
-
- @Override
- public Object invoke(ELContext context, Object[] params)
- {
- // TODO need to use correct manager for module
- ELCreationalContext<?> creationalContext =
ELCreationalContext.of(Container.instance().deploymentManager().createCreationalContext(CONTEXTUAL));
- try
- {
- getCreationalContextStore(context).push(creationalContext);
- return super.invoke(context, params);
- }
- finally
- {
- getCreationalContextStore(context).pop();
- creationalContext.release();
- }
- }
-
- @Override
- public MethodInfo getMethodInfo(ELContext context)
- {
- // TODO need to use correct manager for module
- ELCreationalContext<?> creationalContext =
ELCreationalContext.of(Container.instance().deploymentManager().createCreationalContext(CONTEXTUAL));
- try
- {
- getCreationalContextStore(context).push(creationalContext);
- return super.getMethodInfo(context);
- }
- finally
- {
- getCreationalContextStore(context).pop();
- creationalContext.release();
- }
- }
-
-}
Deleted: ri/trunk/impl/src/main/java/org/jboss/weld/el/WebBeansValueExpression.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/el/WebBeansValueExpression.java 2009-10-08
05:29:40 UTC (rev 3892)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/el/WebBeansValueExpression.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -1,115 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed 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.jboss.weld.el;
-
-import static org.jboss.weld.el.ELCreationalContextStack.getCreationalContextStore;
-
-import javax.el.ELContext;
-import javax.el.ValueExpression;
-import javax.enterprise.context.spi.Contextual;
-import javax.enterprise.context.spi.CreationalContext;
-
-import org.jboss.weld.Container;
-import org.jboss.weld.util.el.ForwardingValueExpression;
-
-/**
- * @author pmuir
- *
- */
-public class WebBeansValueExpression extends ForwardingValueExpression
-{
-
- private static final long serialVersionUID = 1122137212009930853L;
-
- 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 final ValueExpression delegate;
-
- public WebBeansValueExpression(ValueExpression delegate)
- {
- this.delegate = delegate;
- }
-
- @Override
- protected ValueExpression delegate()
- {
- return delegate;
- }
-
- @Override
- public Object getValue(final ELContext context)
- {
- // TODO need to use correct manager for module
- ELCreationalContext<?> creationalContext =
ELCreationalContext.of(Container.instance().deploymentManager().createCreationalContext(CONTEXTUAL));
- try
- {
- getCreationalContextStore(context).push(creationalContext);
- return delegate().getValue(context);
- }
- finally
- {
- getCreationalContextStore(context).pop();
- creationalContext.release();
- }
- }
-
- @Override
- public void setValue(ELContext context, Object value)
- {
- // TODO need to use correct manager for module
- ELCreationalContext<?> creationalContext =
ELCreationalContext.of(Container.instance().deploymentManager().createCreationalContext(CONTEXTUAL));
- try
- {
- getCreationalContextStore(context).push(creationalContext);
- delegate().setValue(context, value);
- }
- finally
- {
- getCreationalContextStore(context).pop();
- creationalContext.release();
- }
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Class getType(ELContext context)
- {
- // TODO need to use correct manager for module
- ELCreationalContext<?> creationalContext =
ELCreationalContext.of(Container.instance().deploymentManager().createCreationalContext(CONTEXTUAL));
- try
- {
- getCreationalContextStore(context).push(creationalContext);
- return delegate().getType(context);
- }
- finally
- {
- getCreationalContextStore(context).pop();
- creationalContext.release();
- }
- }
-
-}
Copied: ri/trunk/impl/src/main/java/org/jboss/weld/el/WeldELContextListener.java (from rev
3879, ri/trunk/impl/src/main/java/org/jboss/weld/el/WebBeansELContextListener.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/el/WeldELContextListener.java
(rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/el/WeldELContextListener.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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.jboss.weld.el;
+
+import javax.el.ELContextEvent;
+import javax.el.ELContextListener;
+
+/**
+ * Responsible for pushing the CreationalContext stack into the ELContext which
+ * is later populated by our expression wrappers
+ *
+ * @author pmuir
+ *
+ */
+public class WeldELContextListener implements ELContextListener
+{
+
+ public void contextCreated(ELContextEvent contextEvent)
+ {
+ ELCreationalContextStack.addToContext(contextEvent.getELContext());
+ }
+
+}
Copied: ri/trunk/impl/src/main/java/org/jboss/weld/el/WeldELResolver.java (from rev 3879,
ri/trunk/impl/src/main/java/org/jboss/weld/el/WebBeansELResolver.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/el/WeldELResolver.java
(rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/el/WeldELResolver.java 2009-10-08 05:51:23
UTC (rev 3893)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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.jboss.weld.el;
+
+import javax.el.ELContext;
+
+import org.jboss.weld.BeanManagerImpl;
+
+/**
+ * @author pmuir
+ *
+ */
+public class WeldELResolver extends AbstractWeldELResolver
+{
+
+ private final BeanManagerImpl beanManager;
+
+ public WeldELResolver(BeanManagerImpl beanManager)
+ {
+ this.beanManager = beanManager;
+ }
+
+ @Override
+ protected BeanManagerImpl getManager(ELContext context)
+ {
+ return beanManager;
+ }
+
+}
Copied: ri/trunk/impl/src/main/java/org/jboss/weld/el/WeldExpressionFactory.java (from rev
3879, ri/trunk/impl/src/main/java/org/jboss/weld/el/WebBeansExpressionFactory.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/el/WeldExpressionFactory.java
(rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/el/WeldExpressionFactory.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -0,0 +1,64 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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.jboss.weld.el;
+
+import javax.el.ELContext;
+import javax.el.ExpressionFactory;
+import javax.el.MethodExpression;
+import javax.el.ValueExpression;
+
+import org.jboss.weld.util.el.ForwardingExpressionFactory;
+
+/**
+ * @author pmuir
+ *
+ */
+public class WeldExpressionFactory extends ForwardingExpressionFactory
+{
+
+ private final ExpressionFactory delegate;
+
+ public WeldExpressionFactory(ExpressionFactory expressionFactory)
+ {
+ if (expressionFactory == null)
+ {
+ throw new IllegalArgumentException("Cannot pass null
expressionFactory");
+ }
+ this.delegate = expressionFactory;
+ }
+
+ @Override
+ protected ExpressionFactory delegate()
+ {
+ return delegate;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public ValueExpression createValueExpression(ELContext context, String expression,
Class expectedType)
+ {
+ return new WeldValueExpression(super.createValueExpression(context, expression,
expectedType));
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public MethodExpression createMethodExpression(ELContext context, String expression,
Class expectedReturnType, Class[] expectedParamTypes)
+ {
+ return new WeldMethodExpression(super.createMethodExpression(context, expression,
expectedReturnType, expectedParamTypes));
+ }
+
+}
Copied: ri/trunk/impl/src/main/java/org/jboss/weld/el/WeldMethodExpression.java (from rev
3879, ri/trunk/impl/src/main/java/org/jboss/weld/el/WebBeansMethodExpression.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/el/WeldMethodExpression.java
(rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/el/WeldMethodExpression.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -0,0 +1,98 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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.jboss.weld.el;
+
+import static org.jboss.weld.el.ELCreationalContextStack.getCreationalContextStore;
+
+import javax.el.ELContext;
+import javax.el.MethodExpression;
+import javax.el.MethodInfo;
+import javax.enterprise.context.spi.Contextual;
+import javax.enterprise.context.spi.CreationalContext;
+
+import org.jboss.weld.Container;
+import org.jboss.weld.util.el.ForwardingMethodExpression;
+
+/**
+ * @author pmuir
+ *
+ */
+public class WeldMethodExpression extends ForwardingMethodExpression
+{
+
+ private static final long serialVersionUID = 7070020110515571744L;
+
+ 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 final MethodExpression delegate;
+
+ public WeldMethodExpression(MethodExpression delegate)
+ {
+ this.delegate = delegate;
+ }
+
+ @Override
+ protected MethodExpression delegate()
+ {
+ return delegate;
+ }
+
+ @Override
+ public Object invoke(ELContext context, Object[] params)
+ {
+ // TODO need to use correct manager for module
+ ELCreationalContext<?> creationalContext =
ELCreationalContext.of(Container.instance().deploymentManager().createCreationalContext(CONTEXTUAL));
+ try
+ {
+ getCreationalContextStore(context).push(creationalContext);
+ return super.invoke(context, params);
+ }
+ finally
+ {
+ getCreationalContextStore(context).pop();
+ creationalContext.release();
+ }
+ }
+
+ @Override
+ public MethodInfo getMethodInfo(ELContext context)
+ {
+ // TODO need to use correct manager for module
+ ELCreationalContext<?> creationalContext =
ELCreationalContext.of(Container.instance().deploymentManager().createCreationalContext(CONTEXTUAL));
+ try
+ {
+ getCreationalContextStore(context).push(creationalContext);
+ return super.getMethodInfo(context);
+ }
+ finally
+ {
+ getCreationalContextStore(context).pop();
+ creationalContext.release();
+ }
+ }
+
+}
Copied: ri/trunk/impl/src/main/java/org/jboss/weld/el/WeldValueExpression.java (from rev
3879, ri/trunk/impl/src/main/java/org/jboss/weld/el/WebBeansValueExpression.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/el/WeldValueExpression.java
(rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/el/WeldValueExpression.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -0,0 +1,115 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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.jboss.weld.el;
+
+import static org.jboss.weld.el.ELCreationalContextStack.getCreationalContextStore;
+
+import javax.el.ELContext;
+import javax.el.ValueExpression;
+import javax.enterprise.context.spi.Contextual;
+import javax.enterprise.context.spi.CreationalContext;
+
+import org.jboss.weld.Container;
+import org.jboss.weld.util.el.ForwardingValueExpression;
+
+/**
+ * @author pmuir
+ *
+ */
+public class WeldValueExpression extends ForwardingValueExpression
+{
+
+ private static final long serialVersionUID = 1122137212009930853L;
+
+ 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 final ValueExpression delegate;
+
+ public WeldValueExpression(ValueExpression delegate)
+ {
+ this.delegate = delegate;
+ }
+
+ @Override
+ protected ValueExpression delegate()
+ {
+ return delegate;
+ }
+
+ @Override
+ public Object getValue(final ELContext context)
+ {
+ // TODO need to use correct manager for module
+ ELCreationalContext<?> creationalContext =
ELCreationalContext.of(Container.instance().deploymentManager().createCreationalContext(CONTEXTUAL));
+ try
+ {
+ getCreationalContextStore(context).push(creationalContext);
+ return delegate().getValue(context);
+ }
+ finally
+ {
+ getCreationalContextStore(context).pop();
+ creationalContext.release();
+ }
+ }
+
+ @Override
+ public void setValue(ELContext context, Object value)
+ {
+ // TODO need to use correct manager for module
+ ELCreationalContext<?> creationalContext =
ELCreationalContext.of(Container.instance().deploymentManager().createCreationalContext(CONTEXTUAL));
+ try
+ {
+ getCreationalContextStore(context).push(creationalContext);
+ delegate().setValue(context, value);
+ }
+ finally
+ {
+ getCreationalContextStore(context).pop();
+ creationalContext.release();
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public Class getType(ELContext context)
+ {
+ // TODO need to use correct manager for module
+ ELCreationalContext<?> creationalContext =
ELCreationalContext.of(Container.instance().deploymentManager().createCreationalContext(CONTEXTUAL));
+ try
+ {
+ getCreationalContextStore(context).push(creationalContext);
+ return delegate().getType(context);
+ }
+ finally
+ {
+ getCreationalContextStore(context).pop();
+ creationalContext.release();
+ }
+ }
+
+}
Deleted: ri/trunk/impl/src/main/java/org/jboss/weld/jsf/WebBeansPhaseListener.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/jsf/WebBeansPhaseListener.java 2009-10-08
05:29:40 UTC (rev 3892)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/jsf/WebBeansPhaseListener.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -1,183 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
- *
- * Use is subject to license terms.
- *
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed 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.jboss.weld.jsf;
-
-import static org.jboss.weld.jsf.JsfHelper.getConversationId;
-import static org.jboss.weld.jsf.JsfHelper.getHttpSession;
-import static org.jboss.weld.jsf.JsfHelper.getModuleBeanManager;
-
-import javax.faces.context.FacesContext;
-import javax.faces.event.PhaseEvent;
-import javax.faces.event.PhaseId;
-import javax.faces.event.PhaseListener;
-import javax.servlet.http.HttpSession;
-
-import org.jboss.weld.BeanManagerImpl;
-import org.jboss.weld.Container;
-import org.jboss.weld.context.ContextLifecycle;
-import org.jboss.weld.context.ConversationContext;
-import org.jboss.weld.context.SessionContext;
-import org.jboss.weld.conversation.ConversationImpl;
-import org.jboss.weld.conversation.ConversationManager;
-import org.jboss.weld.log.LogProvider;
-import org.jboss.weld.log.Logging;
-import org.jboss.weld.servlet.ConversationBeanStore;
-import org.jboss.weld.servlet.HttpSessionManager;
-
-/**
- * <p>
- * A JSF phase listener that initializes aspects of Web Beans in a more
- * fine-grained, integrated manner than what is possible with a servlet filter.
- * This phase listener works in conjunction with other hooks and callbacks
- * registered with the JSF runtime to help manage the Web Beans lifecycle.
- * </p>
- *
- * <p>
- * It's expected that over time, this phase listener may take on more work, but
- * for now the work is focused soley on conversation management. The phase
- * listener restores the long-running conversation if the conversation id token
- * is detected in the request, activates the conversation context in either case
- * (long-running or transient), and finally passivates the conversation after
- * the response has been committed.
- * </p>
- *
- * @author Nicklas Karlsson
- * @author Dan Allen
- */
-public class WebBeansPhaseListener implements PhaseListener
-{
- private static LogProvider log = Logging.getLogProvider(WebBeansPhaseListener.class);
-
- /**
- * Execute before every phase in the JSF life cycle. The order this
- * phase listener executes in relation to other phase listeners is
- * determined by the ordering of the faces-config.xml descriptors.
- * This phase listener should take precedence over extensions.
- *
- * @param phaseEvent The phase event
- */
- public void beforePhase(PhaseEvent phaseEvent)
- {
- if (phaseEvent.getPhaseId().equals(PhaseId.RESTORE_VIEW))
- {
- beforeRestoreView(phaseEvent.getFacesContext());
- }
- }
-
- /**
- * Execute after every phase in the JSF life cycle. The order this
- * phase listener executes in relation to other phase listeners is
- * determined by the ordering of the faces-config.xml descriptors.
- * This phase listener should take precedence over extensions.
- *
- * @param phaseEvent The phase event
- */
- public void afterPhase(PhaseEvent phaseEvent)
- {
- if (phaseEvent.getPhaseId().equals(PhaseId.RENDER_RESPONSE))
- {
- afterRenderResponse(phaseEvent.getFacesContext());
- }
- // be careful with this else as it assumes only one if condition right now
- else if (phaseEvent.getFacesContext().getResponseComplete())
- {
- afterResponseComplete(phaseEvent.getFacesContext(), phaseEvent.getPhaseId());
- }
- }
-
- /**
- * Execute before the Restore View phase.
- */
- private void beforeRestoreView(FacesContext facesContext)
- {
- log.trace("Initiating the session and conversation before the Restore View
phase");
- initiateSessionAndConversation(facesContext);
- }
-
- /**
- * Execute after the Render Response phase.
- */
- private void afterRenderResponse(FacesContext facesContext)
- {
- BeanManagerImpl moduleBeanManager = getModuleBeanManager(facesContext);
- SessionContext sessionContext =
Container.instance().deploymentServices().get(ContextLifecycle.class).getSessionContext();
- ConversationContext conversationContext =
Container.instance().deploymentServices().get(ContextLifecycle.class).getConversationContext();
- if (sessionContext.isActive())
- {
- log.trace("Cleaning up the conversation after the Render Response
phase");
-
moduleBeanManager.getInstanceByType(ConversationManager.class).cleanupConversation();
- conversationContext.setActive(false);
- }
- else
- {
- log.trace("Skipping conversation cleanup after the Render Response phase
because session has been terminated.");
- }
- }
-
- /**
- * Execute after any phase that marks the response as complete.
- */
- private void afterResponseComplete(FacesContext facesContext, PhaseId phaseId)
- {
- BeanManagerImpl moduleBeanManager = getModuleBeanManager(facesContext);
- SessionContext sessionContext =
Container.instance().deploymentServices().get(ContextLifecycle.class).getSessionContext();
- if (sessionContext.isActive())
- {
- log.trace("Cleaning up the conversation after the " + phaseId + "
phase as the response has been marked complete");
-
moduleBeanManager.getInstanceByType(ConversationManager.class).cleanupConversation();
- }
- else
- {
- log.trace("Skipping conversation cleanup after the response has been marked
complete because the session has been terminated.");
- }
- }
-
- /**
- * Retrieve the HTTP session from the FacesContext and assign it to the Web
- * Beans HttpSessionManager. Restore the long-running conversation if the
- * conversation id token is present in the request and, in either case,
- * activate the conversation context (long-running or transient).
- */
- private void initiateSessionAndConversation(FacesContext facesContext)
- {
- HttpSession session = getHttpSession(facesContext);
- BeanManagerImpl moduleBeanManager = getModuleBeanManager(facesContext);
- moduleBeanManager.getInstanceByType(HttpSessionManager.class).setSession(session);
-
moduleBeanManager.getInstanceByType(ConversationManager.class).beginOrRestoreConversation(getConversationId(facesContext));
- String cid =
moduleBeanManager.getInstanceByType(ConversationImpl.class).getUnderlyingId();
-
- ConversationContext conversationContext =
Container.instance().deploymentServices().get(ContextLifecycle.class).getConversationContext();
- conversationContext.setBeanStore(new ConversationBeanStore(session, cid));
- conversationContext.setActive(true);
- }
-
- /**
- * The phase id for which this phase listener is active. This phase listener
- * observes all JSF life-cycle phases.
- */
- public PhaseId getPhaseId()
- {
- return PhaseId.ANY_PHASE;
- }
-
-}
Copied: ri/trunk/impl/src/main/java/org/jboss/weld/jsf/WeldPhaseListener.java (from rev
3879, ri/trunk/impl/src/main/java/org/jboss/weld/jsf/WebBeansPhaseListener.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/jsf/WeldPhaseListener.java
(rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/jsf/WeldPhaseListener.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -0,0 +1,183 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ *
+ * Use is subject to license terms.
+ *
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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.jboss.weld.jsf;
+
+import static org.jboss.weld.jsf.JsfHelper.getConversationId;
+import static org.jboss.weld.jsf.JsfHelper.getHttpSession;
+import static org.jboss.weld.jsf.JsfHelper.getModuleBeanManager;
+
+import javax.faces.context.FacesContext;
+import javax.faces.event.PhaseEvent;
+import javax.faces.event.PhaseId;
+import javax.faces.event.PhaseListener;
+import javax.servlet.http.HttpSession;
+
+import org.jboss.weld.BeanManagerImpl;
+import org.jboss.weld.Container;
+import org.jboss.weld.context.ContextLifecycle;
+import org.jboss.weld.context.ConversationContext;
+import org.jboss.weld.context.SessionContext;
+import org.jboss.weld.conversation.ConversationImpl;
+import org.jboss.weld.conversation.ConversationManager;
+import org.jboss.weld.log.LogProvider;
+import org.jboss.weld.log.Logging;
+import org.jboss.weld.servlet.ConversationBeanStore;
+import org.jboss.weld.servlet.HttpSessionManager;
+
+/**
+ * <p>
+ * A JSF phase listener that initializes aspects of Weld in a more
+ * fine-grained, integrated manner than what is possible with a servlet filter.
+ * This phase listener works in conjunction with other hooks and callbacks
+ * registered with the JSF runtime to help manage the Weld lifecycle.
+ * </p>
+ *
+ * <p>
+ * It's expected that over time, this phase listener may take on more work, but
+ * for now the work is focused soley on conversation management. The phase
+ * listener restores the long-running conversation if the conversation id token
+ * is detected in the request, activates the conversation context in either case
+ * (long-running or transient), and finally passivates the conversation after
+ * the response has been committed.
+ * </p>
+ *
+ * @author Nicklas Karlsson
+ * @author Dan Allen
+ */
+public class WeldPhaseListener implements PhaseListener
+{
+ private static LogProvider log = Logging.getLogProvider(WeldPhaseListener.class);
+
+ /**
+ * Execute before every phase in the JSF life cycle. The order this
+ * phase listener executes in relation to other phase listeners is
+ * determined by the ordering of the faces-config.xml descriptors.
+ * This phase listener should take precedence over extensions.
+ *
+ * @param phaseEvent The phase event
+ */
+ public void beforePhase(PhaseEvent phaseEvent)
+ {
+ if (phaseEvent.getPhaseId().equals(PhaseId.RESTORE_VIEW))
+ {
+ beforeRestoreView(phaseEvent.getFacesContext());
+ }
+ }
+
+ /**
+ * Execute after every phase in the JSF life cycle. The order this
+ * phase listener executes in relation to other phase listeners is
+ * determined by the ordering of the faces-config.xml descriptors.
+ * This phase listener should take precedence over extensions.
+ *
+ * @param phaseEvent The phase event
+ */
+ public void afterPhase(PhaseEvent phaseEvent)
+ {
+ if (phaseEvent.getPhaseId().equals(PhaseId.RENDER_RESPONSE))
+ {
+ afterRenderResponse(phaseEvent.getFacesContext());
+ }
+ // be careful with this else as it assumes only one if condition right now
+ else if (phaseEvent.getFacesContext().getResponseComplete())
+ {
+ afterResponseComplete(phaseEvent.getFacesContext(), phaseEvent.getPhaseId());
+ }
+ }
+
+ /**
+ * Execute before the Restore View phase.
+ */
+ private void beforeRestoreView(FacesContext facesContext)
+ {
+ log.trace("Initiating the session and conversation before the Restore View
phase");
+ initiateSessionAndConversation(facesContext);
+ }
+
+ /**
+ * Execute after the Render Response phase.
+ */
+ private void afterRenderResponse(FacesContext facesContext)
+ {
+ BeanManagerImpl moduleBeanManager = getModuleBeanManager(facesContext);
+ SessionContext sessionContext =
Container.instance().deploymentServices().get(ContextLifecycle.class).getSessionContext();
+ ConversationContext conversationContext =
Container.instance().deploymentServices().get(ContextLifecycle.class).getConversationContext();
+ if (sessionContext.isActive())
+ {
+ log.trace("Cleaning up the conversation after the Render Response
phase");
+
moduleBeanManager.getInstanceByType(ConversationManager.class).cleanupConversation();
+ conversationContext.setActive(false);
+ }
+ else
+ {
+ log.trace("Skipping conversation cleanup after the Render Response phase
because session has been terminated.");
+ }
+ }
+
+ /**
+ * Execute after any phase that marks the response as complete.
+ */
+ private void afterResponseComplete(FacesContext facesContext, PhaseId phaseId)
+ {
+ BeanManagerImpl moduleBeanManager = getModuleBeanManager(facesContext);
+ SessionContext sessionContext =
Container.instance().deploymentServices().get(ContextLifecycle.class).getSessionContext();
+ if (sessionContext.isActive())
+ {
+ log.trace("Cleaning up the conversation after the " + phaseId + "
phase as the response has been marked complete");
+
moduleBeanManager.getInstanceByType(ConversationManager.class).cleanupConversation();
+ }
+ else
+ {
+ log.trace("Skipping conversation cleanup after the response has been marked
complete because the session has been terminated.");
+ }
+ }
+
+ /**
+ * Retrieve the HTTP session from the FacesContext and assign it to the Web
+ * Beans HttpSessionManager. Restore the long-running conversation if the
+ * conversation id token is present in the request and, in either case,
+ * activate the conversation context (long-running or transient).
+ */
+ private void initiateSessionAndConversation(FacesContext facesContext)
+ {
+ HttpSession session = getHttpSession(facesContext);
+ BeanManagerImpl moduleBeanManager = getModuleBeanManager(facesContext);
+ moduleBeanManager.getInstanceByType(HttpSessionManager.class).setSession(session);
+
moduleBeanManager.getInstanceByType(ConversationManager.class).beginOrRestoreConversation(getConversationId(facesContext));
+ String cid =
moduleBeanManager.getInstanceByType(ConversationImpl.class).getUnderlyingId();
+
+ ConversationContext conversationContext =
Container.instance().deploymentServices().get(ContextLifecycle.class).getConversationContext();
+ conversationContext.setBeanStore(new ConversationBeanStore(session, cid));
+ conversationContext.setActive(true);
+ }
+
+ /**
+ * The phase id for which this phase listener is active. This phase listener
+ * observes all JSF life-cycle phases.
+ */
+ public PhaseId getPhaseId()
+ {
+ return PhaseId.ANY_PHASE;
+ }
+
+}
Deleted: ri/trunk/impl/src/main/java/org/jboss/weld/servlet/WebBeansListener.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/servlet/WebBeansListener.java 2009-10-08
05:29:40 UTC (rev 3892)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/servlet/WebBeansListener.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -1,131 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
- *
- * Use is subject to license terms.
- *
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed 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.jboss.weld.servlet;
-
-import javax.servlet.ServletRequestEvent;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSessionEvent;
-
-import org.jboss.weld.Container;
-import org.jboss.weld.context.ContextLifecycle;
-import org.jboss.weld.servlet.api.helpers.AbstractServletListener;
-
-/**
- * The Web Beans listener
- *
- * Listens for context/session creation/destruction.
- *
- * Delegates work to the ServletLifeCycle.
- *
- * @author Nicklas Karlsson
- *
- */
-public class WebBeansListener extends AbstractServletListener
-{
-
- private ServletLifecycle lifecycle;
-
- private ServletLifecycle getLifecycle()
- {
- if (lifecycle == null)
- {
- this.lifecycle = new
ServletLifecycle(Container.instance().deploymentServices().get(ContextLifecycle.class));
- }
- return lifecycle;
- }
-
- /**
- * Called when the session is created
- *
- * @param event The session event
- */
- @Override
- public void sessionCreated(HttpSessionEvent event)
- {
- // JBoss AS will still start the deployment even if WB fails
- if (Container.instance() != null && Container.instance().isInitialized())
- {
- getLifecycle().beginSession(event.getSession());
- }
- }
-
- /**
- * Called when the session is destroyed
- *
- * @param event The session event
- */
- @Override
- public void sessionDestroyed(HttpSessionEvent event)
- {
- // JBoss AS will still start the deployment even if WB fails
- if (Container.instance() != null && Container.instance().isInitialized())
- {
- getLifecycle().endSession(event.getSession());
- }
- }
-
- /**
- * Called when the request is destroyed
- *
- * @param event The request event
- */
- @Override
- public void requestDestroyed(ServletRequestEvent event)
- {
- // JBoss AS will still start the deployment even if WB fails
- if (Container.instance() != null && Container.instance().isInitialized())
- {
- if (event.getServletRequest() instanceof HttpServletRequest)
- {
- getLifecycle().endRequest((HttpServletRequest) event.getServletRequest());
- }
- else
- {
- throw new IllegalStateException("Non HTTP-Servlet lifecycle not
defined");
- }
- }
- }
-
- /**
- * Called when the request is initialized
- *
- * @param event The request event
- */
- @Override
- public void requestInitialized(ServletRequestEvent event)
- {
- // JBoss AS will still start the deployment even if WB fails
- if (Container.instance() != null && Container.instance().isInitialized())
- {
- if (event.getServletRequest() instanceof HttpServletRequest)
- {
- getLifecycle().beginRequest((HttpServletRequest) event.getServletRequest());
- }
- else
- {
- throw new IllegalStateException("Non HTTP-Servlet lifecycle not
defined");
- }
- }
- }
-
-}
Copied: ri/trunk/impl/src/main/java/org/jboss/weld/servlet/WeldListener.java (from rev
3879, ri/trunk/impl/src/main/java/org/jboss/weld/servlet/WebBeansListener.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/servlet/WeldListener.java
(rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/servlet/WeldListener.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -0,0 +1,131 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ *
+ * Use is subject to license terms.
+ *
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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.jboss.weld.servlet;
+
+import javax.servlet.ServletRequestEvent;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSessionEvent;
+
+import org.jboss.weld.Container;
+import org.jboss.weld.context.ContextLifecycle;
+import org.jboss.weld.servlet.api.helpers.AbstractServletListener;
+
+/**
+ * The Weld listener
+ *
+ * Listens for context/session creation/destruction.
+ *
+ * Delegates work to the ServletLifeCycle.
+ *
+ * @author Nicklas Karlsson
+ *
+ */
+public class WeldListener extends AbstractServletListener
+{
+
+ private ServletLifecycle lifecycle;
+
+ private ServletLifecycle getLifecycle()
+ {
+ if (lifecycle == null)
+ {
+ this.lifecycle = new
ServletLifecycle(Container.instance().deploymentServices().get(ContextLifecycle.class));
+ }
+ return lifecycle;
+ }
+
+ /**
+ * Called when the session is created
+ *
+ * @param event The session event
+ */
+ @Override
+ public void sessionCreated(HttpSessionEvent event)
+ {
+ // JBoss AS will still start the deployment even if WB fails
+ if (Container.instance() != null && Container.instance().isInitialized())
+ {
+ getLifecycle().beginSession(event.getSession());
+ }
+ }
+
+ /**
+ * Called when the session is destroyed
+ *
+ * @param event The session event
+ */
+ @Override
+ public void sessionDestroyed(HttpSessionEvent event)
+ {
+ // JBoss AS will still start the deployment even if WB fails
+ if (Container.instance() != null && Container.instance().isInitialized())
+ {
+ getLifecycle().endSession(event.getSession());
+ }
+ }
+
+ /**
+ * Called when the request is destroyed
+ *
+ * @param event The request event
+ */
+ @Override
+ public void requestDestroyed(ServletRequestEvent event)
+ {
+ // JBoss AS will still start the deployment even if WB fails
+ if (Container.instance() != null && Container.instance().isInitialized())
+ {
+ if (event.getServletRequest() instanceof HttpServletRequest)
+ {
+ getLifecycle().endRequest((HttpServletRequest) event.getServletRequest());
+ }
+ else
+ {
+ throw new IllegalStateException("Non HTTP-Servlet lifecycle not
defined");
+ }
+ }
+ }
+
+ /**
+ * Called when the request is initialized
+ *
+ * @param event The request event
+ */
+ @Override
+ public void requestInitialized(ServletRequestEvent event)
+ {
+ // JBoss AS will still start the deployment even if WB fails
+ if (Container.instance() != null && Container.instance().isInitialized())
+ {
+ if (event.getServletRequest() instanceof HttpServletRequest)
+ {
+ getLifecycle().beginRequest((HttpServletRequest) event.getServletRequest());
+ }
+ else
+ {
+ throw new IllegalStateException("Non HTTP-Servlet lifecycle not
defined");
+ }
+ }
+ }
+
+}
Modified: ri/trunk/jboss-as/build.properties
===================================================================
--- ri/trunk/jboss-as/build.properties 2009-10-08 05:29:40 UTC (rev 3892)
+++ ri/trunk/jboss-as/build.properties 2009-10-08 05:51:23 UTC (rev 3893)
@@ -7,8 +7,8 @@
# maximum number of TCK tests to deploy before restarting JBoss AS
# jboss.deployments.restart = 25
-webbeans-deployer.version=5.2.0-SNAPSHOT
-webbeans.version=1.0.0-SNAPSHOT
+weld-deployer.version=5.2.0-SNAPSHOT
+weld.version=1.0.0-SNAPSHOT
jboss-ejb3.version=1.0.0
javassist.version=3.11.0.GA
validation.version=1.0.CR3
Modified:
ri/trunk/jboss-tck-runner/src/test/debug-resources/META-INF/jboss-test-harness.properties
===================================================================
---
ri/trunk/jboss-tck-runner/src/test/debug-resources/META-INF/jboss-test-harness.properties 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/jboss-tck-runner/src/test/debug-resources/META-INF/jboss-test-harness.properties 2009-10-08
05:51:23 UTC (rev 3893)
@@ -1,7 +1,7 @@
# Configuration for running incontainer tests from your IDE
-# Alter the path webbeans accordingly (relative from the tck/impl dir)
+# Alter the path weld accordingly (relative from the tck/impl dir)
org.jboss.testharness.standalone=false
-org.jboss.testharness.container.extraConfigurationDir=../../webbeans/jboss-as
+org.jboss.testharness.container.extraConfigurationDir=../../weld/jboss-as
org.jboss.testharness.container.forceRestart=false
-org.jboss.testharness.libraryDirectory=../../webbeans/jboss-tck-runner/target/dependency/lib
-org.jboss.testharness.runIntegrationTests=true
\ No newline at end of file
+org.jboss.testharness.libraryDirectory=../../weld/jboss-tck-runner/target/dependency/lib
+org.jboss.testharness.runIntegrationTests=true
Modified: ri/trunk/spi/src/main/java/org/jboss/weld/bootstrap/api/Bootstrap.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/weld/bootstrap/api/Bootstrap.java 2009-10-08
05:29:40 UTC (rev 3892)
+++ ri/trunk/spi/src/main/java/org/jboss/weld/bootstrap/api/Bootstrap.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -25,10 +25,10 @@
import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
import org.jboss.weld.bootstrap.spi.Deployment;
import org.jboss.weld.context.api.BeanStore;
-import org.jboss.weld.manager.api.WebBeansManager;
+import org.jboss.weld.manager.api.WeldManager;
/**
- * Application container initialization API for Web Beans.
+ * Application container initialization API for Weld.
*
* To initialize the container you must call, in this order:
*
@@ -124,14 +124,14 @@
* If {@link #startContainer()} has not been called, this method will return
* null.
*
- * If the beanDeploymentArchive is not known to Web Beans (for example, it
- * was not passed to the Web Beans as part of the {@link Deployment}, or has
+ * If the beanDeploymentArchive is not known to Weld (for example, it
+ * was not passed to the Weld as part of the {@link Deployment}, or has
* not yet been requested by
* {@link Deployment#loadBeanDeploymentArchive(Class)}), null will be
* returned.
*
* @return the manager or null if not yet available or not found.
*/
- public WebBeansManager getManager(BeanDeploymentArchive beanDeploymentArchive);
+ public WeldManager getManager(BeanDeploymentArchive beanDeploymentArchive);
}
Modified: ri/trunk/spi/src/main/java/org/jboss/weld/bootstrap/api/Singleton.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/weld/bootstrap/api/Singleton.java 2009-10-08
05:29:40 UTC (rev 3892)
+++ ri/trunk/spi/src/main/java/org/jboss/weld/bootstrap/api/Singleton.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -26,12 +26,12 @@
/**
* Holds a reference to an application singleton. This singleton is used
- * internally by Web Beans to store various application scoped objects.
+ * internally by Weld to store various application scoped objects.
*
- * This allows Web Beans to operate as a shared library. In a shared mode, the
- * same instance of WebBeans implementation is used by all the applications in
+ * This allows Weld to operate as a shared library. In a shared mode, the
+ * same instance of Weld implementation is used by all the applications in
* a server environment. In the exclusive mode, each application loads a
- * separate copy of WebBeans implementation at the application level.
+ * separate copy of Weld implementation at the application level.
*
* Alternative implementations of Singleton can be used as required
*
Modified:
ri/trunk/spi/src/main/java/org/jboss/weld/bootstrap/api/helpers/ForwardingBootstrap.java
===================================================================
---
ri/trunk/spi/src/main/java/org/jboss/weld/bootstrap/api/helpers/ForwardingBootstrap.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/spi/src/main/java/org/jboss/weld/bootstrap/api/helpers/ForwardingBootstrap.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -21,7 +21,7 @@
import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
import org.jboss.weld.bootstrap.spi.Deployment;
import org.jboss.weld.context.api.BeanStore;
-import org.jboss.weld.manager.api.WebBeansManager;
+import org.jboss.weld.manager.api.WeldManager;
/**
* Implementation of {@link Bootstrap} which supports the decorator pattern
@@ -33,7 +33,7 @@
protected abstract Bootstrap delegate();
- public WebBeansManager getManager(BeanDeploymentArchive beanDeploymentArchive)
+ public WeldManager getManager(BeanDeploymentArchive beanDeploymentArchive)
{
return delegate().getManager(beanDeploymentArchive);
}
Deleted: ri/trunk/spi/src/main/java/org/jboss/weld/manager/api/WebBeansManager.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/weld/manager/api/WebBeansManager.java 2009-10-08
05:29:40 UTC (rev 3892)
+++ ri/trunk/spi/src/main/java/org/jboss/weld/manager/api/WebBeansManager.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -1,93 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed 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.jboss.weld.manager.api;
-
-import java.io.Serializable;
-import java.lang.annotation.Annotation;
-
-import javax.enterprise.context.ContextNotActiveException;
-import javax.enterprise.inject.spi.Bean;
-import javax.enterprise.inject.spi.BeanManager;
-import javax.enterprise.inject.spi.InjectionTarget;
-
-import org.jboss.weld.ejb.spi.EjbDescriptor;
-
-/**
- * Functionality provided by the Web Beans Manager over and above the JSR-299
- * Manager.
- *
- * @author Pete Muir
- *
- */
-public interface WebBeansManager extends BeanManager, Serializable
-{
-
- /**
- * Create a new child activity. A child activity inherits all beans,
- * interceptors, decorators, observers, and contexts defined by its direct
- * and indirect parent activities.
- *
- * This method should not be called by the application.
- *
- * @return the child activity
- */
- public WebBeansManager createActivity();
-
- /**
- * Associate an activity with the current context for a normal scope
- *
- * @param scopeType
- * the scope to associate the activity with
- * @return the activity
- * @throws ContextNotActiveException
- * if the given scope is inactive
- * @throws IllegalArgumentException
- * if the given scope is not a normal scope
- */
- public WebBeansManager setCurrent(Class<? extends Annotation> scopeType);
-
- /**
- * The injection target for the given EJB, or null if Web Beans was not
- * given this descriptor in the deployment.
- *
- * @param <T>
- * @param descriptor
- * @return
- */
- public <T> InjectionTarget<T> createInjectionTarget(EjbDescriptor<T>
descriptor);
-
- /**
- * Get the Bean object for the given EJB, or null if Web Beans was not given
- * this descriptor in the deployment.
- *
- * @param <T>
- * @param descriptor
- * @return
- */
- public <T> Bean<T> getBean(EjbDescriptor<T> descriptor);
-
- /**
- * Get the EjbDescriptor for the given ejb name
- *
- * @param <T>
- * @param ejbName
- * @return
- */
- public <T> EjbDescriptor<T> getEjbDescriptor(String ejbName);
-
-}
Copied: ri/trunk/spi/src/main/java/org/jboss/weld/manager/api/WeldManager.java (from rev
3875, ri/trunk/spi/src/main/java/org/jboss/weld/manager/api/WebBeansManager.java)
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/weld/manager/api/WeldManager.java
(rev 0)
+++ ri/trunk/spi/src/main/java/org/jboss/weld/manager/api/WeldManager.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -0,0 +1,93 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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.jboss.weld.manager.api;
+
+import java.io.Serializable;
+import java.lang.annotation.Annotation;
+
+import javax.enterprise.context.ContextNotActiveException;
+import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.BeanManager;
+import javax.enterprise.inject.spi.InjectionTarget;
+
+import org.jboss.weld.ejb.spi.EjbDescriptor;
+
+/**
+ * Functionality provided by the Web Beans Manager over and above the JSR-299
+ * Manager.
+ *
+ * @author Pete Muir
+ *
+ */
+public interface WeldManager extends BeanManager, Serializable
+{
+
+ /**
+ * Create a new child activity. A child activity inherits all beans,
+ * interceptors, decorators, observers, and contexts defined by its direct
+ * and indirect parent activities.
+ *
+ * This method should not be called by the application.
+ *
+ * @return the child activity
+ */
+ public WeldManager createActivity();
+
+ /**
+ * Associate an activity with the current context for a normal scope
+ *
+ * @param scopeType
+ * the scope to associate the activity with
+ * @return the activity
+ * @throws ContextNotActiveException
+ * if the given scope is inactive
+ * @throws IllegalArgumentException
+ * if the given scope is not a normal scope
+ */
+ public WeldManager setCurrent(Class<? extends Annotation> scopeType);
+
+ /**
+ * The injection target for the given EJB, or null if Web Beans was not
+ * given this descriptor in the deployment.
+ *
+ * @param <T>
+ * @param descriptor
+ * @return
+ */
+ public <T> InjectionTarget<T> createInjectionTarget(EjbDescriptor<T>
descriptor);
+
+ /**
+ * Get the Bean object for the given EJB, or null if Web Beans was not given
+ * this descriptor in the deployment.
+ *
+ * @param <T>
+ * @param descriptor
+ * @return
+ */
+ public <T> Bean<T> getBean(EjbDescriptor<T> descriptor);
+
+ /**
+ * Get the EjbDescriptor for the given ejb name
+ *
+ * @param <T>
+ * @param ejbName
+ * @return
+ */
+ public <T> EjbDescriptor<T> getEjbDescriptor(String ejbName);
+
+}
Modified: ri/trunk/spi/src/test/java/org/jboss/weld/bootstrap/api/test/MockBootstrap.java
===================================================================
---
ri/trunk/spi/src/test/java/org/jboss/weld/bootstrap/api/test/MockBootstrap.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/spi/src/test/java/org/jboss/weld/bootstrap/api/test/MockBootstrap.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -9,12 +9,12 @@
import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
import org.jboss.weld.bootstrap.spi.Deployment;
import org.jboss.weld.context.api.BeanStore;
-import org.jboss.weld.manager.api.WebBeansManager;
+import org.jboss.weld.manager.api.WeldManager;
public class MockBootstrap implements Bootstrap
{
- public WebBeansManager getManager(BeanDeploymentArchive beanDeploymentArchive)
+ public WeldManager getManager(BeanDeploymentArchive beanDeploymentArchive)
{
return null;
}
Modified: ri/trunk/tests/src/main/java/org/jboss/weld/mock/MockServletLifecycle.java
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/weld/mock/MockServletLifecycle.java 2009-10-08
05:29:40 UTC (rev 3892)
+++ ri/trunk/tests/src/main/java/org/jboss/weld/mock/MockServletLifecycle.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -1,6 +1,6 @@
package org.jboss.weld.mock;
-import org.jboss.weld.bootstrap.WebBeansBootstrap;
+import org.jboss.weld.bootstrap.WeldBootstrap;
import org.jboss.weld.bootstrap.api.Environment;
import org.jboss.weld.bootstrap.api.Environments;
import org.jboss.weld.bootstrap.api.Lifecycle;
@@ -15,7 +15,7 @@
{
private static final ResourceLoader MOCK_RESOURCE_LOADER = new MockResourceLoader();
- private final WebBeansBootstrap bootstrap;
+ private final WeldBootstrap bootstrap;
private final MockDeployment deployment;
private final BeanStore applicationBeanStore;
private final BeanStore sessionBeanStore;
@@ -30,7 +30,7 @@
{
throw new IllegalStateException("No WebBeanDiscovery is available");
}
- this.bootstrap = new WebBeansBootstrap();
+ this.bootstrap = new WeldBootstrap();
this.deployment.getServices().add(ResourceLoader.class, MOCK_RESOURCE_LOADER);
this.deployment.getServices().add(ServletServices.class, new
MockServletServices(deployment.getArchive()));
this.applicationBeanStore = new ConcurrentHashMapBeanStore();
@@ -79,7 +79,7 @@
return deployment;
}
- protected WebBeansBootstrap getBootstrap()
+ protected WeldBootstrap getBootstrap()
{
return bootstrap;
}
Modified: ri/trunk/tests/src/main/java/org/jboss/weld/mock/el/EL.java
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/weld/mock/el/EL.java 2009-10-08 05:29:40 UTC
(rev 3892)
+++ ri/trunk/tests/src/main/java/org/jboss/weld/mock/el/EL.java 2009-10-08 05:51:23 UTC
(rev 3893)
@@ -31,8 +31,8 @@
import javax.el.VariableMapper;
import org.jboss.weld.BeanManagerImpl;
-import org.jboss.weld.el.WebBeansELContextListener;
-import org.jboss.weld.el.WebBeansExpressionFactory;
+import org.jboss.weld.el.WeldELContextListener;
+import org.jboss.weld.el.WeldExpressionFactory;
import com.sun.el.ExpressionFactoryImpl;
import com.sun.el.lang.FunctionMapperImpl;
@@ -47,9 +47,9 @@
public class EL
{
- public static final ExpressionFactory EXPRESSION_FACTORY = new
WebBeansExpressionFactory(new ExpressionFactoryImpl());
+ public static final ExpressionFactory EXPRESSION_FACTORY = new
WeldExpressionFactory(new ExpressionFactoryImpl());
- public static final ELContextListener[] EL_CONTEXT_LISTENERS = { new
WebBeansELContextListener() };
+ public static final ELContextListener[] EL_CONTEXT_LISTENERS = { new
WeldELContextListener() };
private static ELResolver createELResolver(BeanManagerImpl beanManagerImpl)
{
Deleted: ri/trunk/tests/src/main/java/org/jboss/weld/test/AbstractWebBeansTest.java
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/weld/test/AbstractWebBeansTest.java 2009-10-08
05:29:40 UTC (rev 3892)
+++ ri/trunk/tests/src/main/java/org/jboss/weld/test/AbstractWebBeansTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -1,204 +0,0 @@
-package org.jboss.weld.test;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Set;
-
-import javax.el.ELContext;
-import javax.enterprise.inject.TypeLiteral;
-import javax.enterprise.inject.spi.Bean;
-import javax.servlet.ServletContext;
-
-import org.jboss.testharness.AbstractTest;
-import org.jboss.testharness.impl.runner.servlet.ServletTestRunner;
-import org.jboss.weld.BeanManagerImpl;
-import org.jboss.weld.mock.MockServletContext;
-import org.jboss.weld.mock.el.EL;
-import org.jboss.weld.servlet.ServletHelper;
-import org.jboss.weld.util.collections.EnumerationList;
-import org.testng.ITestContext;
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.BeforeSuite;
-
-public abstract class AbstractWebBeansTest extends AbstractTest
-{
-
- private ServletContext servletContext;
-
- @Override
- @BeforeSuite
- public void beforeSuite(ITestContext context) throws Exception
- {
- if (!isInContainer())
- {
-
getCurrentConfiguration().getExtraPackages().add(AbstractWebBeansTest.class.getPackage().getName());
-
getCurrentConfiguration().getExtraPackages().add(EL.class.getPackage().getName());
-
//getCurrentConfiguration().getExtraPackages().add(MockServletContext.class.getPackage().getName());
- }
- super.beforeSuite(context);
- }
-
- @Override
- @BeforeClass
- public void beforeClass() throws Throwable
- {
- super.beforeClass();
- if (isInContainer())
- {
- servletContext = ServletTestRunner.getCurrentServletContext();
- }
- else
- {
- servletContext = new MockServletContext("");
- }
-
- }
-
- @Override
- @AfterClass
- public void afterClass() throws Exception
- {
- servletContext = null;
- super.afterClass();
- }
-
- /**
- * Checks if all annotations are in a given set of annotations
- *
- * @param annotations The annotation set
- * @param annotationTypes The annotations to match
- * @return True if match, false otherwise
- */
- public boolean annotationSetMatches(Set<? extends Annotation> annotations,
Class<? extends Annotation>... annotationTypes)
- {
- List<Class<? extends Annotation>> annotationTypeList = new
ArrayList<Class<? extends Annotation>>();
- annotationTypeList.addAll(Arrays.asList(annotationTypes));
- for (Annotation annotation : annotations)
- {
- if (annotationTypeList.contains(annotation.annotationType()))
- {
- annotationTypeList.remove(annotation.annotationType());
- }
- else
- {
- return false;
- }
- }
- return annotationTypeList.size() == 0;
- }
-
- protected Iterable<URL> getResources(String name)
- {
- if (name.startsWith("/"))
- {
- name = name.substring(1);
- }
- else
- {
- name = getClass().getPackage().getName().replace(".", "/") +
"/" + name;
- }
- try
- {
- return new
EnumerationList<URL>(getClass().getClassLoader().getResources(name));
- }
- catch (IOException e)
- {
- throw new RuntimeException("Error loading resource from classloader" +
name, e);
- }
- }
-
- protected byte[] serialize(Object instance) throws IOException
- {
- ByteArrayOutputStream bytes = new ByteArrayOutputStream();
- ObjectOutputStream out = new ObjectOutputStream(bytes);
- out.writeObject(instance);
- return bytes.toByteArray();
- }
-
- protected Object deserialize(byte[] bytes) throws IOException, ClassNotFoundException
- {
- ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(bytes));
- return in.readObject();
- }
-
- protected BeanManagerImpl getCurrentManager()
- {
- return ServletHelper.getModuleBeanManager(servletContext);
- }
-
- public boolean isExceptionInHierarchy(Throwable exception, Class<? extends
Throwable> expectedException )
- {
- while (exception != null)
- {
- if (exception.getClass().equals(expectedException))
- {
- return true;
- }
- exception = exception.getCause();
- }
- return false;
- }
-
- public <T> Bean<T> getBean(Type beanType, Annotation... bindings)
- {
- Set<Bean<?>> beans = getCurrentManager().getBeans(beanType, bindings);
- if (beans.size() > 1)
- {
- throw new RuntimeException("More than one bean resolved to " +
beanType + " with bindings " + Arrays.asList(bindings));
- }
- if (beans.size() == 0)
- {
- throw new RuntimeException("No beans resolved to " + beanType + "
with bindings " + Arrays.asList(bindings));
- }
- @SuppressWarnings("unchecked")
- Bean<T> bean = (Bean<T>) beans.iterator().next();
- return bean;
- }
-
- @SuppressWarnings("unchecked")
- public <T> Set<Bean<T>> getBeans(Class<T> type, Annotation...
bindings)
- {
- return (Set) getCurrentManager().getBeans(type, bindings);
- }
-
- @SuppressWarnings("unchecked")
- public <T> Set<Bean<T>> getBeans(TypeLiteral<T> type,
Annotation... bindings)
- {
- return (Set)getCurrentManager().getBeans(type.getType(), bindings);
- }
-
- @SuppressWarnings("unchecked")
- public <T> T createContextualInstance(Class<T> beanType, Annotation...
bindings)
- {
- return (T) createContextualInstance((Type) beanType, bindings);
- }
-
- public Object createContextualInstance(Type beanType, Annotation... bindings)
- {
- Bean<?> bean = getBean(beanType, bindings);
- return getCurrentManager().getReference(bean, beanType,
getCurrentManager().createCreationalContext(bean));
- }
-
- @SuppressWarnings("unchecked")
- public <T> T evaluateValueExpression(String expression, Class<T>
expectedType)
- {
- ELContext elContext = EL.createELContext(getCurrentManager().getCurrent());
- return (T) EL.EXPRESSION_FACTORY.createValueExpression(elContext, expression,
expectedType).getValue(elContext);
- }
-
- protected String getPath(String viewId)
- {
- return getContextPath() + viewId;
- }
-
-}
Copied: ri/trunk/tests/src/main/java/org/jboss/weld/test/AbstractWeldTest.java (from rev
3882, ri/trunk/tests/src/main/java/org/jboss/weld/test/AbstractWebBeansTest.java)
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/weld/test/AbstractWeldTest.java
(rev 0)
+++ ri/trunk/tests/src/main/java/org/jboss/weld/test/AbstractWeldTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -0,0 +1,204 @@
+package org.jboss.weld.test;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Set;
+
+import javax.el.ELContext;
+import javax.enterprise.inject.TypeLiteral;
+import javax.enterprise.inject.spi.Bean;
+import javax.servlet.ServletContext;
+
+import org.jboss.testharness.AbstractTest;
+import org.jboss.testharness.impl.runner.servlet.ServletTestRunner;
+import org.jboss.weld.BeanManagerImpl;
+import org.jboss.weld.mock.MockServletContext;
+import org.jboss.weld.mock.el.EL;
+import org.jboss.weld.servlet.ServletHelper;
+import org.jboss.weld.util.collections.EnumerationList;
+import org.testng.ITestContext;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.BeforeSuite;
+
+public abstract class AbstractWeldTest extends AbstractTest
+{
+
+ private ServletContext servletContext;
+
+ @Override
+ @BeforeSuite
+ public void beforeSuite(ITestContext context) throws Exception
+ {
+ if (!isInContainer())
+ {
+
getCurrentConfiguration().getExtraPackages().add(AbstractWeldTest.class.getPackage().getName());
+
getCurrentConfiguration().getExtraPackages().add(EL.class.getPackage().getName());
+
//getCurrentConfiguration().getExtraPackages().add(MockServletContext.class.getPackage().getName());
+ }
+ super.beforeSuite(context);
+ }
+
+ @Override
+ @BeforeClass
+ public void beforeClass() throws Throwable
+ {
+ super.beforeClass();
+ if (isInContainer())
+ {
+ servletContext = ServletTestRunner.getCurrentServletContext();
+ }
+ else
+ {
+ servletContext = new MockServletContext("");
+ }
+
+ }
+
+ @Override
+ @AfterClass
+ public void afterClass() throws Exception
+ {
+ servletContext = null;
+ super.afterClass();
+ }
+
+ /**
+ * Checks if all annotations are in a given set of annotations
+ *
+ * @param annotations The annotation set
+ * @param annotationTypes The annotations to match
+ * @return True if match, false otherwise
+ */
+ public boolean annotationSetMatches(Set<? extends Annotation> annotations,
Class<? extends Annotation>... annotationTypes)
+ {
+ List<Class<? extends Annotation>> annotationTypeList = new
ArrayList<Class<? extends Annotation>>();
+ annotationTypeList.addAll(Arrays.asList(annotationTypes));
+ for (Annotation annotation : annotations)
+ {
+ if (annotationTypeList.contains(annotation.annotationType()))
+ {
+ annotationTypeList.remove(annotation.annotationType());
+ }
+ else
+ {
+ return false;
+ }
+ }
+ return annotationTypeList.size() == 0;
+ }
+
+ protected Iterable<URL> getResources(String name)
+ {
+ if (name.startsWith("/"))
+ {
+ name = name.substring(1);
+ }
+ else
+ {
+ name = getClass().getPackage().getName().replace(".", "/") +
"/" + name;
+ }
+ try
+ {
+ return new
EnumerationList<URL>(getClass().getClassLoader().getResources(name));
+ }
+ catch (IOException e)
+ {
+ throw new RuntimeException("Error loading resource from classloader" +
name, e);
+ }
+ }
+
+ protected byte[] serialize(Object instance) throws IOException
+ {
+ ByteArrayOutputStream bytes = new ByteArrayOutputStream();
+ ObjectOutputStream out = new ObjectOutputStream(bytes);
+ out.writeObject(instance);
+ return bytes.toByteArray();
+ }
+
+ protected Object deserialize(byte[] bytes) throws IOException, ClassNotFoundException
+ {
+ ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(bytes));
+ return in.readObject();
+ }
+
+ protected BeanManagerImpl getCurrentManager()
+ {
+ return ServletHelper.getModuleBeanManager(servletContext);
+ }
+
+ public boolean isExceptionInHierarchy(Throwable exception, Class<? extends
Throwable> expectedException )
+ {
+ while (exception != null)
+ {
+ if (exception.getClass().equals(expectedException))
+ {
+ return true;
+ }
+ exception = exception.getCause();
+ }
+ return false;
+ }
+
+ public <T> Bean<T> getBean(Type beanType, Annotation... bindings)
+ {
+ Set<Bean<?>> beans = getCurrentManager().getBeans(beanType, bindings);
+ if (beans.size() > 1)
+ {
+ throw new RuntimeException("More than one bean resolved to " +
beanType + " with bindings " + Arrays.asList(bindings));
+ }
+ if (beans.size() == 0)
+ {
+ throw new RuntimeException("No beans resolved to " + beanType + "
with bindings " + Arrays.asList(bindings));
+ }
+ @SuppressWarnings("unchecked")
+ Bean<T> bean = (Bean<T>) beans.iterator().next();
+ return bean;
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> Set<Bean<T>> getBeans(Class<T> type, Annotation...
bindings)
+ {
+ return (Set) getCurrentManager().getBeans(type, bindings);
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> Set<Bean<T>> getBeans(TypeLiteral<T> type,
Annotation... bindings)
+ {
+ return (Set)getCurrentManager().getBeans(type.getType(), bindings);
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T createContextualInstance(Class<T> beanType, Annotation...
bindings)
+ {
+ return (T) createContextualInstance((Type) beanType, bindings);
+ }
+
+ public Object createContextualInstance(Type beanType, Annotation... bindings)
+ {
+ Bean<?> bean = getBean(beanType, bindings);
+ return getCurrentManager().getReference(bean, beanType,
getCurrentManager().createCreationalContext(bean));
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T evaluateValueExpression(String expression, Class<T>
expectedType)
+ {
+ ELContext elContext = EL.createELContext(getCurrentManager().getCurrent());
+ return (T) EL.EXPRESSION_FACTORY.createValueExpression(elContext, expression,
expectedType).getValue(elContext);
+ }
+
+ protected String getPath(String viewId)
+ {
+ return getContextPath() + viewId;
+ }
+
+}
Modified: ri/trunk/tests/src/test/debug-resources/META-INF/jboss-test-harness.properties
===================================================================
---
ri/trunk/tests/src/test/debug-resources/META-INF/jboss-test-harness.properties 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/debug-resources/META-INF/jboss-test-harness.properties 2009-10-08
05:51:23 UTC (rev 3893)
@@ -1,7 +1,7 @@
# Configuration for running incontainer tests from your IDE
-# Alter the path webbeans accordingly (relative from the tck/impl dir)
+# Alter the path weld accordingly (relative from the tck/impl dir)
org.jboss.testharness.standalone=false
-org.jboss.testharness.container.extraConfigurationDir=../../webbeans/jboss-as
+org.jboss.testharness.container.extraConfigurationDir=../../weld/jboss-as
org.jboss.testharness.container.forceRestart=false
-org.jboss.testharness.libraryDirectory=../../webbeans/tests/target/dependency/lib
-org.jboss.testharness.runIntegrationTests=true
\ No newline at end of file
+org.jboss.testharness.libraryDirectory=../../weld/tests/target/dependency/lib
+org.jboss.testharness.runIntegrationTests=true
Modified: ri/trunk/tests/src/test/java/org/jboss/weld/test/examples/ExampleTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/weld/test/examples/ExampleTest.java 2009-10-08
05:29:40 UTC (rev 3892)
+++ ri/trunk/tests/src/test/java/org/jboss/weld/test/examples/ExampleTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -1,11 +1,11 @@
package org.jboss.weld.test.examples;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
@Artifact
-public class ExampleTest extends AbstractWebBeansTest
+public class ExampleTest extends AbstractWeldTest
{
@Test
public void testGameGenerator() throws Exception
Modified: ri/trunk/tests/src/test/java/org/jboss/weld/test/examples/MockExampleTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/examples/MockExampleTest.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/examples/MockExampleTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -2,12 +2,12 @@
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
@Artifact
@BeansXml("beans.xml")
-public class MockExampleTest extends AbstractWebBeansTest
+public class MockExampleTest extends AbstractWeldTest
{
@Test
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/activities/ActivitiesTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/activities/ActivitiesTest.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/activities/ActivitiesTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -21,7 +21,7 @@
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.weld.bean.ForwardingBean;
import org.jboss.weld.literal.DefaultLiteral;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
@@ -31,7 +31,7 @@
*
*/
@Artifact
-public class ActivitiesTest extends AbstractWebBeansTest
+public class ActivitiesTest extends AbstractWeldTest
{
private static final Set<Annotation> DEFAULT_BINDINGS = new
HashSet<Annotation>();
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/activities/child/SameBeanTypeInChildActivityTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/activities/child/SameBeanTypeInChildActivityTest.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/activities/child/SameBeanTypeInChildActivityTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -16,8 +16,8 @@
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.weld.literal.DefaultLiteral;
-import org.jboss.weld.manager.api.WebBeansManager;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.manager.api.WeldManager;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
/**
@@ -26,7 +26,7 @@
*
*/
@Artifact
-public class SameBeanTypeInChildActivityTest extends AbstractWebBeansTest
+public class SameBeanTypeInChildActivityTest extends AbstractWeldTest
{
private static final Set<Annotation> DEFAULT_BINDINGS = new
HashSet<Annotation>();
@@ -115,8 +115,8 @@
@Test(groups = { "broken" }, expectedExceptions = { InjectionException.class
})
public void testSameBeanTypeInChildAsIndirectParentInjection()
{
- WebBeansManager childActivity = getCurrentManager().createActivity();
- WebBeansManager grandChildActivity = childActivity.createActivity();
+ WeldManager childActivity = getCurrentManager().createActivity();
+ WeldManager grandChildActivity = childActivity.createActivity();
Bean<?> anotherMyBean = createDummyBean(grandChildActivity);
grandChildActivity.addBean(anotherMyBean);
}
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/activities/current/ELCurrentActivityTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/activities/current/ELCurrentActivityTest.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/activities/current/ELCurrentActivityTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -16,8 +16,8 @@
import javax.enterprise.inject.spi.InjectionPoint;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.weld.manager.api.WebBeansManager;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.manager.api.WeldManager;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
/**
@@ -26,7 +26,7 @@
*
*/
@Artifact
-public class ELCurrentActivityTest extends AbstractWebBeansTest
+public class ELCurrentActivityTest extends AbstractWeldTest
{
@@ -150,7 +150,7 @@
Context dummyContext = new DummyContext();
getCurrentManager().addContext(dummyContext);
assert getBeans(Cow.class).size() == 1;
- WebBeansManager childActivity = getCurrentManager().createActivity();
+ WeldManager childActivity = getCurrentManager().createActivity();
childActivity.addBean(new Daisy(childActivity));
childActivity.setCurrent(dummyContext.getScope());
assert evaluateValueExpression("#{daisy}", Cow.class) != null;
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/activities/current/EventCurrentActivityTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/activities/current/EventCurrentActivityTest.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/activities/current/EventCurrentActivityTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -7,7 +7,7 @@
import javax.enterprise.context.spi.CreationalContext;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
/**
@@ -16,7 +16,7 @@
*
*/
@Artifact
-public class EventCurrentActivityTest extends AbstractWebBeansTest
+public class EventCurrentActivityTest extends AbstractWeldTest
{
@@ -57,7 +57,7 @@
{
// Context dummyContext = new DummyContext();
// getCurrentManager().addContext(dummyContext);
-// WebBeansManager childActivity = getCurrentManager().createActivity();
+// WeldManager childActivity = getCurrentManager().createActivity();
// TestableObserver<NightTime> observer = new
TestableObserver<NightTime>()
// {
//
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/activities/current/InactiveScopeTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/activities/current/InactiveScopeTest.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/activities/current/InactiveScopeTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -8,8 +8,8 @@
import javax.enterprise.context.spi.CreationalContext;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.weld.manager.api.WebBeansManager;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.manager.api.WeldManager;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
/**
@@ -18,7 +18,7 @@
*
*/
@Artifact
-public class InactiveScopeTest extends AbstractWebBeansTest
+public class InactiveScopeTest extends AbstractWeldTest
{
@@ -60,7 +60,7 @@
DummyContext dummyContext = new DummyContext();
dummyContext.setActive(false);
getCurrentManager().addContext(dummyContext);
- WebBeansManager childActivity = getCurrentManager().createActivity();
+ WeldManager childActivity = getCurrentManager().createActivity();
childActivity.setCurrent(dummyContext.getScope());
}
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/activities/current/InjectedManagerCurrentActivityTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/activities/current/InjectedManagerCurrentActivityTest.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/activities/current/InjectedManagerCurrentActivityTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -7,8 +7,8 @@
import javax.enterprise.context.spi.CreationalContext;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.weld.manager.api.WebBeansManager;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.manager.api.WeldManager;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
/**
@@ -17,7 +17,7 @@
*
*/
@Artifact
-public class InjectedManagerCurrentActivityTest extends AbstractWebBeansTest
+public class InjectedManagerCurrentActivityTest extends AbstractWeldTest
{
private static class DummyContext implements Context
@@ -58,7 +58,7 @@
Context dummyContext = new DummyContext();
getCurrentManager().addContext(dummyContext);
assert getBeans(Cow.class).size() == 1;
- WebBeansManager childActivity = getCurrentManager().createActivity();
+ WeldManager childActivity = getCurrentManager().createActivity();
childActivity.setCurrent(dummyContext.getScope());
assert createContextualInstance(Horse.class).getManager().equals(childActivity);
}
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/activities/current/InstanceCurrentActivityTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/activities/current/InstanceCurrentActivityTest.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/activities/current/InstanceCurrentActivityTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -16,8 +16,8 @@
import javax.enterprise.inject.spi.InjectionPoint;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.weld.manager.api.WebBeansManager;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.manager.api.WeldManager;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
/**
@@ -26,7 +26,7 @@
*
*/
@Artifact
-public class InstanceCurrentActivityTest extends AbstractWebBeansTest
+public class InstanceCurrentActivityTest extends AbstractWeldTest
{
public static class TameLiteral extends AnnotationLiteral<Tame> implements Tame
{}
@@ -158,7 +158,7 @@
Context dummyContext = new DummyContext();
getCurrentManager().addContext(dummyContext);
assert getBeans(Cow.class).size() == 1;
- WebBeansManager childActivity = getCurrentManager().createActivity();
+ WeldManager childActivity = getCurrentManager().createActivity();
childActivity.addBean(new Daisy(childActivity));
childActivity.setCurrent(dummyContext.getScope());
assert createContextualInstance(Field.class).get() != null;
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/activities/current/JndiManagerCurrentActivityTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/activities/current/JndiManagerCurrentActivityTest.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/activities/current/JndiManagerCurrentActivityTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -8,8 +8,8 @@
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.IntegrationTest;
-import org.jboss.weld.manager.api.WebBeansManager;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.manager.api.WeldManager;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
/**
@@ -19,7 +19,7 @@
*/
@Artifact
@IntegrationTest
-public class JndiManagerCurrentActivityTest extends AbstractWebBeansTest
+public class JndiManagerCurrentActivityTest extends AbstractWeldTest
{
private static class DummyContext implements Context
@@ -60,7 +60,7 @@
Context dummyContext = new DummyContext();
getCurrentManager().addContext(dummyContext);
assert getBeans(Cow.class).size() == 1;
- WebBeansManager childActivity = getCurrentManager().createActivity();
+ WeldManager childActivity = getCurrentManager().createActivity();
childActivity.setCurrent(dummyContext.getScope());
assert createContextualInstance(Donkey.class).getManager().equals(childActivity);
}
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/activities/current/NonNormalScopeTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/activities/current/NonNormalScopeTest.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/activities/current/NonNormalScopeTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -7,12 +7,12 @@
import javax.enterprise.context.spi.CreationalContext;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.weld.manager.api.WebBeansManager;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.manager.api.WeldManager;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
@Artifact
-public class NonNormalScopeTest extends AbstractWebBeansTest
+public class NonNormalScopeTest extends AbstractWeldTest
{
private static class DummyContext implements Context
@@ -63,7 +63,7 @@
{
Context dummyContext = new NonNormalContext();
getCurrentManager().addContext(dummyContext);
- WebBeansManager childActivity = getCurrentManager().createActivity();
+ WeldManager childActivity = getCurrentManager().createActivity();
childActivity.setCurrent(dummyContext.getScope());
}
}
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/annotated/DeclaringTypeTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/annotated/DeclaringTypeTest.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/annotated/DeclaringTypeTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -21,7 +21,7 @@
import javax.enterprise.inject.spi.AnnotatedType;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.Assert;
import org.testng.annotations.Test;
@@ -30,7 +30,7 @@
*
*/
@Artifact
-public class DeclaringTypeTest extends AbstractWebBeansTest
+public class DeclaringTypeTest extends AbstractWeldTest
{
@Test
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/annotated/ExampleTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/annotated/ExampleTest.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/annotated/ExampleTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -8,7 +8,7 @@
import javax.enterprise.inject.spi.AnnotatedType;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.Assert;
import org.testng.annotations.Test;
@@ -18,7 +18,7 @@
* @version $Revision: 1.1 $
*/
@Artifact
-public class ExampleTest extends AbstractWebBeansTest
+public class ExampleTest extends AbstractWeldTest
{
@Test
public void testAnnotatedCallableGetParameters() throws Exception
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/annotated/decoration/AnnotatedTypeDecoratorTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/annotated/decoration/AnnotatedTypeDecoratorTest.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/annotated/decoration/AnnotatedTypeDecoratorTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -13,7 +13,7 @@
import javax.inject.Inject;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
/**
@@ -22,7 +22,7 @@
* @version $Revision: 1.1 $
*/
@Artifact
-public class AnnotatedTypeDecoratorTest extends AbstractWebBeansTest
+public class AnnotatedTypeDecoratorTest extends AbstractWeldTest
{
@Test
public void testAnnotationDecorator() throws Exception
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/bootstrap/DiscoverFailsBootstrapTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/bootstrap/DiscoverFailsBootstrapTest.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/bootstrap/DiscoverFailsBootstrapTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -1,6 +1,6 @@
package org.jboss.weld.test.unit.bootstrap;
-import org.jboss.weld.bootstrap.WebBeansBootstrap;
+import org.jboss.weld.bootstrap.WeldBootstrap;
import org.jboss.weld.bootstrap.api.Bootstrap;
import org.jboss.weld.bootstrap.api.Environments;
import org.jboss.weld.context.api.helpers.ConcurrentHashMapBeanStore;
@@ -12,7 +12,7 @@
@Test(groups="bootstrap",
expectedExceptions=IllegalArgumentException.class)
public void testDiscoverFails()
{
- Bootstrap bootstrap = new WebBeansBootstrap();
+ Bootstrap bootstrap = new WeldBootstrap();
bootstrap.startContainer(Environments.SE, null, new ConcurrentHashMapBeanStore());
}
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/bootstrap/multipleEnterprise/BootstrapTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/bootstrap/multipleEnterprise/BootstrapTest.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/bootstrap/multipleEnterprise/BootstrapTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -11,12 +11,12 @@
import org.jboss.testharness.impl.packaging.PackagingType;
import org.jboss.weld.bean.RIBean;
import org.jboss.weld.bean.SessionBean;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
@Artifact
@Packaging(PackagingType.EAR)
-public class BootstrapTest extends AbstractWebBeansTest
+public class BootstrapTest extends AbstractWeldTest
{
@Test(groups="bootstrap")
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/bootstrap/multipleEnterpriseAndSimple/BootstrapTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/bootstrap/multipleEnterpriseAndSimple/BootstrapTest.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/bootstrap/multipleEnterpriseAndSimple/BootstrapTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -12,12 +12,12 @@
import org.jboss.weld.bean.ManagedBean;
import org.jboss.weld.bean.RIBean;
import org.jboss.weld.bean.SessionBean;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
@Artifact
@Packaging(PackagingType.EAR)
-public class BootstrapTest extends AbstractWebBeansTest
+public class BootstrapTest extends AbstractWeldTest
{
@Test(groups="bootstrap")
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/bootstrap/multipleSimple/BootstrapTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/bootstrap/multipleSimple/BootstrapTest.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/bootstrap/multipleSimple/BootstrapTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -9,11 +9,11 @@
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.weld.bean.ManagedBean;
import org.jboss.weld.bean.RIBean;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
@Artifact
-public class BootstrapTest extends AbstractWebBeansTest
+public class BootstrapTest extends AbstractWeldTest
{
@Test(groups="bootstrap")
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/bootstrap/singleEnterprise/BootstrapTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/bootstrap/singleEnterprise/BootstrapTest.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/bootstrap/singleEnterprise/BootstrapTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -10,12 +10,12 @@
import org.jboss.testharness.impl.packaging.Packaging;
import org.jboss.testharness.impl.packaging.PackagingType;
import org.jboss.weld.bean.RIBean;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
@Artifact
@Packaging(PackagingType.EAR)
-public class BootstrapTest extends AbstractWebBeansTest
+public class BootstrapTest extends AbstractWeldTest
{
@Test(groups="bootstrap")
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/bootstrap/singleProducerMethod/BootstrapTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/bootstrap/singleProducerMethod/BootstrapTest.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/bootstrap/singleProducerMethod/BootstrapTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -12,12 +12,12 @@
import org.jboss.weld.bean.ManagedBean;
import org.jboss.weld.bean.ProducerMethod;
import org.jboss.weld.bean.RIBean;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
@Artifact
@Packaging(PackagingType.EAR)
-public class BootstrapTest extends AbstractWebBeansTest
+public class BootstrapTest extends AbstractWeldTest
{
@Test(groups="bootstrap")
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/bootstrap/singleSimple/BootstrapTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/bootstrap/singleSimple/BootstrapTest.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/bootstrap/singleSimple/BootstrapTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -8,11 +8,11 @@
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.weld.bean.RIBean;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
@Artifact
-public class BootstrapTest extends AbstractWebBeansTest
+public class BootstrapTest extends AbstractWeldTest
{
@Test(groups="bootstrap")
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/context/ApplicationScopedTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/context/ApplicationScopedTest.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/context/ApplicationScopedTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -3,11 +3,11 @@
import java.util.concurrent.CountDownLatch;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
@Artifact
-public class ApplicationScopedTest extends AbstractWebBeansTest
+public class ApplicationScopedTest extends AbstractWeldTest
{
@Test
Modified: ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/context/ContextTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/context/ContextTest.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/context/ContextTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -2,12 +2,12 @@
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.IntegrationTest;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
@Artifact
@IntegrationTest
-public class ContextTest extends AbstractWebBeansTest
+public class ContextTest extends AbstractWeldTest
{
// WBRI-155
@Test(description="WBRI155", groups="stub")
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/context/ParameterizedTypeScopedTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/context/ParameterizedTypeScopedTest.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/context/ParameterizedTypeScopedTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -3,11 +3,11 @@
import java.util.List;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
@Artifact
-public class ParameterizedTypeScopedTest extends AbstractWebBeansTest
+public class ParameterizedTypeScopedTest extends AbstractWeldTest
{
@Test
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/context/PassivatingContextTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/context/PassivatingContextTest.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/context/PassivatingContextTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -10,7 +10,7 @@
import org.testng.annotations.Test;
@Artifact
-public class PassivatingContextTest extends org.jboss.weld.test.AbstractWebBeansTest
+public class PassivatingContextTest extends org.jboss.weld.test.AbstractWeldTest
{
/**
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/decorator/simple/SimpleDecoratorTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/decorator/simple/SimpleDecoratorTest.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/decorator/simple/SimpleDecoratorTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -2,7 +2,7 @@
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
/**
@@ -12,7 +12,7 @@
*/
@Artifact
@BeansXml("beans.xml")
-public class SimpleDecoratorTest extends AbstractWebBeansTest
+public class SimpleDecoratorTest extends AbstractWeldTest
{
@Test
public void testSimpleDecorator()
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/definition/ELResolverTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/definition/ELResolverTest.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/definition/ELResolverTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -7,25 +7,25 @@
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.weld.mock.el.EL;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
/**
- * Test the WebBeansELResolver and that it collaborates with the standard EL resolver
chain.
+ * Test the WeldELResolver and that it collaborates with the standard EL resolver chain.
*
* @author Pete Muir
* @author Dan Allen
*/
@Artifact
-public class ELResolverTest extends AbstractWebBeansTest
+public class ELResolverTest extends AbstractWeldTest
{
/**
- * Test that the WebBeansELResolver only works to resolve the base of an EL
+ * Test that the WeldELResolver only works to resolve the base of an EL
* expression, in this case a named bean. Once the base is resolved, the
* remainder of the expression should be delegated to the standard chain of
- * property resolvers. If the WebBeansELResolver oversteps its bounds by
- * trying to resolve the property against the Web Beans namespace, the test
+ * property resolvers. If the WeldELResolver oversteps its bounds by
+ * trying to resolve the property against the Weld namespace, the test
* will fail.
*/
@Test
@@ -38,11 +38,11 @@
}
/**
- * Test that the WebBeansELResolver only works to resolve the base of an EL
+ * Test that the WeldELResolver only works to resolve the base of an EL
* expression, in this case from a producer method. Once the base is
* resolved, the remainder of the expression should be delegated to the
- * standard chain of property resolvers. If the WebBeansELResolver oversteps
- * its bounds by trying to resolve the property against the Web Beans
+ * standard chain of property resolvers. If the WeldELResolver oversteps
+ * its bounds by trying to resolve the property against the Weld
* namespace, the test will fail.
*/
@Test
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/definition/StereotypesTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/definition/StereotypesTest.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/definition/StereotypesTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -6,11 +6,11 @@
import org.jboss.weld.metadata.TypeStore;
import org.jboss.weld.metadata.cache.StereotypeModel;
import org.jboss.weld.resources.ClassTransformer;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
@Artifact
-public class StereotypesTest extends AbstractWebBeansTest
+public class StereotypesTest extends AbstractWeldTest
{
private final ClassTransformer transformer = new ClassTransformer(new TypeStore());
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/environments/servlet/ServletLifecycleTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/environments/servlet/ServletLifecycleTest.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/environments/servlet/ServletLifecycleTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -1,7 +1,7 @@
package org.jboss.weld.test.unit.environments.servlet;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
@@ -20,7 +20,7 @@
* @author Dan Allen
*/
@Artifact
-public class ServletLifecycleTest extends AbstractWebBeansTest
+public class ServletLifecycleTest extends AbstractWeldTest
{
@Test(groups = "broken")
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/NewEnterpriseBeanTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/NewEnterpriseBeanTest.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/NewEnterpriseBeanTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -12,12 +12,12 @@
import org.jboss.weld.bean.SessionBean;
import org.jboss.weld.introspector.WBAnnotated;
import org.jboss.weld.literal.NewLiteral;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
@Artifact
@Packaging(PackagingType.EAR)
-public class NewEnterpriseBeanTest extends AbstractWebBeansTest
+public class NewEnterpriseBeanTest extends AbstractWeldTest
{
private static final New NEW_LITERAL = new NewLiteral()
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/annotatedItem/ClassAnnotatedItemTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/annotatedItem/ClassAnnotatedItemTest.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/annotatedItem/ClassAnnotatedItemTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -12,11 +12,11 @@
import org.jboss.weld.introspector.jlr.WBClassImpl;
import org.jboss.weld.metadata.TypeStore;
import org.jboss.weld.resources.ClassTransformer;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
@Artifact
-public class ClassAnnotatedItemTest extends AbstractWebBeansTest
+public class ClassAnnotatedItemTest extends AbstractWeldTest
{
private final ClassTransformer transformer = new ClassTransformer(new TypeStore());
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/enterprise/EnterpriseBeanTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/enterprise/EnterpriseBeanTest.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/enterprise/EnterpriseBeanTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -4,13 +4,13 @@
import org.jboss.testharness.impl.packaging.IntegrationTest;
import org.jboss.testharness.impl.packaging.Packaging;
import org.jboss.testharness.impl.packaging.PackagingType;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
@Artifact
@IntegrationTest
@Packaging(PackagingType.EAR)
-public class EnterpriseBeanTest extends AbstractWebBeansTest
+public class EnterpriseBeanTest extends AbstractWeldTest
{
@Test(description="WBRI-179")
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -14,7 +14,7 @@
import org.jboss.testharness.impl.packaging.IntegrationTest;
import org.jboss.testharness.impl.packaging.Packaging;
import org.jboss.testharness.impl.packaging.PackagingType;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
/**
@@ -35,7 +35,7 @@
@Artifact
@Packaging(PackagingType.EAR)
@IntegrationTest
-public class EnterpriseBeanLifecycleTest extends AbstractWebBeansTest
+public class EnterpriseBeanLifecycleTest extends AbstractWeldTest
{
/**
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/event/SimpleEventTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/event/SimpleEventTest.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/event/SimpleEventTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -8,11 +8,11 @@
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.weld.BeanManagerImpl;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
@Artifact
-public class SimpleEventTest extends AbstractWebBeansTest
+public class SimpleEventTest extends AbstractWeldTest
{
private static boolean RECEIVE_1_OBSERVED;
private static boolean RECEIVE_2_OBSERVED;
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/event/tx/AbstractHtmlUnitTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/event/tx/AbstractHtmlUnitTest.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/event/tx/AbstractHtmlUnitTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -3,12 +3,12 @@
import java.util.HashSet;
import java.util.Set;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.test.AbstractWeldTest;
import com.gargoylesoftware.htmlunit.html.HtmlElement;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
-public abstract class AbstractHtmlUnitTest extends AbstractWebBeansTest
+public abstract class AbstractHtmlUnitTest extends AbstractWeldTest
{
public AbstractHtmlUnitTest()
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/exceptions/ExceptionHandlingTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/exceptions/ExceptionHandlingTest.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/exceptions/ExceptionHandlingTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -4,11 +4,11 @@
import javax.enterprise.inject.CreationException;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
@Artifact
-public class ExceptionHandlingTest extends AbstractWebBeansTest
+public class ExceptionHandlingTest extends AbstractWeldTest
{
@Test(expectedExceptions=FooException.class)
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/named/NamedBeanWithBindingTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/named/NamedBeanWithBindingTest.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/named/NamedBeanWithBindingTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -3,14 +3,14 @@
import javax.enterprise.inject.spi.Bean;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
/**
* @author Dan Allen
*/
@Artifact(addCurrentPackage = true)
-public class NamedBeanWithBindingTest extends AbstractWebBeansTest
+public class NamedBeanWithBindingTest extends AbstractWeldTest
{
@Test
public void testGetNamedBeanWithBinding()
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/newsimple/NewSimpleBeanTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/newsimple/NewSimpleBeanTest.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/newsimple/NewSimpleBeanTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -9,11 +9,11 @@
import org.jboss.weld.bean.NewManagedBean;
import org.jboss.weld.introspector.WBAnnotated;
import org.jboss.weld.literal.NewLiteral;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
@Artifact
-public class NewSimpleBeanTest extends AbstractWebBeansTest
+public class NewSimpleBeanTest extends AbstractWeldTest
{
private ManagedBean<WrappedSimpleBean> wrappedSimpleBean;
private NewManagedBean<WrappedSimpleBean> newSimpleBean;
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/producer/field/ParameterizedProducerTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/producer/field/ParameterizedProducerTest.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/producer/field/ParameterizedProducerTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -4,11 +4,11 @@
import java.util.List;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
@Artifact
-public class ParameterizedProducerTest extends AbstractWebBeansTest
+public class ParameterizedProducerTest extends AbstractWeldTest
{
@Test
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/producer/method/DisposalMethodOnOtherBeanNotResolvedTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/producer/method/DisposalMethodOnOtherBeanNotResolvedTest.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/producer/method/DisposalMethodOnOtherBeanNotResolvedTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -4,11 +4,11 @@
import javax.enterprise.inject.spi.Bean;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
@Artifact
-public class DisposalMethodOnOtherBeanNotResolvedTest extends AbstractWebBeansTest
+public class DisposalMethodOnOtherBeanNotResolvedTest extends AbstractWeldTest
{
@Test
public void test()
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/producer/method/ManagerProducerTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/producer/method/ManagerProducerTest.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/producer/method/ManagerProducerTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -1,11 +1,11 @@
package org.jboss.weld.test.unit.implementation.producer.method;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
@Artifact
-public class ManagerProducerTest extends AbstractWebBeansTest
+public class ManagerProducerTest extends AbstractWeldTest
{
@Test(description="WBRI-183")
public void testInjectManagerProducer()
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/producer/method/NamedProducerTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/producer/method/NamedProducerTest.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/producer/method/NamedProducerTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -3,11 +3,11 @@
import javax.enterprise.inject.spi.Bean;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
@Artifact
-public class NamedProducerTest extends AbstractWebBeansTest
+public class NamedProducerTest extends AbstractWeldTest
{
@Test
public void testNamedProducer()
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/producer/method/NamedProducerWithBindingTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/producer/method/NamedProducerWithBindingTest.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/producer/method/NamedProducerWithBindingTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -7,14 +7,14 @@
import javax.enterprise.inject.spi.Bean;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
/**
* @author Dan Allen
*/
@Artifact(addCurrentPackage = true)
-public class NamedProducerWithBindingTest extends AbstractWebBeansTest
+public class NamedProducerWithBindingTest extends AbstractWeldTest
{
@Test
public void testGetNamedProducerWithBinding()
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/producer/method/NullProducerTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/producer/method/NullProducerTest.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/producer/method/NullProducerTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -1,11 +1,11 @@
package org.jboss.weld.test.unit.implementation.producer.method;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
@Artifact
-public class NullProducerTest extends AbstractWebBeansTest
+public class NullProducerTest extends AbstractWeldTest
{
@Test(description="WBRI-276")
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/proxy/ProxyTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/proxy/ProxyTest.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/proxy/ProxyTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -3,11 +3,11 @@
import javax.enterprise.inject.spi.Bean;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
@Artifact
-public class ProxyTest extends AbstractWebBeansTest
+public class ProxyTest extends AbstractWeldTest
{
@Test(description="WBRI-122")
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/proxy/enterprise/EnterpriseBeanProxyTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/proxy/enterprise/EnterpriseBeanProxyTest.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/proxy/enterprise/EnterpriseBeanProxyTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -5,12 +5,12 @@
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.Packaging;
import org.jboss.testharness.impl.packaging.PackagingType;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
@Artifact
@Packaging(PackagingType.EAR)
-public class EnterpriseBeanProxyTest extends AbstractWebBeansTest
+public class EnterpriseBeanProxyTest extends AbstractWeldTest
{
/**
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/interceptor/ejb/EnterpriseBeanInterceptionTests.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/interceptor/ejb/EnterpriseBeanInterceptionTests.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/interceptor/ejb/EnterpriseBeanInterceptionTests.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -12,14 +12,14 @@
import org.jboss.testharness.impl.packaging.PackagingType;
import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
import org.jboss.weld.bean.SessionBean;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
@Artifact
@Packaging(PackagingType.EAR)
@BeansXml("beans.xml")
-public class EnterpriseBeanInterceptionTests extends AbstractWebBeansTest
+public class EnterpriseBeanInterceptionTests extends AbstractWeldTest
{
@Test(groups = { "interceptors"})
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/interceptor/ejb3model/Ejb3InterceptionModelTests.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/interceptor/ejb3model/Ejb3InterceptionModelTests.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/interceptor/ejb3model/Ejb3InterceptionModelTests.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -21,7 +21,7 @@
import javax.enterprise.context.spi.CreationalContext;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
import org.testng.annotations.BeforeTest;
@@ -32,7 +32,7 @@
* @author Marius Bogoevici
*/
@Artifact
-public class Ejb3InterceptionModelTests extends AbstractWebBeansTest
+public class Ejb3InterceptionModelTests extends AbstractWeldTest
{
@BeforeMethod
public void reset()
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/interceptor/simple/SimpleInterceptorTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/interceptor/simple/SimpleInterceptorTest.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/interceptor/simple/SimpleInterceptorTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -20,7 +20,7 @@
import org.jboss.weld.metadata.TypeStore;
import org.jboss.weld.metadata.cache.InterceptorBindingModel;
import org.jboss.weld.resources.ClassTransformer;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.test.AbstractWeldTest;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
import org.testng.annotations.Test;
@@ -35,7 +35,7 @@
*/
@Artifact
@BeansXml("beans.xml")
-public class SimpleInterceptorTest extends AbstractWebBeansTest
+public class SimpleInterceptorTest extends AbstractWeldTest
{
@Test
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/lookup/LookupInstanceTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/lookup/LookupInstanceTest.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/lookup/LookupInstanceTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -7,11 +7,11 @@
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.weld.literal.DefaultLiteral;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
@Artifact
-public class LookupInstanceTest extends AbstractWebBeansTest
+public class LookupInstanceTest extends AbstractWeldTest
{
Modified: ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/lookup/Wbri256Test.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/lookup/Wbri256Test.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/lookup/Wbri256Test.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -1,11 +1,11 @@
package org.jboss.weld.test.unit.lookup;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
@Artifact
-public class Wbri256Test extends AbstractWebBeansTest
+public class Wbri256Test extends AbstractWeldTest
{
@Test
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/lookup/circular/CircularDependencyTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/lookup/circular/CircularDependencyTest.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/lookup/circular/CircularDependencyTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -1,11 +1,11 @@
package org.jboss.weld.test.unit.lookup.circular;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
@Artifact
-public class CircularDependencyTest extends AbstractWebBeansTest
+public class CircularDependencyTest extends AbstractWeldTest
{
@Test
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/lookup/wbri279/Wbri279Test.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/lookup/wbri279/Wbri279Test.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/lookup/wbri279/Wbri279Test.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -17,7 +17,7 @@
package org.jboss.weld.test.unit.lookup.wbri279;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
/**
@@ -25,7 +25,7 @@
*
*/
@Artifact
-public class Wbri279Test extends AbstractWebBeansTest
+public class Wbri279Test extends AbstractWeldTest
{
@Test(description="WBRI-279")
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/lookup/wbri293/ContextualReferenceTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/lookup/wbri293/ContextualReferenceTest.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/lookup/wbri293/ContextualReferenceTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -17,7 +17,7 @@
package org.jboss.weld.test.unit.lookup.wbri293;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
/**
@@ -26,7 +26,7 @@
*
*/
@Artifact
-public class ContextualReferenceTest extends AbstractWebBeansTest
+public class ContextualReferenceTest extends AbstractWeldTest
{
@Test(groups = "broken")
public void testReferencesEqual() {
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/manager/EjbDescriptorLookupTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/manager/EjbDescriptorLookupTest.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/manager/EjbDescriptorLookupTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -25,7 +25,7 @@
import org.jboss.weld.bean.SessionBean;
import org.jboss.weld.ejb.InternalEjbDescriptor;
import org.jboss.weld.ejb.spi.EjbDescriptor;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
/**
@@ -34,7 +34,7 @@
*/
@Artifact
@Packaging(PackagingType.EAR)
-public class EjbDescriptorLookupTest extends AbstractWebBeansTest
+public class EjbDescriptorLookupTest extends AbstractWeldTest
{
@Test
Modified: ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/manager/ManagerTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/manager/ManagerTest.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/manager/ManagerTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -15,12 +15,12 @@
import org.jboss.testharness.impl.packaging.Packaging;
import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.literal.DefaultLiteral;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
@Artifact
@Packaging
-public class ManagerTest extends AbstractWebBeansTest
+public class ManagerTest extends AbstractWeldTest
{
private static final Set<Annotation> DEFAULT_BINDINGS = new
HashSet<Annotation>();
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/noncontextual/ExampleTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/noncontextual/ExampleTest.java 2009-10-08
05:29:40 UTC (rev 3892)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/noncontextual/ExampleTest.java 2009-10-08
05:51:23 UTC (rev 3893)
@@ -8,12 +8,12 @@
import org.jboss.metadata.validation.ValidationException;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.weld.test.AbstractWebBeansTest;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.Assert;
import org.testng.annotations.Test;
@Artifact
-public class ExampleTest extends AbstractWebBeansTest
+public class ExampleTest extends AbstractWeldTest
{
@Test
public void testNonContextual() throws Exception