Author: thomas.diesler(a)jboss.com
Date: 2007-05-19 20:29:48 -0400 (Sat, 19 May 2007)
New Revision: 3150
Added:
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/ApplicationMetaDataAdaptorEJB3.java
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/WebAppDesciptorModifier.java
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/WebXMLRewriter.java
trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/WebAppDesciptorModifierImpl.java
trunk/jbossws-core/src/main/java/org/jboss/wsf/stack/jbws/WebAppDesciptorModifierImpl.java
Removed:
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/AbstractApplicationMetaDataAdapter.java
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/ServiceEndpointPublisher.java
trunk/integration/spi/src/main/java/org/jboss/wsintegration/
Modified:
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/ApplicationMetaDataAdapter.java
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/DeploymentInfoAdapter.java
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXWSDeployerHookEJB3.java
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/ModifyWebMetaDataDeployer.java
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/UnifiedDeploymentInfoDeployer.java
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/WebAppDeployerDeployer.java
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/WebMetaDataAdapter.java
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/InvocationHandlerEJB3.java
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/ModifyWebMetaDataDeployer.java
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/WebAppDeployerDeployer.java
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/WebMetaDataAdaptor.java
trunk/integration/jbws/src/main/resources/jbossws-jbws42.sar/jbossws.beans/META-INF/jboss-beans.xml
trunk/integration/jbws/src/main/resources/jbossws-jbws50.sar/META-INF/jbossws-beans.xml
trunk/integration/spi/.classpath
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/ContextRootDeployer.java
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/URLPatternDeployer.java
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/utils/IOUtils.java
trunk/integration/sunri/ant-import/build-thirdparty.xml
trunk/integration/sunri/build.xml
trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/InvokerEJB3.java
trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/RequestHandlerImpl.java
trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/SunJaxwsDeployer.java
trunk/integration/sunri/src/main/resources/jbossws-jboss50.sar/META-INF/jbossws-beans.xml
trunk/jbossws-core/.classpath
trunk/jbossws-core/ant-import/build-thirdparty.xml
Log:
Add support for EJB3 endpoints for SunRI
Deleted:
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/AbstractApplicationMetaDataAdapter.java
===================================================================
---
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/AbstractApplicationMetaDataAdapter.java 2007-05-19
16:25:26 UTC (rev 3149)
+++
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/AbstractApplicationMetaDataAdapter.java 2007-05-20
00:29:48 UTC (rev 3150)
@@ -1,87 +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.jboss42;
-
-// $Id$
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.jboss.metadata.ApplicationMetaData;
-import org.jboss.metadata.BeanMetaData;
-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.UnifiedApplicationMetaData.PublishLocationAdapter;
-
-/**
- * Build container independent application meta data
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public abstract class AbstractApplicationMetaDataAdapter
-{
- public UnifiedApplicationMetaData
buildUnifiedApplicationMetaData(UnifiedDeploymentInfo udi, ApplicationMetaData apmd)
- {
- udi.addAttachment(ApplicationMetaData.class, apmd);
-
- UnifiedApplicationMetaData umd = new UnifiedApplicationMetaData();
- buildUnifiedBeanMetaData(umd, apmd);
- umd.setConfigName(apmd.getConfigName());
- umd.setConfigFile(apmd.getConfigFile());
- umd.setWebServiceContextRoot(apmd.getWebServiceContextRoot());
- umd.setSecurityDomain(apmd.getSecurityDomain());
- umd.setPublishLocationAdapter(getPublishLocationAdpater(apmd));
- return umd;
- }
-
- protected PublishLocationAdapter getPublishLocationAdpater(final ApplicationMetaData
apmd)
- {
- return new PublishLocationAdapter ()
- {
- public String getWsdlPublishLocationByName(String name)
- {
- return apmd.getWsdlPublishLocationByName(name);
- }
- };
- }
-
- protected void buildUnifiedBeanMetaData(UnifiedApplicationMetaData umd,
ApplicationMetaData metaData)
- {
- List<UnifiedBeanMetaData> beans = new
ArrayList<UnifiedBeanMetaData>();
- Iterator it = metaData.getEnterpriseBeans();
- while (it.hasNext())
- {
- BeanMetaData bmd = (BeanMetaData)it.next();
- UnifiedBeanMetaData ubmd = buildUnifiedBeanMetaData(bmd);
- if (ubmd != null)
- {
- beans.add(ubmd);
- }
- }
- umd.setEnterpriseBeans(beans);
- }
-
- protected abstract UnifiedBeanMetaData buildUnifiedBeanMetaData(BeanMetaData bmd);
-}
Modified:
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/ApplicationMetaDataAdapter.java
===================================================================
---
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/ApplicationMetaDataAdapter.java 2007-05-19
16:25:26 UTC (rev 3149)
+++
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/ApplicationMetaDataAdapter.java 2007-05-20
00:29:48 UTC (rev 3150)
@@ -23,14 +23,22 @@
// $Id$
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+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.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
@@ -38,10 +46,53 @@
* @author Thomas.Diesler(a)jboss.org
* @since 05-May-2006
*/
-public class ApplicationMetaDataAdapter extends AbstractApplicationMetaDataAdapter
+public class ApplicationMetaDataAdapter
{
- protected UnifiedBeanMetaData buildUnifiedBeanMetaData(BeanMetaData bmd)
+ public static UnifiedApplicationMetaData
buildUnifiedApplicationMetaData(UnifiedDeploymentInfo udi, ApplicationMetaData apmd)
{
+ udi.addAttachment(ApplicationMetaData.class, apmd);
+
+ UnifiedApplicationMetaData umd = new UnifiedApplicationMetaData();
+ buildUnifiedBeanMetaData(umd, apmd);
+ umd.setConfigName(apmd.getConfigName());
+ umd.setConfigFile(apmd.getConfigFile());
+ umd.setWebServiceContextRoot(apmd.getWebServiceContextRoot());
+ umd.setSecurityDomain(apmd.getSecurityDomain());
+ umd.setPublishLocationAdapter(getPublishLocationAdpater(apmd));
+
+ udi.addAttachment(UnifiedApplicationMetaData.class, umd);
+ return umd;
+ }
+
+ private static PublishLocationAdapter getPublishLocationAdpater(final
ApplicationMetaData apmd)
+ {
+ return new PublishLocationAdapter ()
+ {
+ public String getWsdlPublishLocationByName(String name)
+ {
+ return apmd.getWsdlPublishLocationByName(name);
+ }
+ };
+ }
+
+ private static void buildUnifiedBeanMetaData(UnifiedApplicationMetaData umd,
ApplicationMetaData metaData)
+ {
+ List<UnifiedBeanMetaData> beans = new
ArrayList<UnifiedBeanMetaData>();
+ Iterator it = metaData.getEnterpriseBeans();
+ while (it.hasNext())
+ {
+ BeanMetaData bmd = (BeanMetaData)it.next();
+ UnifiedBeanMetaData ubmd = buildUnifiedBeanMetaData(bmd);
+ if (ubmd != null)
+ {
+ beans.add(ubmd);
+ }
+ }
+ umd.setEnterpriseBeans(beans);
+ }
+
+ private static UnifiedBeanMetaData buildUnifiedBeanMetaData(BeanMetaData bmd)
+ {
UnifiedBeanMetaData ubmd = null;
if (bmd instanceof SessionMetaData)
{
Added:
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/ApplicationMetaDataAdaptorEJB3.java
===================================================================
---
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/ApplicationMetaDataAdaptorEJB3.java
(rev 0)
+++
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/ApplicationMetaDataAdaptorEJB3.java 2007-05-20
00:29:48 UTC (rev 3150)
@@ -0,0 +1,94 @@
+/*
+ * 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.jboss42;
+
+// $Id$
+
+import java.util.ArrayList;
+
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+import org.jboss.ejb3.Ejb3ModuleMBean;
+import org.jboss.ejb3.stateless.StatelessContainer;
+import org.jboss.logging.Logger;
+import org.jboss.mx.util.MBeanProxy;
+import org.jboss.mx.util.MBeanProxyCreationException;
+import org.jboss.mx.util.MBeanServerLocator;
+import org.jboss.wsf.spi.deployment.UnifiedDeploymentInfo;
+import org.jboss.wsf.spi.deployment.WSDeploymentException;
+import org.jboss.wsf.spi.metadata.j2ee.UnifiedApplicationMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.UnifiedBeanMetaData;
+
+/**
+ * Build container independent application meta data
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-Apr-2007
+ */
+public class ApplicationMetaDataAdaptorEJB3
+{
+ // logging support
+ private static Logger log = Logger.getLogger(ApplicationMetaDataAdaptorEJB3.class);
+
+ public static UnifiedApplicationMetaData
buildUnifiedApplicationMetaData(UnifiedDeploymentInfo udi)
+ {
+ Ejb3ModuleMBean ejb3Module = getEJB3Module(udi.deployedObject);
+
+ ArrayList<UnifiedBeanMetaData> beans = new
ArrayList<UnifiedBeanMetaData>();
+ for (Object container : ejb3Module.getContainers().values())
+ {
+ if (container instanceof StatelessContainer)
+ {
+ StatelessContainer slc = (StatelessContainer)container;
+ UnifiedBeanMetaData uslc = new UnifiedBeanMetaData();
+ uslc.setEjbName(slc.getEjbName());
+ uslc.setEjbClass(slc.getBeanClassName());
+ beans.add(uslc);
+ }
+ }
+
+ UnifiedApplicationMetaData umd = new UnifiedApplicationMetaData();
+ umd.setEnterpriseBeans(beans);
+
+ udi.addAttachment(UnifiedApplicationMetaData.class, umd);
+ return umd;
+ }
+
+ static Ejb3ModuleMBean getEJB3Module(ObjectName objectName)
+ {
+ Ejb3ModuleMBean ejb3Module;
+ try
+ {
+ MBeanServer server = MBeanServerLocator.locateJBoss();
+ ejb3Module = (Ejb3ModuleMBean)MBeanProxy.get(Ejb3ModuleMBean.class, objectName,
server);
+ if (ejb3Module == null)
+ throw new WSDeploymentException("Cannot obtain EJB3 module: " +
objectName);
+
+ return ejb3Module;
+ }
+ catch (MBeanProxyCreationException ex)
+ {
+ throw new WSDeploymentException("Cannot obtain proxy to EJB3
module");
+ }
+ }
+}
Property changes on:
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/ApplicationMetaDataAdaptorEJB3.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
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-05-19
16:25:26 UTC (rev 3149)
+++
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/DeploymentInfoAdapter.java 2007-05-20
00:29:48 UTC (rev 3150)
@@ -26,25 +26,13 @@
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
-import java.util.ArrayList;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-
import org.jboss.deployment.DeploymentInfo;
-import org.jboss.ejb3.Ejb3ModuleMBean;
-import org.jboss.ejb3.stateless.StatelessContainer;
import org.jboss.logging.Logger;
import org.jboss.metadata.ApplicationMetaData;
import org.jboss.metadata.WebMetaData;
-import org.jboss.mx.util.MBeanProxy;
-import org.jboss.mx.util.MBeanProxyCreationException;
-import org.jboss.mx.util.MBeanServerLocator;
import org.jboss.ws.integration.ResourceLoaderAdapter;
import org.jboss.wsf.spi.deployment.UnifiedDeploymentInfo;
-import org.jboss.wsf.spi.deployment.WSDeploymentException;
-import org.jboss.wsf.spi.metadata.j2ee.UnifiedApplicationMetaData;
-import org.jboss.wsf.spi.metadata.j2ee.UnifiedBeanMetaData;
/**
* Build container independent deployment info.
@@ -57,21 +45,8 @@
// logging support
private static Logger log = Logger.getLogger(DeploymentInfoAdapter.class);
- private WebMetaDataAdapter webMetaDataAdapter;
- private AbstractApplicationMetaDataAdapter appMetaDataAdapter;
-
- public void setAppMetaDataAdapter(AbstractApplicationMetaDataAdapter
applicationMetaDataAdapter)
+ public static UnifiedDeploymentInfo buildDeploymentInfo(UnifiedDeploymentInfo udi,
DeploymentInfo di)
{
- this.appMetaDataAdapter = applicationMetaDataAdapter;
- }
-
- public void setWebMetaDataAdapter(WebMetaDataAdapter webMetaDataAdapter)
- {
- this.webMetaDataAdapter = webMetaDataAdapter;
- }
-
- public UnifiedDeploymentInfo buildDeploymentInfo(UnifiedDeploymentInfo udi,
DeploymentInfo di)
- {
udi.addAttachment(DeploymentInfo.class, di);
if (di.parent != null)
@@ -93,7 +68,7 @@
return udi;
}
- private URL getDeploymentURL(DeploymentInfo di)
+ private static URL getDeploymentURL(DeploymentInfo di)
{
URL deploymentURL = (di.localUrl != null ? di.localUrl : di.url);
if ("file".equals(deploymentURL.getProtocol()))
@@ -114,55 +89,21 @@
return deploymentURL;
}
- private void buildMetaData(UnifiedDeploymentInfo udi, Object metaData)
+ private static void buildMetaData(UnifiedDeploymentInfo udi, Object metaData)
{
if (metaData instanceof WebMetaData)
{
- udi.metaData = webMetaDataAdapter.buildUnifiedWebMetaData(udi,
(WebMetaData)metaData);
+ udi.metaData = WebMetaDataAdapter.buildUnifiedWebMetaData(udi,
(WebMetaData)metaData);
udi.webappURL = udi.url;
}
else if (metaData instanceof ApplicationMetaData)
{
- udi.metaData = appMetaDataAdapter.buildUnifiedApplicationMetaData(udi,
(ApplicationMetaData)metaData);
+ udi.metaData = ApplicationMetaDataAdapter.buildUnifiedApplicationMetaData(udi,
(ApplicationMetaData)metaData);
}
else if (udi.deployedObject != null)
{
- Ejb3ModuleMBean ejb3Module = getEJB3Module(udi.deployedObject);
-
- ArrayList<UnifiedBeanMetaData> beans = new
ArrayList<UnifiedBeanMetaData>();
- for (Object container : ejb3Module.getContainers().values())
- {
- if (container instanceof StatelessContainer)
- {
- StatelessContainer slc = (StatelessContainer)container;
- UnifiedBeanMetaData uslc = new UnifiedBeanMetaData();
- uslc.setEjbName(slc.getEjbName());
- uslc.setEjbClass(slc.getBeanClassName());
- beans.add(uslc);
- }
- }
-
- UnifiedApplicationMetaData appMetaData = new UnifiedApplicationMetaData();
- appMetaData.setEnterpriseBeans(beans);
- udi.metaData = appMetaData;
+ udi.metaData =
ApplicationMetaDataAdaptorEJB3.buildUnifiedApplicationMetaData(udi);
+ ;
}
}
-
- public static Ejb3ModuleMBean getEJB3Module(ObjectName objectName)
- {
- Ejb3ModuleMBean ejb3Module;
- try
- {
- MBeanServer server = MBeanServerLocator.locateJBoss();
- ejb3Module = (Ejb3ModuleMBean)MBeanProxy.get(Ejb3ModuleMBean.class, objectName,
server);
- if (ejb3Module == null)
- throw new WSDeploymentException("Cannot obtain EJB3 module: " +
objectName);
-
- return ejb3Module;
- }
- catch (MBeanProxyCreationException ex)
- {
- throw new WSDeploymentException("Cannot obtain proxy to EJB3
module");
- }
- }
}
Modified:
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXWSDeployerHookEJB3.java
===================================================================
---
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXWSDeployerHookEJB3.java 2007-05-19
16:25:26 UTC (rev 3149)
+++
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXWSDeployerHookEJB3.java 2007-05-20
00:29:48 UTC (rev 3150)
@@ -59,7 +59,7 @@
Service service = dep.getService();
- Ejb3ModuleMBean ejb3Module =
DeploymentInfoAdapter.getEJB3Module(unit.deployedObject);
+ Ejb3ModuleMBean ejb3Module =
ApplicationMetaDataAdaptorEJB3.getEJB3Module(unit.deployedObject);
for (Object manager : ejb3Module.getContainers().values())
{
if (manager instanceof EJBContainer)
@@ -90,7 +90,7 @@
boolean isWebserviceDeployment = false;
// Check if the ejb3 contains annotated endpoints
- Ejb3ModuleMBean ejb3Module =
DeploymentInfoAdapter.getEJB3Module(unit.deployedObject);
+ Ejb3ModuleMBean ejb3Module =
ApplicationMetaDataAdaptorEJB3.getEJB3Module(unit.deployedObject);
for (Object manager : ejb3Module.getContainers().values())
{
if (manager instanceof EJBContainer)
Modified:
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/ModifyWebMetaDataDeployer.java
===================================================================
---
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/ModifyWebMetaDataDeployer.java 2007-05-19
16:25:26 UTC (rev 3149)
+++
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/ModifyWebMetaDataDeployer.java 2007-05-20
00:29:48 UTC (rev 3150)
@@ -26,9 +26,9 @@
import org.jboss.wsf.spi.deployment.AbstractDeployer;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.deployment.ServiceEndpointPublisher;
import org.jboss.wsf.spi.deployment.UnifiedDeploymentInfo;
-import org.jboss.wsf.spi.deployment.ServiceEndpointPublisher.RewriteResults;
+import org.jboss.wsf.spi.deployment.WebAppDesciptorModifier;
+import org.jboss.wsf.spi.deployment.WebXMLRewriter;
/**
* A deployer that modifies the web.xml meta data
@@ -38,11 +38,11 @@
*/
public class ModifyWebMetaDataDeployer extends AbstractDeployer
{
- private ServiceEndpointPublisher serviceEndpointPublisher;
+ private WebXMLRewriter webXMLRewriter;
- public void setServiceEndpointPublisher(ServiceEndpointPublisher
serviceEndpointPublisher)
+ public void setWebXMLRewriter(WebXMLRewriter serviceEndpointPublisher)
{
- this.serviceEndpointPublisher = serviceEndpointPublisher;
+ this.webXMLRewriter = serviceEndpointPublisher;
}
public void create(Deployment dep)
@@ -51,7 +51,7 @@
if (udi == null)
throw new IllegalStateException("Cannot obtain unified deployement
info");
- RewriteResults results = serviceEndpointPublisher.rewriteWebXml(udi);
+ WebAppDesciptorModifier.RewriteResults results =
webXMLRewriter.rewriteWebXml(dep);
// The endpoint may not have a target bean when
// <servlet-class> originally contained a javax.servlet.Servlet
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-05-19
16:25:26 UTC (rev 3149)
+++
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/UnifiedDeploymentInfoDeployer.java 2007-05-20
00:29:48 UTC (rev 3150)
@@ -40,13 +40,6 @@
*/
public class UnifiedDeploymentInfoDeployer extends AbstractDeployer
{
- private DeploymentInfoAdapter deploymentInfoAdapter;
-
- public void setDeploymentInfoAdapter(DeploymentInfoAdapter deploymentInfoAdapter)
- {
- this.deploymentInfoAdapter = deploymentInfoAdapter;
- }
-
@Override
public void create(Deployment dep)
{
@@ -61,13 +54,13 @@
if (type.toString().startsWith("JAXWS"))
{
udi = new JAXWSDeployment(type);
- deploymentInfoAdapter.buildDeploymentInfo(udi, unit);
+ DeploymentInfoAdapter.buildDeploymentInfo(udi, unit);
}
else
{
WebservicesMetaData wsMetaData =
dep.getContext().getAttachment(WebservicesMetaData.class);
udi = new JAXRPCDeployment(type, wsMetaData);
- deploymentInfoAdapter.buildDeploymentInfo(udi, unit);
+ DeploymentInfoAdapter.buildDeploymentInfo(udi, unit);
}
dep.getContext().addAttachment(UnifiedDeploymentInfo.class, udi);
Modified:
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/WebAppDeployerDeployer.java
===================================================================
---
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/WebAppDeployerDeployer.java 2007-05-19
16:25:26 UTC (rev 3149)
+++
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/WebAppDeployerDeployer.java 2007-05-20
00:29:48 UTC (rev 3150)
@@ -35,7 +35,7 @@
import org.jboss.mx.util.MBeanServerLocator;
import org.jboss.wsf.spi.deployment.AbstractDeployer;
import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.ServiceEndpointPublisher;
+import org.jboss.wsf.spi.deployment.WebXMLRewriter;
import org.jboss.wsf.spi.deployment.UnifiedDeploymentInfo;
import org.jboss.wsf.spi.deployment.WSDeploymentException;
@@ -50,11 +50,11 @@
// provide logging
private static Logger log = Logger.getLogger(WebAppDeployerDeployer.class);
- private ServiceEndpointPublisher serviceEndpointPublisher;
+ private WebXMLRewriter webXMLRewriter;
- public void setServiceEndpointPublisher(ServiceEndpointPublisher
serviceEndpointPublisher)
+ public void setWebXMLRewriter(WebXMLRewriter serviceEndpointPublisher)
{
- this.serviceEndpointPublisher = serviceEndpointPublisher;
+ this.webXMLRewriter = serviceEndpointPublisher;
}
public void create(Deployment dep)
@@ -72,7 +72,7 @@
if (di == null)
throw new IllegalStateException("Cannot obtain DeploymentInfo from
context");
- serviceEndpointPublisher.rewriteWebXml(udi);
+ webXMLRewriter.rewriteWebXml(dep);
// Preserve the repository config
DeploymentInfo auxdi = new DeploymentInfo(warURL, null,
MBeanServerLocator.locateJBoss());
Modified:
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/WebMetaDataAdapter.java
===================================================================
---
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/WebMetaDataAdapter.java 2007-05-19
16:25:26 UTC (rev 3149)
+++
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/WebMetaDataAdapter.java 2007-05-20
00:29:48 UTC (rev 3150)
@@ -47,7 +47,7 @@
*/
public class WebMetaDataAdapter
{
- public UnifiedWebMetaData buildUnifiedWebMetaData(UnifiedDeploymentInfo udi,
WebMetaData webMetaData)
+ public static UnifiedWebMetaData buildUnifiedWebMetaData(UnifiedDeploymentInfo udi,
WebMetaData webMetaData)
{
udi.addAttachment(WebMetaData.class, webMetaData);
@@ -61,10 +61,11 @@
umd.setPublishLocationAdapter(getPublishLocationAdpater(webMetaData));
umd.setSecurityMetaData(getSecurityMetaData(webMetaData.getSecurityContraints()));
+ udi.addAttachment(UnifiedWebMetaData.class, umd);
return umd;
}
- private PublishLocationAdapter getPublishLocationAdpater(final WebMetaData wmd)
+ private static PublishLocationAdapter getPublishLocationAdpater(final WebMetaData
wmd)
{
return new PublishLocationAdapter()
{
@@ -75,7 +76,7 @@
};
}
- private List<UnifiedWebSecurityMetaData> getSecurityMetaData(final Iterator
securityConstraints)
+ private static List<UnifiedWebSecurityMetaData> getSecurityMetaData(final
Iterator securityConstraints)
{
ArrayList<UnifiedWebSecurityMetaData> unifiedsecurityMetaData = new
ArrayList<UnifiedWebSecurityMetaData>();
@@ -104,7 +105,7 @@
return unifiedsecurityMetaData;
}
- private Map<String, String> getServletClassMap(WebMetaData wmd)
+ private static Map<String, String> getServletClassMap(WebMetaData wmd)
{
Map<String, String> mappings = new HashMap<String, String>();
Iterator it = wmd.getServletClassMap().entrySet().iterator();
Modified:
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-05-19
16:25:26 UTC (rev 3149)
+++
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/ApplicationMetaDataAdaptor.java 2007-05-20
00:29:48 UTC (rev 3150)
@@ -64,6 +64,8 @@
buildUnifiedBeanMetaData(umd, appMetaData);
buildWebservicesMetaData(umd, appMetaData);
umd.setSecurityDomain(appMetaData.getSecurityDomain());
+
+ udi.addAttachment(UnifiedApplicationMetaData.class, umd);
return umd;
}
Modified:
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-05-19
16:25:26 UTC (rev 3149)
+++
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/ApplicationMetaDataAdaptorEJB3.java 2007-05-20
00:29:48 UTC (rev 3150)
@@ -67,6 +67,8 @@
UnifiedApplicationMetaData umd = new UnifiedApplicationMetaData();
buildUnifiedBeanMetaData(umd, ejb3Deployment);
buildWebservicesMetaData(umd, jarDD);
+
+ udi.addAttachment(UnifiedApplicationMetaData.class, umd);
return umd;
}
Modified:
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/InvocationHandlerEJB3.java
===================================================================
---
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/InvocationHandlerEJB3.java 2007-05-19
16:25:26 UTC (rev 3149)
+++
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/InvocationHandlerEJB3.java 2007-05-20
00:29:48 UTC (rev 3150)
@@ -56,8 +56,6 @@
public void create(Endpoint ep)
{
- super.create(ep);
-
String ejbName = ep.getName().getKeyProperty(Endpoint.SEPID_PROPERTY_ENDPOINT);
if (ejbName == null)
throw new WebServiceException("Cannot obtain ejb-link");
Modified:
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/ModifyWebMetaDataDeployer.java
===================================================================
---
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/ModifyWebMetaDataDeployer.java 2007-05-19
16:25:26 UTC (rev 3149)
+++
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/ModifyWebMetaDataDeployer.java 2007-05-20
00:29:48 UTC (rev 3150)
@@ -42,11 +42,6 @@
{
private String servletClass;
- public String getServletClass()
- {
- return servletClass;
- }
-
public void setServletClass(String servletClass)
{
this.servletClass = servletClass;
Modified:
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/WebAppDeployerDeployer.java
===================================================================
---
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/WebAppDeployerDeployer.java 2007-05-19
16:25:26 UTC (rev 3149)
+++
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/WebAppDeployerDeployer.java 2007-05-20
00:29:48 UTC (rev 3150)
@@ -36,7 +36,7 @@
import org.jboss.virtual.VirtualFile;
import org.jboss.wsf.spi.deployment.AbstractDeployer;
import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.ServiceEndpointPublisher;
+import org.jboss.wsf.spi.deployment.WebXMLRewriter;
import org.jboss.wsf.spi.deployment.UnifiedDeploymentInfo;
import org.jboss.wsf.spi.deployment.WSDeploymentException;
@@ -52,7 +52,7 @@
private static Logger log = Logger.getLogger(WebAppDeployerDeployer.class);
private MainDeployer mainDeployer;
- private ServiceEndpointPublisher serviceEndpointPublisher;
+ private WebXMLRewriter webXMLRewriter;
private Map<String, DeploymentContext> contextMap = new HashMap<String,
DeploymentContext>();
public void setMainDeployer(MainDeployer mainDeployer)
@@ -60,9 +60,9 @@
this.mainDeployer = mainDeployer;
}
- public void setServiceEndpointPublisher(ServiceEndpointPublisher
serviceEndpointPublisher)
+ public void setWebXMLRewriter(WebXMLRewriter serviceEndpointPublisher)
{
- this.serviceEndpointPublisher = serviceEndpointPublisher;
+ this.webXMLRewriter = serviceEndpointPublisher;
}
public void create(Deployment dep)
@@ -76,7 +76,7 @@
log.debug("publishServiceEndpoint: " + warURL);
try
{
- serviceEndpointPublisher.rewriteWebXml(udi);
+ webXMLRewriter.rewriteWebXml(dep);
DeploymentContext context = createDeploymentContext(warURL);
mainDeployer.addDeploymentContext(context);
Modified:
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-05-19
16:25:26 UTC (rev 3149)
+++
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/WebMetaDataAdaptor.java 2007-05-20
00:29:48 UTC (rev 3150)
@@ -36,6 +36,7 @@
import org.jboss.metadata.web.Servlet;
import org.jboss.metadata.web.ServletMapping;
import org.jboss.wsf.spi.deployment.UnifiedDeploymentInfo;
+import org.jboss.wsf.spi.metadata.j2ee.UnifiedApplicationMetaData;
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;
@@ -64,6 +65,7 @@
umd.setPublishLocationAdapter(getPublishLocationAdpater(wmd));
umd.setSecurityMetaData(getSecurityMetaData(wmd.getSecurityContraints()));
+ udi.addAttachment(UnifiedWebMetaData.class, umd);
return umd;
}
Modified:
trunk/integration/jbws/src/main/resources/jbossws-jbws42.sar/jbossws.beans/META-INF/jboss-beans.xml
===================================================================
---
trunk/integration/jbws/src/main/resources/jbossws-jbws42.sar/jbossws.beans/META-INF/jboss-beans.xml 2007-05-19
16:25:26 UTC (rev 3149)
+++
trunk/integration/jbws/src/main/resources/jbossws-jbws42.sar/jbossws.beans/META-INF/jboss-beans.xml 2007-05-20
00:29:48 UTC (rev 3150)
@@ -141,13 +141,11 @@
<bean name="WSEndpointRegistryDeployer"
class="org.jboss.wsf.spi.deployment.EndpointRegistryDeployer"/>
<bean name="WSEventingDeployer"
class="org.jboss.wsf.stack.jbws.EventingDeployer"/>
<bean name="WSModifyWebMetaDataDeployer"
class="org.jboss.wsf.container.jboss42.ModifyWebMetaDataDeployer">
- <property name="serviceEndpointPublisher"><inject
bean="WSServiceEndpointPublisher"/></property>
+ <property name="webXMLRewriter"><inject
bean="WSWebXMLRewriter"/></property>
</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"/>
@@ -156,21 +154,18 @@
<property name="securityRolesHandlerEJB3"><inject
bean="WSSecurityRolesHandlerEJB3"/></property>
</bean>
<bean name="WSWebAppDeployerDeployer"
class="org.jboss.wsf.container.jboss42.WebAppDeployerDeployer">
- <property name="serviceEndpointPublisher"><inject
bean="WSServiceEndpointPublisher"/></property>
+ <property name="webXMLRewriter"><inject
bean="WSWebXMLRewriter"/></property>
</bean>
<!-- Deployer helper beans -->
<bean name="WSSecurityRolesHandlerEJB21"
class="org.jboss.wsf.container.jboss42.SecurityRolesHandlerEJB21"/>
<bean name="WSSecurityRolesHandlerEJB3"
class="org.jboss.wsf.container.jboss42.SecurityRolesHandlerEJB3"/>
- <bean name="WSServiceEndpointPublisher"
class="org.jboss.wsf.spi.deployment.ServiceEndpointPublisher">
+ <bean name="WSWebAppDesciptorModifier"
class="org.jboss.wsf.stack.jbws.WebAppDesciptorModifierImpl">
<property
name="servletClass">org.jboss.wsf.stack.jbws.ServiceEndpointServlet</property>
</bean>
- <bean name="WSDeploymentInfoAdapter"
class="org.jboss.wsf.container.jboss42.DeploymentInfoAdapter">
- <property name="appMetaDataAdapter"><inject
bean="WSAppMetaDataAdapter"/></property>
- <property name="webMetaDataAdapter"><inject
bean="WSWebMetaDataAdapter"/></property>
+ <bean name="WSWebXMLRewriter"
class="org.jboss.wsf.spi.deployment.WebXMLRewriter">
+ <property name="desciptorModifier"><inject
bean="WSWebAppDesciptorModifier"/></property>
</bean>
- <bean name="WSAppMetaDataAdapter"
class="org.jboss.wsf.container.jboss42.ApplicationMetaDataAdapter"/>
- <bean name="WSWebMetaDataAdapter"
class="org.jboss.wsf.container.jboss42.WebMetaDataAdapter"/>
<!--
Register DeployerHooks with JBoss deployers
Modified:
trunk/integration/jbws/src/main/resources/jbossws-jbws50.sar/META-INF/jbossws-beans.xml
===================================================================
---
trunk/integration/jbws/src/main/resources/jbossws-jbws50.sar/META-INF/jbossws-beans.xml 2007-05-19
16:25:26 UTC (rev 3149)
+++
trunk/integration/jbws/src/main/resources/jbossws-jbws50.sar/META-INF/jbossws-beans.xml 2007-05-20
00:29:48 UTC (rev 3150)
@@ -153,7 +153,7 @@
<bean name="WSEndpointRegistryDeployer"
class="org.jboss.wsf.spi.deployment.EndpointRegistryDeployer"/>
<bean name="WSEventingDeployer"
class="org.jboss.wsf.stack.jbws.EventingDeployer"/>
<bean name="WSModifyWebMetaDataDeployer"
class="org.jboss.wsf.container.jboss50.ModifyWebMetaDataDeployer">
- <property
name="servletClass">org.jboss.wsf.stack.jbws.ServiceEndpointServlet</property>
+ <property name="servletClass"><inject
bean="WSWebAppDesciptorModifier"
property="servletClass"/></property>
</bean>
<bean name="WSPublishContractDeployer"
class="org.jboss.wsf.stack.jbws.PublishContractDeployer"/>
<bean name="WSServiceEndpointInvokerDeployer"
class="org.jboss.wsf.stack.jbws.ServiceEndpointInvokerDeployer"/>
@@ -166,16 +166,19 @@
<property name="securityRolesHandlerEJB3"><inject
bean="WSSecurityRolesHandlerEJB3"/></property>
</bean>
<bean name="WSWebAppDeployerDeployer"
class="org.jboss.wsf.container.jboss50.WebAppDeployerDeployer">
- <property name="serviceEndpointPublisher"><inject
bean="WSServiceEndpointPublisher"/></property>
+ <property name="webXMLRewriter"><inject
bean="WSWebXMLRewriter"/></property>
<property name="mainDeployer"><inject
bean="MainDeployer"/></property>
</bean>
<!-- Deployer helper beans -->
<bean name="WSSecurityRolesHandlerEJB21"
class="org.jboss.wsf.container.jboss50.SecurityRolesHandlerEJB21"/>
<bean name="WSSecurityRolesHandlerEJB3"
class="org.jboss.wsf.container.jboss50.SecurityRolesHandlerEJB3"/>
- <bean name="WSServiceEndpointPublisher"
class="org.jboss.wsf.spi.deployment.ServiceEndpointPublisher">
- <property name="servletClass"><inject
bean="WSModifyWebMetaDataDeployer"
property="servletClass"/></property>
+ <bean name="WSWebAppDesciptorModifier"
class="org.jboss.wsf.stack.jbws.WebAppDesciptorModifierImpl">
+ <property
name="servletClass">org.jboss.wsf.stack.jbws.ServiceEndpointServlet</property>
</bean>
+ <bean name="WSWebXMLRewriter"
class="org.jboss.wsf.spi.deployment.WebXMLRewriter">
+ <property name="desciptorModifier"><inject
bean="WSWebAppDesciptorModifier"/></property>
+ </bean>
<!--
Register DeployerHooks with JBoss deployers
Modified: trunk/integration/spi/.classpath
===================================================================
--- trunk/integration/spi/.classpath 2007-05-19 16:25:26 UTC (rev 3149)
+++ trunk/integration/spi/.classpath 2007-05-20 00:29:48 UTC (rev 3150)
@@ -6,7 +6,7 @@
<classpathentry kind="lib"
path="thirdparty/jboss-common-core.jar"/>
<classpathentry kind="lib"
path="thirdparty/jboss-container.jar"/>
<classpathentry kind="lib"
path="thirdparty/jboss-dependency.jar"/>
- <classpathentry kind="lib"
path="thirdparty/jboss-deployers.jar"/>
+ <classpathentry kind="lib" path="thirdparty/jboss-deployers.jar"
sourcepath="thirdparty/jboss-deployers-src.zip"/>
<classpathentry kind="lib"
path="thirdparty/jboss-logging-log4j.jar"/>
<classpathentry kind="lib"
path="thirdparty/jboss-logging-spi.jar"/>
<classpathentry kind="lib"
path="thirdparty/jboss-microcontainer.jar"/>
Modified:
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/ContextRootDeployer.java
===================================================================
---
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/ContextRootDeployer.java 2007-05-19
16:25:26 UTC (rev 3149)
+++
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/ContextRootDeployer.java 2007-05-20
00:29:48 UTC (rev 3150)
@@ -40,7 +40,8 @@
String contextRoot = null;
// #1 Use the explicit context root from the web meta data
- UnifiedWebMetaData webMetaData =
dep.getContext().getAttachment(UnifiedWebMetaData.class);
+ UnifiedDeploymentInfo udi =
dep.getContext().getAttachment(UnifiedDeploymentInfo.class);
+ UnifiedWebMetaData webMetaData = udi.getAttachment(UnifiedWebMetaData.class);
if (webMetaData != null)
contextRoot = webMetaData.getContextRoot();
@@ -64,7 +65,6 @@
// #3 Use the implicit context root derived from the deployment name
if (contextRoot == null)
{
- UnifiedDeploymentInfo udi =
dep.getContext().getAttachment(UnifiedDeploymentInfo.class);
String name = udi.simpleName;
contextRoot = name.substring(0, name.length() - 4);
if (udi.parent != null)
Deleted:
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/ServiceEndpointPublisher.java
===================================================================
---
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/ServiceEndpointPublisher.java 2007-05-19
16:25:26 UTC (rev 3149)
+++
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/ServiceEndpointPublisher.java 2007-05-20
00:29:48 UTC (rev 3150)
@@ -1,261 +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.spi.deployment;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.ws.WebServiceException;
-
-import org.jboss.logging.Logger;
-import org.jboss.wsf.spi.utils.DOMUtils;
-import org.jboss.wsf.spi.utils.DOMWriter;
-import org.jboss.wsf.spi.utils.IOUtils;
-import org.w3c.dom.Element;
-
-/**
- * The publisher for web service endpoints
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 12-May-2006
- */
-public class ServiceEndpointPublisher
-{
- // logging support
- private static Logger log = Logger.getLogger(ServiceEndpointPublisher.class);
-
- // The configured service endpoint servlet
- private String servletClass;
-
- // The results of the URL rewriting
- public class RewriteResults
- {
- // The URL to the rewrittn web.xml
- public URL webXML;
- // Maps the servlet name to the target bean
- public Map<String, String> sepTargetMap = new HashMap<String,
String>();
- }
-
- public String getServletClass()
- {
- return servletClass;
- }
-
- public void setServletClass(String servletClass)
- {
- this.servletClass = servletClass;
- }
-
- public RewriteResults rewriteWebXml(UnifiedDeploymentInfo udi)
- {
- URL warURL = udi.webappURL;
- File warFile = new File(warURL.getFile());
- if (warFile.isDirectory() == false)
- throw new WebServiceException("Expected a war directory: " + warURL);
-
- File webXML = new File(warURL.getFile() + "/WEB-INF/web.xml");
- if (webXML.isFile() == false)
- throw new WebServiceException("Cannot find web.xml: " + webXML);
-
- try
- {
- // After redeployment there might be a stale copy of the original
web.xml.org,
we delete it
- File orgWebXML = new File(webXML.getCanonicalPath() + ".org");
- orgWebXML.delete();
-
- // Rename the web.xml
- if (webXML.renameTo(orgWebXML) == false)
- throw new WebServiceException("Cannot rename web.xml: " +
orgWebXML);
-
- FileInputStream stream = new FileInputStream(orgWebXML);
- return rewriteWebXml(stream, webXML, udi.classLoader);
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception e)
- {
- throw new WebServiceException(e);
- }
- }
-
- private RewriteResults rewriteWebXml(InputStream source, File dest, ClassLoader
loader) throws Exception
- {
- if (dest == null)
- {
- dest = File.createTempFile("jbossws-alt-web", "xml",
IOUtils.createTempDirectory());
- dest.deleteOnExit();
- }
-
- Element root = DOMUtils.parse(source);
- RewriteResults results = modifyServletConfig(root, loader);
- results.webXML = dest.toURL();
-
- FileOutputStream fos = new FileOutputStream(dest);
- new DOMWriter(fos).setPrettyprint(true).print(root);
- fos.flush();
- fos.close();
-
- return results;
- }
-
- private RewriteResults modifyServletConfig(Element root, ClassLoader loader) throws
ClassNotFoundException
- {
- RewriteResults results = new RewriteResults();
- Iterator itServlets = DOMUtils.getChildElements(root, "servlet");
- while (itServlets.hasNext())
- {
- Element servletElement = (Element)itServlets.next();
- String linkName =
DOMUtils.getTextContent(DOMUtils.getFirstChildElement(servletElement,
"servlet-name"));
-
- // find the servlet-class
- Element classElement = DOMUtils.getFirstChildElement(servletElement,
"servlet-class");
-
- // JSP
- if (classElement == null)
- continue;
-
- String orgServletClassName = DOMUtils.getTextContent(classElement).trim();
-
- // Get the servlet class
- Class orgServletClass = null;
- if (loader != null)
- {
- try
- {
- orgServletClass = loader.loadClass(orgServletClassName);
- }
- catch (ClassNotFoundException ex)
- {
- log.warn("Cannot load servlet class: " + orgServletClassName);
- }
- }
-
- String targetBeanName = null;
-
- // Nothing to do if we have an <init-param>
- if (isAlreadyModified(servletElement))
- {
- Iterator itParams = DOMUtils.getChildElements(servletElement,
"init-param");
- while (itParams.hasNext())
- {
- Element elParam = (Element)itParams.next();
- Element elParamName = DOMUtils.getFirstChildElement(elParam,
"param-name");
- Element elParamValue = DOMUtils.getFirstChildElement(elParam,
"param-value");
- if
(Endpoint.SEPID_DOMAIN_ENDPOINT.equals(DOMUtils.getTextContent(elParamName)))
- {
- targetBeanName = DOMUtils.getTextContent(elParamValue);
- }
- }
- }
- else
- {
- // Check if it is a real servlet that we can ignore
- if (orgServletClass != null &&
javax.servlet.Servlet.class.isAssignableFrom(orgServletClass))
- {
- log.info("Ignore servlet: " + orgServletClassName);
- continue;
- }
- else if (orgServletClassName.endsWith("Servlet"))
- {
- log.info("Ignore <servlet-class> that ends with
'Servlet': " + orgServletClassName);
- continue;
- }
-
- // build a list of detached elements that come after <servlet-class>
- boolean startDetach = false;
- List<Element> detachedElements = new ArrayList<Element>();
- Iterator itDetached = DOMUtils.getChildElements(servletElement);
- while (itDetached.hasNext())
- {
- Element el = (Element)itDetached.next();
- if (startDetach == true)
- {
- detachedElements.add(el);
- servletElement.removeChild(el);
- }
- if (el.equals(classElement))
- {
- servletElement.removeChild(el);
- startDetach = true;
- }
- }
-
- // replace the class name
- classElement = (Element)DOMUtils.createElement("servlet-class");
- classElement.appendChild(DOMUtils.createTextNode(servletClass));
- classElement =
(Element)servletElement.getOwnerDocument().importNode(classElement, true);
- servletElement.appendChild(classElement);
-
- // add additional init params
- if (orgServletClassName.equals(servletClass) == false)
- {
- Element paramElement = DOMUtils.createElement("init-param");
-
paramElement.appendChild(DOMUtils.createElement("param-name")).appendChild(DOMUtils.createTextNode(Endpoint.SEPID_DOMAIN_ENDPOINT));
-
paramElement.appendChild(DOMUtils.createElement("param-value")).appendChild(DOMUtils.createTextNode(orgServletClassName));
- paramElement =
(Element)servletElement.getOwnerDocument().importNode(paramElement, true);
- servletElement.appendChild(paramElement);
- targetBeanName = orgServletClassName;
- }
-
- // reattach the elements
- itDetached = detachedElements.iterator();
- while (itDetached.hasNext())
- {
- Element el = (Element)itDetached.next();
- servletElement.appendChild(el);
- }
- }
-
- if (targetBeanName == null)
- throw new IllegalStateException("Cannot obtain service endpoint bean
for: " + linkName);
-
- // remember the target bean name
- results.sepTargetMap.put(linkName, targetBeanName.trim());
- }
-
- return results;
- }
-
- // Return true if the web.xml is already modified
- private boolean isAlreadyModified(Element servletElement)
- {
- Iterator itParams = DOMUtils.getChildElements(servletElement,
"init-param");
- while (itParams.hasNext())
- {
- Element elParam = (Element)itParams.next();
- Element elParamName = DOMUtils.getFirstChildElement(elParam,
"param-name");
- if
(Endpoint.SEPID_DOMAIN_ENDPOINT.equals(DOMUtils.getTextContent(elParamName)))
- return true;
- }
- return false;
- }
-}
\ No newline at end of file
Modified:
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/URLPatternDeployer.java
===================================================================
---
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/URLPatternDeployer.java 2007-05-19
16:25:26 UTC (rev 3149)
+++
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/URLPatternDeployer.java 2007-05-20
00:29:48 UTC (rev 3150)
@@ -49,7 +49,8 @@
String urlPattern = null;
// #1 For JSE lookup the url-pattern from the servlet mappings
- UnifiedWebMetaData webMetaData =
dep.getContext().getAttachment(UnifiedWebMetaData.class);
+ UnifiedDeploymentInfo udi =
dep.getContext().getAttachment(UnifiedDeploymentInfo.class);
+ UnifiedWebMetaData webMetaData = udi.getAttachment(UnifiedWebMetaData.class);
if (webMetaData != null)
{
String epName = ep.getShortName();
Added:
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/WebAppDesciptorModifier.java
===================================================================
---
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/WebAppDesciptorModifier.java
(rev 0)
+++
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/WebAppDesciptorModifier.java 2007-05-20
00:29:48 UTC (rev 3150)
@@ -0,0 +1,48 @@
+/*
+ * 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.spi.deployment;
+
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.dom4j.Document;
+
+/**
+ * Modifies the web app according to the stack requirements.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 19-May-2007
+ */
+public interface WebAppDesciptorModifier
+{
+ // The results of the URL rewriting
+ public class RewriteResults
+ {
+ // The URL to the rewrittn web.xml
+ public URL webXML;
+ // Maps the servlet name to the target bean
+ public Map<String, String> sepTargetMap = new HashMap<String,
String>();
+ }
+
+ RewriteResults modifyDescriptor(Deployment dep, Document webXml) throws
ClassNotFoundException;
+}
\ No newline at end of file
Property changes on:
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/WebAppDesciptorModifier.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied:
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/WebXMLRewriter.java (from
rev 3149,
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/ServiceEndpointPublisher.java)
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/WebXMLRewriter.java
(rev 0)
+++
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/WebXMLRewriter.java 2007-05-20
00:29:48 UTC (rev 3150)
@@ -0,0 +1,117 @@
+/*
+ * 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.spi.deployment;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.net.URL;
+
+import javax.xml.ws.WebServiceException;
+
+import org.dom4j.Document;
+import org.dom4j.io.OutputFormat;
+import org.dom4j.io.SAXReader;
+import org.dom4j.io.XMLWriter;
+import org.jboss.wsf.spi.deployment.WebAppDesciptorModifier.RewriteResults;
+import org.jboss.wsf.spi.utils.IOUtils;
+
+/**
+ * The rewriter for web.xml
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 19-May-2007
+ */
+public class WebXMLRewriter
+{
+ private WebAppDesciptorModifier desciptorModifier;
+
+ public WebAppDesciptorModifier getDesciptorModifier()
+ {
+ return desciptorModifier;
+ }
+
+ public void setDesciptorModifier(WebAppDesciptorModifier desciptorModifier)
+ {
+ this.desciptorModifier = desciptorModifier;
+ }
+
+ public RewriteResults rewriteWebXml(Deployment dep)
+ {
+ UnifiedDeploymentInfo udi =
dep.getContext().getAttachment(UnifiedDeploymentInfo.class);
+
+ URL warURL = udi.webappURL;
+ File warFile = new File(warURL.getFile());
+ if (warFile.isDirectory() == false)
+ throw new WebServiceException("Expected a war directory: " + warURL);
+
+ File webXML = new File(warURL.getFile() + "/WEB-INF/web.xml");
+ if (webXML.isFile() == false)
+ throw new WebServiceException("Cannot find web.xml: " + webXML);
+
+ try
+ {
+ // After redeployment there might be a stale copy of the original
web.xml.org,
we delete it
+ File orgWebXML = new File(webXML.getCanonicalPath() + ".org");
+ orgWebXML.delete();
+
+ // Rename the web.xml
+ if (webXML.renameTo(orgWebXML) == false)
+ throw new WebServiceException("Cannot rename web.xml: " +
orgWebXML);
+
+ FileInputStream stream = new FileInputStream(orgWebXML);
+ return rewriteWebXml(stream, webXML, dep);
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception e)
+ {
+ throw new WebServiceException(e);
+ }
+ }
+
+ private RewriteResults rewriteWebXml(InputStream source, File destFile, Deployment
dep) throws Exception
+ {
+ if (destFile == null)
+ {
+ destFile = File.createTempFile("jbossws-alt-web", "xml",
IOUtils.createTempDirectory());
+ destFile.deleteOnExit();
+ }
+
+ SAXReader reader = new SAXReader();
+ Document document = reader.read(source);
+
+ RewriteResults results = desciptorModifier.modifyDescriptor(dep, document);
+ results.webXML = destFile.toURL();
+
+ FileOutputStream fos = new FileOutputStream(destFile);
+ OutputFormat format = OutputFormat.createPrettyPrint();
+ XMLWriter writer = new XMLWriter(fos, format);
+ writer.write(document);
+ writer.close();
+
+ return results;
+ }
+}
\ No newline at end of file
Modified: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/utils/IOUtils.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/spi/utils/IOUtils.java 2007-05-19
16:25:26 UTC (rev 3149)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/spi/utils/IOUtils.java 2007-05-20
00:29:48 UTC (rev 3150)
@@ -37,7 +37,6 @@
import javax.activation.DataHandler;
import javax.xml.ws.WebServiceException;
-import org.jboss.logging.Logger;
import org.jboss.wsf.spi.management.ServerConfig;
import org.jboss.wsf.spi.management.ServerConfigFactory;
@@ -48,8 +47,6 @@
*/
public final class IOUtils
{
- private static Logger log = Logger.getLogger(IOUtils.class);
-
// Hide the constructor
private IOUtils()
{
@@ -86,12 +83,12 @@
r = reader.read(bytes);
}
}
-
+
public static byte[] convertToBytes(DataHandler dh)
{
try
{
- ByteArrayOutputStream buffOS= new ByteArrayOutputStream();
+ ByteArrayOutputStream buffOS = new ByteArrayOutputStream();
dh.writeTo(buffOS);
return buffOS.toByteArray();
}
@@ -123,12 +120,12 @@
public static File createTempDirectory() throws IOException
{
File tmpdir = null;
-
+
try
{
ServerConfigFactory factory = ServerConfigFactory.getInstance();
ServerConfig config = factory.getServerConfig();
-
+
tmpdir = new File(config.getServerTempDir().getCanonicalPath() +
"/jbossws");
tmpdir.mkdirs();
}
@@ -136,7 +133,7 @@
{
// Use the Java temp directory if there is no server config (the client)
}
-
+
return tmpdir;
}
}
Modified: trunk/integration/sunri/ant-import/build-thirdparty.xml
===================================================================
--- trunk/integration/sunri/ant-import/build-thirdparty.xml 2007-05-19 16:25:26 UTC (rev
3149)
+++ trunk/integration/sunri/ant-import/build-thirdparty.xml 2007-05-20 00:29:48 UTC (rev
3150)
@@ -71,6 +71,7 @@
<!-- The compile classpath for jboss50 integration -->
<path id="sunri50.integration.classpath">
<pathelement location="${spi.dir}/output/lib/jbossws-spi.jar"/>
+ <pathelement location="${jboss50.lib}/dom4j.jar"/>
<pathelement location="${jboss50.lib}/jboss-aop-jdk50.jar"/>
<pathelement location="${jboss50.lib}/jboss-common-core.jar"/>
<pathelement location="${jboss50.lib}/jboss-dependency.jar"/>
Modified: trunk/integration/sunri/build.xml
===================================================================
--- trunk/integration/sunri/build.xml 2007-05-19 16:25:26 UTC (rev 3149)
+++ trunk/integration/sunri/build.xml 2007-05-20 00:29:48 UTC (rev 3150)
@@ -129,6 +129,9 @@
<include name="jbossws-context.war"/>
</fileset>
-->
+ <fileset dir="${spi.dir}/thirdparty">
+ <include name="jaxrpc-api.jar"/>
+ </fileset>
<fileset dir="${thirdparty.dir}">
<include name="FastInfoset.jar"/>
<include name="http.jar"/>
Modified:
trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/InvokerEJB3.java
===================================================================
---
trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/InvokerEJB3.java 2007-05-19
16:25:26 UTC (rev 3149)
+++
trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/InvokerEJB3.java 2007-05-20
00:29:48 UTC (rev 3150)
@@ -27,7 +27,12 @@
import java.lang.reflect.Method;
import javax.xml.ws.Provider;
+import javax.xml.ws.WebServiceException;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.invocation.EndpointInvocation;
+import org.jboss.wsf.spi.invocation.InvocationHandler;
+
import com.sun.istack.NotNull;
import com.sun.xml.ws.api.message.Packet;
import com.sun.xml.ws.api.server.InstanceResolver;
@@ -44,7 +49,7 @@
public class InvokerEJB3 extends Invoker
{
private final InstanceResolver resolver;
-
+
public InvokerEJB3(InstanceResolver resolver)
{
this.resolver = resolver;
@@ -72,7 +77,35 @@
@Override
public Object invoke(Packet p, Method m, Object... args) throws
InvocationTargetException, IllegalAccessException
{
- Object targetBean = resolver.resolve(p);
- return m.invoke(targetBean, args);
+ Endpoint ep = EndpointAssociation.getEndpoint();
+
+ InvocationHandler invHandler = ep.getInvocationHandler();
+ EndpointInvocation inv = invHandler.createInvocation();
+ inv.setJavaMethod(m);
+ inv.setArgs(args);
+
+ Object retObj = null;
+ try
+ {
+ invHandler.invoke(ep, null, inv);
+ retObj = inv.getReturnValue();
+ }
+ catch (Exception ex)
+ {
+ handleException(ex);
+ }
+
+ return retObj;
}
-}
+
+ private void handleException(Exception ex) throws InvocationTargetException,
IllegalAccessException
+ {
+ if (ex instanceof InvocationTargetException)
+ throw (InvocationTargetException)ex;
+
+ if (ex instanceof IllegalAccessException)
+ throw (IllegalAccessException)ex;
+
+ throw new WebServiceException(ex);
+ }
+}
\ No newline at end of file
Modified:
trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/RequestHandlerImpl.java
===================================================================
---
trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/RequestHandlerImpl.java 2007-05-19
16:25:26 UTC (rev 3149)
+++
trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/RequestHandlerImpl.java 2007-05-20
00:29:48 UTC (rev 3150)
@@ -56,6 +56,9 @@
public void handleHttpRequest(Endpoint endpoint, HttpServletRequest req,
HttpServletResponse res, ServletContext context) throws ServletException, IOException
{
WSServletDelegate delegate =
(WSServletDelegate)context.getAttribute(WSServlet.JAXWS_RI_RUNTIME_INFO);
+ if (delegate == null)
+ throw new IllegalStateException("Cannot obtain servlet delegate");
+
String method = req.getMethod();
if (method.equals("POST"))
{
Modified:
trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/SunJaxwsDeployer.java
===================================================================
---
trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/SunJaxwsDeployer.java 2007-05-19
16:25:26 UTC (rev 3149)
+++
trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/SunJaxwsDeployer.java 2007-05-20
00:29:48 UTC (rev 3150)
@@ -23,12 +23,6 @@
//$Id$
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.jboss.metadata.WebMetaData;
-import org.jboss.metadata.web.Servlet;
-import org.jboss.metadata.web.ServletMapping;
import org.jboss.wsf.spi.deployment.AbstractDeployer;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
@@ -49,68 +43,14 @@
DDEndpoints dd = new DDEndpoints();
for (Endpoint ep : dep.getService().getEndpoints())
{
- String name = getName(dep, ep);
- String implBean = ep.getTargetBean();
- String urlPattern = getUrlPattern(dep, ep);
+ String epName = ep.getShortName();
+ String targetBean = ep.getTargetBean();
+ String urlPattern = ep.getURLPattern();
- DDEndpoint ddep = new DDEndpoint(name, implBean, urlPattern);
+ DDEndpoint ddep = new DDEndpoint(epName, targetBean, urlPattern);
log.info("Add " + ddep);
dd.addEndpoint(ddep);
}
dep.getContext().addAttachment(DDEndpoints.class, dd);
}
-
- private String getName(Deployment dep, Endpoint ep)
- {
- String name = null;
- String implBean = ep.getTargetBean();
- WebMetaData webMetaData = dep.getContext().getAttachment(WebMetaData.class);
- if (webMetaData != null)
- {
- for (Servlet servlet : webMetaData.getServlets())
- {
- String servletClass = servlet.getServletClass();
- if (implBean.equals(servletClass))
- {
- name = servlet.getName();
- }
- }
- }
- return name;
- }
-
- private String getUrlPattern(Deployment dep, Endpoint ep)
- {
- String urlPattern = null;
- String targetBean = ep.getTargetBean();
- WebMetaData webMetaData = dep.getContext().getAttachment(WebMetaData.class);
- if (webMetaData != null)
- {
- for (Servlet servlet : webMetaData.getServlets())
- {
- String name = servlet.getName();
- String servletClass = servlet.getServletClass();
- if (targetBean.equals(servletClass))
- {
- ServletMapping mapping = getServletMapping(webMetaData, name);
- ArrayList<String> urlPatterns = mapping.getUrlPatterns();
- if (urlPatterns.size() > 0)
- urlPattern = urlPatterns.get(0);
- }
- }
- }
- return urlPattern;
- }
-
- private ServletMapping getServletMapping(WebMetaData webMetaData, String name)
- {
- Iterator it = webMetaData.getServletMappings().iterator();
- while (it.hasNext())
- {
- ServletMapping mapping = (ServletMapping)it.next();
- if (name.equals(mapping.getName()))
- return mapping;
- }
- throw new IllegalStateException("Cannot obtian mapping for: " + name);
- }
}
\ No newline at end of file
Added:
trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/WebAppDesciptorModifierImpl.java
===================================================================
---
trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/WebAppDesciptorModifierImpl.java
(rev 0)
+++
trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/WebAppDesciptorModifierImpl.java 2007-05-20
00:29:48 UTC (rev 3150)
@@ -0,0 +1,135 @@
+/*
+ * 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.stack.sunri;
+
+import java.util.Iterator;
+
+import org.dom4j.Document;
+import org.dom4j.Element;
+import org.jboss.logging.Logger;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.WebAppDesciptorModifier;
+import org.jboss.wsf.stack.sunri.metadata.sunjaxws.DDEndpoints;
+
+/**
+ * Modifies web.xml for jbossws
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 19-May-2006
+ */
+public class WebAppDesciptorModifierImpl implements WebAppDesciptorModifier
+{
+ // logging support
+ private static Logger log = Logger.getLogger(WebAppDesciptorModifierImpl.class);
+
+ private String listenerClass;
+ private String servletClass;
+
+ public String getListenerClass()
+ {
+ return listenerClass;
+ }
+
+ public void setListenerClass(String listenerClass)
+ {
+ this.listenerClass = listenerClass;
+ }
+
+ public String getServletClass()
+ {
+ return servletClass;
+ }
+
+ public void setServletClass(String servletClass)
+ {
+ this.servletClass = servletClass;
+ }
+
+ public RewriteResults modifyDescriptor(Deployment dep, Document webXml) throws
ClassNotFoundException
+ {
+ RewriteResults results = new RewriteResults();
+
+ Element root = webXml.getRootElement();
+
+ DDEndpoints ddSunJaxws = dep.getContext().getAttachment(DDEndpoints.class);
+ if (ddSunJaxws == null)
+ throw new IllegalStateException("Cannot obtain sun-jaxws meta data");
+
+ Element contextParam = root.addElement("context-param");
+
contextParam.addElement("param-name").addText(WSServletContextListenerJBWS.PARAM_SUN_JAXWS_URL);
+
contextParam.addElement("param-value").addText(ddSunJaxws.createFileURL().toExternalForm());
+
+
root.addElement("listener").addElement("listener-class").addText(listenerClass);
+
+ for (Iterator it = root.elementIterator("servlet"); it.hasNext();)
+ {
+ Element servlet = (Element)it.next();
+ String linkName = servlet.element("servlet-name").getTextTrim();
+
+ // find the servlet-class
+ Element classElement = servlet.element("servlet-class");
+
+ // JSP
+ if (classElement == null)
+ continue;
+
+ String orgServletClassName = classElement.getTextTrim();
+
+ // Get the servlet class
+ Class orgServletClass = null;
+ try
+ {
+ ClassLoader loader = dep.getClassLoader();
+ orgServletClass = loader.loadClass(orgServletClassName);
+ }
+ catch (ClassNotFoundException ex)
+ {
+ log.warn("Cannot load servlet class: " + orgServletClassName);
+ }
+
+ String targetBeanName = null;
+
+ // Check if it is a real servlet that we can ignore
+ if (orgServletClass != null &&
javax.servlet.Servlet.class.isAssignableFrom(orgServletClass))
+ {
+ log.info("Ignore servlet: " + orgServletClassName);
+ continue;
+ }
+ else if (orgServletClassName.endsWith("Servlet"))
+ {
+ log.info("Ignore <servlet-class> that ends with 'Servlet':
" + orgServletClassName);
+ continue;
+ }
+
+ classElement.setText(servletClass);
+ targetBeanName = orgServletClassName;
+
+ if (targetBeanName == null)
+ throw new IllegalStateException("Cannot obtain service endpoint bean
for: " + linkName);
+
+ // remember the target bean name
+ results.sepTargetMap.put(linkName, targetBeanName);
+ }
+
+ return results;
+ }
+}
\ No newline at end of file
Property changes on:
trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/WebAppDesciptorModifierImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified:
trunk/integration/sunri/src/main/resources/jbossws-jboss50.sar/META-INF/jbossws-beans.xml
===================================================================
---
trunk/integration/sunri/src/main/resources/jbossws-jboss50.sar/META-INF/jbossws-beans.xml 2007-05-19
16:25:26 UTC (rev 3149)
+++
trunk/integration/sunri/src/main/resources/jbossws-jboss50.sar/META-INF/jbossws-beans.xml 2007-05-20
00:29:48 UTC (rev 3150)
@@ -102,6 +102,7 @@
<inject bean="WSUnifiedDeploymentInfoDeployer"/>
<inject bean="WSContextRootDeployer"/>
<inject bean="WSURLPatternDeployer"/>
+ <inject bean="WSSunJaxwsDeployer"/>
<inject bean="WSWebAppGeneratorDeployer"/>
<inject bean="WSWebAppDeployerDeployer"/>
</list>
@@ -137,26 +138,30 @@
<bean name="WSEndpointNameDeployer"
class="org.jboss.wsf.spi.deployment.EndpointNameDeployer"/>
<bean name="WSEndpointRegistryDeployer"
class="org.jboss.wsf.spi.deployment.EndpointRegistryDeployer"/>
<bean name="WSModifyWebMetaDataDeployer"
class="org.jboss.wsf.stack.sunri.ModifyWebMetaDataDeployer">
- <property
name="listenerClass">org.jboss.wsf.stack.sunri.WSServletContextListenerJBWS</property>
- <property
name="servletClass">org.jboss.wsf.stack.sunri.WSEndpointServletJBWS</property>
+ <property name="listenerClass"><inject
bean="WSWebAppDesciptorModifier"
property="listenerClass"/></property>
+ <property name="servletClass"><inject
bean="WSWebAppDesciptorModifier"
property="servletClass"/></property>
</bean>
<bean name="WSSunJaxwsDeployer"
class="org.jboss.wsf.stack.sunri.SunJaxwsDeployer"/>
+ <bean name="WSUnifiedDeploymentInfoDeployer"
class="org.jboss.wsf.container.jboss50.UnifiedDeploymentInfoDeployer"/>
+ <bean name="WSURLPatternDeployer"
class="org.jboss.wsf.spi.deployment.URLPatternDeployer"/>
<bean name="WSWebAppGeneratorDeployer"
class="org.jboss.wsf.spi.deployment.WebAppGeneratorDeployer">
<property name="securityRolesHandlerEJB3"><inject
bean="WSSecurityRolesHandlerEJB3"/></property>
</bean>
<bean name="WSWebAppDeployerDeployer"
class="org.jboss.wsf.container.jboss50.WebAppDeployerDeployer">
- <property name="serviceEndpointPublisher"><inject
bean="WSServiceEndpointPublisher"/></property>
+ <property name="webXMLRewriter"><inject
bean="WSWebXMLRewriter"/></property>
<property name="mainDeployer"><inject
bean="MainDeployer"/></property>
</bean>
- <bean name="WSUnifiedDeploymentInfoDeployer"
class="org.jboss.wsf.container.jboss50.UnifiedDeploymentInfoDeployer"/>
- <bean name="WSURLPatternDeployer"
class="org.jboss.wsf.spi.deployment.URLPatternDeployer"/>
<!-- Deployer helper beans -->
<bean name="WSSecurityRolesHandlerEJB21"
class="org.jboss.wsf.container.jboss50.SecurityRolesHandlerEJB21"/>
<bean name="WSSecurityRolesHandlerEJB3"
class="org.jboss.wsf.container.jboss50.SecurityRolesHandlerEJB3"/>
- <bean name="WSServiceEndpointPublisher"
class="org.jboss.wsf.spi.deployment.ServiceEndpointPublisher">
- <property name="servletClass"><inject
bean="WSModifyWebMetaDataDeployer"
property="servletClass"/></property>
+ <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.stack.sunri.WSEndpointServletJBWS</property>
</bean>
+ <bean name="WSWebXMLRewriter"
class="org.jboss.wsf.spi.deployment.WebXMLRewriter">
+ <property name="desciptorModifier"><inject
bean="WSWebAppDesciptorModifier"/></property>
+ </bean>
<!--
Register DeployerHooks with JBoss deployers
Modified: trunk/jbossws-core/.classpath
===================================================================
--- trunk/jbossws-core/.classpath 2007-05-19 16:25:26 UTC (rev 3149)
+++ trunk/jbossws-core/.classpath 2007-05-20 00:29:48 UTC (rev 3150)
@@ -33,5 +33,6 @@
<classpathentry kind="con"
path="org.eclipse.jdt.USER_LIBRARY/jboss-5.0.x"/>
<classpathentry combineaccessrules="false" kind="src"
path="/integration-spi"/>
<classpathentry kind="lib"
path="/integration-spi/thirdparty/junit.jar"/>
+ <classpathentry kind="lib" path="thirdparty/dom4j.jar"/>
<classpathentry kind="output" path="output-eclipse"/>
</classpath>
Modified: trunk/jbossws-core/ant-import/build-thirdparty.xml
===================================================================
--- trunk/jbossws-core/ant-import/build-thirdparty.xml 2007-05-19 16:25:26 UTC (rev 3149)
+++ trunk/jbossws-core/ant-import/build-thirdparty.xml 2007-05-20 00:29:48 UTC (rev 3150)
@@ -110,6 +110,7 @@
<pathelement
location="${thirdparty.dir}/ejb3.deployer/jboss-annotations-ejb3.jar"/>
<pathelement
location="${thirdparty.dir}/ejb3.deployer/jboss-ejb3x.jar"/>
<pathelement location="${thirdparty.dir}/activation.jar"/>
+ <pathelement location="${thirdparty.dir}/dom4j.jar"/>
<pathelement location="${thirdparty.dir}/getopt.jar"/>
<pathelement location="${thirdparty.dir}/javassist.jar"/>
<pathelement location="${thirdparty.dir}/jaxb-api.jar"/>
Added:
trunk/jbossws-core/src/main/java/org/jboss/wsf/stack/jbws/WebAppDesciptorModifierImpl.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/wsf/stack/jbws/WebAppDesciptorModifierImpl.java
(rev 0)
+++
trunk/jbossws-core/src/main/java/org/jboss/wsf/stack/jbws/WebAppDesciptorModifierImpl.java 2007-05-20
00:29:48 UTC (rev 3150)
@@ -0,0 +1,152 @@
+/*
+ * 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.stack.jbws;
+
+import java.util.Iterator;
+
+import org.dom4j.Document;
+import org.dom4j.Element;
+import org.jboss.logging.Logger;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.deployment.WebAppDesciptorModifier;
+
+/**
+ * Modifies web.xml for jbossws
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 19-May-2006
+ */
+public class WebAppDesciptorModifierImpl implements WebAppDesciptorModifier
+{
+ // logging support
+ private static Logger log = Logger.getLogger(WebAppDesciptorModifierImpl.class);
+
+ // The configured service endpoint servlet
+ private String servletClass;
+
+ public String getServletClass()
+ {
+ return servletClass;
+ }
+
+ public void setServletClass(String servletClass)
+ {
+ this.servletClass = servletClass;
+ }
+
+ public RewriteResults modifyDescriptor(Deployment dep, Document webXml) throws
ClassNotFoundException
+ {
+ RewriteResults results = new RewriteResults();
+
+ Element root = webXml.getRootElement();
+ for (Iterator it = root.elementIterator("servlet"); it.hasNext();)
+ {
+ Element servlet = (Element)it.next();
+ String linkName = servlet.element("servlet-name").getTextTrim();
+
+ // find the servlet-class
+ Element classElement = servlet.element("servlet-class");
+
+ // JSP
+ if (classElement == null)
+ continue;
+
+ String orgServletClassName = classElement.getTextTrim();
+
+ // Get the servlet class
+ Class orgServletClass = null;
+ try
+ {
+ ClassLoader loader = dep.getClassLoader();
+ orgServletClass = loader.loadClass(orgServletClassName);
+ }
+ catch (ClassNotFoundException ex)
+ {
+ log.warn("Cannot load servlet class: " + orgServletClassName);
+ }
+
+ String targetBeanName = null;
+
+ // Nothing to do if we have an <init-param>
+ if (isAlreadyModified(servlet))
+ {
+ for (Iterator itParam = servlet.elementIterator("init-param");
it.hasNext();)
+ {
+ Element elParam = (Element)itParam.next();
+ String paramName = elParam.element("param-name").getTextTrim();
+ String paramValue =
elParam.element("param-value").getTextTrim();
+ if (Endpoint.SEPID_DOMAIN_ENDPOINT.equals(paramName))
+ {
+ targetBeanName = paramValue;
+ }
+ }
+ }
+ else
+ {
+ // Check if it is a real servlet that we can ignore
+ if (orgServletClass != null &&
javax.servlet.Servlet.class.isAssignableFrom(orgServletClass))
+ {
+ log.info("Ignore servlet: " + orgServletClassName);
+ continue;
+ }
+ else if (orgServletClassName.endsWith("Servlet"))
+ {
+ log.info("Ignore <servlet-class> that ends with
'Servlet': " + orgServletClassName);
+ continue;
+ }
+
+ classElement.setText(servletClass);
+
+ // add additional init params
+ if (orgServletClassName.equals(servletClass) == false)
+ {
+ targetBeanName = orgServletClassName;
+ Element paramElement = classElement.addElement("init-param");
+
paramElement.addElement("param-name").addText(Endpoint.SEPID_DOMAIN_ENDPOINT);
+ paramElement.addElement("param-value").addText(targetBeanName);
+ }
+ }
+
+ if (targetBeanName == null)
+ throw new IllegalStateException("Cannot obtain service endpoint bean
for: " + linkName);
+
+ // remember the target bean name
+ results.sepTargetMap.put(linkName, targetBeanName);
+ }
+
+ return results;
+ }
+
+ // Return true if the web.xml is already modified
+ private boolean isAlreadyModified(Element servlet)
+ {
+ for (Iterator it = servlet.elementIterator("init-param"); it.hasNext();)
+ {
+ Element elParam = (Element)it.next();
+ String paramName = elParam.element("param-name").getTextTrim();
+ if (Endpoint.SEPID_DOMAIN_ENDPOINT.equals(paramName))
+ return true;
+ }
+ return false;
+ }
+}
\ No newline at end of file
Property changes on:
trunk/jbossws-core/src/main/java/org/jboss/wsf/stack/jbws/WebAppDesciptorModifierImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF