[jboss-cvs] JBossAS SVN: r108412 - in branches/weld-snapshot-integration: weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/env and 5 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Sun Oct 3 02:30:20 EDT 2010
Author: marius.bogoevici
Date: 2010-10-03 02:30:18 -0400 (Sun, 03 Oct 2010)
New Revision: 108412
Removed:
branches/weld-snapshot-integration/weld-int/ejb/src/main/java/org/jboss/weld/integration/servlet/
Modified:
branches/weld-snapshot-integration/component-matrix/pom.xml
branches/weld-snapshot-integration/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/env/WeldBootstrapDeployer.java
branches/weld-snapshot-integration/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/env/helpers/BootstrapBean.java
branches/weld-snapshot-integration/weld-int/deployer/src/test/java/org/jboss/test/deployers/support/MockWeldBootstrap.java
branches/weld-snapshot-integration/weld-int/deployer/src/test/java/org/jboss/test/deployers/support/deployer/MockBootDeployer.java
branches/weld-snapshot-integration/weld-int/webtier/src/main/java/org/jboss/weld/integration/webtier/jsf/WeldApplication.java
Log:
Merged trunk with known-good-weld-snapshot
Modified: branches/weld-snapshot-integration/component-matrix/pom.xml
===================================================================
--- branches/weld-snapshot-integration/component-matrix/pom.xml 2010-10-01 20:29:54 UTC (rev 108411)
+++ branches/weld-snapshot-integration/component-matrix/pom.xml 2010-10-03 06:30:18 UTC (rev 108412)
@@ -134,7 +134,7 @@
<version.org.jboss.stdio>1.0.0.CR3</version.org.jboss.stdio>
<version.org.jboss.threads>2.0.0.CR4</version.org.jboss.threads>
<version.org.jboss.vfs>3.0.0.CR5</version.org.jboss.vfs>
- <version.org.jboss.weld>1.1.0.Beta1</version.org.jboss.weld>
+ <version.org.jboss.weld>1.1.0-SNAPSHOT</version.org.jboss.weld>
<version.org.jboss.xnio>2.1.0.CR2</version.org.jboss.xnio>
<version.org.jboss.xnio.metadata>2.1.0.CR5</version.org.jboss.xnio.metadata>
<version.org.slf4j>1.5.6</version.org.slf4j>
@@ -148,7 +148,7 @@
<version.sun.jaxb>2.2</version.sun.jaxb>
<version.sun-jaxws>2.2</version.sun-jaxws>
<version.sun-policy>2.0-b01</version.sun-policy>
- <version.weld.api>1.1.Beta1</version.weld.api>
+ <version.weld.api>1.1-SNAPSHOT</version.weld.api>
<version.xdoclet>1.2.3</version.xdoclet>
<version.xmlschema>1.4.5</version.xmlschema>
</properties>
Modified: branches/weld-snapshot-integration/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/env/WeldBootstrapDeployer.java
===================================================================
--- branches/weld-snapshot-integration/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/env/WeldBootstrapDeployer.java 2010-10-01 20:29:54 UTC (rev 108411)
+++ branches/weld-snapshot-integration/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/env/WeldBootstrapDeployer.java 2010-10-03 06:30:18 UTC (rev 108412)
@@ -29,12 +29,8 @@
import org.jboss.deployers.spi.DeploymentException;
import org.jboss.deployers.structure.spi.DeploymentUnit;
import org.jboss.weld.bootstrap.api.Bootstrap;
-import org.jboss.weld.context.api.BeanStore;
-import org.jboss.weld.context.api.helpers.ConcurrentHashMapBeanStore;
import org.jboss.weld.integration.deployer.DeployersUtils;
import org.jboss.weld.integration.deployer.env.bda.DeploymentImpl;
-import org.jboss.weld.integration.deployer.env.helpers.BootstrapBean;
-import org.jboss.weld.integration.injection.WeldInjector;
/**
* Deploy Weld boostrap service.
@@ -77,7 +73,6 @@
bootstrap.addPropertyMetaData("jpaServices", createServiceConnector("JBossJpaServices", "org.jboss.weld.integration.persistence.JBossJpaServices", unit));
bootstrap.addPropertyMetaData("resourceServices", bootstrap.createInject("JBossResourceServices"));
bootstrap.addPropertyMetaData("transactionServices", bootstrap.createInject("JBossTransactionServices"));
- bootstrap.addPropertyMetaData("applicationContext", createBeanStore());
bootstrap.addPropertyMetaData("securityServices", bootstrap.createInject("JBossSecurityServices"));
bootstrap.addPropertyMetaData("validationServices", createValidationServices(unit));
bootstrap.setCreate("initialize");
@@ -100,16 +95,6 @@
}
/**
- * Create new bean store.
- *
- * @return the bean store instance
- */
- protected BeanStore createBeanStore()
- {
- return new ConcurrentHashMapBeanStore();
- }
-
- /**
* Create bootstrap bean.
*
* @param unit the deployment unit
Modified: branches/weld-snapshot-integration/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/env/helpers/BootstrapBean.java
===================================================================
--- branches/weld-snapshot-integration/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/env/helpers/BootstrapBean.java 2010-10-01 20:29:54 UTC (rev 108411)
+++ branches/weld-snapshot-integration/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/env/helpers/BootstrapBean.java 2010-10-03 06:30:18 UTC (rev 108412)
@@ -1,20 +1,15 @@
package org.jboss.weld.integration.deployer.env.helpers;
-import javax.servlet.ServletContext;
-
import org.jboss.weld.bootstrap.api.Bootstrap;
import org.jboss.weld.bootstrap.api.Environments;
import org.jboss.weld.bootstrap.api.Service;
-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.ejb.spi.EjbServices;
import org.jboss.weld.injection.spi.EjbInjectionServices;
import org.jboss.weld.injection.spi.JpaInjectionServices;
import org.jboss.weld.injection.spi.ResourceInjectionServices;
import org.jboss.weld.integration.deployer.env.bda.DeploymentImpl;
import org.jboss.weld.security.spi.SecurityServices;
-import org.jboss.weld.servlet.api.ServletServices;
import org.jboss.weld.transaction.spi.TransactionServices;
import org.jboss.weld.validation.spi.ValidationServices;
@@ -27,30 +22,8 @@
public class BootstrapBean
{
- static class JBossServletServices implements ServletServices
- {
-
- // For now, JBoss is using a totally flat deployment structure
- private final BeanDeploymentArchive beanDeploymentArchive;
-
- public JBossServletServices(BeanDeploymentArchive beanDeploymentArchive)
- {
- this.beanDeploymentArchive = beanDeploymentArchive;
- }
-
-
- public BeanDeploymentArchive getBeanDeploymentArchive(ServletContext ctx)
- {
- return beanDeploymentArchive;
- }
-
- public void cleanup() {}
-
- }
-
private final Bootstrap bootstrap;
private final DeploymentImpl deployment;
- private BeanStore applicationBeanStore;
public BootstrapBean(Bootstrap bootstrap, DeploymentImpl deployment)
{
@@ -88,11 +61,6 @@
addDeploymentService(TransactionServices.class, transactionServices);
}
- public void setApplicationContext(BeanStore applicationContext)
- {
- this.applicationBeanStore = applicationContext;
- }
-
public void setValidationServices(ValidationServices validationServices)
{
addDeploymentService(ValidationServices.class, validationServices);
@@ -129,12 +97,7 @@
public void initialize()
{
deployment.initialize(bootstrap);
- // Create the JBoss Servlet Services
- for (BeanDeploymentArchive beanDeploymentArchive: deployment.getBeanDeploymentArchives())
- {
- addDeploymentService(ServletServices.class, new JBossServletServices(beanDeploymentArchive));
- }
- bootstrap.startContainer(Environments.EE_INJECT, deployment, applicationBeanStore);
+ bootstrap.startContainer(Environments.EE_INJECT, deployment);
}
public void shutdown()
Modified: branches/weld-snapshot-integration/weld-int/deployer/src/test/java/org/jboss/test/deployers/support/MockWeldBootstrap.java
===================================================================
--- branches/weld-snapshot-integration/weld-int/deployer/src/test/java/org/jboss/test/deployers/support/MockWeldBootstrap.java 2010-10-01 20:29:54 UTC (rev 108411)
+++ branches/weld-snapshot-integration/weld-int/deployer/src/test/java/org/jboss/test/deployers/support/MockWeldBootstrap.java 2010-10-03 06:30:18 UTC (rev 108412)
@@ -31,7 +31,6 @@
import org.jboss.weld.bootstrap.spi.BeansXml;
import org.jboss.weld.bootstrap.spi.Deployment;
import org.jboss.weld.bootstrap.spi.Metadata;
-import org.jboss.weld.context.api.BeanStore;
import org.jboss.weld.manager.api.WeldManager;
/**
@@ -54,7 +53,7 @@
public void initialize()
{
- startContainer(null, null, null);
+ startContainer(null, null);
}
public void boot()
@@ -62,7 +61,7 @@
startInitialization().deployBeans().validateBeans().endInitialization();
}
- public Bootstrap startContainer(Environment environment, Deployment deployment, BeanStore beanStore)
+ public Bootstrap startContainer(Environment environment, Deployment deployment)
{
create = true;
return this;
Modified: branches/weld-snapshot-integration/weld-int/deployer/src/test/java/org/jboss/test/deployers/support/deployer/MockBootDeployer.java
===================================================================
--- branches/weld-snapshot-integration/weld-int/deployer/src/test/java/org/jboss/test/deployers/support/deployer/MockBootDeployer.java 2010-10-01 20:29:54 UTC (rev 108411)
+++ branches/weld-snapshot-integration/weld-int/deployer/src/test/java/org/jboss/test/deployers/support/deployer/MockBootDeployer.java 2010-10-03 06:30:18 UTC (rev 108412)
@@ -29,8 +29,6 @@
import org.jboss.deployers.spi.DeploymentException;
import org.jboss.deployers.structure.spi.DeploymentUnit;
import org.jboss.weld.bootstrap.spi.Deployment;
-import org.jboss.weld.context.api.BeanStore;
-import org.jboss.weld.context.api.helpers.ConcurrentHashMapBeanStore;
import org.jboss.weld.integration.deployer.DeployersUtils;
import org.jboss.weld.integration.deployer.env.AbstractBootstrapInfoDeployer;
import org.jboss.weld.integration.deployer.env.BootstrapInfo;
@@ -80,14 +78,5 @@
unit.addAttachment(bootstrapName + "_" + BeanMetaData.class.getSimpleName(), bootstrap.getBeanMetaData());
}
-
- /**
- * Create new bean store.
- *
- * @return the bean store instance
- */
- protected BeanStore createBeanStore()
- {
- return new ConcurrentHashMapBeanStore();
- }
+
}
\ No newline at end of file
Modified: branches/weld-snapshot-integration/weld-int/webtier/src/main/java/org/jboss/weld/integration/webtier/jsf/WeldApplication.java
===================================================================
--- branches/weld-snapshot-integration/weld-int/webtier/src/main/java/org/jboss/weld/integration/webtier/jsf/WeldApplication.java 2010-10-01 20:29:54 UTC (rev 108411)
+++ branches/weld-snapshot-integration/weld-int/webtier/src/main/java/org/jboss/weld/integration/webtier/jsf/WeldApplication.java 2010-10-03 06:30:18 UTC (rev 108412)
@@ -21,8 +21,8 @@
import javax.el.ExpressionFactory;
import javax.enterprise.inject.spi.BeanManager;
import javax.faces.application.Application;
-import javax.faces.context.FacesContext;
-import javax.servlet.ServletContext;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
import org.jboss.weld.integration.webtier.util.Reflections;
@@ -95,14 +95,13 @@
private static BeanManager beanManager()
{
- if (FacesContext.getCurrentInstance() != null && FacesContext.getCurrentInstance().getExternalContext().getContext() instanceof ServletContext)
+ try
{
- ServletContext servletContext = (ServletContext) FacesContext.getCurrentInstance().getExternalContext().getContext();
- return (BeanManager) servletContext.getAttribute(BeanManager.class.getName());
+ return (BeanManager) new InitialContext().lookup("java:comp/BeanManager");
}
- else
+ catch (NamingException e)
{
- return null;
+ throw new IllegalStateException("Unable to lookup java:comp/BeanManager", e);
}
}
More information about the jboss-cvs-commits
mailing list