JBossWS SVN: r7071 - container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/transport.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2008-05-16 17:06:37 -0400 (Fri, 16 May 2008)
New Revision: 7071
Added:
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/transport/BareTransportManagerFactory.java
Log:
adding transport manager factory impl
Added: container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/transport/BareTransportManagerFactory.java
===================================================================
--- container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/transport/BareTransportManagerFactory.java (rev 0)
+++ container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/transport/BareTransportManagerFactory.java 2008-05-16 21:06:37 UTC (rev 7071)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.container.jboss50.transport;
+
+import org.jboss.wsf.spi.transport.TransportManagerFactory;
+import org.jboss.wsf.spi.transport.TransportManager;
+import org.jboss.wsf.spi.transport.Protocol;
+
+/**
+ * Used with MC
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class BareTransportManagerFactory implements TransportManagerFactory
+{
+
+ private TransportManager httpTransport;
+
+
+ public void setHttpTransport(TransportManager httpTransport)
+ {
+ this.httpTransport = httpTransport;
+ }
+
+ public TransportManager createTransportManager(Protocol protocol)
+ {
+ TransportManager manager = null;
+
+ switch(protocol)
+ {
+ case HTTP:
+ manager = httpTransport;
+ break;
+ default:
+ throw new IllegalArgumentException("No TransportManager for protocol: " + protocol);
+ }
+
+ return manager;
+ }
+}
+
Property changes on: container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/transport/BareTransportManagerFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
16 years, 7 months
JBossWS SVN: r7070 - container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/wsf/container/jboss50/transport.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2008-05-16 17:01:30 -0400 (Fri, 16 May 2008)
New Revision: 7070
Modified:
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/wsf/container/jboss50/transport/WSFRuntimeDelegateHttpServer.java
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/wsf/container/jboss50/transport/WebAppGenerator.java
Log:
optimization
Modified: container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/wsf/container/jboss50/transport/WSFRuntimeDelegateHttpServer.java
===================================================================
--- container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/wsf/container/jboss50/transport/WSFRuntimeDelegateHttpServer.java 2008-05-16 21:00:41 UTC (rev 7069)
+++ container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/wsf/container/jboss50/transport/WSFRuntimeDelegateHttpServer.java 2008-05-16 21:01:30 UTC (rev 7070)
@@ -28,7 +28,11 @@
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.WSFRuntime;
import org.jboss.wsf.spi.WSFRuntimeLocator;
-import org.jboss.wsf.spi.deployment.*;
+import org.jboss.wsf.spi.deployment.AbstractExtensible;
+import org.jboss.wsf.spi.deployment.ArchiveDeployment;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.DeploymentModelFactory;
+import org.jboss.wsf.spi.deployment.Service;
import org.jboss.wsf.spi.http.HttpContext;
import org.jboss.wsf.spi.http.HttpContextFactory;
import org.jboss.wsf.spi.http.HttpServer;
Modified: container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/wsf/container/jboss50/transport/WebAppGenerator.java
===================================================================
--- container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/wsf/container/jboss50/transport/WebAppGenerator.java 2008-05-16 21:00:41 UTC (rev 7069)
+++ container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/wsf/container/jboss50/transport/WebAppGenerator.java 2008-05-16 21:01:30 UTC (rev 7070)
@@ -41,13 +41,11 @@
import org.jboss.wsf.spi.annotation.WebContext;
import org.jboss.wsf.spi.deployment.ArchiveDeployment;
import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.DeploymentAspect;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.deployment.WSFDeploymentException;
import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData;
import org.jboss.wsf.spi.metadata.j2ee.EJBMetaData;
import org.jboss.wsf.spi.metadata.j2ee.EJBSecurityMetaData;
-import org.jboss.wsf.spi.WSFRuntime;
import org.jboss.wsf.container.jboss50.deployment.tomcat.SecurityHandler;
/**
16 years, 7 months
JBossWS SVN: r7069 - in container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50: transport and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2008-05-16 17:00:41 -0400 (Fri, 16 May 2008)
New Revision: 7069
Added:
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/transport/WebAppGenerator.java
Removed:
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/WebApp50GeneratorDeploymentAspect.java
Log:
refactoring
Deleted: container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/WebApp50GeneratorDeploymentAspect.java
===================================================================
--- container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/WebApp50GeneratorDeploymentAspect.java 2008-05-16 19:27:58 UTC (rev 7068)
+++ container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/WebApp50GeneratorDeploymentAspect.java 2008-05-16 21:00:41 UTC (rev 7069)
@@ -1,54 +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 org.dom4j.Document;
-import org.jboss.wsf.framework.deployment.WebAppGeneratorDeploymentAspect;
-import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.SecurityHandler;
-
-/**
- * Add doctype declarations to the generated descriptors
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 13-Oct-2007
- */
-public class WebApp50GeneratorDeploymentAspect extends WebAppGeneratorDeploymentAspect
-{
- @Override
- protected Document createWebAppDescriptor(Deployment dep, SecurityHandler securityHandler)
- {
- Document document = super.createWebAppDescriptor(dep, securityHandler);
- document.addDocType("web-app", "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN", "http://java.sun.com/dtd/web-app_2_3.dtd");
- return document;
- }
-
- @Override
- protected Document createJBossWebAppDescriptor(Deployment dep, SecurityHandler securityHandler)
- {
- Document document = super.createJBossWebAppDescriptor(dep, securityHandler);
- document.addDocType("jboss-web", "-//JBoss//DTD Web Application 5.0//EN", "http://www.jboss.org/j2ee/dtd/jboss-web_5_0.dtd");
- return document;
- }
-}
Added: container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/transport/WebAppGenerator.java
===================================================================
--- container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/transport/WebAppGenerator.java (rev 0)
+++ container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/transport/WebAppGenerator.java 2008-05-16 21:00:41 UTC (rev 7069)
@@ -0,0 +1,286 @@
+/*
+ * 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.transport;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.net.URL;
+import java.util.ArrayList;
+
+import org.jboss.wsf.framework.deployment.WebAppGeneratorDeploymentAspect;
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.WSFRuntime;
+import org.jboss.wsf.spi.annotation.WebContext;
+import org.jboss.wsf.spi.deployment.ArchiveDeployment;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.deployment.SecurityHandler;
+import org.jboss.wsf.spi.deployment.WSFDeploymentException;
+import org.jboss.wsf.spi.management.ServerConfig;
+import org.jboss.wsf.spi.management.ServerConfigFactory;
+import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.EJBMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.EJBSecurityMetaData;
+import org.dom4j.Document;
+import org.dom4j.DocumentHelper;
+import org.dom4j.Element;
+import org.dom4j.io.OutputFormat;
+import org.dom4j.io.XMLWriter;
+
+/**
+ * A deployer that generates a webapp for an EJB endpoint
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ *
+ * @since 25-Apr-2007
+ */
+public class WebAppGenerator
+{
+ private SecurityHandler securityHandlerEJB21;
+ private SecurityHandler securityHandlerEJB3;
+
+ public void setSecurityHandlerEJB21(SecurityHandler handler)
+ {
+ this.securityHandlerEJB21 = handler;
+ }
+
+ public void setSecurityHandlerEJB3(SecurityHandler handler)
+ {
+ this.securityHandlerEJB3 = handler;
+ }
+
+ public URL create(Deployment dep)
+ {
+ String typeStr = dep.getType().toString();
+ URL webAppURL = null;
+ if (typeStr.endsWith("EJB21"))
+ {
+ webAppURL = generatWebDeployment((ArchiveDeployment)dep, securityHandlerEJB21);
+ dep.setProperty("org.jboss.ws.webapp.url", webAppURL);
+ }
+ else if (typeStr.endsWith("EJB3"))
+ {
+ webAppURL = generatWebDeployment((ArchiveDeployment)dep, securityHandlerEJB3);
+ dep.setProperty("org.jboss.ws.webapp.url", webAppURL);
+ }
+ else
+ {
+ webAppURL = generatWebDeployment((ArchiveDeployment)dep, null);
+ dep.setProperty("org.jboss.ws.webapp.url", webAppURL);
+ }
+
+ return webAppURL;
+ }
+
+ protected URL generatWebDeployment(ArchiveDeployment dep, SecurityHandler securityHandler)
+ {
+ Document webDoc = createWebAppDescriptor(dep, securityHandler);
+ Document jbossDoc = createJBossWebAppDescriptor(dep, securityHandler);
+
+ File tmpWar = null;
+ try
+ {
+ // TODO: recursive dependency, ohoh
+ SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ ServerConfig config = spiProvider.getSPI(ServerConfigFactory.class).getServerConfig();
+ File tmpdir = new File(config.getServerTempDir().getCanonicalPath() + "/deploy");
+
+ String deploymentName = dep.getCanonicalName().replace('/', '-');
+ tmpWar = File.createTempFile(deploymentName, ".war", tmpdir);
+ tmpWar.delete();
+
+ File webInf = new File(tmpWar, "WEB-INF");
+ webInf.mkdirs();
+
+ File webXml = new File(webInf, "web.xml");
+ FileWriter fw = new FileWriter(webXml);
+ OutputFormat format = OutputFormat.createPrettyPrint();
+ XMLWriter writer = new XMLWriter(fw, format);
+ writer.write(webDoc);
+ writer.close();
+
+ File jbossWebXml = new File(webInf, "jboss-web.xml");
+ fw = new FileWriter(jbossWebXml);
+ writer = new XMLWriter(fw, format);
+ writer.write(jbossDoc);
+ writer.close();
+
+ return tmpWar.toURL();
+ }
+ catch (IOException e)
+ {
+ throw new WSFDeploymentException("Failed to create webservice.war", e);
+ }
+ }
+
+ protected Document createWebAppDescriptor(Deployment dep, SecurityHandler securityHandler)
+ {
+ Document document = DocumentHelper.createDocument();
+ Element webApp = document.addElement("web-app");
+
+ /*
+ <servlet>
+ <servlet-name>
+ <servlet-class>
+ </servlet>
+ */
+ for (Endpoint ep : dep.getService().getEndpoints())
+ {
+ Element servlet = webApp.addElement("servlet");
+ servlet.addElement("servlet-name").addText(ep.getShortName());
+ servlet.addElement("servlet-class").addText(ep.getTargetBeanName());
+ }
+
+ /*
+ <servlet-mapping>
+ <servlet-name>
+ <url-pattern>
+ </servlet-mapping>
+ */
+ ArrayList urlPatters = new ArrayList();
+ for (Endpoint ep : dep.getService().getEndpoints())
+ {
+ Element servletMapping = webApp.addElement("servlet-mapping");
+ servletMapping.addElement("servlet-name").addText(ep.getShortName());
+ servletMapping.addElement("url-pattern").addText(ep.getURLPattern());
+ }
+
+ String authMethod = null;
+
+ // Add web-app/security-constraint for each port component
+ for (Endpoint ep : dep.getService().getEndpoints())
+ {
+ String ejbName = ep.getShortName();
+
+ Boolean secureWSDLAccess = null;
+ String transportGuarantee = null;
+ String beanAuthMethod = null;
+
+ WebContext anWebContext = (WebContext)ep.getTargetBeanClass().getAnnotation(WebContext.class);
+ if (anWebContext != null)
+ {
+ if (anWebContext.authMethod().length() > 0)
+ beanAuthMethod = anWebContext.authMethod();
+ if (anWebContext.transportGuarantee().length() > 0)
+ transportGuarantee = anWebContext.transportGuarantee();
+ if (anWebContext.secureWSDLAccess())
+ secureWSDLAccess = anWebContext.secureWSDLAccess();
+ }
+
+ EJBArchiveMetaData appMetaData = dep.getAttachment(EJBArchiveMetaData.class);
+ if (appMetaData != null && appMetaData.getBeanByEjbName(ejbName) != null)
+ {
+ EJBMetaData bmd = appMetaData.getBeanByEjbName(ejbName);
+ EJBSecurityMetaData smd = bmd.getSecurityMetaData();
+ if (smd != null)
+ {
+ beanAuthMethod = smd.getAuthMethod();
+ transportGuarantee = smd.getTransportGuarantee();
+ secureWSDLAccess = smd.getSecureWSDLAccess();
+ }
+ }
+
+ if (beanAuthMethod != null || transportGuarantee != null)
+ {
+ /*
+ <security-constraint>
+ <web-resource-collection>
+ <web-resource-name>TestUnAuthPort</web-resource-name>
+ <url-pattern>/HSTestRoot/TestUnAuth/*</url-pattern>
+ </web-resource-collection>
+ <auth-constraint>
+ <role-name>*</role-name>
+ </auth-constraint>
+ <user-data-constraint>
+ <transport-guarantee>NONE</transport-guarantee>
+ </user-data-constraint>
+ </security-constraint>
+ */
+ Element securityConstraint = webApp.addElement("security-constraint");
+ Element wrc = securityConstraint.addElement("web-resource-collection");
+ wrc.addElement("web-resource-name").addText(ejbName);
+ wrc.addElement("url-pattern").addText(ep.getURLPattern());
+ if (Boolean.TRUE.equals(secureWSDLAccess))
+ {
+ wrc.addElement("http-method").addText("GET");
+ }
+ wrc.addElement("http-method").addText("POST");
+
+ // Optional auth-constraint
+ if (beanAuthMethod != null)
+ {
+ // Only the first auth-method gives the war login-config/auth-method
+ if (authMethod == null)
+ authMethod = beanAuthMethod;
+
+ Element authConstraint = securityConstraint.addElement("auth-constraint").addElement("role-name").addText("*");
+ }
+ // Optional user-data-constraint
+ if (transportGuarantee != null)
+ {
+ Element userData = securityConstraint.addElement("user-data-constraint");
+ userData.addElement("transport-guarantee").addText(transportGuarantee);
+ }
+ }
+ }
+
+ // Optional login-config/auth-method
+ if (authMethod != null && securityHandler != null)
+ {
+ Element loginConfig = webApp.addElement("login-config");
+ loginConfig.addElement("auth-method").addText(authMethod);
+ loginConfig.addElement("realm-name").addText("EJBServiceEndpointServlet Realm");
+
+ securityHandler.addSecurityRoles(webApp, dep);
+ }
+ document.addDocType("web-app", "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN", "http://java.sun.com/dtd/web-app_2_3.dtd");
+ return document;
+ }
+
+ protected Document createJBossWebAppDescriptor(Deployment dep, SecurityHandler securityHandler)
+ {
+ Document document = DocumentHelper.createDocument();
+
+ /* Create a jboss-web
+ <jboss-web>
+ <security-domain>java:/jaas/cts</security-domain>
+ <context-root>/ws/ejbN/</context-root>
+ <virtual-host>some.domain.com</virtual-host>
+ </jboss-web>
+ */
+ Element jbossWeb = document.addElement("jboss-web");
+
+ if (securityHandler != null)
+ securityHandler.addSecurityDomain(jbossWeb, dep);
+
+ // Get the context root for this deployment
+ String contextRoot = dep.getService().getContextRoot();
+ if (contextRoot == null)
+ throw new WSFDeploymentException("Cannot obtain context root");
+
+ jbossWeb.addElement("context-root").addText(contextRoot);
+ document.addDocType("jboss-web", "-//JBoss//DTD Web Application 5.0//EN", "http://www.jboss.org/j2ee/dtd/jboss-web_5_0.dtd");
+ return document;
+ }
+}
Property changes on: container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/transport/WebAppGenerator.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
16 years, 7 months
JBossWS SVN: r7068 - in container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50: transport and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2008-05-16 15:27:58 -0400 (Fri, 16 May 2008)
New Revision: 7068
Added:
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/transport/
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/transport/WSFRuntimeDelegateHttpServer.java
Removed:
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/DeploymentAspectHttpServer.java
Log:
refactoring
Deleted: container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/DeploymentAspectHttpServer.java
===================================================================
--- container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/DeploymentAspectHttpServer.java 2008-05-16 18:59:58 UTC (rev 7067)
+++ container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/DeploymentAspectHttpServer.java 2008-05-16 19:27:58 UTC (rev 7068)
@@ -1,124 +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 javax.xml.ws.Endpoint;
-import javax.xml.ws.WebServiceException;
-
-import org.jboss.wsf.spi.SPIProvider;
-import org.jboss.wsf.spi.SPIProviderResolver;
-import org.jboss.wsf.spi.deployment.AbstractExtensible;
-import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.DeploymentAspectManager;
-import org.jboss.wsf.spi.deployment.DeploymentAspectManagerFactory;
-import org.jboss.wsf.spi.deployment.DeploymentModelFactory;
-import org.jboss.wsf.spi.deployment.Service;
-import org.jboss.wsf.spi.http.HttpContext;
-import org.jboss.wsf.spi.http.HttpContextFactory;
-import org.jboss.wsf.spi.http.HttpServer;
-
-/**
- * A HTTP Server that uses DeploymentAspects
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 07-Jul-2006
- */
-public class DeploymentAspectHttpServer extends AbstractExtensible implements HttpServer
-{
- /** Start an instance of this HTTP server */
- public void start()
- {
- // verify required properties
- }
-
- /** Create an HTTP context */
- public HttpContext createContext(String contextRoot)
- {
- SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
- HttpContext httpContext = spiProvider.getSPI(HttpContextFactory.class).newHttpContext(this, contextRoot);
- return httpContext;
- }
-
- /** Publish an JAXWS endpoint to the HTTP server */
- public void publish(HttpContext context, Endpoint endpoint)
- {
- Class implClass = getImplementorClass(endpoint);
-
- try
- {
- // Get the deployment model factory
- SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
- DeploymentModelFactory depModelFactory = spiProvider.getSPI(DeploymentModelFactory.class);
-
- // Create/Setup the deployment
- Deployment dep = depModelFactory.newDeployment("endpoint-deployment", implClass.getClassLoader());
- dep.setRuntimeClassLoader(dep.getInitialClassLoader());
-
- // Create/Setup the service
- Service service = dep.getService();
- service.setContextRoot(context.getContextRoot());
-
- // Create/Setup the endpoint
- org.jboss.wsf.spi.deployment.Endpoint ep = depModelFactory.newEndpoint(implClass.getName());
- service.addEndpoint(ep);
-
- // Deploy using deployment aspects
- DeploymentAspectManagerFactory depManagerFactory = spiProvider.getSPI(DeploymentAspectManagerFactory.class);
- DeploymentAspectManager depManager = depManagerFactory.getDeploymentAspectManager("WSDeploymentAspectManagerEndpointAPI");
- depManager.create(dep, null);
- depManager.start(dep, null);
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new WebServiceException(ex);
- }
- }
-
- /** Destroys an JAXWS endpoint on the HTTP server */
- public void destroy(HttpContext context, Endpoint endpoint)
- {
- try
- {
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new WebServiceException(ex);
- }
- }
-
- private Class getImplementorClass(Endpoint endpoint)
- {
- Object implementor = endpoint.getImplementor();
- Class implClass = (implementor instanceof Class ? (Class)implementor : implementor.getClass());
- return implClass;
- }
-}
\ No newline at end of file
Added: container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/transport/WSFRuntimeDelegateHttpServer.java
===================================================================
--- container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/transport/WSFRuntimeDelegateHttpServer.java (rev 0)
+++ container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/transport/WSFRuntimeDelegateHttpServer.java 2008-05-16 19:27:58 UTC (rev 7068)
@@ -0,0 +1,134 @@
+/*
+ * 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.transport;
+
+//$Id$
+
+import org.jboss.wsf.common.ResourceLoaderAdapter;
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.WSFRuntime;
+import org.jboss.wsf.spi.WSFRuntimeLocator;
+import org.jboss.wsf.spi.deployment.AbstractExtensible;
+import org.jboss.wsf.spi.deployment.ArchiveDeployment;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.DeploymentModelFactory;
+import org.jboss.wsf.spi.deployment.Service;
+import org.jboss.wsf.spi.http.HttpContext;
+import org.jboss.wsf.spi.http.HttpContextFactory;
+import org.jboss.wsf.spi.http.HttpServer;
+
+import javax.xml.ws.Endpoint;
+import javax.xml.ws.WebServiceException;
+
+/**
+ * A HTTP Server that uses DeploymentAspects
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 07-Jul-2006
+ */
+public class WSFRuntimeDelegateHttpServer extends AbstractExtensible implements HttpServer
+{
+ /** Start an instance of this HTTP server */
+ public void start()
+ {
+ // verify required properties
+ }
+
+ /** Create an HTTP context */
+ public HttpContext createContext(String contextRoot)
+ {
+ SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ HttpContext httpContext = spiProvider.getSPI(HttpContextFactory.class).newHttpContext(this, contextRoot);
+ return httpContext;
+ }
+
+ /** Publish an JAXWS endpoint to the HTTP server */
+ public void publish(HttpContext context, Endpoint endpoint)
+ {
+ Class implClass = getImplementorClass(endpoint);
+
+ try
+ {
+ // Get the deployment model factory
+ SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ WSFRuntimeLocator locator = spiProvider.getSPI(WSFRuntimeLocator.class);
+ WSFRuntime runtime = locator.locateRuntime("EndpointAPIRuntime");
+
+ DeploymentModelFactory depModelFactory = spiProvider.getSPI(DeploymentModelFactory.class);
+
+ // Create/Setup the deployment
+ Deployment dep = depModelFactory.newDeployment("endpoint-deployment", implClass.getClassLoader());
+ dep.setType(Deployment.DeploymentType.JAXWS_JSE);
+ dep.setRuntimeClassLoader(dep.getInitialClassLoader());
+
+ // TODO: Hack, should this become another DeploymentAspect?
+ ((ArchiveDeployment)dep).setRootFile(new ResourceLoaderAdapter());
+
+ // Create/Setup the service
+ Service service = dep.getService();
+ service.setContextRoot(context.getContextRoot());
+
+ // Create/Setup the endpoint
+ org.jboss.wsf.spi.deployment.Endpoint ep = depModelFactory.newEndpoint(implClass.getName());
+ ep.setShortName(implClass.getName()+"-Endpoint");
+ ep.setURLPattern("/*");
+ service.addEndpoint(ep);
+
+ // Deploy using deployment aspects
+ runtime.create(dep);
+ runtime.start(dep);
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception ex)
+ {
+ throw new WebServiceException(ex);
+ }
+ }
+
+ /** Destroys an JAXWS endpoint on the HTTP server */
+ public void destroy(HttpContext context, Endpoint endpoint)
+ {
+ try
+ {
+
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception ex)
+ {
+ throw new WebServiceException(ex);
+ }
+ }
+
+ private Class getImplementorClass(Endpoint endpoint)
+ {
+ Object implementor = endpoint.getImplementor();
+ Class implClass = (implementor instanceof Class ? (Class)implementor : implementor.getClass());
+ return implClass;
+ }
+}
\ No newline at end of file
Property changes on: container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/transport/WSFRuntimeDelegateHttpServer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
16 years, 8 months
JBossWS SVN: r7067 - container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/wsf/container/jboss50/deployment.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2008-05-16 14:59:58 -0400 (Fri, 16 May 2008)
New Revision: 7067
Modified:
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/wsf/container/jboss50/deployment/RuntimeLoaderDeploymentAspect.java
Log:
optimization
Modified: container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/wsf/container/jboss50/deployment/RuntimeLoaderDeploymentAspect.java
===================================================================
--- container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/wsf/container/jboss50/deployment/RuntimeLoaderDeploymentAspect.java 2008-05-16 18:59:44 UTC (rev 7066)
+++ container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/wsf/container/jboss50/deployment/RuntimeLoaderDeploymentAspect.java 2008-05-16 18:59:58 UTC (rev 7067)
@@ -38,7 +38,6 @@
*/
public class RuntimeLoaderDeploymentAspect extends DeploymentAspect
{
-
public void start(Deployment dep, WSFRuntime runtime)
{
// EJB3 endpoints
16 years, 8 months
JBossWS SVN: r7066 - in container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50: deployment and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2008-05-16 14:59:44 -0400 (Fri, 16 May 2008)
New Revision: 7066
Modified:
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/BareWSFRuntime.java
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployment/RuntimeLoaderDeploymentAspect.java
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployment/metadata/ContainerMetaDataAdapter.java
Log:
sync with 501 integration
Modified: container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/BareWSFRuntime.java
===================================================================
--- container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/BareWSFRuntime.java 2008-05-16 17:58:17 UTC (rev 7065)
+++ container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/BareWSFRuntime.java 2008-05-16 18:59:44 UTC (rev 7066)
@@ -23,15 +23,12 @@
import org.jboss.logging.Logger;
import org.jboss.wsf.spi.ComposableRuntime;
-import org.jboss.wsf.spi.SPIProvider;
-import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.WSFRuntime;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.DeploymentAspectManager;
import org.jboss.wsf.spi.invocation.InvocationHandlerFactory;
import org.jboss.wsf.spi.invocation.RequestHandlerFactory;
import org.jboss.wsf.spi.management.EndpointRegistry;
-import org.jboss.wsf.spi.management.EndpointRegistryFactory;
import org.jboss.wsf.spi.transport.TransportManagerFactory;
/**
@@ -53,8 +50,6 @@
private TransportManagerFactory transportManagerFactory;
- boolean initialized;
-
public String getRuntimeName()
{
return runtimeName;
@@ -70,22 +65,9 @@
public void create(Deployment deployment)
{
- init();
deploymentManager.create(deployment, this);
}
- private void init()
- {
- if(!initialized)
- {
- SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
- this.endpointRegistry = spiProvider.getSPI(EndpointRegistryFactory.class).getEndpointRegistry();
- this.requestHandlerFactory = spiProvider.getSPI(RequestHandlerFactory.class);
- this.invocationHandlerFactory = spiProvider.getSPI(InvocationHandlerFactory.class);
- initialized = true;
- }
- }
-
public void start(Deployment deployment)
{
deploymentManager.start(deployment, this);
@@ -107,7 +89,7 @@
public void setTransportManagerFactory(TransportManagerFactory factory)
{
assert factory!=null;
- log.info(runtimeName + " -> TransportManagerFactory: " + factory);
+ log.debug(runtimeName + " -> TransportManagerFactory: " + factory);
this.transportManagerFactory = factory;
}
@@ -119,7 +101,7 @@
public void setEndpointRegistry(EndpointRegistry endpointRegistry)
{
assert endpointRegistry!=null;
- log.info(runtimeName + " -> EndpointRegistry: " + endpointRegistry);
+ log.debug(runtimeName + " -> EndpointRegistry: " + endpointRegistry);
this.endpointRegistry = endpointRegistry;
}
@@ -131,7 +113,7 @@
public void setDeploymentAspectManager(DeploymentAspectManager deploymentManager)
{
assert deploymentManager!=null;
- log.info(runtimeName + " -> DeploymentAspectManager: " + deploymentManager);
+ log.debug(runtimeName + " -> DeploymentAspectManager: " + deploymentManager);
this.deploymentManager = deploymentManager;
}
@@ -143,7 +125,7 @@
public void setRequestHandlerFactory(RequestHandlerFactory factory)
{
assert factory!=null;
- log.info(runtimeName + " -> RequestHandlerFactory: "+ factory);
+ log.debug(runtimeName + " -> RequestHandlerFactory: "+ factory);
this.requestHandlerFactory = factory;
}
@@ -156,7 +138,7 @@
public void setInvocationHandlerFactory(InvocationHandlerFactory factory)
{
assert factory!=null;
- log.info(runtimeName + " -> InvocationHandlerFactory: "+ factory);
+ log.debug(runtimeName + " -> InvocationHandlerFactory: "+ factory);
this.invocationHandlerFactory = factory;
}
Modified: container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployment/RuntimeLoaderDeploymentAspect.java
===================================================================
--- container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployment/RuntimeLoaderDeploymentAspect.java 2008-05-16 17:58:17 UTC (rev 7065)
+++ container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployment/RuntimeLoaderDeploymentAspect.java 2008-05-16 18:59:44 UTC (rev 7066)
@@ -38,30 +38,25 @@
*/
public class RuntimeLoaderDeploymentAspect extends DeploymentAspect
{
-
public void start(Deployment dep, WSFRuntime runtime)
{
-
- // JSE endpoints
- if (dep.getAttachment(JBossWebMetaData.class) != null)
- {
- JBossWebMetaData webMetaData = dep.getAttachment(JBossWebMetaData.class);
- ClassLoader classLoader = webMetaData.getContextLoader();
- dep.setRuntimeClassLoader(classLoader);
- }
-
// EJB3 endpoints
- else if (dep.getAttachment(Ejb3Deployment.class) != null)
+ if (dep.getAttachment(Ejb3Deployment.class) != null)
{
dep.setRuntimeClassLoader(dep.getInitialClassLoader());
}
-
// EJB21 endpoints
else if (dep.getAttachment(JBossMetaData.class) != null)
{
dep.setRuntimeClassLoader(dep.getInitialClassLoader());
}
-
+ // JSE endpoints
+ else if (dep.getAttachment(JBossWebMetaData.class) != null)
+ {
+ JBossWebMetaData webMetaData = dep.getAttachment(JBossWebMetaData.class);
+ ClassLoader classLoader = webMetaData.getContextLoader();
+ dep.setRuntimeClassLoader(classLoader);
+ }
else
{
throw new IllegalArgumentException("Unable to determine runtime loader");
Modified: container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployment/metadata/ContainerMetaDataAdapter.java
===================================================================
--- container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployment/metadata/ContainerMetaDataAdapter.java 2008-05-16 17:58:17 UTC (rev 7065)
+++ container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployment/metadata/ContainerMetaDataAdapter.java 2008-05-16 18:59:44 UTC (rev 7066)
@@ -23,19 +23,19 @@
//$Id$
-import java.net.URL;
-
import org.jboss.deployers.structure.spi.DeploymentUnit;
import org.jboss.ejb3.Ejb3Deployment;
import org.jboss.logging.Logger;
import org.jboss.metadata.ejb.jboss.JBossMetaData;
import org.jboss.metadata.web.jboss.JBossWebMetaData;
-import org.jboss.wsf.container.jboss50.WebAppDesciptorModifier;
import org.jboss.wsf.spi.deployment.ArchiveDeployment;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData;
import org.jboss.wsf.spi.metadata.j2ee.JSEArchiveMetaData;
+import org.jboss.wsf.spi.transport.HttpSpec;
+import java.net.URL;
+
/**
* Build container independent deployment info.
*
@@ -82,7 +82,7 @@
if (dep instanceof ArchiveDeployment)
{
URL webURL = ((ArchiveDeployment)dep).getRootFile().toURL();
- dep.setProperty(WebAppDesciptorModifier.PROPERTY_WEBAPP_URL, webURL);
+ dep.setProperty(HttpSpec.PROPERTY_WEBAPP_URL, webURL);
}
}
16 years, 8 months
JBossWS SVN: r7065 - container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2008-05-16 13:58:17 -0400 (Fri, 16 May 2008)
New Revision: 7065
Modified:
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/AbstractDeployerHook.java
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/AbstractDeployerHookEJB.java
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/AbstractDeployerHookJSE.java
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/ArchiveDeployerHook.java
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/JAXRPCDeployerHookPostJSE.java
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/JAXRPCDeployerHookPreJSE.java
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/JAXWSDeployerHookPostJSE.java
Log:
sync with jboss501 integration
Modified: container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/AbstractDeployerHook.java
===================================================================
--- container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/AbstractDeployerHook.java 2008-05-16 17:57:21 UTC (rev 7064)
+++ container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/AbstractDeployerHook.java 2008-05-16 17:58:17 UTC (rev 7065)
@@ -50,16 +50,6 @@
private DeploymentModelFactory deploymentModelFactory;
- public String getRuntimeName()
- {
- return runtimeName;
- }
-
- public void setRuntimeName(String runtimeName)
- {
- this.runtimeName = runtimeName;
- }
-
public WSFRuntime getWsfRuntime()
{
if(null == wsfRuntime)
@@ -76,6 +66,11 @@
this.wsfRuntime = wsfRuntime;
}
+ public void setRuntimeName(String runtimeName)
+ {
+ this.runtimeName = runtimeName;
+ }
+
public DeploymentModelFactory getDeploymentModelFactory()
{
if(null == deploymentModelFactory)
Modified: container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/AbstractDeployerHookEJB.java
===================================================================
--- container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/AbstractDeployerHookEJB.java 2008-05-16 17:57:21 UTC (rev 7064)
+++ container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/AbstractDeployerHookEJB.java 2008-05-16 17:58:17 UTC (rev 7065)
@@ -24,6 +24,7 @@
import org.jboss.deployers.structure.spi.DeploymentUnit;
import org.jboss.deployers.spi.DeploymentException;
import org.jboss.wsf.spi.deployment.Deployment;
+import static org.jboss.wsf.spi.deployment.Deployment.DeploymentState;
//$Id$
@@ -42,13 +43,11 @@
super.deploy(unit); // Calls create
Deployment dep = unit.getAttachment(Deployment.class);
- if(null==dep || Deployment.DeploymentState.CREATED != dep.getState())
+ if(null==dep || DeploymentState.CREATED != dep.getState())
throw new DeploymentException("Create step failed");
// execute the 'start' step
getWsfRuntime().start(dep);
-
}
-
}
}
Modified: container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/AbstractDeployerHookJSE.java
===================================================================
--- container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/AbstractDeployerHookJSE.java 2008-05-16 17:57:21 UTC (rev 7064)
+++ container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/AbstractDeployerHookJSE.java 2008-05-16 17:58:17 UTC (rev 7065)
@@ -29,8 +29,8 @@
import org.jboss.metadata.javaee.spec.ParamValueMetaData;
import org.jboss.metadata.web.jboss.JBossWebMetaData;
import org.jboss.metadata.web.spec.ServletMetaData;
-import org.jboss.wsf.container.jboss50.WebAppDesciptorModifier;
import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.transport.HttpSpec;
/**
* An abstract deployer for JSE Endpoints
@@ -43,7 +43,7 @@
public boolean isWebServiceDeployment(DeploymentUnit unit)
{
JBossWebMetaData webMetaData = unit.getAttachment(JBossWebMetaData.class);
- boolean isGenerated = Boolean.TRUE.equals(unit.getAttachment(WebAppDesciptorModifier.PROPERTY_GENERATED_WEBAPP));
+ boolean isGenerated = Boolean.TRUE.equals(unit.getAttachment(HttpSpec.PROPERTY_GENERATED_WEBAPP));
return webMetaData != null && isGenerated == false;
}
Modified: container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/ArchiveDeployerHook.java
===================================================================
--- container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/ArchiveDeployerHook.java 2008-05-16 17:57:21 UTC (rev 7064)
+++ container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/ArchiveDeployerHook.java 2008-05-16 17:58:17 UTC (rev 7065)
@@ -23,6 +23,8 @@
//$Id$
+import java.net.URL;
+
import org.jboss.deployers.spi.DeploymentException;
import org.jboss.deployers.structure.spi.DeploymentUnit;
import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
@@ -39,51 +41,39 @@
import org.jboss.xb.binding.UnmarshallerFactory;
import org.w3c.dom.Element;
-import java.net.URL;
-
/**
* An abstract web service deployer.
- *
- * deploy(unit)
+ * <pre>
+ * deploy(unit)
* if(isWebServiceDeployment)
* dep = createDeployment(unit)
- * deploy(dep)
+ * create(dep)
+ * start(dep)
*
* undeploy(unit)
* dep = getDeployment(unit)
- * undeploy(dep)
+ * stop(dep)
+ * destroy(dep)
+ * </pre>
*
* @author Thomas.Diesler(a)jboss.org
+ * @author Heiko.Braun(a)jboss.com
+ *
* @since 25-Apr-2007
*/
public abstract class ArchiveDeployerHook extends AbstractDeployerHook
{
- /** Depending on the type of deployment, this method should return true
- * if the deployment contains web service endpoints.
+ /**
+ * Executes the 'create' step only. <br/>
+ * Subclasses need to take care that the 'start' step is executed as well.
*/
- public abstract boolean isWebServiceDeployment(DeploymentUnit unit);
-
- /** Create the Deployment for a given DeploymentUnit
- */
- public abstract Deployment createDeployment(DeploymentUnit unit);
-
- /** Get the Deployment for a given DeploymentUnit
- */
- public Deployment getDeployment(DeploymentUnit unit)
- {
- Deployment dep = unit.getAttachment(Deployment.class);
- return (dep != null && dep.getType() == getDeploymentType() ? dep : null);
- }
-
public void deploy(DeploymentUnit unit) throws DeploymentException
{
- if (ignoreDeployment(unit))
- return;
-
- if (isWebServiceDeployment(unit))
+ if (!ignoreDeployment(unit) && isWebServiceDeployment(unit))
{
log.debug("deploy: " + unit.getName());
+
Deployment dep = getDeployment(unit);
if (dep == null)
{
@@ -91,11 +81,22 @@
dep.addAttachment(DeploymentUnit.class, unit);
}
- getWsfRuntime().create(dep);
- unit.addAttachment(Deployment.class, dep);
+ if(Deployment.DeploymentState.UNDEFINED == dep.getState())
+ {
+ getWsfRuntime().create(dep);
+ unit.addAttachment(Deployment.class, dep);
+ }
+ else
+ {
+ throw new IllegalArgumentException("Cannot process Deployment in state " + dep.getState() + ": " + dep);
+ }
}
}
+ /**
+ * Executes the stop() and destroy() lifecycles
+ * @param unit
+ */
public void undeploy(DeploymentUnit unit)
{
if (ignoreDeployment(unit))
@@ -110,6 +111,23 @@
}
}
+ /** Depending on the type of deployment, this method should return true
+ * if the deployment contains web service endpoints.
+ */
+ public abstract boolean isWebServiceDeployment(DeploymentUnit unit);
+
+ /** Create the Deployment for a given DeploymentUnit
+ */
+ public abstract Deployment createDeployment(DeploymentUnit unit);
+
+ /** Get the Deployment for a given DeploymentUnit
+ */
+ public Deployment getDeployment(DeploymentUnit unit)
+ {
+ Deployment dep = unit.getAttachment(Deployment.class);
+ return (dep != null && dep.getType() == getDeploymentType() ? dep : null);
+ }
+
/** Unmrashall the webservices.xml if there is one
*/
protected WebservicesMetaData getWebservicesMetaData(DeploymentUnit unit)
Modified: container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/JAXRPCDeployerHookPostJSE.java
===================================================================
--- container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/JAXRPCDeployerHookPostJSE.java 2008-05-16 17:57:21 UTC (rev 7064)
+++ container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/JAXRPCDeployerHookPostJSE.java 2008-05-16 17:58:17 UTC (rev 7065)
@@ -23,9 +23,11 @@
// $Id$
+import org.jboss.deployers.spi.DeploymentException;
import org.jboss.deployers.structure.spi.DeploymentUnit;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.metadata.webservices.WebservicesMetaData;
+import static org.jboss.wsf.spi.deployment.Deployment.DeploymentState;
/**
* A deployer JAXRPC JSE Endpoints
@@ -35,18 +37,39 @@
*/
public class JAXRPCDeployerHookPostJSE extends DeployerHookPostJSE
{
- /** Get the deployment type this deployer can handle
+
+ /**
+ * Expects the 'create' step to be executed in
+ * {@link org.jboss.wsf.container.jboss50.deployer.JAXRPCDeployerHookPreJSE}
+ * and executes the 'start' step.
+ *
*/
+ public void deploy(DeploymentUnit unit) throws DeploymentException
+ {
+ if (!ignoreDeployment(unit) && isWebServiceDeployment(unit))
+ {
+ Deployment dep = getDeployment(unit);
+ if(null==dep || DeploymentState.CREATED != dep.getState())
+ throw new DeploymentException("Create step is missing");
+
+ // execute the 'start' step
+ getWsfRuntime().start(dep);
+ }
+ }
+
+ /**
+ * Get the deployment type this deployer can handle
+ */
public Deployment.DeploymentType getDeploymentType()
{
return Deployment.DeploymentType.JAXRPC_JSE;
}
-
@Override
public boolean isWebServiceDeployment(DeploymentUnit unit)
{
WebservicesMetaData wsMetaData = getWebservicesMetaData(unit);
return (wsMetaData!=null && super.isWebServiceDeployment(unit));
}
+
}
Modified: container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/JAXRPCDeployerHookPreJSE.java
===================================================================
--- container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/JAXRPCDeployerHookPreJSE.java 2008-05-16 17:57:21 UTC (rev 7064)
+++ container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/JAXRPCDeployerHookPreJSE.java 2008-05-16 17:58:17 UTC (rev 7065)
@@ -46,6 +46,7 @@
*/
public class JAXRPCDeployerHookPreJSE extends AbstractDeployerHookJSE
{
+
public void undeploy(DeploymentUnit unit)
{
// the JAXRPCDeployerHookPostJSE deals with undeployments
Modified: container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/JAXWSDeployerHookPostJSE.java
===================================================================
--- container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/JAXWSDeployerHookPostJSE.java 2008-05-16 17:57:21 UTC (rev 7064)
+++ container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/JAXWSDeployerHookPostJSE.java 2008-05-16 17:58:17 UTC (rev 7065)
@@ -27,6 +27,7 @@
import org.jboss.deployers.spi.DeploymentException;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.metadata.webservices.WebservicesMetaData;
+import static org.jboss.wsf.spi.deployment.Deployment.DeploymentState;
/**
* @author Heiko.Braun(a)jboss.com
@@ -34,6 +35,7 @@
*/
public class JAXWSDeployerHookPostJSE extends DeployerHookPostJSE
{
+
/**
* Expects the 'create' step to be executed in
* {@link org.jboss.wsf.container.jboss50.deployer.JAXWSDeployerHookPreJSE} and
@@ -45,7 +47,7 @@
if (!ignoreDeployment(unit) && isWebServiceDeployment(unit))
{
Deployment dep = getDeployment(unit);
- if (null == dep || Deployment.DeploymentState.CREATED != dep.getState())
+ if (null == dep || DeploymentState.CREATED != dep.getState())
throw new DeploymentException("Create step failed");
// execute the 'start' step
16 years, 8 months
JBossWS SVN: r7064 - container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/wsf/container/jboss50/deployer.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2008-05-16 13:57:21 -0400 (Fri, 16 May 2008)
New Revision: 7064
Modified:
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/wsf/container/jboss50/deployer/AbstractDeployerHookEJB.java
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/wsf/container/jboss50/deployer/AbstractDeployerHookJSE.java
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/wsf/container/jboss50/deployer/ArchiveDeployerHook.java
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/wsf/container/jboss50/deployer/JAXRPCDeployerHookPostJSE.java
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/wsf/container/jboss50/deployer/JAXRPCDeployerHookPreJSE.java
Log:
optimization
Modified: container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/wsf/container/jboss50/deployer/AbstractDeployerHookEJB.java
===================================================================
--- container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/wsf/container/jboss50/deployer/AbstractDeployerHookEJB.java 2008-05-16 12:24:31 UTC (rev 7063)
+++ container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/wsf/container/jboss50/deployer/AbstractDeployerHookEJB.java 2008-05-16 17:57:21 UTC (rev 7064)
@@ -36,7 +36,6 @@
*/
public abstract class AbstractDeployerHookEJB extends ArchiveDeployerHook
{
-
public void deploy(DeploymentUnit unit) throws DeploymentException
{
if(!ignoreDeployment(unit) && isWebServiceDeployment(unit))
@@ -49,8 +48,6 @@
// execute the 'start' step
getWsfRuntime().start(dep);
-
}
-
}
}
Modified: container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/wsf/container/jboss50/deployer/AbstractDeployerHookJSE.java
===================================================================
--- container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/wsf/container/jboss50/deployer/AbstractDeployerHookJSE.java 2008-05-16 12:24:31 UTC (rev 7063)
+++ container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/wsf/container/jboss50/deployer/AbstractDeployerHookJSE.java 2008-05-16 17:57:21 UTC (rev 7064)
@@ -31,7 +31,6 @@
import org.jboss.metadata.web.spec.ServletMetaData;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.transport.HttpSpec;
-import org.jboss.wsf.container.jboss50.deployment.tomcat.WebMetaDataModifier;
/**
* An abstract deployer for JSE Endpoints
Modified: container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/wsf/container/jboss50/deployer/ArchiveDeployerHook.java
===================================================================
--- container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/wsf/container/jboss50/deployer/ArchiveDeployerHook.java 2008-05-16 12:24:31 UTC (rev 7063)
+++ container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/wsf/container/jboss50/deployer/ArchiveDeployerHook.java 2008-05-16 17:57:21 UTC (rev 7064)
@@ -63,6 +63,7 @@
*/
public abstract class ArchiveDeployerHook extends AbstractDeployerHook
{
+
/**
* Executes the 'create' step only. <br/>
* Subclasses need to take care that the 'start' step is executed as well.
Modified: container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/wsf/container/jboss50/deployer/JAXRPCDeployerHookPostJSE.java
===================================================================
--- container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/wsf/container/jboss50/deployer/JAXRPCDeployerHookPostJSE.java 2008-05-16 12:24:31 UTC (rev 7063)
+++ container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/wsf/container/jboss50/deployer/JAXRPCDeployerHookPostJSE.java 2008-05-16 17:57:21 UTC (rev 7064)
@@ -71,4 +71,5 @@
WebservicesMetaData wsMetaData = getWebservicesMetaData(unit);
return (wsMetaData!=null && super.isWebServiceDeployment(unit));
}
+
}
Modified: container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/wsf/container/jboss50/deployer/JAXRPCDeployerHookPreJSE.java
===================================================================
--- container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/wsf/container/jboss50/deployer/JAXRPCDeployerHookPreJSE.java 2008-05-16 12:24:31 UTC (rev 7063)
+++ container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/wsf/container/jboss50/deployer/JAXRPCDeployerHookPreJSE.java 2008-05-16 17:57:21 UTC (rev 7064)
@@ -47,7 +47,6 @@
public class JAXRPCDeployerHookPreJSE extends AbstractDeployerHookJSE
{
-
public void undeploy(DeploymentUnit unit)
{
// the JAXRPCDeployerHookPostJSE deals with undeployments
16 years, 8 months
JBossWS SVN: r7063 - container/jboss50/branches/jbossws-jboss500/src/main/resources/jbossws-jboss50-container.jar/META-INF.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2008-05-16 08:24:31 -0400 (Fri, 16 May 2008)
New Revision: 7063
Modified:
container/jboss50/branches/jbossws-jboss500/src/main/resources/jbossws-jboss50-container.jar/META-INF/jbossws-container-beans.xml
Log:
refactoring done
Modified: container/jboss50/branches/jbossws-jboss500/src/main/resources/jbossws-jboss50-container.jar/META-INF/jbossws-container-beans.xml
===================================================================
--- container/jboss50/branches/jbossws-jboss500/src/main/resources/jbossws-jboss50-container.jar/META-INF/jbossws-container-beans.xml 2008-05-16 12:16:15 UTC (rev 7062)
+++ container/jboss50/branches/jbossws-jboss500/src/main/resources/jbossws-jboss50-container.jar/META-INF/jbossws-container-beans.xml 2008-05-16 12:24:31 UTC (rev 7063)
@@ -60,7 +60,7 @@
<!--
The container deployment aspects
-->
- <bean name="WSContainerMetaDataDeploymentAspect" class="org.jboss.wsf.container.jboss50.ContainerMetaDataDeploymentAspect">
+ <bean name="WSContainerMetaDataDeploymentAspect" class="org.jboss.wsf.container.jboss50.deployment.metadata.ContainerMetaDataDeploymentAspect">
<property name="provides">ContainerMetaData, VFSRoot</property>
</bean>
@@ -101,11 +101,11 @@
<property name="provides">RegisteredEndpoint</property>
</bean>
- <bean name="WSModifyWebMetaDataDeploymentAspect" class="org.jboss.wsf.container.jboss50.ModifyWebMetaDataDeploymentAspect">
+ <bean name="WSModifyWebMetaDataDeploymentAspect" class="org.jboss.wsf.container.jboss50.deployment.tomcat.ModifyWebMetaDataDeploymentAspect">
<property name="requires">ContextProperties, StackDescriptor</property>
</bean>
- <bean name="WSRuntimeLoaderDeploymentAspect" class="org.jboss.wsf.container.jboss50.RuntimeLoaderDeploymentAspect">
+ <bean name="WSRuntimeLoaderDeploymentAspect" class="org.jboss.wsf.container.jboss50.deployment.RuntimeLoaderDeploymentAspect">
<property name="requires">ContainerMetaData</property>
<property name="provides">RuntimeLoader</property>
</bean>
@@ -129,8 +129,8 @@
</bean>
<!-- Deployment aspect helper beans -->
- <bean name="WSSecurityHandlerEJB21" class="org.jboss.wsf.container.jboss50.SecurityHandlerEJB21"/>
- <bean name="WSSecurityHandlerEJB3" class="org.jboss.wsf.container.jboss50.SecurityHandlerEJB3"/>
+ <bean name="WSSecurityHandlerEJB21" class="org.jboss.wsf.container.jboss50.deployment.tomcat.SecurityHandlerEJB21"/>
+ <bean name="WSSecurityHandlerEJB3" class="org.jboss.wsf.container.jboss50.deployment.tomcat.SecurityHandlerEJB3"/>
<bean name="WSWebAppDesciptorModifier" class="org.jboss.wsf.container.jboss50.DefaultWebAppDesciptorModifierImpl"/>
<bean name="WSWebXMLRewriter" class="org.jboss.wsf.container.jboss50.WebXMLRewriterImpl">
<property name="desciptorModifier"><inject bean="WSWebAppDesciptorModifier"/></property>
16 years, 8 months
JBossWS SVN: r7062 - container/jboss50/branches/jbossws-jboss501/src/main/resources/jbossws-jboss50.deployer/META-INF.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2008-05-16 08:16:15 -0400 (Fri, 16 May 2008)
New Revision: 7062
Modified:
container/jboss50/branches/jbossws-jboss501/src/main/resources/jbossws-jboss50.deployer/META-INF/jbossws-deployer-beans.xml
Log:
fix formatting
Modified: container/jboss50/branches/jbossws-jboss501/src/main/resources/jbossws-jboss50.deployer/META-INF/jbossws-deployer-beans.xml
===================================================================
--- container/jboss50/branches/jbossws-jboss501/src/main/resources/jbossws-jboss50.deployer/META-INF/jbossws-deployer-beans.xml 2008-05-16 12:15:50 UTC (rev 7061)
+++ container/jboss50/branches/jbossws-jboss501/src/main/resources/jbossws-jboss50.deployer/META-INF/jbossws-deployer-beans.xml 2008-05-16 12:16:15 UTC (rev 7062)
@@ -4,7 +4,8 @@
xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_2_0.xsd"
xmlns="urn:jboss:bean-deployer:2.0">
- <!-- *********************************************************************************************************************
+ <!--
+ *********************************************************************************************************************
Web Service deployment
There are two deployers registered with the JBoss Main Deployer.
@@ -17,12 +18,12 @@
Each WebServiceDeployer has a number of DeployerHooks registered with it
- WebServiceDeployerEJB
- - WSDeployerHook_JAXRPC_EJB21
- - WSDeployerHook_JAXWS_EJB3
+ - WSDeployerHook_JAXRPC_EJB21
+ - WSDeployerHook_JAXWS_EJB3
- WebServiceDeployerPreJSE
- - WSDeployerHook_JAXRPC_JSE
- - WSDeployerHook_JAXWS_JSE
+ - WSDeployerHook_JAXRPC_JSE
+ - WSDeployerHook_JAXWS_JSE
Conceptually, each of these hooks implements the following pattern:
@@ -32,8 +33,8 @@
DeploymentAspectManager.deploy(dep)
DeployerHook.undeploy(unit)
- Deployment dep = getDeployment(unit)
- WSFRuntime.start(dep)
+ Deployment dep = getDeployment(unit)
+ WSFRuntime.start(dep)
Each deployer hook has a web service WSFRuntime injected into it.
16 years, 8 months