[jboss-cvs] JBossAS SVN: r109713 - in branches/JBoss-AS-6.0.x-ipv6: connector/src/main/java/org/jboss/resource/deployers and 23 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Dec 3 17:31:47 EST 2010
Author: rachmatowicz at jboss.com
Date: 2010-12-03 17:31:46 -0500 (Fri, 03 Dec 2010)
New Revision: 109713
Added:
branches/JBoss-AS-6.0.x-ipv6/connector/src/main/java/org/jboss/resource/deployers/DataSourceDeployer.java
branches/JBoss-AS-6.0.x-ipv6/webservices/src/main/java/org/jboss/webservices/integration/weld/
branches/JBoss-AS-6.0.x-ipv6/webservices/src/main/java/org/jboss/webservices/integration/weld/WeldDeploymentAspect.java
branches/JBoss-AS-6.0.x-ipv6/webservices/src/main/java/org/jboss/webservices/integration/weld/WeldInvocationHandler.java
Removed:
branches/JBoss-AS-6.0.x-ipv6/webservices/src/main/java/org/jboss/webservices/integration/weld/WeldDeploymentAspect.java
branches/JBoss-AS-6.0.x-ipv6/webservices/src/main/java/org/jboss/webservices/integration/weld/WeldInvocationHandler.java
Modified:
branches/JBoss-AS-6.0.x-ipv6/component-matrix/pom.xml
branches/JBoss-AS-6.0.x-ipv6/connector/src/main/java/org/jboss/resource/metadata/mcf/DataSourceDeploymentMetaData.java
branches/JBoss-AS-6.0.x-ipv6/connector/src/main/java/org/jboss/resource/metadata/mcf/ManagedConnectionFactoryDeploymentMetaData.java
branches/JBoss-AS-6.0.x-ipv6/connector/src/resources/deployers/jca-deployers-jboss-beans.xml
branches/JBoss-AS-6.0.x-ipv6/ejb3/src/resources/META-INF/jpa-deployers-jboss-beans.xml
branches/JBoss-AS-6.0.x-ipv6/ejb3/src/resources/standard/jpa-deployers-jboss-beans.xml
branches/JBoss-AS-6.0.x-ipv6/embedded/src/test/java/org/jboss/jbossas/embedded/testsuite/ServerIntegrationTest.java
branches/JBoss-AS-6.0.x-ipv6/profileservice/pom.xml
branches/JBoss-AS-6.0.x-ipv6/profileservice/src/resources/hdscanner-jboss-beans.xml
branches/JBoss-AS-6.0.x-ipv6/server/src/etc/deploy/transaction-jboss-beans.xml
branches/JBoss-AS-6.0.x-ipv6/server/src/etc/deployers/switchboard-jboss-beans.xml
branches/JBoss-AS-6.0.x-ipv6/server/src/main/java/org/jboss/web/deployers/AbstractWarDeployer.java
branches/JBoss-AS-6.0.x-ipv6/system/src/main/java/org/jboss/system/tools/ProfileServiceToolsFacade.java
branches/JBoss-AS-6.0.x-ipv6/testsuite/src/main/org/jboss/test/cluster/defaultcfg/web/test/CleanShutdownTestCase.java
branches/JBoss-AS-6.0.x-ipv6/testsuite/src/main/org/jboss/test/deployers/test/LegacyDeploymentScannerUnitTestCase.java
branches/JBoss-AS-6.0.x-ipv6/testsuite/src/main/org/jboss/test/profileservice/test/SecurityManagedObjectsTestCase.java
branches/JBoss-AS-6.0.x-ipv6/tomcat/src/main/java/org/jboss/web/tomcat/service/TomcatInjectionContainer.java
branches/JBoss-AS-6.0.x-ipv6/varia/src/resources/beanvalidation/bv-core-jboss-beans.xml
branches/JBoss-AS-6.0.x-ipv6/webservices/pom.xml
branches/JBoss-AS-6.0.x-ipv6/webservices/src/main/java/org/jboss/webservices/integration/deployers/AbstractDescriptorDeployer.java
branches/JBoss-AS-6.0.x-ipv6/webservices/src/main/java/org/jboss/webservices/integration/deployers/JMSDescriptorDeployer.java
branches/JBoss-AS-6.0.x-ipv6/webservices/src/main/java/org/jboss/webservices/integration/deployers/WSDescriptorDeployer.java
branches/JBoss-AS-6.0.x-ipv6/webservices/src/main/java/org/jboss/webservices/integration/injection/ServiceRefResourceProvider.java
branches/JBoss-AS-6.0.x-ipv6/webservices/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB3.java
branches/JBoss-AS-6.0.x-ipv6/webservices/src/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml
Log:
Merge trunk interval (109570-109711) into ipv6 revision 109712
Modified: branches/JBoss-AS-6.0.x-ipv6/component-matrix/pom.xml
===================================================================
--- branches/JBoss-AS-6.0.x-ipv6/component-matrix/pom.xml 2010-12-03 20:29:21 UTC (rev 109712)
+++ branches/JBoss-AS-6.0.x-ipv6/component-matrix/pom.xml 2010-12-03 22:31:46 UTC (rev 109713)
@@ -50,13 +50,13 @@
<version.javax.validation>1.0.0.GA</version.javax.validation>
<version.jaxws-httpserver-httpspi>1.0.0.GA</version.jaxws-httpserver-httpspi>
<version.jboss.injection>1.0.0-alpha-6</version.jboss.injection>
- <version.jboss.jaxr>2.0.1</version.jboss.jaxr>
+ <version.jboss.jaxr>2.0.2</version.jboss.jaxr>
<version.jboss.jbossts>4.13.1.Final</version.jboss.jbossts>
<version.jboss.jbossws-native>3.4.0.CR3</version.jboss.jbossws-native>
<version.jboss.jbossws-cxf>3.4.0.CR3</version.jboss.jbossws-cxf>
- <version.jboss.jbossws-common>1.4.1.CR2</version.jboss.jbossws-common>
+ <version.jboss.jbossws-common>1.4.1.CR3</version.jboss.jbossws-common>
<version.jboss.jbossws-framework>3.4.1.CR1</version.jboss.jbossws-framework>
- <version.jboss.jbossws-spi>1.4.1.CR2</version.jboss.jbossws-spi>
+ <version.jboss.jbossws-spi>1.4.1.CR4</version.jboss.jbossws-spi>
<version.jboss.jms-integration-tests>1.0.1.GA</version.jboss.jms-integration-tests>
<version.jboss.jsf-deployer>1.0.3</version.jboss.jsf-deployer>
<version.jboss.web>3.0.0-beta-7</version.jboss.web>
@@ -67,7 +67,8 @@
<version.org.hibernate.commons.annotations>3.2.0.Final</version.org.hibernate.commons.annotations>
<version.org.hibernate.entity.manager>${version.org.hibernate}</version.org.hibernate.entity.manager>
<version.org.hibernate.javax.persistence>1.0.0.Final</version.org.hibernate.javax.persistence>
- <version.org.hibernate.validator>4.0.2.GA</version.org.hibernate.validator>
+ <version.org.hibernate.legacy>4.0.2.GA</version.org.hibernate.legacy>
+ <version.org.hibernate.validator>4.1.0.Final</version.org.hibernate.validator>
<version.org.infinispan>4.2.0.CR2</version.org.infinispan>
<version.org.jboss.aop>2.2.1.Alpha3</version.org.jboss.aop>
<version.org.jboss.aspects.currentinvocation>1.0.1</version.org.jboss.aspects.currentinvocation>
@@ -85,7 +86,7 @@
<version.org.jboss.cluster.cache.ispn>1.0.0.CR8</version.org.jboss.cluster.cache.ispn>
<version.org.jboss.common.core>2.2.17.GA</version.org.jboss.common.core>
<version.org.jboss.deployers>2.2.0.Alpha8</version.org.jboss.deployers>
- <version.org.jboss.ejb3.depchain>1.0.0-alpha-26</version.org.jboss.ejb3.depchain>
+ <version.org.jboss.ejb3.depchain>1.0.0-alpha-29</version.org.jboss.ejb3.depchain>
<!-- This to move into the EJB3 BOM -->
<version.org.jboss.ejb3.embedded>1.0.0-alpha-1</version.org.jboss.ejb3.embedded>
<version.org.jboss.ejb.api>1.0-alpha-1</version.org.jboss.ejb.api>
@@ -96,7 +97,7 @@
<version.org.jboss.javaee.specs.bom>1.0.0.CR1</version.org.jboss.javaee.specs.bom>
<version.org.jboss.jbossxb>2.0.2.Beta9</version.org.jboss.jbossxb>
<version.org.jboss.jopr>1.4.0.GA</version.org.jboss.jopr>
- <version.org.jboss.jpa.deployers>1.0.2-alpha-1</version.org.jboss.jpa.deployers>
+ <version.org.jboss.jpa.deployers>1.0.2-alpha-2</version.org.jboss.jpa.deployers>
<version.org.jboss.jpa.vfs3>1.0.2-alpha-2</version.org.jboss.jpa.vfs3>
<version.org.jboss.jpa.impl>2.0.0</version.org.jboss.jpa.impl>
<version.org.jboss.jpa.mcint>1.0.0-alpha-2</version.org.jboss.jpa.mcint>
@@ -113,7 +114,7 @@
<version.org.jboss.metadata.client>2.0.0.Alpha2</version.org.jboss.metadata.client>
<version.org.jboss.metadata.common>2.0.0.Alpha22</version.org.jboss.metadata.common>
<version.org.jboss.metadata.ear>2.0.0.Alpha4</version.org.jboss.metadata.ear>
- <version.org.jboss.metadata.ejb>2.0.0-alpha-24</version.org.jboss.metadata.ejb>
+ <version.org.jboss.metadata.ejb>2.0.0-alpha-25</version.org.jboss.metadata.ejb>
<version.org.jboss.metadata.rar>2.0.0.Alpha</version.org.jboss.metadata.rar>
<version.org.jboss.metadata.war>2.0.0.Alpha15</version.org.jboss.metadata.war>
<version.org.jboss.mod_cluster>1.1.0.Final</version.org.jboss.mod_cluster>
@@ -133,7 +134,7 @@
<version.org.jboss.shrinkwrap>1.0.0-alpha-11</version.org.jboss.shrinkwrap>
<version.org.jboss.slf4j>1.0.2.GA</version.org.jboss.slf4j>
<version.org.jboss.stdio>1.0.0.CR3</version.org.jboss.stdio>
- <version.org.jboss.switchboard.depchain>1.0.0-alpha-12</version.org.jboss.switchboard.depchain>
+ <version.org.jboss.switchboard.depchain>1.0.0-alpha-13</version.org.jboss.switchboard.depchain>
<version.org.jboss.threads>2.0.0.CR7</version.org.jboss.threads>
<version.org.jboss.threads-metadata>2.0.0.CR4</version.org.jboss.threads-metadata>
<version.org.jboss.vfs>3.0.0.CR5</version.org.jboss.vfs>
@@ -1830,7 +1831,7 @@
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator-legacy</artifactId>
- <version>${version.org.hibernate.validator}</version>
+ <version>${version.org.hibernate.legacy}</version>
</dependency>
<dependency>
Copied: branches/JBoss-AS-6.0.x-ipv6/connector/src/main/java/org/jboss/resource/deployers/DataSourceDeployer.java (from rev 109712, trunk/connector/src/main/java/org/jboss/resource/deployers/DataSourceDeployer.java)
===================================================================
--- branches/JBoss-AS-6.0.x-ipv6/connector/src/main/java/org/jboss/resource/deployers/DataSourceDeployer.java (rev 0)
+++ branches/JBoss-AS-6.0.x-ipv6/connector/src/main/java/org/jboss/resource/deployers/DataSourceDeployer.java 2010-12-03 22:31:46 UTC (rev 109713)
@@ -0,0 +1,246 @@
+package org.jboss.resource.deployers;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.DeploymentStages;
+import org.jboss.deployers.spi.deployer.helpers.AbstractDeployer;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.logging.Logger;
+import org.jboss.metadata.client.spec.ApplicationClient6MetaData;
+import org.jboss.metadata.client.spec.ApplicationClientMetaData;
+import org.jboss.metadata.ear.spec.Ear60MetaData;
+import org.jboss.metadata.ear.spec.EarMetaData;
+import org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData;
+import org.jboss.metadata.ejb.jboss.JBossEnterpriseBeansMetaData;
+import org.jboss.metadata.ejb.jboss.JBossMetaData;
+import org.jboss.metadata.javaee.spec.DataSourceMetaData;
+import org.jboss.metadata.javaee.spec.DataSourcesMetaData;
+import org.jboss.metadata.javaee.spec.Environment;
+import org.jboss.metadata.javaee.spec.PropertyMetaData;
+import org.jboss.metadata.web.spec.WebMetaData;
+import org.jboss.resource.metadata.mcf.ConnectionPoolMetaData;
+import org.jboss.resource.metadata.mcf.DataSourceConnectionPropertyMetaData;
+import org.jboss.resource.metadata.mcf.LocalDataSourceDeploymentMetaData;
+import org.jboss.resource.metadata.mcf.ManagedConnectionFactoryDeploymentGroup;
+import org.jboss.resource.metadata.mcf.NoTxDataSourceDeploymentMetaData;
+import org.jboss.resource.metadata.mcf.NonXADataSourceDeploymentMetaData;
+import org.jboss.resource.metadata.repository.DefaultJCAMetaDataRepository;
+
+/**
+ * The DataSourceDeployer is designed to satisfy the EE6 specification
+ * requirement 5.17 where data-sources can be defined in the application.xml,
+ * ejb-jar.xml, web.xml and application-client.xml descriptors. The
+ * DataSourceDeployer simply reads the appropriate instances of meta data and
+ * translates each to the appropriate ManagedConnectionFactoryDeployment type which is in turn
+ * passed to the ManagedConnectionFactoryDeployer for real deployment.
+ *
+ * @author Weston M. Price
+ *
+ *
+ */
+public class DataSourceDeployer extends AbstractDeployer {
+
+ private static final Logger logger = Logger.getLogger(DataSourceDeployer.class);
+
+ private boolean isEARSupported = true;
+ private boolean isWARSupported = true;
+ private boolean isEJBSupported = true;
+ private boolean isCARSupported = true;
+
+ public DataSourceDeployer() {
+ setStage(DeploymentStages.POST_CLASSLOADER);
+ addInput(EarMetaData.class);
+ addInput(WebMetaData.class);
+ addInput("annotated."+ WebMetaData.class.getName() + ":classes");
+ addInput(ApplicationClient6MetaData.class);
+ addInput(JBossMetaData.class);
+ }
+
+ public boolean isEARSupported() {
+ return isEARSupported;
+ }
+
+ public void setEARSupported(boolean isEARSupported) {
+ this.isEARSupported = isEARSupported;
+ }
+
+ public boolean isWARSupported() {
+ return isWARSupported;
+ }
+
+ public void setWARSupported(boolean isWARSupported) {
+ this.isWARSupported = isWARSupported;
+ }
+
+ public boolean isEJBSupported() {
+ return isEJBSupported;
+ }
+
+ public void setEJBSupported(boolean isEJBSupported) {
+ this.isEJBSupported = isEJBSupported;
+ }
+
+ public boolean isCARSupported() {
+ return isCARSupported;
+ }
+
+ public void setCARSupported(boolean isCARSupported) {
+ this.isCARSupported = isCARSupported;
+ }
+
+ @Override
+ public void deploy(DeploymentUnit unit) throws DeploymentException
+ {
+ DataSourcesMetaData dsmd = getDataSourcesMetaData(unit);
+ ManagedConnectionFactoryDeploymentGroup group = getMCFMetaData(dsmd);
+ unit.addAttachment(ManagedConnectionFactoryDeploymentGroup.class, group);
+ }
+
+ private ManagedConnectionFactoryDeploymentGroup getMCFMetaData(DataSourcesMetaData dataSources)
+ {
+ ManagedConnectionFactoryDeploymentGroup group = new ManagedConnectionFactoryDeploymentGroup();
+ NonXADataSourceDeploymentMetaData depMd = null;
+
+ for(String key: dataSources.keySet())
+ {
+ DataSourceMetaData dsmd = dataSources.get(key);
+
+ if(dsmd.isTransactional())
+ {
+ depMd = new LocalDataSourceDeploymentMetaData();
+ }
+ else
+ {
+ depMd = new NoTxDataSourceDeploymentMetaData();
+ }
+
+ depMd.setJndiName(normalizeJndiName(dsmd.getName()));
+ depMd.setDriverClass(dsmd.getClassName());
+ depMd.setConnectionUrl(dsmd.getUrl());
+ depMd.setUserName(dsmd.getUser());
+ depMd.setPassWord(dsmd.getPassword());
+
+ if(dsmd.getIsolationLevel() != null)
+ {
+ depMd.setTransactionIsolation(dsmd.getIsolationLevel().toString());
+ }
+
+ List<DataSourceConnectionPropertyMetaData> connProps = new ArrayList<DataSourceConnectionPropertyMetaData>();
+ depMd.setDataSourceConnectionProperties(connProps);
+
+ if(dsmd.getProperties() != null && dsmd.getProperties().keySet().size() > 0)
+ {
+ for(String propKey: dsmd.getProperties().keySet())
+ {
+ PropertyMetaData prop = dsmd.getProperties().get(propKey);
+ DataSourceConnectionPropertyMetaData dsProp = new DataSourceConnectionPropertyMetaData();
+ dsProp.setName(propKey);
+ dsProp.setValue(prop.getName());
+ }
+
+ }
+
+ //TODO max statements should be handled
+
+ ConnectionPoolMetaData cpmd = (ConnectionPoolMetaData)depMd;
+ cpmd.setMinSize(dsmd.getMinPoolSize());
+ cpmd.setMaxSize(dsmd.getMaxPoolSize());
+ cpmd.setIdleTimeoutMinutes(dsmd.getMaxIdleTime() / 60);
+ cpmd.setBlockingTimeoutMilliSeconds(dsmd.getLoginTimeout() * 1000);
+
+ group.addManagedConnectionFactoryDeployment(depMd);
+
+ }
+
+
+ return group;
+ }
+
+ private DataSourcesMetaData getDataSourcesMetaData(DeploymentUnit du)
+ {
+ DataSourcesMetaData candidates = new DataSourcesMetaData();
+ DataSourcesMetaData temp = null;
+
+ WebMetaData wmd = du.getAttachment(WebMetaData.class);
+
+ if(isWARSupported() && wmd != null)
+ {
+ temp = ((Environment)wmd).getDataSources();
+
+ if(temp != null && !temp.isEmpty())
+ {
+ candidates.addAll(temp);
+ }
+ }
+
+ wmd = du.getAttachment("annotated."+ WebMetaData.class.getName() + ":classes", WebMetaData.class);
+
+ if(isWARSupported() && wmd != null)
+ {
+ temp = ((Environment)wmd).getDataSources();
+
+ if(temp != null && !temp.isEmpty())
+ {
+ candidates.addAll(temp);
+ }
+ }
+
+ EarMetaData emd = du.getAttachment(EarMetaData.class);
+
+ if(isEARSupported() && (emd != null && emd.isEE6()))
+ {
+ if( ((Ear60MetaData)emd).getEarEnvironmentRefsGroup() != null)
+ {
+ temp = ((Ear60MetaData)emd).getEarEnvironmentRefsGroup().getDataSources();
+
+ if(temp != null && !temp.isEmpty())
+ {
+ candidates.addAll(temp);
+ }
+ }
+
+ }
+
+ JBossMetaData ebmd = du.getAttachment(JBossMetaData.class);
+
+ if(isEJBSupported() && (ebmd != null && ebmd.isEJB3x()))
+ {
+
+ JBossEnterpriseBeansMetaData je = ebmd.getEnterpriseBeans();
+ temp = ((Environment)ebmd).getDataSources();
+
+ if(temp != null && !temp.isEmpty())
+ {
+ candidates.addAll(temp);
+ }
+ }
+
+ ApplicationClientMetaData acmd = du.getAttachment(ApplicationClientMetaData.class);
+
+ if(isCARSupported() && acmd != null)
+ {
+ //TODO support application clients
+ }
+
+ return candidates;
+ }
+
+
+ private static String normalizeJndiName(String jndiName)
+ {
+
+ if(jndiName != null)
+ {
+ if(jndiName.contains("java:"))
+ {
+ return jndiName.replace("java:", "").trim();
+ }
+ }
+
+ return jndiName;
+
+ }
+
+}
Modified: branches/JBoss-AS-6.0.x-ipv6/connector/src/main/java/org/jboss/resource/metadata/mcf/DataSourceDeploymentMetaData.java
===================================================================
--- branches/JBoss-AS-6.0.x-ipv6/connector/src/main/java/org/jboss/resource/metadata/mcf/DataSourceDeploymentMetaData.java 2010-12-03 20:29:21 UTC (rev 109712)
+++ branches/JBoss-AS-6.0.x-ipv6/connector/src/main/java/org/jboss/resource/metadata/mcf/DataSourceDeploymentMetaData.java 2010-12-03 22:31:46 UTC (rev 109713)
@@ -321,7 +321,8 @@
@ManagementPropertyFactory(ConnectionFactoryProperty.class)
public List<ManagedConnectionFactoryPropertyMetaData> getManagedConnectionFactoryProperties()
{
- List<ManagedConnectionFactoryPropertyMetaData> properties = new ArrayList<ManagedConnectionFactoryPropertyMetaData>();
+ List<ManagedConnectionFactoryPropertyMetaData> properties = super.getManagedConnectionFactoryProperties();
+
ManagedConnectionFactoryPropertyMetaData property = null;
if(getUserName() != null)
Modified: branches/JBoss-AS-6.0.x-ipv6/connector/src/main/java/org/jboss/resource/metadata/mcf/ManagedConnectionFactoryDeploymentMetaData.java
===================================================================
--- branches/JBoss-AS-6.0.x-ipv6/connector/src/main/java/org/jboss/resource/metadata/mcf/ManagedConnectionFactoryDeploymentMetaData.java 2010-12-03 20:29:21 UTC (rev 109712)
+++ branches/JBoss-AS-6.0.x-ipv6/connector/src/main/java/org/jboss/resource/metadata/mcf/ManagedConnectionFactoryDeploymentMetaData.java 2010-12-03 22:31:46 UTC (rev 109713)
@@ -44,8 +44,8 @@
import org.jboss.managed.api.annotation.ViewUse;
import org.jboss.resource.deployers.management.ConnectionFactoryProperty;
import org.jboss.system.metadata.ServiceMetaData;
+import org.jboss.util.StringPropertyReplacer;
-
/**
* A ManagedConnectionFactoryDeployment.
*
@@ -211,6 +211,10 @@
@ManagementObjectID(type="DataSource")
public String getJndiName()
{
+ if (jndiName.indexOf("${") >= 0 && jndiName.indexOf('}') >=0)
+ {
+ jndiName = StringPropertyReplacer.replaceProperties(jndiName);
+ }
return jndiName;
}
@@ -268,20 +272,6 @@
}
/**
- * Get the managedConnectionFactoryProperties.
- *
- * @return the managedConnectionFactoryProperties.
- */
- @ManagementProperty(name="config-property",
- description="The connection factory config properties",
- managed=true, includeInTemplate=true)
- @ManagementPropertyFactory(ConnectionFactoryProperty.class)
- public List<ManagedConnectionFactoryPropertyMetaData> getManagedConnectionFactoryProperties()
- {
- return managedConnectionFactoryProperties;
- }
-
- /**
* Set the managedConnectionFactoryProperties.
*
* @param managedConnectionFactoryProperties The managedConnectionFactoryProperties to set.
@@ -655,4 +645,53 @@
{
this.dbmsMetaData = dbmsMetaData;
}
+
+ /**
+ * Get the managedConnectionFactoryProperties.
+ *
+ * @return the managedConnectionFactoryProperties.
+ */
+ @ManagementProperty(name="config-property",
+ description="The connection factory config properties",
+ managed=true, includeInTemplate=true)
+ @ManagementPropertyFactory(ConnectionFactoryProperty.class)
+ public List<ManagedConnectionFactoryPropertyMetaData> getManagedConnectionFactoryProperties()
+ {
+ List<ManagedConnectionFactoryPropertyMetaData> properties = managedConnectionFactoryProperties;
+ ManagedConnectionFactoryPropertyMetaData property = null;
+
+ if(getJndiName() != null)
+ {
+ property = new ManagedConnectionFactoryPropertyMetaData();
+ property.setName("JndiName");
+ property.setValue(getJndiName());
+ properties.add(property);
+ }
+
+ if(getRarName() != null)
+ {
+ property = new ManagedConnectionFactoryPropertyMetaData();
+ property.setName("RarName");
+ property.setValue(getRarName());
+ properties.add(property);
+ }
+
+ if(getConnectionDefinition() != null)
+ {
+ property = new ManagedConnectionFactoryPropertyMetaData();
+ property.setName("ConnectionDefinition");
+ property.setValue(getConnectionDefinition());
+ properties.add(property);
+ }
+
+ if(getJmxInvokerName() != null)
+ {
+ property = new ManagedConnectionFactoryPropertyMetaData();
+ property.setName("JmxInvokerName");
+ property.setValue(getJmxInvokerName());
+ properties.add(property);
+ }
+
+ return properties;
+ }
}
Modified: branches/JBoss-AS-6.0.x-ipv6/connector/src/resources/deployers/jca-deployers-jboss-beans.xml
===================================================================
--- branches/JBoss-AS-6.0.x-ipv6/connector/src/resources/deployers/jca-deployers-jboss-beans.xml 2010-12-03 20:29:21 UTC (rev 109712)
+++ branches/JBoss-AS-6.0.x-ipv6/connector/src/resources/deployers/jca-deployers-jboss-beans.xml 2010-12-03 22:31:46 UTC (rev 109713)
@@ -182,5 +182,12 @@
<bean name="MCFDGComponentMapper" class="org.jboss.resource.deployers.management.MCFDGComponentMapper">
<constructor><parameter><inject bean="PersistenceFactory" /></parameter></constructor>
</bean>
-
+
+ <!-- Deployer responsible for managing EE5.17 data source definitions -->
+ <bean name="DataSourceDeployer" class="org.jboss.resource.deployers.DataSourceDeployer">
+ <property name="EJBSupported">false</property>
+ <property name="CARSupported">false</property>
+ </bean>
+
+
</deployment>
Modified: branches/JBoss-AS-6.0.x-ipv6/ejb3/src/resources/META-INF/jpa-deployers-jboss-beans.xml
===================================================================
--- branches/JBoss-AS-6.0.x-ipv6/ejb3/src/resources/META-INF/jpa-deployers-jboss-beans.xml 2010-12-03 20:29:21 UTC (rev 109712)
+++ branches/JBoss-AS-6.0.x-ipv6/ejb3/src/resources/META-INF/jpa-deployers-jboss-beans.xml 2010-12-03 22:31:46 UTC (rev 109713)
@@ -123,4 +123,11 @@
</map>
</property>
</bean>
+
+ <!-- Resource provider for PersistenceUnit reference -->
+ <bean name="org.jboss.switchboard.PersistenceUnitResourceProvider" class="org.jboss.jpa.deployers.switchboard.PersistenceUnitResourceProvider">
+ <constructor>
+ <parameter><inject bean="PersistenceUnitDependencyResolver"/></parameter>
+ </constructor>
+ </bean>
</deployment>
Modified: branches/JBoss-AS-6.0.x-ipv6/ejb3/src/resources/standard/jpa-deployers-jboss-beans.xml
===================================================================
--- branches/JBoss-AS-6.0.x-ipv6/ejb3/src/resources/standard/jpa-deployers-jboss-beans.xml 2010-12-03 20:29:21 UTC (rev 109712)
+++ branches/JBoss-AS-6.0.x-ipv6/ejb3/src/resources/standard/jpa-deployers-jboss-beans.xml 2010-12-03 22:31:46 UTC (rev 109713)
@@ -127,4 +127,11 @@
</map>
</property>
</bean>
+ <!-- Resource provider for PersistenceUnit reference -->
+ <bean name="org.jboss.switchboard.PersistenceUnitResourceProvider" class="org.jboss.jpa.deployers.switchboard.PersistenceUnitResourceProvider">
+ <constructor>
+ <parameter><inject bean="PersistenceUnitDependencyResolver"/></parameter>
+ </constructor>
+ </bean>
+
</deployment>
Modified: branches/JBoss-AS-6.0.x-ipv6/embedded/src/test/java/org/jboss/jbossas/embedded/testsuite/ServerIntegrationTest.java
===================================================================
--- branches/JBoss-AS-6.0.x-ipv6/embedded/src/test/java/org/jboss/jbossas/embedded/testsuite/ServerIntegrationTest.java 2010-12-03 20:29:21 UTC (rev 109712)
+++ branches/JBoss-AS-6.0.x-ipv6/embedded/src/test/java/org/jboss/jbossas/embedded/testsuite/ServerIntegrationTest.java 2010-12-03 22:31:46 UTC (rev 109713)
@@ -81,6 +81,7 @@
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.AfterClass;
import org.junit.BeforeClass;
+import org.junit.Ignore;
import org.junit.Test;
/**
@@ -297,6 +298,7 @@
* Tests EJB3 3.1 @Asynchronous support
*/
@Test
+ @Ignore // temporarily disabled till Async interceptor is enabled back in EJB3 release
public void testEjb31Async() throws Exception
{
// Log
Modified: branches/JBoss-AS-6.0.x-ipv6/profileservice/pom.xml
===================================================================
--- branches/JBoss-AS-6.0.x-ipv6/profileservice/pom.xml 2010-12-03 20:29:21 UTC (rev 109712)
+++ branches/JBoss-AS-6.0.x-ipv6/profileservice/pom.xml 2010-12-03 22:31:46 UTC (rev 109713)
@@ -163,116 +163,6 @@
<version>4.5</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-vfs-spi</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.remoting</groupId>
- <artifactId>jboss-remoting</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.man</groupId>
- <artifactId>jboss-metatype</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-vfs</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.aop</groupId>
- <artifactId>jboss-aop</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-structure-spi</artifactId>
- </dependency>
- <dependency>
- <groupId>xml-apis</groupId>
- <artifactId>xml-apis</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-client-spi</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-spi</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-core-spi</artifactId>
- </dependency>
- <dependency>
- <groupId>stax</groupId>
- <artifactId>stax-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.spec.javax.ejb</groupId>
- <artifactId>jboss-ejb-api_3.1_spec</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.spec.javax.annotation</groupId>
- <artifactId>jboss-annotations-api_1.1_spec</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.spec.javax.servlet</groupId>
- <artifactId>jboss-servlet-api_3.0_spec</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.spec.javax.servlet.jsp</groupId>
- <artifactId>jboss-jsp-api_2.2_spec</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.spec.javax.el</groupId>
- <artifactId>jboss-el-api_2.2_spec</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.spec.javax.security.jacc</groupId>
- <artifactId>jboss-jacc-api_1.4_spec</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.spec.javax.security.auth.message</groupId>
- <artifactId>jboss-jaspi-api_1.0_spec</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.spec.javax.transaction</groupId>
- <artifactId>jboss-transaction-api_1.1_spec</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.spec.javax.jms</groupId>
- <artifactId>jboss-jms-api_1.1_spec</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.spec.javax.interceptor</groupId>
- <artifactId>jboss-interceptors-api_1.1_spec</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.ejb3</groupId>
- <artifactId>jboss-ejb3-ext-api</artifactId>
- <exclusions>
- <exclusion>
- <groupId>org.jboss.javaee</groupId>
- <artifactId>jboss-ejb-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.jboss.javaee</groupId>
- <artifactId>jboss-ejb-api_3.1</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.jboss.logging</groupId>
- <artifactId>jboss-logging-spi</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.jboss.logging</groupId>
- <artifactId>jboss-logging-log4j</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.jboss.metadata</groupId>
- <artifactId>jboss-metadata</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
</dependencies>
</project>
Modified: branches/JBoss-AS-6.0.x-ipv6/profileservice/src/resources/hdscanner-jboss-beans.xml
===================================================================
--- branches/JBoss-AS-6.0.x-ipv6/profileservice/src/resources/hdscanner-jboss-beans.xml 2010-12-03 20:29:21 UTC (rev 109712)
+++ branches/JBoss-AS-6.0.x-ipv6/profileservice/src/resources/hdscanner-jboss-beans.xml 2010-12-03 22:31:46 UTC (rev 109713)
@@ -17,6 +17,7 @@
<bean name="ProfileServiceDeploymentRepositoryAdapter" class="org.jboss.system.tools.LegacyDeploymentScannerAdapter">
<property name="profileService"><inject bean="jboss.profileservice:service=ProfileService" /></property>
<property name="repositoryManager"><inject bean="ArtifactRepositoryManager" /></property>
+ <property name="actionController"><inject bean="ActionController" /></property>
<property name="hdFactory"><inject bean="HDScannerFactory" /></property>
</bean>
Modified: branches/JBoss-AS-6.0.x-ipv6/server/src/etc/deploy/transaction-jboss-beans.xml
===================================================================
--- branches/JBoss-AS-6.0.x-ipv6/server/src/etc/deploy/transaction-jboss-beans.xml 2010-12-03 20:29:21 UTC (rev 109712)
+++ branches/JBoss-AS-6.0.x-ipv6/server/src/etc/deploy/transaction-jboss-beans.xml 2010-12-03 22:31:46 UTC (rev 109713)
@@ -10,6 +10,8 @@
jonathan.halliday at redhat.com, 2010-10
-->
+ <bean name="TxControl" class="com.arjuna.ats.arjuna.coordinator.TxControl"/>
+
<bean name="RecoveryEnvironmentBean" class="com.arjuna.ats.arjuna.common.RecoveryEnvironmentBean">
<annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.jta:name=RecoveryEnvironmentBean", exposedInterface=com.arjuna.ats.arjuna.common.RecoveryEnvironmentBeanMBean.class, registerDirectly=true)</annotation>
@@ -191,7 +193,7 @@
<bean name="TransactionManager" class="com.arjuna.ats.jbossatx.jta.TransactionManagerService">
<annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss:service=TransactionManager", exposedInterface=com.arjuna.ats.jbossatx.jta.TransactionManagerServiceMBean.class, registerDirectly=true)</annotation>
<annotation>@org.jboss.managed.api.annotation.ManagementObject(name="TransactionManager",componentType=@org.jboss.managed.api.annotation.ManagementComponent(type = "MCBean", subtype = "JTA"),targetInterface=com.arjuna.ats.jbossatx.jta.TransactionManagerServiceMBean.class)</annotation>
-
+ <depends>TxControl</depends>
<property name="jbossXATerminator"><inject bean="XATerminator"/></property>
<property name="transactionSynchronizationRegistry"><inject bean="TransactionSynchronizationRegistry"/></property>
Modified: branches/JBoss-AS-6.0.x-ipv6/server/src/etc/deployers/switchboard-jboss-beans.xml
===================================================================
--- branches/JBoss-AS-6.0.x-ipv6/server/src/etc/deployers/switchboard-jboss-beans.xml 2010-12-03 20:29:21 UTC (rev 109712)
+++ branches/JBoss-AS-6.0.x-ipv6/server/src/etc/deployers/switchboard-jboss-beans.xml 2010-12-03 22:31:46 UTC (rev 109713)
@@ -129,6 +129,7 @@
</constructor>
</bean>
+
<!-- Resource provider registry -->
<bean name="org.jboss.switchboard.ResourceProviderRegistry" class="org.jboss.switchboard.mc.resource.provider.ResourceProviderRegistry">
<property name="resourceProviders">
@@ -138,6 +139,7 @@
<inject bean="org.jboss.switchboard.ResourceRefResourceProvider"/>
<inject bean="org.jboss.switchboard.MessageDestinationRefResourceProvider"/>
<inject bean="org.jboss.switchboard.WebServiceRefResourceProvider"/>
+ <inject bean="org.jboss.switchboard.PersistenceUnitResourceProvider"/>
<!-- Disabled till we resolve the transient failures with EJB jndi dependencies
<inject bean="org.jboss.switchboard.EJBLocalRefResourceProvider"/>
<inject bean="org.jboss.switchboard.EJBRefResourceProvider"/>
Modified: branches/JBoss-AS-6.0.x-ipv6/server/src/main/java/org/jboss/web/deployers/AbstractWarDeployer.java
===================================================================
--- branches/JBoss-AS-6.0.x-ipv6/server/src/main/java/org/jboss/web/deployers/AbstractWarDeployer.java 2010-12-03 20:29:21 UTC (rev 109712)
+++ branches/JBoss-AS-6.0.x-ipv6/server/src/main/java/org/jboss/web/deployers/AbstractWarDeployer.java 2010-12-03 22:31:46 UTC (rev 109713)
@@ -78,8 +78,6 @@
import org.jboss.metadata.javaee.spec.Environment;
import org.jboss.metadata.javaee.spec.PersistenceContextReferenceMetaData;
import org.jboss.metadata.javaee.spec.PersistenceContextReferencesMetaData;
-import org.jboss.metadata.javaee.spec.PersistenceUnitReferenceMetaData;
-import org.jboss.metadata.javaee.spec.PersistenceUnitReferencesMetaData;
import org.jboss.metadata.web.jboss.ClassLoadingMetaData;
import org.jboss.metadata.web.jboss.JBossWebMetaData;
import org.jboss.metadata.web.spec.WebMetaData;
@@ -797,24 +795,9 @@
}
}
- // TODO: We haven't yet integrated PU/PC and EJB reference providers in SwitchBoard.
+ // TODO: We haven't yet integrated PC and EJB reference providers in SwitchBoard.
// The following sections will be removed after the RPs are made available
- // JBAS-6795 Add dependency on PersistenceUnit references
- PersistenceUnitReferencesMetaData puRefs = metaData.getPersistenceUnitRefs();
- if (puRefs != null)
- {
- for (PersistenceUnitReferenceMetaData puRef : metaData.getPersistenceUnitRefs())
- {
- // TODO: this is a duplication of the logic in PersistenceUnitHandler
- String persistenceUnitName = puRef.getPersistenceUnitName();
- String beanName = persistenceUnitDependencyResolver.resolvePersistenceUnitSupplier(unit, persistenceUnitName);
- ServiceDependencyMetaData sdmd = new ServiceDependencyMetaData();
- sdmd.setIDependOn(beanName);
- dependencies.add(sdmd);
- }
- }
-
// JBAS-6795 Add dependency on PersistenceContext references
PersistenceContextReferencesMetaData pcRefs = metaData.getPersistenceContextRefs();
if (pcRefs != null)
Modified: branches/JBoss-AS-6.0.x-ipv6/system/src/main/java/org/jboss/system/tools/ProfileServiceToolsFacade.java
===================================================================
--- branches/JBoss-AS-6.0.x-ipv6/system/src/main/java/org/jboss/system/tools/ProfileServiceToolsFacade.java 2010-12-03 20:29:21 UTC (rev 109712)
+++ branches/JBoss-AS-6.0.x-ipv6/system/src/main/java/org/jboss/system/tools/ProfileServiceToolsFacade.java 2010-12-03 22:31:46 UTC (rev 109713)
@@ -28,6 +28,7 @@
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
+import java.util.Set;
import java.util.concurrent.TimeUnit;
import org.jboss.profileservice.profile.metadata.plugin.HotDeploymentProfileMetaData;
@@ -35,8 +36,11 @@
import org.jboss.profileservice.profile.metadata.plugin.ScanPeriod;
import org.jboss.profileservice.repository.artifact.ArtifactRepositoryManager;
import org.jboss.profileservice.spi.NoSuchProfileException;
+import org.jboss.profileservice.spi.Profile;
import org.jboss.profileservice.spi.ProfileKey;
import org.jboss.profileservice.spi.ProfileService;
+import org.jboss.profileservice.spi.action.ActionController;
+import org.jboss.profileservice.spi.managed.ManagedProfile;
import org.jboss.profileservice.spi.metadata.ProfileMetaData;
import org.jboss.profileservice.spi.repository.ArtifactId;
import org.jboss.profileservice.spi.repository.ArtifactRepository;
@@ -65,6 +69,8 @@
/** The time unit. */
private TimeUnit timeUnit = TimeUnit.SECONDS;
+ private ActionController actionController;
+
/** The profile service. */
private ProfileService profileService;
@@ -154,6 +160,13 @@
this.repositoryManager = repositoryManager;
}
+ public ActionController getActionController() {
+ return actionController;
+ }
+ public void setActionController(ActionController actionController) {
+ this.actionController = actionController;
+ }
+
/**
* start()
*/
@@ -167,6 +180,9 @@
{
throw new IllegalStateException("null repository manager");
}
+ if(actionController == null) {
+ throw new IllegalStateException("null action controller");
+ }
}
/**
@@ -279,17 +295,19 @@
*
* @return the deployment urls.
*/
- public String[] listDeployedURLs()
- {
+ public String[] listDeployedURLs() {
final Collection<String> names = new HashSet<String>();
- for(final ArtifactRepository<ArtifactId> repository : repositoryManager.getRepositories())
- {
- final URI artifactRepositoryURI = repository.getRepositoryURI();
- names.add(artifactRepositoryURI.getPath());
+ for(final ProfileKey key : actionController.getActiveProfiles()) {
+ final ManagedProfile managed = actionController.getManagedProfile(key);
+ final Profile profile = managed.getProfile();
+ final Set<String> deploymentNames = profile.getDeploymentNames();
+ if(deploymentNames != null && deploymentNames.isEmpty() == false) {
+ names.addAll(deploymentNames);
+ }
}
return names.toArray(new String[names.size()]);
}
-
+
/**
* Check whether a repository manages a certain {@code URI}.
*
Modified: branches/JBoss-AS-6.0.x-ipv6/testsuite/src/main/org/jboss/test/cluster/defaultcfg/web/test/CleanShutdownTestCase.java
===================================================================
--- branches/JBoss-AS-6.0.x-ipv6/testsuite/src/main/org/jboss/test/cluster/defaultcfg/web/test/CleanShutdownTestCase.java 2010-12-03 20:29:21 UTC (rev 109712)
+++ branches/JBoss-AS-6.0.x-ipv6/testsuite/src/main/org/jboss/test/cluster/defaultcfg/web/test/CleanShutdownTestCase.java 2010-12-03 22:31:46 UTC (rev 109713)
@@ -21,6 +21,7 @@
*/
package org.jboss.test.cluster.defaultcfg.web.test;
+import java.net.InetAddress;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
@@ -204,11 +205,11 @@
private Cookie findCookie(int serverIndex, String name) throws Exception
{
- String domain = this.getServers()[serverIndex];
+ InetAddress address = InetAddress.getByName(this.getServers()[serverIndex]);
for (Cookie cookie: this.client.getState().getCookies())
{
- if (cookie.getDomain().equalsIgnoreCase(domain) && cookie.getName().equals(name))
+ if (InetAddress.getByName(cookie.getDomain()).equals(address) && cookie.getName().equals(name))
{
return cookie;
}
Modified: branches/JBoss-AS-6.0.x-ipv6/testsuite/src/main/org/jboss/test/deployers/test/LegacyDeploymentScannerUnitTestCase.java
===================================================================
--- branches/JBoss-AS-6.0.x-ipv6/testsuite/src/main/org/jboss/test/deployers/test/LegacyDeploymentScannerUnitTestCase.java 2010-12-03 20:29:21 UTC (rev 109712)
+++ branches/JBoss-AS-6.0.x-ipv6/testsuite/src/main/org/jboss/test/deployers/test/LegacyDeploymentScannerUnitTestCase.java 2010-12-03 22:31:46 UTC (rev 109713)
@@ -155,8 +155,6 @@
assertNotNull(deployments);
assertTrue(deployments.length > 1);
- URL directory = getDeployURL(deployDir);
- assertFalse(Arrays.binarySearch(deployments, directory.toURI().toString()) == -1);
}
public void testDeploymentMgrRedeploy() throws Exception
Modified: branches/JBoss-AS-6.0.x-ipv6/testsuite/src/main/org/jboss/test/profileservice/test/SecurityManagedObjectsTestCase.java
===================================================================
--- branches/JBoss-AS-6.0.x-ipv6/testsuite/src/main/org/jboss/test/profileservice/test/SecurityManagedObjectsTestCase.java 2010-12-03 20:29:21 UTC (rev 109712)
+++ branches/JBoss-AS-6.0.x-ipv6/testsuite/src/main/org/jboss/test/profileservice/test/SecurityManagedObjectsTestCase.java 2010-12-03 22:31:46 UTC (rev 109713)
@@ -320,7 +320,6 @@
// verify that the component has the expected managed properties.
Map<String, ManagedProperty> properties = component.getProperties();
assertNotNull(properties);
- assertEquals("Unexpected number of properties", 22, properties.size());
assertTrue("Missing expected property: securityDomain", properties.containsKey("securityDomain"));
assertTrue("Missing expected property: state", properties.containsKey("state"));
// keystore and truststore configuration properties.
Modified: branches/JBoss-AS-6.0.x-ipv6/tomcat/src/main/java/org/jboss/web/tomcat/service/TomcatInjectionContainer.java
===================================================================
--- branches/JBoss-AS-6.0.x-ipv6/tomcat/src/main/java/org/jboss/web/tomcat/service/TomcatInjectionContainer.java 2010-12-03 20:29:21 UTC (rev 109712)
+++ branches/JBoss-AS-6.0.x-ipv6/tomcat/src/main/java/org/jboss/web/tomcat/service/TomcatInjectionContainer.java 2010-12-03 22:31:46 UTC (rev 109713)
@@ -30,7 +30,6 @@
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -62,7 +61,6 @@
import org.jboss.injection.InjectionHandler;
import org.jboss.injection.Injector;
import org.jboss.injection.PersistenceContextHandler;
-import org.jboss.injection.PersistenceUnitHandler;
import org.jboss.injection.manager.spi.InjectionManager;
import org.jboss.jpa.resolvers.PersistenceUnitDependencyResolver;
import org.jboss.logging.Logger;
@@ -583,7 +581,6 @@
try
{
handlers.add(new PersistenceContextHandler<Environment>());
- handlers.add(new PersistenceUnitHandler<Environment>());
}
catch (NoClassDefFoundError e)
{
Modified: branches/JBoss-AS-6.0.x-ipv6/varia/src/resources/beanvalidation/bv-core-jboss-beans.xml
===================================================================
--- branches/JBoss-AS-6.0.x-ipv6/varia/src/resources/beanvalidation/bv-core-jboss-beans.xml 2010-12-03 20:29:21 UTC (rev 109712)
+++ branches/JBoss-AS-6.0.x-ipv6/varia/src/resources/beanvalidation/bv-core-jboss-beans.xml 2010-12-03 22:31:46 UTC (rev 109713)
@@ -5,7 +5,14 @@
-->
<deployment xmlns="urn:jboss:bean-deployer:2.0">
- <!-- ValidatorFactory factory -->
+ <!-- ValidatorFactory factory
+ We currently use org.hibernate.validator.util.LazyValidatorFactory
+ Two contracts are important:
+ - it lazily creates the ValidatorFactory when getValidator() is first requested
+ - it enforces that the default validation provider is Hibernate Validator
+ The latter is necessary to ensure that by default AS uses Hibernate Validator. This will reduce confusion
+ for support and for people using Bean Validation
+ -->
<beanfactory name="ValidatorFactoryFactory" class="org.hibernate.validator.util.LazyValidatorFactory"/>
<!-- JEE DU filter -->
Modified: branches/JBoss-AS-6.0.x-ipv6/webservices/pom.xml
===================================================================
--- branches/JBoss-AS-6.0.x-ipv6/webservices/pom.xml 2010-12-03 20:29:21 UTC (rev 109712)
+++ branches/JBoss-AS-6.0.x-ipv6/webservices/pom.xml 2010-12-03 22:31:46 UTC (rev 109713)
@@ -116,6 +116,12 @@
</dependency>
<!-- jboss provided dependencies -->
<dependency>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>weld-int-deployer</artifactId>
+ <version>${version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
<groupId>org.jboss.switchboard</groupId>
<artifactId>jboss-switchboard-spi</artifactId>
</dependency>
Modified: branches/JBoss-AS-6.0.x-ipv6/webservices/src/main/java/org/jboss/webservices/integration/deployers/AbstractDescriptorDeployer.java
===================================================================
--- branches/JBoss-AS-6.0.x-ipv6/webservices/src/main/java/org/jboss/webservices/integration/deployers/AbstractDescriptorDeployer.java 2010-12-03 20:29:21 UTC (rev 109712)
+++ branches/JBoss-AS-6.0.x-ipv6/webservices/src/main/java/org/jboss/webservices/integration/deployers/AbstractDescriptorDeployer.java 2010-12-03 22:31:46 UTC (rev 109713)
@@ -21,12 +21,15 @@
*/
package org.jboss.webservices.integration.deployers;
-import org.jboss.deployers.vfs.spi.deployer.ObjectModelFactoryDeployer;
+import org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer;
import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
import org.jboss.vfs.VFSInputSource;
import org.jboss.vfs.VirtualFile;
+import org.jboss.wsf.spi.metadata.DescriptorParser;
import org.jboss.wsf.spi.metadata.DescriptorProcessor;
import org.jboss.xb.binding.ObjectModelFactory;
+import org.jboss.xb.binding.Unmarshaller;
+import org.jboss.xb.binding.UnmarshallerFactory;
import org.xml.sax.InputSource;
/**
@@ -34,25 +37,32 @@
*
* @author <a href="mailto:ropalka at redhat.com">Richard Opalka</a>
*/
-abstract class AbstractDescriptorDeployer<P extends DescriptorProcessor<T>, T> extends ObjectModelFactoryDeployer<T>
+abstract class AbstractDescriptorDeployer<P extends DescriptorProcessor<T>, Q extends DescriptorParser<T>, T> extends AbstractVFSParsingDeployer<T>
{
private P ddProcessor;
+ private Q ddParser;
AbstractDescriptorDeployer(Class<T> output)
{
super(output);
this.setName("UNSPECIFIED");
- this.setUseSchemaValidation(false);
}
+ @SuppressWarnings({"deprecation", "unchecked"})
@Override
protected T parse(final VFSDeploymentUnit unit, final VirtualFile file, final T root) throws Exception
{
- if (this.ddProcessor != null)
+ if (this.ddParser != null) //default to using new parsers if available
{
+ return this.ddParser.parse(file.toURL());
+ }
+ else if (this.ddProcessor != null)
+ {
InputSource source = new VFSInputSource(file);
+ Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
+ unmarshaller.setValidation(this.ddProcessor.isValidating());
ObjectModelFactory factory = this.ddProcessor.getFactory(file.toURL());
- return getHelper().parse(source, root, factory);
+ return (T)unmarshaller.unmarshal(source, factory, root);
}
return null;
@@ -61,6 +71,7 @@
/**
* MC incallback method. It will be invoked each time subclass specific DescriptorProcessor bean will be installed.
*/
+ @Deprecated
protected void setProcessor(final P ddProcessor)
{
if (this.ddProcessor != null)
@@ -68,12 +79,18 @@
this.ddProcessor = ddProcessor;
this.setName(this.ddProcessor.getDescriptorName());
- this.setUseSchemaValidation(this.ddProcessor.isValidating());
}
+
+ /**
+ * MC incallback method. It will be invoked each time subclass specific DescriptorParser bean will be installed.
+ */
+ protected void setParser(final Q ddParser)
+ {
+ if (this.ddParser != null)
+ throw new IllegalStateException("Only one " + this.ddParser.getClass() + " instance can be installed in MC");
- @Override
- protected ObjectModelFactory getObjectModelFactory(final T root)
- {
- throw new UnsupportedOperationException();
+ this.ddParser = ddParser;
+ this.setName(this.ddParser.getDescriptorName());
}
+
}
Modified: branches/JBoss-AS-6.0.x-ipv6/webservices/src/main/java/org/jboss/webservices/integration/deployers/JMSDescriptorDeployer.java
===================================================================
--- branches/JBoss-AS-6.0.x-ipv6/webservices/src/main/java/org/jboss/webservices/integration/deployers/JMSDescriptorDeployer.java 2010-12-03 20:29:21 UTC (rev 109712)
+++ branches/JBoss-AS-6.0.x-ipv6/webservices/src/main/java/org/jboss/webservices/integration/deployers/JMSDescriptorDeployer.java 2010-12-03 22:31:46 UTC (rev 109713)
@@ -21,6 +21,7 @@
*/
package org.jboss.webservices.integration.deployers;
+import org.jboss.wsf.spi.metadata.jms.JMSDescriptorParser;
import org.jboss.wsf.spi.metadata.jms.JMSDescriptorProcessor;
import org.jboss.wsf.spi.metadata.jms.JMSEndpointsMetaData;
@@ -29,7 +30,7 @@
*
* @author <a href="mailto:ropalka at redhat.com">Richard Opalka</a>
*/
-public final class JMSDescriptorDeployer extends AbstractDescriptorDeployer<JMSDescriptorProcessor, JMSEndpointsMetaData>
+public final class JMSDescriptorDeployer extends AbstractDescriptorDeployer<JMSDescriptorProcessor, JMSDescriptorParser, JMSEndpointsMetaData>
{
/**
* Constructor.
@@ -44,8 +45,19 @@
* @param processor the processor
*/
@Override
+ @Deprecated
public void setProcessor(final JMSDescriptorProcessor processor)
{
super.setProcessor(processor);
}
+
+ /**
+ * MC incallback method. It will be invoked each time JMSDescriptorParser bean will be installed.
+ * @param parser the parser
+ */
+ @Override
+ public void setParser(final JMSDescriptorParser parser)
+ {
+ super.setParser(parser);
+ }
}
Modified: branches/JBoss-AS-6.0.x-ipv6/webservices/src/main/java/org/jboss/webservices/integration/deployers/WSDescriptorDeployer.java
===================================================================
--- branches/JBoss-AS-6.0.x-ipv6/webservices/src/main/java/org/jboss/webservices/integration/deployers/WSDescriptorDeployer.java 2010-12-03 20:29:21 UTC (rev 109712)
+++ branches/JBoss-AS-6.0.x-ipv6/webservices/src/main/java/org/jboss/webservices/integration/deployers/WSDescriptorDeployer.java 2010-12-03 22:31:46 UTC (rev 109713)
@@ -21,6 +21,7 @@
*/
package org.jboss.webservices.integration.deployers;
+import org.jboss.wsf.spi.metadata.webservices.WebservicesDescriptorParser;
import org.jboss.wsf.spi.metadata.webservices.WebservicesDescriptorProcessor;
import org.jboss.wsf.spi.metadata.webservices.WebservicesMetaData;
@@ -29,7 +30,7 @@
*
* @author <a href="mailto:ropalka at redhat.com">Richard Opalka</a>
*/
-public final class WSDescriptorDeployer extends AbstractDescriptorDeployer<WebservicesDescriptorProcessor, WebservicesMetaData>
+public final class WSDescriptorDeployer extends AbstractDescriptorDeployer<WebservicesDescriptorProcessor, WebservicesDescriptorParser, WebservicesMetaData>
{
/**
* Constructor.
@@ -44,8 +45,19 @@
* @param processor the processor
*/
@Override
+ @Deprecated
public void setProcessor(final WebservicesDescriptorProcessor processor)
{
super.setProcessor(processor);
}
+
+ /**
+ * MC incallback method. It will be invoked each time WebservicesDescriptorParser bean will be installed.
+ * @param parser the parser
+ */
+ @Override
+ public void setParser(final WebservicesDescriptorParser parser)
+ {
+ super.setParser(parser);
+ }
}
Modified: branches/JBoss-AS-6.0.x-ipv6/webservices/src/main/java/org/jboss/webservices/integration/injection/ServiceRefResourceProvider.java
===================================================================
--- branches/JBoss-AS-6.0.x-ipv6/webservices/src/main/java/org/jboss/webservices/integration/injection/ServiceRefResourceProvider.java 2010-12-03 20:29:21 UTC (rev 109712)
+++ branches/JBoss-AS-6.0.x-ipv6/webservices/src/main/java/org/jboss/webservices/integration/injection/ServiceRefResourceProvider.java 2010-12-03 22:31:46 UTC (rev 109713)
@@ -144,18 +144,18 @@
*/
private UnifiedVirtualFile getUnifiedVirtualFile(final DeploymentUnit deploymentUnit)
{
- DeploymentUnit du = deploymentUnit;
- while (du.isComponent())
- du = du.getParent();
+ DeploymentUnit tempDeploymentUnit = deploymentUnit;
+ while (tempDeploymentUnit.isComponent())
+ tempDeploymentUnit = tempDeploymentUnit.getParent();
- if (du instanceof VFSDeploymentUnit)
+ if (tempDeploymentUnit instanceof VFSDeploymentUnit)
{
- VFSDeploymentUnit vdu = (VFSDeploymentUnit) du;
+ VFSDeploymentUnit vdu = (VFSDeploymentUnit) tempDeploymentUnit;
return new VirtualFileAdaptor(vdu.getRoot());
}
else
{
- throw new IllegalArgumentException("Can only handle real VFS deployments: " + du);
+ throw new IllegalArgumentException("Can only handle real VFS deployments: " + tempDeploymentUnit);
}
}
@@ -197,7 +197,12 @@
if (serviceRefSBMD.getInjectionTargets() != null && serviceRefSBMD.getInjectionTargets().size() > 0)
{
if (serviceRefSBMD.getInjectionTargets().size() > 1)
- throw new UnsupportedOperationException("What to do in such case?");
+ {
+ // TODO: We should validate all the injection targets whether they're compatible.
+ // This means all the injection targets must be assignable or equivalent.
+ // If there are @Addressing, @RespectBinding or @MTOM annotations present on injection targets,
+ // these annotations must be equivalent for all the injection targets.
+ }
final InjectionTarget injectionTarget = serviceRefSBMD.getInjectionTargets().iterator().next();
AccessibleObject anAlement = this.findInjectionTarget(loader, injectionTarget);
Modified: branches/JBoss-AS-6.0.x-ipv6/webservices/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB3.java
===================================================================
--- branches/JBoss-AS-6.0.x-ipv6/webservices/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB3.java 2010-12-03 20:29:21 UTC (rev 109712)
+++ branches/JBoss-AS-6.0.x-ipv6/webservices/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB3.java 2010-12-03 22:31:46 UTC (rev 109713)
@@ -160,7 +160,7 @@
* @param invocation current invocation
*/
@Override
- protected void onBeforeInvocation(final Invocation invocation)
+ public void onBeforeInvocation(final Invocation invocation)
{
final WebServiceContext wsContext = this.getWebServiceContext(invocation);
ThreadLocalAwareWebServiceContext.getInstance().setMessageContext(wsContext);
@@ -172,7 +172,7 @@
* @param invocation current invocation
*/
@Override
- protected void onAfterInvocation(final Invocation invocation)
+ public void onAfterInvocation(final Invocation invocation)
{
ThreadLocalAwareWebServiceContext.getInstance().setMessageContext(null);
}
Copied: branches/JBoss-AS-6.0.x-ipv6/webservices/src/main/java/org/jboss/webservices/integration/weld (from rev 109712, trunk/webservices/src/main/java/org/jboss/webservices/integration/weld)
Deleted: branches/JBoss-AS-6.0.x-ipv6/webservices/src/main/java/org/jboss/webservices/integration/weld/WeldDeploymentAspect.java
===================================================================
--- trunk/webservices/src/main/java/org/jboss/webservices/integration/weld/WeldDeploymentAspect.java 2010-12-03 20:29:21 UTC (rev 109712)
+++ branches/JBoss-AS-6.0.x-ipv6/webservices/src/main/java/org/jboss/webservices/integration/weld/WeldDeploymentAspect.java 2010-12-03 22:31:46 UTC (rev 109713)
@@ -1,69 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2010, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.webservices.integration.weld;
-
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.weld.integration.deployer.DeployersUtils;
-import org.jboss.wsf.common.integration.AbstractDeploymentAspect;
-import org.jboss.wsf.common.integration.WSHelper;
-import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.Endpoint;
-
-/**
- * Weld deployment aspect that associates Weld Invocation handler
- * if WS CDI integration is detected.
- *
- * @author <a href="mailto:ropalka at redhat.com">Richard Opalka</a>
- */
-public final class WeldDeploymentAspect extends AbstractDeploymentAspect
-{
-
- public WeldDeploymentAspect()
- {
- // does nothing
- }
-
- @Override
- public void start(final Deployment dep)
- {
- if (!WSHelper.isJaxwsJseDeployment(dep))
- {
- // we support weld integration for JAXWS JSE endpoints only
- return;
- }
-
- final DeploymentUnit deploymentUnit = WSHelper.getRequiredAttachment(dep, DeploymentUnit.class);
- if (this.isWeldDeployment(deploymentUnit))
- {
- for (final Endpoint endpoint : dep.getService().getEndpoints())
- {
- endpoint.setInvocationHandler(new WeldInvocationHandler(deploymentUnit, endpoint.getInvocationHandler()));
- }
- }
- }
-
- private boolean isWeldDeployment(final DeploymentUnit unit)
- {
- return unit.getAttachment(DeployersUtils.WELD_FILES) != null;
- }
-
-}
Copied: branches/JBoss-AS-6.0.x-ipv6/webservices/src/main/java/org/jboss/webservices/integration/weld/WeldDeploymentAspect.java (from rev 109712, trunk/webservices/src/main/java/org/jboss/webservices/integration/weld/WeldDeploymentAspect.java)
===================================================================
--- branches/JBoss-AS-6.0.x-ipv6/webservices/src/main/java/org/jboss/webservices/integration/weld/WeldDeploymentAspect.java (rev 0)
+++ branches/JBoss-AS-6.0.x-ipv6/webservices/src/main/java/org/jboss/webservices/integration/weld/WeldDeploymentAspect.java 2010-12-03 22:31:46 UTC (rev 109713)
@@ -0,0 +1,69 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.webservices.integration.weld;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.weld.integration.deployer.DeployersUtils;
+import org.jboss.wsf.common.integration.AbstractDeploymentAspect;
+import org.jboss.wsf.common.integration.WSHelper;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Endpoint;
+
+/**
+ * Weld deployment aspect that associates Weld Invocation handler
+ * if WS CDI integration is detected.
+ *
+ * @author <a href="mailto:ropalka at redhat.com">Richard Opalka</a>
+ */
+public final class WeldDeploymentAspect extends AbstractDeploymentAspect
+{
+
+ public WeldDeploymentAspect()
+ {
+ // does nothing
+ }
+
+ @Override
+ public void start(final Deployment dep)
+ {
+ if (!WSHelper.isJaxwsJseDeployment(dep))
+ {
+ // we support weld integration for JAXWS JSE endpoints only
+ return;
+ }
+
+ final DeploymentUnit deploymentUnit = WSHelper.getRequiredAttachment(dep, DeploymentUnit.class);
+ if (this.isWeldDeployment(deploymentUnit))
+ {
+ for (final Endpoint endpoint : dep.getService().getEndpoints())
+ {
+ endpoint.setInvocationHandler(new WeldInvocationHandler(deploymentUnit, endpoint.getInvocationHandler()));
+ }
+ }
+ }
+
+ private boolean isWeldDeployment(final DeploymentUnit unit)
+ {
+ return unit.getAttachment(DeployersUtils.WELD_FILES) != null;
+ }
+
+}
Deleted: branches/JBoss-AS-6.0.x-ipv6/webservices/src/main/java/org/jboss/webservices/integration/weld/WeldInvocationHandler.java
===================================================================
--- trunk/webservices/src/main/java/org/jboss/webservices/integration/weld/WeldInvocationHandler.java 2010-12-03 20:29:21 UTC (rev 109712)
+++ branches/JBoss-AS-6.0.x-ipv6/webservices/src/main/java/org/jboss/webservices/integration/weld/WeldInvocationHandler.java 2010-12-03 22:31:46 UTC (rev 109713)
@@ -1,80 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2010, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.webservices.integration.weld;
-
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.wsf.common.invocation.AbstractInvocationHandlerJSE;
-import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.invocation.Invocation;
-import org.jboss.wsf.spi.invocation.InvocationHandler;
-
-/**
- * Weld invocation handler.
- *
- * @author <a href="maito:ropalka at redhat.com">Richard Opalka</a>
- */
-public final class WeldInvocationHandler extends AbstractInvocationHandlerJSE
-{
-
- private final DeploymentUnit deploymentUnit;
-
- private final InvocationHandler delegate;
-
- public WeldInvocationHandler(final DeploymentUnit unit, final InvocationHandler delegate)
- {
- this.deploymentUnit = unit;
- this.delegate = delegate;
- }
-
- @Override
- public void onEndpointInstantiated(final Endpoint endpoint, final Invocation invocation) throws Exception
- {
- // handle Weld injections first
- this.handleWeldInjection(invocation.getInvocationContext().getTargetBean());
- // handle JBossWS injections last and call @PostConstruct & @PreDestroy annotated lifecycle methods
- this.delegate.onEndpointInstantiated(endpoint, invocation);
- }
-
- @Override
- public void onBeforeInvocation(final Invocation invocation) throws Exception
- {
- this.delegate.onBeforeInvocation(invocation);
- }
-
- @Override
- public void onAfterInvocation(final Invocation invocation) throws Exception
- {
- this.delegate.onAfterInvocation(invocation);
- }
-
- /**
- * Handles weld injection.
- *
- * @param instance to operate upon
- */
- private void handleWeldInjection(final Object instance)
- {
- // TODO: implement Marius ;)
- // Just FYI calling 'new InitialContext()' in this method will return proper JNDI ctx because this method is executed in servlet environment.
- }
-
-}
Copied: branches/JBoss-AS-6.0.x-ipv6/webservices/src/main/java/org/jboss/webservices/integration/weld/WeldInvocationHandler.java (from rev 109712, trunk/webservices/src/main/java/org/jboss/webservices/integration/weld/WeldInvocationHandler.java)
===================================================================
--- branches/JBoss-AS-6.0.x-ipv6/webservices/src/main/java/org/jboss/webservices/integration/weld/WeldInvocationHandler.java (rev 0)
+++ branches/JBoss-AS-6.0.x-ipv6/webservices/src/main/java/org/jboss/webservices/integration/weld/WeldInvocationHandler.java 2010-12-03 22:31:46 UTC (rev 109713)
@@ -0,0 +1,80 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.webservices.integration.weld;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.wsf.common.invocation.AbstractInvocationHandlerJSE;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.invocation.Invocation;
+import org.jboss.wsf.spi.invocation.InvocationHandler;
+
+/**
+ * Weld invocation handler.
+ *
+ * @author <a href="maito:ropalka at redhat.com">Richard Opalka</a>
+ */
+public final class WeldInvocationHandler extends AbstractInvocationHandlerJSE
+{
+
+ private final DeploymentUnit deploymentUnit;
+
+ private final InvocationHandler delegate;
+
+ public WeldInvocationHandler(final DeploymentUnit unit, final InvocationHandler delegate)
+ {
+ this.deploymentUnit = unit;
+ this.delegate = delegate;
+ }
+
+ @Override
+ public void onEndpointInstantiated(final Endpoint endpoint, final Invocation invocation) throws Exception
+ {
+ // handle Weld injections first
+ this.handleWeldInjection(invocation.getInvocationContext().getTargetBean());
+ // handle JBossWS injections last and call @PostConstruct & @PreDestroy annotated lifecycle methods
+ this.delegate.onEndpointInstantiated(endpoint, invocation);
+ }
+
+ @Override
+ public void onBeforeInvocation(final Invocation invocation) throws Exception
+ {
+ this.delegate.onBeforeInvocation(invocation);
+ }
+
+ @Override
+ public void onAfterInvocation(final Invocation invocation) throws Exception
+ {
+ this.delegate.onAfterInvocation(invocation);
+ }
+
+ /**
+ * Handles weld injection.
+ *
+ * @param instance to operate upon
+ */
+ private void handleWeldInjection(final Object instance)
+ {
+ // TODO: implement Marius ;)
+ // Just FYI calling 'new InitialContext()' in this method will return proper JNDI ctx because this method is executed in servlet environment.
+ }
+
+}
Modified: branches/JBoss-AS-6.0.x-ipv6/webservices/src/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml
===================================================================
--- branches/JBoss-AS-6.0.x-ipv6/webservices/src/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml 2010-12-03 20:29:21 UTC (rev 109712)
+++ branches/JBoss-AS-6.0.x-ipv6/webservices/src/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml 2010-12-03 22:31:46 UTC (rev 109713)
@@ -62,10 +62,12 @@
<!-- deployers -->
<bean name="WSDescriptorDeployer" class="org.jboss.webservices.integration.deployers.WSDescriptorDeployer">
<incallback method="setProcessor"/>
+ <incallback method="setParser"/>
</bean>
<bean name="JMSDescriptorDeployer" class="org.jboss.webservices.integration.deployers.JMSDescriptorDeployer">
<incallback method="setProcessor"/>
+ <incallback method="setParser"/>
</bean>
<bean name="WSEJBAdapterDeployer" class="org.jboss.webservices.integration.deployers.WSEJBAdapterDeployer"/>
@@ -151,4 +153,9 @@
<property name="provides">WebMetaData</property>
</bean>
+ <bean name="WSWeldDeploymentAspect" class="org.jboss.webservices.integration.weld.WeldDeploymentAspect">
+ <property name="requires">StackEndpointHandler</property>
+ <property name="provides">CDIInjection</property>
+ </bean>
+
</deployment>
More information about the jboss-cvs-commits
mailing list