[jbossws-commits] JBossWS SVN: r3405 - in trunk/integration: jboss50/src/main/java/org/jboss/wsf/container/jboss50 and 4 other directories.
jbossws-commits at lists.jboss.org
jbossws-commits at lists.jboss.org
Sun Jun 3 07:45:48 EDT 2007
Author: thomas.diesler at jboss.com
Date: 2007-06-03 07:45:47 -0400 (Sun, 03 Jun 2007)
New Revision: 3405
Added:
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/ApplicationMetaDataAdapterEJB21.java
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/ApplicationMetaDataAdapterEJB3.java
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/WebMetaDataAdapter.java
Removed:
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/ApplicationMetaDataAdaptor.java
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/ApplicationMetaDataAdaptorEJB3.java
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/WebMetaDataAdaptor.java
Modified:
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/DeploymentInfoAdapter.java
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/UnifiedDeploymentInfoDeployer.java
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/DeploymentInfoAdapter.java
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/UnifiedDeploymentInfoDeployer.java
trunk/integration/native/src/main/resources/jbossws-native40.sar/jbossws.beans/META-INF/jboss-beans.xml
trunk/integration/native/src/main/resources/jbossws-native42.sar/jbossws.beans/META-INF/jboss-beans.xml
trunk/integration/sunri/src/main/resources/jbossws-sunri42.sar/jbossws.beans/META-INF/jboss-beans.xml
trunk/integration/xfire/src/main/resources/jbossws-xfire42.sar/jbossws.beans/META-INF/jboss-beans.xml
Log:
Provide defaults for jboss42 MetaData Adapters
Modified: trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/DeploymentInfoAdapter.java
===================================================================
--- trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/DeploymentInfoAdapter.java 2007-06-03 11:25:38 UTC (rev 3404)
+++ trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/DeploymentInfoAdapter.java 2007-06-03 11:45:47 UTC (rev 3405)
@@ -46,23 +46,23 @@
// logging support
private static Logger log = Logger.getLogger(DeploymentInfoAdapter.class);
- private ApplicationMetaDataAdapterEJB3 applicationMetaDataAdapterEJB3;
- private AbstractApplicationMetaDataAdapter applicationMetaDataAdapterEJB21;
- private WebMetaDataAdapter webMetaDataAdapter;
+ private ApplicationMetaDataAdapterEJB3 applicationMetaDataAdapterEJB3 = new ApplicationMetaDataAdapterEJB3();
+ private AbstractApplicationMetaDataAdapter applicationMetaDataAdapterEJB21 = new ApplicationMetaDataAdapterEJB21();
+ private WebMetaDataAdapter webMetaDataAdapter = new WebMetaDataAdapter();
- public void setApplicationMetaDataAdapterEJB21(AbstractApplicationMetaDataAdapter applicationMetaDataAdapterEJB21)
+ public void setApplicationMetaDataAdapterEJB21(AbstractApplicationMetaDataAdapter adapter)
{
- this.applicationMetaDataAdapterEJB21 = applicationMetaDataAdapterEJB21;
+ this.applicationMetaDataAdapterEJB21 = adapter;
}
- public void setApplicationMetaDataAdapterEJB3(ApplicationMetaDataAdapterEJB3 applicationMetaDataAdapterEJB3)
+ public void setApplicationMetaDataAdapterEJB3(ApplicationMetaDataAdapterEJB3 adapter)
{
- this.applicationMetaDataAdapterEJB3 = applicationMetaDataAdapterEJB3;
+ this.applicationMetaDataAdapterEJB3 = adapter;
}
- public void setWebMetaDataAdapter(WebMetaDataAdapter webMetaDataAdapter)
+ public void setWebMetaDataAdapter(WebMetaDataAdapter adapter)
{
- this.webMetaDataAdapter = webMetaDataAdapter;
+ this.webMetaDataAdapter = adapter;
}
public UnifiedDeploymentInfo buildDeploymentInfo(Deployment dep, UnifiedDeploymentInfo udi, DeploymentInfo di)
Modified: trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/UnifiedDeploymentInfoDeployer.java
===================================================================
--- trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/UnifiedDeploymentInfoDeployer.java 2007-06-03 11:25:38 UTC (rev 3404)
+++ trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/UnifiedDeploymentInfoDeployer.java 2007-06-03 11:45:47 UTC (rev 3405)
@@ -40,11 +40,11 @@
*/
public class UnifiedDeploymentInfoDeployer extends AbstractDeployer
{
- private DeploymentInfoAdapter deploymentInfoAdapter;
+ private DeploymentInfoAdapter deploymentInfoAdapter = new DeploymentInfoAdapter();
- public void setDeploymentInfoAdapter(DeploymentInfoAdapter deploymentInfoAdapter)
+ public void setDeploymentInfoAdapter(DeploymentInfoAdapter adapter)
{
- this.deploymentInfoAdapter = deploymentInfoAdapter;
+ this.deploymentInfoAdapter = adapter;
}
@Override
Copied: trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/ApplicationMetaDataAdapterEJB21.java (from rev 3399, trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/ApplicationMetaDataAdaptor.java)
===================================================================
--- trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/ApplicationMetaDataAdapterEJB21.java (rev 0)
+++ trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/ApplicationMetaDataAdapterEJB21.java 2007-06-03 11:45:47 UTC (rev 3405)
@@ -0,0 +1,166 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.wsf.container.jboss50;
+
+// $Id$
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.jboss.deployers.spi.deployer.DeploymentUnit;
+import org.jboss.logging.Logger;
+import org.jboss.metadata.ApplicationMetaData;
+import org.jboss.metadata.BeanMetaData;
+import org.jboss.metadata.EjbPortComponentMetaData;
+import org.jboss.metadata.MessageDrivenMetaData;
+import org.jboss.metadata.SessionMetaData;
+import org.jboss.metadata.ApplicationMetaData.WebserviceDescription;
+import org.jboss.metadata.ApplicationMetaData.Webservices;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.UnifiedDeploymentInfo;
+import org.jboss.wsf.spi.metadata.j2ee.UnifiedApplicationMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.UnifiedBeanMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.UnifiedEjbPortComponentMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.UnifiedMessageDrivenMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.UnifiedSessionMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.UnifiedApplicationMetaData.PublishLocationAdapter;
+
+/**
+ * Build container independent application meta data
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @since 05-May-2006
+ */
+public class ApplicationMetaDataAdapterEJB21
+{
+ // logging support
+ private static Logger log = Logger.getLogger(ApplicationMetaDataAdapterEJB21.class);
+
+ public UnifiedApplicationMetaData buildUnifiedApplicationMetaData(Deployment dep, UnifiedDeploymentInfo udi, DeploymentUnit unit)
+ {
+ ApplicationMetaData appMetaData = unit.getAttachment(ApplicationMetaData.class);
+ dep.getContext().addAttachment(ApplicationMetaData.class, appMetaData);
+
+ UnifiedApplicationMetaData umd = new UnifiedApplicationMetaData();
+ buildUnifiedBeanMetaData(umd, appMetaData);
+ buildWebservicesMetaData(umd, appMetaData);
+ umd.setSecurityDomain(appMetaData.getSecurityDomain());
+
+ dep.getContext().addAttachment(UnifiedApplicationMetaData.class, umd);
+ return umd;
+ }
+
+ private void buildWebservicesMetaData(UnifiedApplicationMetaData umd, ApplicationMetaData apmd)
+ {
+ Webservices webservices = apmd.getWebservices();
+ if (webservices != null)
+ {
+ String contextRoot = webservices.getContextRoot();
+ umd.setPublishLocationAdapter(getPublishLocationAdpater(webservices));
+
+ List<WebserviceDescription> wsDescriptions = webservices.getWebserviceDescriptions();
+ if (wsDescriptions.size() > 1)
+ log.warn("Multiple <webservice-description> elements not supported");
+
+ if (wsDescriptions.size() > 0)
+ {
+ WebserviceDescription wsd = wsDescriptions.get(0);
+ umd.setConfigName(wsd.getConfigName());
+ umd.setConfigFile(wsd.getConfigFile());
+ }
+
+ umd.setWebServiceContextRoot(contextRoot);
+ }
+ }
+
+ private PublishLocationAdapter getPublishLocationAdpater(final Webservices webservices)
+ {
+ return new PublishLocationAdapter()
+ {
+ public String getWsdlPublishLocationByName(String name)
+ {
+ String wsdlPublishLocation = null;
+ for (WebserviceDescription wsd : webservices.getWebserviceDescriptions())
+ {
+ if (wsd.getDescriptionName().equals(name))
+ {
+ wsdlPublishLocation = wsd.getWsdlPublishLocation();
+ }
+ }
+ return wsdlPublishLocation;
+ }
+ };
+ }
+
+ private void buildUnifiedBeanMetaData(UnifiedApplicationMetaData umd, ApplicationMetaData appMetaData)
+ {
+ List<UnifiedBeanMetaData> beans = new ArrayList<UnifiedBeanMetaData>();
+ Iterator it = appMetaData.getEnterpriseBeans();
+ while (it.hasNext())
+ {
+ BeanMetaData bmd = (BeanMetaData)it.next();
+ buildUnifiedBeanMetaData(beans, bmd);
+ }
+ umd.setEnterpriseBeans(beans);
+ }
+
+ private UnifiedBeanMetaData buildUnifiedBeanMetaData(List<UnifiedBeanMetaData> beans, BeanMetaData bmd)
+ {
+ UnifiedBeanMetaData ubmd = null;
+ if (bmd instanceof SessionMetaData)
+ {
+ ubmd = new UnifiedSessionMetaData();
+ }
+ else if (bmd instanceof MessageDrivenMetaData)
+ {
+ ubmd = new UnifiedMessageDrivenMetaData();
+ ((UnifiedMessageDrivenMetaData)ubmd).setDestinationJndiName(((MessageDrivenMetaData)bmd).getDestinationJndiName());
+ }
+
+ if (ubmd != null)
+ {
+ ubmd.setEjbName(bmd.getEjbName());
+ ubmd.setEjbClass(bmd.getEjbClass());
+ ubmd.setServiceEndpointInterface(bmd.getServiceEndpoint());
+ ubmd.setHome(bmd.getHome());
+ ubmd.setLocalHome(bmd.getLocalHome());
+ ubmd.setJndiName(bmd.getJndiName());
+ ubmd.setLocalJndiName(bmd.getLocalJndiName());
+
+ EjbPortComponentMetaData pcmd = bmd.getPortComponent();
+ if (pcmd != null)
+ {
+ UnifiedEjbPortComponentMetaData upcmd = new UnifiedEjbPortComponentMetaData();
+ upcmd.setPortComponentName(pcmd.getPortComponentName());
+ upcmd.setPortComponentURI(pcmd.getPortComponentURI());
+ upcmd.setAuthMethod(pcmd.getAuthMethod());
+ upcmd.setTransportGuarantee(pcmd.getTransportGuarantee());
+ upcmd.setSecureWSDLAccess(pcmd.getSecureWSDLAccess());
+ ubmd.setPortComponent(upcmd);
+ }
+
+ beans.add(ubmd);
+ }
+ return ubmd;
+ }
+}
Copied: trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/ApplicationMetaDataAdapterEJB3.java (from rev 3399, trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/ApplicationMetaDataAdaptorEJB3.java)
===================================================================
--- trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/ApplicationMetaDataAdapterEJB3.java (rev 0)
+++ trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/ApplicationMetaDataAdapterEJB3.java 2007-06-03 11:45:47 UTC (rev 3405)
@@ -0,0 +1,170 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.wsf.container.jboss50;
+
+// $Id$
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.jboss.deployers.spi.deployer.DeploymentUnit;
+import org.jboss.ejb3.Container;
+import org.jboss.ejb3.EJBContainer;
+import org.jboss.ejb3.Ejb3Deployment;
+import org.jboss.ejb3.SessionContainer;
+import org.jboss.ejb3.mdb.MessagingContainer;
+import org.jboss.ejb3.metamodel.Ejb3PortComponent;
+import org.jboss.ejb3.metamodel.EjbJarDD;
+import org.jboss.ejb3.metamodel.EnterpriseBean;
+import org.jboss.ejb3.metamodel.WebserviceDescription;
+import org.jboss.ejb3.metamodel.Webservices;
+import org.jboss.logging.Logger;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.UnifiedDeploymentInfo;
+import org.jboss.wsf.spi.metadata.j2ee.UnifiedApplicationMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.UnifiedBeanMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.UnifiedEjbPortComponentMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.UnifiedMessageDrivenMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.UnifiedSessionMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.UnifiedApplicationMetaData.PublishLocationAdapter;
+
+/**
+ * Build container independent application meta data
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @since 14-Apr-2007
+ */
+public class ApplicationMetaDataAdapterEJB3
+{
+ // logging support
+ private static Logger log = Logger.getLogger(ApplicationMetaDataAdapterEJB3.class);
+
+ public UnifiedApplicationMetaData buildUnifiedApplicationMetaData(Deployment dep, UnifiedDeploymentInfo udi, DeploymentUnit unit)
+ {
+ Ejb3Deployment ejb3Deployment = unit.getAttachment(Ejb3Deployment.class);
+ dep.getContext().addAttachment(Ejb3Deployment.class, ejb3Deployment);
+
+ EjbJarDD jarDD = unit.getAttachment(EjbJarDD.class);
+ UnifiedApplicationMetaData umd = new UnifiedApplicationMetaData();
+ buildUnifiedBeanMetaData(umd, ejb3Deployment);
+ buildWebservicesMetaData(umd, jarDD);
+
+ dep.getContext().addAttachment(UnifiedApplicationMetaData.class, umd);
+ return umd;
+ }
+
+ private void buildWebservicesMetaData(UnifiedApplicationMetaData umd, EjbJarDD jarDD)
+ {
+ // nothing to do
+ if (jarDD == null)
+ return;
+
+ Webservices webservices = jarDD.getWebservices();
+ if (webservices != null)
+ {
+ String contextRoot = webservices.getContextRoot();
+ umd.setPublishLocationAdapter(getPublishLocationAdpater(webservices));
+
+ List<WebserviceDescription> wsDescriptions = webservices.getWebserviceDescriptions();
+ if (wsDescriptions.size() > 1)
+ log.warn("Multiple <webservice-description> elements not supported");
+
+ if (wsDescriptions.size() > 0)
+ {
+ WebserviceDescription wsd = wsDescriptions.get(0);
+ umd.setConfigName(wsd.getConfigName());
+ umd.setConfigFile(wsd.getConfigFile());
+
+ // com/sun/ts/tests/webservices12/ejb/annotations/WSEjbWebServiceRefTest1
+ // WSEjbWebServiceRefTest1VerifyTargetEndpointAddress
+ if (contextRoot == null)
+ contextRoot = "/" + wsd.getDescriptionName();
+ }
+
+ umd.setWebServiceContextRoot(contextRoot);
+ }
+ }
+
+ private void buildUnifiedBeanMetaData(UnifiedApplicationMetaData umd, Ejb3Deployment ejb3Deployment)
+ {
+ List<UnifiedBeanMetaData> ubmdList = new ArrayList<UnifiedBeanMetaData>();
+ Iterator<Container> it = ejb3Deployment.getEjbContainers().values().iterator();
+ while (it.hasNext())
+ {
+ EJBContainer container = (EJBContainer)it.next();
+ UnifiedBeanMetaData ubmd = null;
+ if (container instanceof SessionContainer)
+ {
+ ubmd = new UnifiedSessionMetaData();
+ }
+ else if (container instanceof MessagingContainer)
+ {
+ ubmd = new UnifiedMessageDrivenMetaData();
+ log.warn("No implemented: initialize MDB destination");
+ //((UnifiedMessageDrivenMetaData)ubmd).setDestinationJndiName(((MessagingContainer)container).getDestination());
+ }
+
+ if (ubmd != null)
+ {
+ ubmd.setEjbName(container.getEjbName());
+ ubmd.setEjbClass(container.getBeanClassName());
+
+ EnterpriseBean bean = container.getXml();
+ Ejb3PortComponent pcMetaData = (bean != null ? bean.getPortComponent() : null);
+ if (pcMetaData != null)
+ {
+ UnifiedEjbPortComponentMetaData ejbPortComp = new UnifiedEjbPortComponentMetaData();
+ ejbPortComp.setPortComponentName(pcMetaData.getPortComponentName());
+ ejbPortComp.setPortComponentURI(pcMetaData.getPortComponentURI());
+ ejbPortComp.setAuthMethod(pcMetaData.getAuthMethod());
+ ejbPortComp.setTransportGuarantee(pcMetaData.getTransportGuarantee());
+ ejbPortComp.setSecureWSDLAccess(pcMetaData.getSecureWSDLAccess());
+
+ ubmd.setPortComponent(ejbPortComp);
+ }
+
+ ubmdList.add(ubmd);
+ }
+ }
+ umd.setEnterpriseBeans(ubmdList);
+ }
+
+ private PublishLocationAdapter getPublishLocationAdpater(final Webservices webservices)
+ {
+ return new PublishLocationAdapter()
+ {
+ public String getWsdlPublishLocationByName(String name)
+ {
+ String wsdlPublishLocation = null;
+ for (WebserviceDescription wsd : webservices.getWebserviceDescriptions())
+ {
+ if (wsd.getDescriptionName().equals(name))
+ {
+ wsdlPublishLocation = wsd.getWsdlPublishLocation();
+ }
+ }
+ return wsdlPublishLocation;
+ }
+ };
+ }
+}
Deleted: trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/ApplicationMetaDataAdaptor.java
===================================================================
--- trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/ApplicationMetaDataAdaptor.java 2007-06-03 11:25:38 UTC (rev 3404)
+++ trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/ApplicationMetaDataAdaptor.java 2007-06-03 11:45:47 UTC (rev 3405)
@@ -1,166 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.wsf.container.jboss50;
-
-// $Id$
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
-import org.jboss.logging.Logger;
-import org.jboss.metadata.ApplicationMetaData;
-import org.jboss.metadata.BeanMetaData;
-import org.jboss.metadata.EjbPortComponentMetaData;
-import org.jboss.metadata.MessageDrivenMetaData;
-import org.jboss.metadata.SessionMetaData;
-import org.jboss.metadata.ApplicationMetaData.WebserviceDescription;
-import org.jboss.metadata.ApplicationMetaData.Webservices;
-import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.UnifiedDeploymentInfo;
-import org.jboss.wsf.spi.metadata.j2ee.UnifiedApplicationMetaData;
-import org.jboss.wsf.spi.metadata.j2ee.UnifiedBeanMetaData;
-import org.jboss.wsf.spi.metadata.j2ee.UnifiedEjbPortComponentMetaData;
-import org.jboss.wsf.spi.metadata.j2ee.UnifiedMessageDrivenMetaData;
-import org.jboss.wsf.spi.metadata.j2ee.UnifiedSessionMetaData;
-import org.jboss.wsf.spi.metadata.j2ee.UnifiedApplicationMetaData.PublishLocationAdapter;
-
-/**
- * Build container independent application meta data
- *
- * @author Thomas.Diesler at jboss.org
- * @since 05-May-2006
- */
-public class ApplicationMetaDataAdaptor
-{
- // logging support
- private static Logger log = Logger.getLogger(ApplicationMetaDataAdaptor.class);
-
- public static UnifiedApplicationMetaData buildUnifiedApplicationMetaData(Deployment dep, UnifiedDeploymentInfo udi, DeploymentUnit unit)
- {
- ApplicationMetaData appMetaData = unit.getAttachment(ApplicationMetaData.class);
- dep.getContext().addAttachment(ApplicationMetaData.class, appMetaData);
-
- UnifiedApplicationMetaData umd = new UnifiedApplicationMetaData();
- buildUnifiedBeanMetaData(umd, appMetaData);
- buildWebservicesMetaData(umd, appMetaData);
- umd.setSecurityDomain(appMetaData.getSecurityDomain());
-
- dep.getContext().addAttachment(UnifiedApplicationMetaData.class, umd);
- return umd;
- }
-
- private static void buildWebservicesMetaData(UnifiedApplicationMetaData umd, ApplicationMetaData apmd)
- {
- Webservices webservices = apmd.getWebservices();
- if (webservices != null)
- {
- String contextRoot = webservices.getContextRoot();
- umd.setPublishLocationAdapter(getPublishLocationAdpater(webservices));
-
- List<WebserviceDescription> wsDescriptions = webservices.getWebserviceDescriptions();
- if (wsDescriptions.size() > 1)
- log.warn("Multiple <webservice-description> elements not supported");
-
- if (wsDescriptions.size() > 0)
- {
- WebserviceDescription wsd = wsDescriptions.get(0);
- umd.setConfigName(wsd.getConfigName());
- umd.setConfigFile(wsd.getConfigFile());
- }
-
- umd.setWebServiceContextRoot(contextRoot);
- }
- }
-
- private static PublishLocationAdapter getPublishLocationAdpater(final Webservices webservices)
- {
- return new PublishLocationAdapter()
- {
- public String getWsdlPublishLocationByName(String name)
- {
- String wsdlPublishLocation = null;
- for (WebserviceDescription wsd : webservices.getWebserviceDescriptions())
- {
- if (wsd.getDescriptionName().equals(name))
- {
- wsdlPublishLocation = wsd.getWsdlPublishLocation();
- }
- }
- return wsdlPublishLocation;
- }
- };
- }
-
- private static void buildUnifiedBeanMetaData(UnifiedApplicationMetaData umd, ApplicationMetaData appMetaData)
- {
- List<UnifiedBeanMetaData> beans = new ArrayList<UnifiedBeanMetaData>();
- Iterator it = appMetaData.getEnterpriseBeans();
- while (it.hasNext())
- {
- BeanMetaData bmd = (BeanMetaData)it.next();
- buildUnifiedBeanMetaData(beans, bmd);
- }
- umd.setEnterpriseBeans(beans);
- }
-
- private static UnifiedBeanMetaData buildUnifiedBeanMetaData(List<UnifiedBeanMetaData> beans, BeanMetaData bmd)
- {
- UnifiedBeanMetaData ubmd = null;
- if (bmd instanceof SessionMetaData)
- {
- ubmd = new UnifiedSessionMetaData();
- }
- else if (bmd instanceof MessageDrivenMetaData)
- {
- ubmd = new UnifiedMessageDrivenMetaData();
- ((UnifiedMessageDrivenMetaData)ubmd).setDestinationJndiName(((MessageDrivenMetaData)bmd).getDestinationJndiName());
- }
-
- if (ubmd != null)
- {
- ubmd.setEjbName(bmd.getEjbName());
- ubmd.setEjbClass(bmd.getEjbClass());
- ubmd.setServiceEndpointInterface(bmd.getServiceEndpoint());
- ubmd.setHome(bmd.getHome());
- ubmd.setLocalHome(bmd.getLocalHome());
- ubmd.setJndiName(bmd.getJndiName());
- ubmd.setLocalJndiName(bmd.getLocalJndiName());
-
- EjbPortComponentMetaData pcmd = bmd.getPortComponent();
- if (pcmd != null)
- {
- UnifiedEjbPortComponentMetaData upcmd = new UnifiedEjbPortComponentMetaData();
- upcmd.setPortComponentName(pcmd.getPortComponentName());
- upcmd.setPortComponentURI(pcmd.getPortComponentURI());
- upcmd.setAuthMethod(pcmd.getAuthMethod());
- upcmd.setTransportGuarantee(pcmd.getTransportGuarantee());
- upcmd.setSecureWSDLAccess(pcmd.getSecureWSDLAccess());
- ubmd.setPortComponent(upcmd);
- }
-
- beans.add(ubmd);
- }
- return ubmd;
- }
-}
Deleted: trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/ApplicationMetaDataAdaptorEJB3.java
===================================================================
--- trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/ApplicationMetaDataAdaptorEJB3.java 2007-06-03 11:25:38 UTC (rev 3404)
+++ trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/ApplicationMetaDataAdaptorEJB3.java 2007-06-03 11:45:47 UTC (rev 3405)
@@ -1,170 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.wsf.container.jboss50;
-
-// $Id$
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
-import org.jboss.ejb3.Container;
-import org.jboss.ejb3.EJBContainer;
-import org.jboss.ejb3.Ejb3Deployment;
-import org.jboss.ejb3.SessionContainer;
-import org.jboss.ejb3.mdb.MessagingContainer;
-import org.jboss.ejb3.metamodel.Ejb3PortComponent;
-import org.jboss.ejb3.metamodel.EjbJarDD;
-import org.jboss.ejb3.metamodel.EnterpriseBean;
-import org.jboss.ejb3.metamodel.WebserviceDescription;
-import org.jboss.ejb3.metamodel.Webservices;
-import org.jboss.logging.Logger;
-import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.UnifiedDeploymentInfo;
-import org.jboss.wsf.spi.metadata.j2ee.UnifiedApplicationMetaData;
-import org.jboss.wsf.spi.metadata.j2ee.UnifiedBeanMetaData;
-import org.jboss.wsf.spi.metadata.j2ee.UnifiedEjbPortComponentMetaData;
-import org.jboss.wsf.spi.metadata.j2ee.UnifiedMessageDrivenMetaData;
-import org.jboss.wsf.spi.metadata.j2ee.UnifiedSessionMetaData;
-import org.jboss.wsf.spi.metadata.j2ee.UnifiedApplicationMetaData.PublishLocationAdapter;
-
-/**
- * Build container independent application meta data
- *
- * @author Thomas.Diesler at jboss.org
- * @since 14-Apr-2007
- */
-public class ApplicationMetaDataAdaptorEJB3
-{
- // logging support
- private static Logger log = Logger.getLogger(ApplicationMetaDataAdaptorEJB3.class);
-
- public static UnifiedApplicationMetaData buildUnifiedApplicationMetaData(Deployment dep, UnifiedDeploymentInfo udi, DeploymentUnit unit)
- {
- Ejb3Deployment ejb3Deployment = unit.getAttachment(Ejb3Deployment.class);
- dep.getContext().addAttachment(Ejb3Deployment.class, ejb3Deployment);
-
- EjbJarDD jarDD = unit.getAttachment(EjbJarDD.class);
- UnifiedApplicationMetaData umd = new UnifiedApplicationMetaData();
- buildUnifiedBeanMetaData(umd, ejb3Deployment);
- buildWebservicesMetaData(umd, jarDD);
-
- dep.getContext().addAttachment(UnifiedApplicationMetaData.class, umd);
- return umd;
- }
-
- private static void buildWebservicesMetaData(UnifiedApplicationMetaData umd, EjbJarDD jarDD)
- {
- // nothing to do
- if (jarDD == null)
- return;
-
- Webservices webservices = jarDD.getWebservices();
- if (webservices != null)
- {
- String contextRoot = webservices.getContextRoot();
- umd.setPublishLocationAdapter(getPublishLocationAdpater(webservices));
-
- List<WebserviceDescription> wsDescriptions = webservices.getWebserviceDescriptions();
- if (wsDescriptions.size() > 1)
- log.warn("Multiple <webservice-description> elements not supported");
-
- if (wsDescriptions.size() > 0)
- {
- WebserviceDescription wsd = wsDescriptions.get(0);
- umd.setConfigName(wsd.getConfigName());
- umd.setConfigFile(wsd.getConfigFile());
-
- // com/sun/ts/tests/webservices12/ejb/annotations/WSEjbWebServiceRefTest1
- // WSEjbWebServiceRefTest1VerifyTargetEndpointAddress
- if (contextRoot == null)
- contextRoot = "/" + wsd.getDescriptionName();
- }
-
- umd.setWebServiceContextRoot(contextRoot);
- }
- }
-
- private static void buildUnifiedBeanMetaData(UnifiedApplicationMetaData umd, Ejb3Deployment ejb3Deployment)
- {
- List<UnifiedBeanMetaData> ubmdList = new ArrayList<UnifiedBeanMetaData>();
- Iterator<Container> it = ejb3Deployment.getEjbContainers().values().iterator();
- while (it.hasNext())
- {
- EJBContainer container = (EJBContainer)it.next();
- UnifiedBeanMetaData ubmd = null;
- if (container instanceof SessionContainer)
- {
- ubmd = new UnifiedSessionMetaData();
- }
- else if (container instanceof MessagingContainer)
- {
- ubmd = new UnifiedMessageDrivenMetaData();
- log.warn("No implemented: initialize MDB destination");
- //((UnifiedMessageDrivenMetaData)ubmd).setDestinationJndiName(((MessagingContainer)container).getDestination());
- }
-
- if (ubmd != null)
- {
- ubmd.setEjbName(container.getEjbName());
- ubmd.setEjbClass(container.getBeanClassName());
-
- EnterpriseBean bean = container.getXml();
- Ejb3PortComponent pcMetaData = (bean != null ? bean.getPortComponent() : null);
- if (pcMetaData != null)
- {
- UnifiedEjbPortComponentMetaData ejbPortComp = new UnifiedEjbPortComponentMetaData();
- ejbPortComp.setPortComponentName(pcMetaData.getPortComponentName());
- ejbPortComp.setPortComponentURI(pcMetaData.getPortComponentURI());
- ejbPortComp.setAuthMethod(pcMetaData.getAuthMethod());
- ejbPortComp.setTransportGuarantee(pcMetaData.getTransportGuarantee());
- ejbPortComp.setSecureWSDLAccess(pcMetaData.getSecureWSDLAccess());
-
- ubmd.setPortComponent(ejbPortComp);
- }
-
- ubmdList.add(ubmd);
- }
- }
- umd.setEnterpriseBeans(ubmdList);
- }
-
- private static PublishLocationAdapter getPublishLocationAdpater(final Webservices webservices)
- {
- return new PublishLocationAdapter()
- {
- public String getWsdlPublishLocationByName(String name)
- {
- String wsdlPublishLocation = null;
- for (WebserviceDescription wsd : webservices.getWebserviceDescriptions())
- {
- if (wsd.getDescriptionName().equals(name))
- {
- wsdlPublishLocation = wsd.getWsdlPublishLocation();
- }
- }
- return wsdlPublishLocation;
- }
- };
- }
-}
Modified: trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/DeploymentInfoAdapter.java
===================================================================
--- trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/DeploymentInfoAdapter.java 2007-06-03 11:25:38 UTC (rev 3404)
+++ trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/DeploymentInfoAdapter.java 2007-06-03 11:45:47 UTC (rev 3405)
@@ -45,8 +45,27 @@
// logging support
private static Logger log = Logger.getLogger(DeploymentInfoAdapter.class);
- public static void buildDeploymentInfo(Deployment dep, UnifiedDeploymentInfo udi, DeploymentUnit unit)
+ private ApplicationMetaDataAdapterEJB3 applicationMetaDataAdapterEJB3 = new ApplicationMetaDataAdapterEJB3();
+ private ApplicationMetaDataAdapterEJB21 applicationMetaDataAdapterEJB21 = new ApplicationMetaDataAdapterEJB21();
+ private WebMetaDataAdapter webMetaDataAdapter = new WebMetaDataAdapter();
+
+ public void setApplicationMetaDataAdapterEJB21(ApplicationMetaDataAdapterEJB21 adapter)
{
+ this.applicationMetaDataAdapterEJB21 = adapter;
+ }
+
+ public void setApplicationMetaDataAdapterEJB3(ApplicationMetaDataAdapterEJB3 adapter)
+ {
+ this.applicationMetaDataAdapterEJB3 = adapter;
+ }
+
+ public void setWebMetaDataAdapter(WebMetaDataAdapter adapter)
+ {
+ this.webMetaDataAdapter = adapter;
+ }
+
+ public void buildDeploymentInfo(Deployment dep, UnifiedDeploymentInfo udi, DeploymentUnit unit)
+ {
dep.getContext().addAttachment(DeploymentUnit.class, unit);
try
@@ -82,19 +101,19 @@
}
}
- private static void buildMetaData(Deployment dep, UnifiedDeploymentInfo udi, DeploymentUnit unit) throws Exception
+ private void buildMetaData(Deployment dep, UnifiedDeploymentInfo udi, DeploymentUnit unit) throws Exception
{
if (unit.getAttachment(Ejb3Deployment.class) != null)
{
- udi.metaData = ApplicationMetaDataAdaptorEJB3.buildUnifiedApplicationMetaData(dep, udi, unit);
+ udi.metaData = applicationMetaDataAdapterEJB3.buildUnifiedApplicationMetaData(dep, udi, unit);
}
else if (unit.getAttachment(ApplicationMetaData.class) != null)
{
- udi.metaData = ApplicationMetaDataAdaptor.buildUnifiedApplicationMetaData(dep, udi, unit);
+ udi.metaData = applicationMetaDataAdapterEJB21.buildUnifiedApplicationMetaData(dep, udi, unit);
}
else if (unit.getAttachment(WebMetaData.class) != null)
{
- udi.metaData = WebMetaDataAdaptor.buildUnifiedWebMetaData(dep, udi, unit);
+ udi.metaData = webMetaDataAdapter.buildUnifiedWebMetaData(dep, udi, unit);
udi.webappURL = udi.vfRoot.toURL();
}
}
Modified: trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/UnifiedDeploymentInfoDeployer.java
===================================================================
--- trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/UnifiedDeploymentInfoDeployer.java 2007-06-03 11:25:38 UTC (rev 3404)
+++ trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/UnifiedDeploymentInfoDeployer.java 2007-06-03 11:45:47 UTC (rev 3405)
@@ -40,6 +40,13 @@
*/
public class UnifiedDeploymentInfoDeployer extends AbstractDeployer
{
+ private DeploymentInfoAdapter deploymentInfoAdapter = new DeploymentInfoAdapter();
+
+ public void setDeploymentInfoAdapter(DeploymentInfoAdapter adapter)
+ {
+ this.deploymentInfoAdapter = adapter;
+ }
+
@Override
public void create(Deployment dep)
{
@@ -54,13 +61,13 @@
if (type.toString().startsWith("JAXWS"))
{
udi = new JAXWSDeployment(type);
- DeploymentInfoAdapter.buildDeploymentInfo(dep, udi, unit);
+ deploymentInfoAdapter.buildDeploymentInfo(dep, udi, unit);
}
else
{
WebservicesMetaData wsMetaData = dep.getContext().getAttachment(WebservicesMetaData.class);
udi = new JAXRPCDeployment(type, wsMetaData);
- DeploymentInfoAdapter.buildDeploymentInfo(dep, udi, unit);
+ deploymentInfoAdapter.buildDeploymentInfo(dep, udi, unit);
}
dep.getContext().addAttachment(UnifiedDeploymentInfo.class, udi);
Copied: trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/WebMetaDataAdapter.java (from rev 3399, trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/WebMetaDataAdaptor.java)
===================================================================
--- trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/WebMetaDataAdapter.java (rev 0)
+++ trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/WebMetaDataAdapter.java 2007-06-03 11:45:47 UTC (rev 3405)
@@ -0,0 +1,138 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.wsf.container.jboss50;
+
+// $Id$
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.jboss.deployers.spi.deployer.DeploymentUnit;
+import org.jboss.metadata.WebMetaData;
+import org.jboss.metadata.WebSecurityMetaData;
+import org.jboss.metadata.WebSecurityMetaData.WebResourceCollection;
+import org.jboss.metadata.web.Servlet;
+import org.jboss.metadata.web.ServletMapping;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.UnifiedDeploymentInfo;
+import org.jboss.wsf.spi.metadata.j2ee.UnifiedWebMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.UnifiedWebSecurityMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.UnifiedWebMetaData.PublishLocationAdapter;
+import org.jboss.wsf.spi.metadata.j2ee.UnifiedWebSecurityMetaData.UnifiedWebResourceCollection;
+
+/**
+ * Build container independent web meta data
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @since 05-May-2006
+ */
+public class WebMetaDataAdapter
+{
+ public UnifiedWebMetaData buildUnifiedWebMetaData(Deployment dep, UnifiedDeploymentInfo udi, DeploymentUnit unit)
+ {
+ WebMetaData wmd = unit.getAttachment(WebMetaData.class);
+ dep.getContext().addAttachment(WebMetaData.class, wmd);
+
+ UnifiedWebMetaData umd = new UnifiedWebMetaData();
+ umd.setContextRoot(wmd.getContextRoot());
+ umd.setServletMappings(getServletMappings(wmd));
+ umd.setServletClassNames(getServletClassMap(wmd));
+ umd.setConfigName(wmd.getConfigName());
+ umd.setConfigFile(wmd.getConfigFile());
+ umd.setSecurityDomain(wmd.getSecurityDomain());
+ umd.setPublishLocationAdapter(getPublishLocationAdpater(wmd));
+ umd.setSecurityMetaData(getSecurityMetaData(wmd.getSecurityContraints()));
+
+ dep.getContext().addAttachment(UnifiedWebMetaData.class, umd);
+ return umd;
+ }
+
+ private PublishLocationAdapter getPublishLocationAdpater(final WebMetaData wmd)
+ {
+ return new PublishLocationAdapter()
+ {
+ public String getWsdlPublishLocationByName(String name)
+ {
+ return wmd.getWsdlPublishLocationByName(name);
+ }
+ };
+ }
+
+ protected List<UnifiedWebSecurityMetaData> getSecurityMetaData(final Iterator securityConstraints)
+ {
+ ArrayList<UnifiedWebSecurityMetaData> unifiedsecurityMetaData = new ArrayList<UnifiedWebSecurityMetaData>();
+
+ while (securityConstraints.hasNext())
+ {
+ WebSecurityMetaData securityMetaData = (WebSecurityMetaData)securityConstraints.next();
+
+ UnifiedWebSecurityMetaData current = new UnifiedWebSecurityMetaData();
+ unifiedsecurityMetaData.add(current);
+
+ current.setTransportGuarantee(securityMetaData.getTransportGuarantee());
+
+ Map<String, WebResourceCollection> resources = securityMetaData.getWebResources();
+ for (WebResourceCollection webResource : resources.values())
+ {
+ UnifiedWebResourceCollection currentResource = current.addWebResource(webResource.getName());
+ for (String currentPattern : webResource.getUrlPatterns())
+ {
+ currentResource.addPattern(currentPattern);
+ }
+ }
+ }
+
+ return unifiedsecurityMetaData;
+ }
+
+ private Map<String, String> getServletMappings(WebMetaData wmd)
+ {
+ Map<String, String> mappings = new HashMap<String, String>();
+ Iterator it = wmd.getServletMappings().iterator();
+ while (it.hasNext())
+ {
+ ServletMapping sm = (ServletMapping)it.next();
+ // FIXME - Add support for multiple mappings
+ mappings.put(sm.getName(), sm.getUrlPatterns().get(0));
+ }
+ return mappings;
+ }
+
+ private Map<String, String> getServletClassMap(WebMetaData wmd)
+ {
+ Map<String, String> mappings = new HashMap<String, String>();
+ Iterator it = wmd.getServlets().iterator();
+ while (it.hasNext())
+ {
+ Servlet servlet = (Servlet)it.next();
+ // Skip JSPs
+ if (servlet.getServletClass() == null || servlet.getServletClass().length() == 0)
+ continue;
+
+ mappings.put(servlet.getName(), servlet.getServletClass());
+ }
+ return mappings;
+ }
+}
Deleted: trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/WebMetaDataAdaptor.java
===================================================================
--- trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/WebMetaDataAdaptor.java 2007-06-03 11:25:38 UTC (rev 3404)
+++ trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/WebMetaDataAdaptor.java 2007-06-03 11:45:47 UTC (rev 3405)
@@ -1,138 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.wsf.container.jboss50;
-
-// $Id$
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
-import org.jboss.metadata.WebMetaData;
-import org.jboss.metadata.WebSecurityMetaData;
-import org.jboss.metadata.WebSecurityMetaData.WebResourceCollection;
-import org.jboss.metadata.web.Servlet;
-import org.jboss.metadata.web.ServletMapping;
-import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.UnifiedDeploymentInfo;
-import org.jboss.wsf.spi.metadata.j2ee.UnifiedWebMetaData;
-import org.jboss.wsf.spi.metadata.j2ee.UnifiedWebSecurityMetaData;
-import org.jboss.wsf.spi.metadata.j2ee.UnifiedWebMetaData.PublishLocationAdapter;
-import org.jboss.wsf.spi.metadata.j2ee.UnifiedWebSecurityMetaData.UnifiedWebResourceCollection;
-
-/**
- * Build container independent web meta data
- *
- * @author Thomas.Diesler at jboss.org
- * @since 05-May-2006
- */
-public class WebMetaDataAdaptor
-{
- public static UnifiedWebMetaData buildUnifiedWebMetaData(Deployment dep, UnifiedDeploymentInfo udi, DeploymentUnit unit)
- {
- WebMetaData wmd = unit.getAttachment(WebMetaData.class);
- dep.getContext().addAttachment(WebMetaData.class, wmd);
-
- UnifiedWebMetaData umd = new UnifiedWebMetaData();
- umd.setContextRoot(wmd.getContextRoot());
- umd.setServletMappings(getServletMappings(wmd));
- umd.setServletClassNames(getServletClassMap(wmd));
- umd.setConfigName(wmd.getConfigName());
- umd.setConfigFile(wmd.getConfigFile());
- umd.setSecurityDomain(wmd.getSecurityDomain());
- umd.setPublishLocationAdapter(getPublishLocationAdpater(wmd));
- umd.setSecurityMetaData(getSecurityMetaData(wmd.getSecurityContraints()));
-
- dep.getContext().addAttachment(UnifiedWebMetaData.class, umd);
- return umd;
- }
-
- private static PublishLocationAdapter getPublishLocationAdpater(final WebMetaData wmd)
- {
- return new PublishLocationAdapter()
- {
- public String getWsdlPublishLocationByName(String name)
- {
- return wmd.getWsdlPublishLocationByName(name);
- }
- };
- }
-
- protected static List<UnifiedWebSecurityMetaData> getSecurityMetaData(final Iterator securityConstraints)
- {
- ArrayList<UnifiedWebSecurityMetaData> unifiedsecurityMetaData = new ArrayList<UnifiedWebSecurityMetaData>();
-
- while (securityConstraints.hasNext())
- {
- WebSecurityMetaData securityMetaData = (WebSecurityMetaData)securityConstraints.next();
-
- UnifiedWebSecurityMetaData current = new UnifiedWebSecurityMetaData();
- unifiedsecurityMetaData.add(current);
-
- current.setTransportGuarantee(securityMetaData.getTransportGuarantee());
-
- Map<String, WebResourceCollection> resources = securityMetaData.getWebResources();
- for (WebResourceCollection webResource : resources.values())
- {
- UnifiedWebResourceCollection currentResource = current.addWebResource(webResource.getName());
- for (String currentPattern : webResource.getUrlPatterns())
- {
- currentResource.addPattern(currentPattern);
- }
- }
- }
-
- return unifiedsecurityMetaData;
- }
-
- private static Map<String, String> getServletMappings(WebMetaData wmd)
- {
- Map<String, String> mappings = new HashMap<String, String>();
- Iterator it = wmd.getServletMappings().iterator();
- while (it.hasNext())
- {
- ServletMapping sm = (ServletMapping)it.next();
- // FIXME - Add support for multiple mappings
- mappings.put(sm.getName(), sm.getUrlPatterns().get(0));
- }
- return mappings;
- }
-
- private static Map<String, String> getServletClassMap(WebMetaData wmd)
- {
- Map<String, String> mappings = new HashMap<String, String>();
- Iterator it = wmd.getServlets().iterator();
- while (it.hasNext())
- {
- Servlet servlet = (Servlet)it.next();
- // Skip JSPs
- if (servlet.getServletClass() == null || servlet.getServletClass().length() == 0)
- continue;
-
- mappings.put(servlet.getName(), servlet.getServletClass());
- }
- return mappings;
- }
-}
Modified: trunk/integration/native/src/main/resources/jbossws-native40.sar/jbossws.beans/META-INF/jboss-beans.xml
===================================================================
--- trunk/integration/native/src/main/resources/jbossws-native40.sar/jbossws.beans/META-INF/jboss-beans.xml 2007-06-03 11:25:38 UTC (rev 3404)
+++ trunk/integration/native/src/main/resources/jbossws-native40.sar/jbossws.beans/META-INF/jboss-beans.xml 2007-06-03 11:45:47 UTC (rev 3405)
@@ -163,11 +163,8 @@
<!-- Deployer helper beans -->
<bean name="WSApplicationMetaDataAdapterEJB21" class="org.jboss.wsf.container.jboss40.ApplicationMetaDataAdapterEJB21"/>
- <bean name="WSApplicationMetaDataAdapterEJB3" class="org.jboss.wsf.container.jboss42.ApplicationMetaDataAdapterEJB3"/>
<bean name="WSDeploymentInfoAdapter" class="org.jboss.wsf.container.jboss42.DeploymentInfoAdapter">
<property name="applicationMetaDataAdapterEJB21"><inject bean="WSApplicationMetaDataAdapterEJB21"/></property>
- <property name="applicationMetaDataAdapterEJB3"><inject bean="WSApplicationMetaDataAdapterEJB3"/></property>
- <property name="webMetaDataAdapter"><inject bean="WSWebMetaDataAdapter"/></property>
</bean>
<bean name="WSSecurityHandlerEJB21" class="org.jboss.wsf.container.jboss42.SecurityHandlerEJB21"/>
<bean name="WSSecurityHandlerEJB3" class="org.jboss.wsf.container.jboss42.SecurityHandlerEJB3"/>
@@ -175,7 +172,6 @@
<bean name="WSWebAppDesciptorModifier" class="org.jboss.wsf.stack.jbws.WebAppDesciptorModifierImpl">
<property name="servletClass">org.jboss.wsf.stack.jbws.ServiceEndpointServlet</property>
</bean>
- <bean name="WSWebMetaDataAdapter" class="org.jboss.wsf.container.jboss42.WebMetaDataAdapter"/>
<bean name="WSWebXMLRewriter" class="org.jboss.wsf.spi.deployment.WebXMLRewriter">
<property name="desciptorModifier"><inject bean="WSWebAppDesciptorModifier"/></property>
</bean>
Modified: trunk/integration/native/src/main/resources/jbossws-native42.sar/jbossws.beans/META-INF/jboss-beans.xml
===================================================================
--- trunk/integration/native/src/main/resources/jbossws-native42.sar/jbossws.beans/META-INF/jboss-beans.xml 2007-06-03 11:25:38 UTC (rev 3404)
+++ trunk/integration/native/src/main/resources/jbossws-native42.sar/jbossws.beans/META-INF/jboss-beans.xml 2007-06-03 11:45:47 UTC (rev 3405)
@@ -147,9 +147,7 @@
</bean>
<bean name="WSPublishContractDeployer" class="org.jboss.wsf.stack.jbws.PublishContractDeployer"/>
<bean name="WSServiceEndpointInvokerDeployer" class="org.jboss.wsf.stack.jbws.ServiceEndpointInvokerDeployer"/>
- <bean name="WSUnifiedDeploymentInfoDeployer" class="org.jboss.wsf.container.jboss42.UnifiedDeploymentInfoDeployer">
- <property name="deploymentInfoAdapter"><inject bean="WSDeploymentInfoAdapter"/></property>
- </bean>
+ <bean name="WSUnifiedDeploymentInfoDeployer" class="org.jboss.wsf.container.jboss42.UnifiedDeploymentInfoDeployer"/>
<bean name="WSUnifiedMetaDataAssociationDeployer" class="org.jboss.wsf.stack.jbws.UnifiedMetaDataAssociationDeployer"/>
<bean name="WSUnifiedMetaDataDeployer" class="org.jboss.wsf.stack.jbws.UnifiedMetaDataDeployer"/>
<bean name="WSURLPatternDeployer" class="org.jboss.wsf.spi.deployment.URLPatternDeployer"/>
@@ -162,19 +160,11 @@
</bean>
<!-- Deployer helper beans -->
- <bean name="WSApplicationMetaDataAdapterEJB21" class="org.jboss.wsf.container.jboss42.ApplicationMetaDataAdapterEJB21"/>
- <bean name="WSApplicationMetaDataAdapterEJB3" class="org.jboss.wsf.container.jboss42.ApplicationMetaDataAdapterEJB3"/>
- <bean name="WSDeploymentInfoAdapter" class="org.jboss.wsf.container.jboss42.DeploymentInfoAdapter">
- <property name="applicationMetaDataAdapterEJB21"><inject bean="WSApplicationMetaDataAdapterEJB21"/></property>
- <property name="applicationMetaDataAdapterEJB3"><inject bean="WSApplicationMetaDataAdapterEJB3"/></property>
- <property name="webMetaDataAdapter"><inject bean="WSWebMetaDataAdapter"/></property>
- </bean>
<bean name="WSSecurityHandlerEJB21" class="org.jboss.wsf.container.jboss42.SecurityHandlerEJB21"/>
<bean name="WSSecurityHandlerEJB3" class="org.jboss.wsf.container.jboss42.SecurityHandlerEJB3"/>
<bean name="WSWebAppDesciptorModifier" class="org.jboss.wsf.stack.jbws.WebAppDesciptorModifierImpl">
<property name="servletClass">org.jboss.wsf.stack.jbws.ServiceEndpointServlet</property>
</bean>
- <bean name="WSWebMetaDataAdapter" class="org.jboss.wsf.container.jboss42.WebMetaDataAdapter"/>
<bean name="WSWebXMLRewriter" class="org.jboss.wsf.spi.deployment.WebXMLRewriter">
<property name="desciptorModifier"><inject bean="WSWebAppDesciptorModifier"/></property>
</bean>
Modified: trunk/integration/sunri/src/main/resources/jbossws-sunri42.sar/jbossws.beans/META-INF/jboss-beans.xml
===================================================================
--- trunk/integration/sunri/src/main/resources/jbossws-sunri42.sar/jbossws.beans/META-INF/jboss-beans.xml 2007-06-03 11:25:38 UTC (rev 3404)
+++ trunk/integration/sunri/src/main/resources/jbossws-sunri42.sar/jbossws.beans/META-INF/jboss-beans.xml 2007-06-03 11:45:47 UTC (rev 3405)
@@ -130,9 +130,7 @@
<property name="webXMLRewriter"><inject bean="WSWebXMLRewriter"/></property>
</bean>
<bean name="WSSunJaxwsDeployer" class="org.jboss.wsf.stack.sunri.SunJaxwsDeployer"/>
- <bean name="WSUnifiedDeploymentInfoDeployer" class="org.jboss.wsf.container.jboss42.UnifiedDeploymentInfoDeployer">
- <property name="deploymentInfoAdapter"><inject bean="WSDeploymentInfoAdapter"/></property>
- </bean>
+ <bean name="WSUnifiedDeploymentInfoDeployer" class="org.jboss.wsf.container.jboss42.UnifiedDeploymentInfoDeployer"/>
<bean name="WSURLPatternDeployer" class="org.jboss.wsf.spi.deployment.URLPatternDeployer"/>
<bean name="WSWebAppGeneratorDeployer" class="org.jboss.wsf.spi.deployment.WebAppGeneratorDeployer">
<property name="securityHandlerEJB3"><inject bean="WSSecurityHandlerEJB3"/></property>
@@ -142,20 +140,12 @@
</bean>
<!-- Deployer helper beans -->
- <bean name="WSApplicationMetaDataAdapterEJB21" class="org.jboss.wsf.container.jboss42.ApplicationMetaDataAdapterEJB21"/>
- <bean name="WSApplicationMetaDataAdapterEJB3" class="org.jboss.wsf.container.jboss42.ApplicationMetaDataAdapterEJB3"/>
- <bean name="WSDeploymentInfoAdapter" class="org.jboss.wsf.container.jboss42.DeploymentInfoAdapter">
- <property name="applicationMetaDataAdapterEJB21"><inject bean="WSApplicationMetaDataAdapterEJB21"/></property>
- <property name="applicationMetaDataAdapterEJB3"><inject bean="WSApplicationMetaDataAdapterEJB3"/></property>
- <property name="webMetaDataAdapter"><inject bean="WSWebMetaDataAdapter"/></property>
- </bean>
<bean name="WSSecurityHandlerEJB21" class="org.jboss.wsf.container.jboss42.SecurityHandlerEJB21"/>
<bean name="WSSecurityHandlerEJB3" class="org.jboss.wsf.container.jboss42.SecurityHandlerEJB3"/>
<bean name="WSWebAppDesciptorModifier" class="org.jboss.wsf.stack.sunri.WebAppDesciptorModifierImpl">
<property name="listenerClass">org.jboss.wsf.stack.sunri.WSServletContextListenerJBWS</property>
<property name="servletClass">org.jboss.wsf.spi.invocation.EndpointServlet</property>
</bean>
- <bean name="WSWebMetaDataAdapter" class="org.jboss.wsf.container.jboss42.WebMetaDataAdapter"/>
<bean name="WSWebXMLRewriter" class="org.jboss.wsf.spi.deployment.WebXMLRewriter">
<property name="desciptorModifier"><inject bean="WSWebAppDesciptorModifier"/></property>
</bean>
Modified: trunk/integration/xfire/src/main/resources/jbossws-xfire42.sar/jbossws.beans/META-INF/jboss-beans.xml
===================================================================
--- trunk/integration/xfire/src/main/resources/jbossws-xfire42.sar/jbossws.beans/META-INF/jboss-beans.xml 2007-06-03 11:25:38 UTC (rev 3404)
+++ trunk/integration/xfire/src/main/resources/jbossws-xfire42.sar/jbossws.beans/META-INF/jboss-beans.xml 2007-06-03 11:45:47 UTC (rev 3405)
@@ -129,9 +129,7 @@
<bean name="WSModifyWebMetaDataDeployer" class="org.jboss.wsf.container.jboss42.ModifyWebMetaDataDeployer">
<property name="webXMLRewriter"><inject bean="WSWebXMLRewriter"/></property>
</bean>
- <bean name="WSUnifiedDeploymentInfoDeployer" class="org.jboss.wsf.container.jboss42.UnifiedDeploymentInfoDeployer">
- <property name="deploymentInfoAdapter"><inject bean="WSDeploymentInfoAdapter"/></property>
- </bean>
+ <bean name="WSUnifiedDeploymentInfoDeployer" class="org.jboss.wsf.container.jboss42.UnifiedDeploymentInfoDeployer"/>
<bean name="WSURLPatternDeployer" class="org.jboss.wsf.spi.deployment.URLPatternDeployer"/>
<bean name="WSWebAppGeneratorDeployer" class="org.jboss.wsf.spi.deployment.WebAppGeneratorDeployer">
<property name="securityHandlerEJB3"><inject bean="WSSecurityHandlerEJB3"/></property>
@@ -146,19 +144,11 @@
</bean>
<!-- Deployer helper beans -->
- <bean name="WSApplicationMetaDataAdapterEJB21" class="org.jboss.wsf.container.jboss42.ApplicationMetaDataAdapterEJB21"/>
- <bean name="WSApplicationMetaDataAdapterEJB3" class="org.jboss.wsf.container.jboss42.ApplicationMetaDataAdapterEJB3"/>
- <bean name="WSDeploymentInfoAdapter" class="org.jboss.wsf.container.jboss42.DeploymentInfoAdapter">
- <property name="applicationMetaDataAdapterEJB21"><inject bean="WSApplicationMetaDataAdapterEJB21"/></property>
- <property name="applicationMetaDataAdapterEJB3"><inject bean="WSApplicationMetaDataAdapterEJB3"/></property>
- <property name="webMetaDataAdapter"><inject bean="WSWebMetaDataAdapter"/></property>
- </bean>
<bean name="WSSecurityHandlerEJB21" class="org.jboss.wsf.container.jboss42.SecurityHandlerEJB21"/>
<bean name="WSSecurityHandlerEJB3" class="org.jboss.wsf.container.jboss42.SecurityHandlerEJB3"/>
<bean name="WSWebAppDesciptorModifier" class="org.jboss.wsf.stack.xfire.WebAppDesciptorModifierImpl">
<property name="servletClass">org.jboss.wsf.stack.xfire.XFireConfigurableServletExt</property>
</bean>
- <bean name="WSWebMetaDataAdapter" class="org.jboss.wsf.container.jboss42.WebMetaDataAdapter"/>
<bean name="WSWebXMLRewriter" class="org.jboss.wsf.spi.deployment.WebXMLRewriter">
<property name="desciptorModifier"><inject bean="WSWebAppDesciptorModifier"/></property>
</bean>
More information about the jbossws-commits
mailing list