Author: thomas.diesler(a)jboss.com
Date: 2007-07-30 10:31:05 -0400 (Mon, 30 Jul 2007)
New Revision: 4027
Added:
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/DeploymentAspectHttpServer.java
Modified:
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/AbstractDeployerHook.java
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXRPCDeployerHookEJB21.java
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXRPCDeployerHookJSE.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/JAXWSDeployerHookJSE.java
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/AbstractDeployerHook.java
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXRPCDeployerHookEJB21.java
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXRPCDeployerHookJSE.java
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXWSDeployerHookEJB3.java
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXWSDeployerHookJSE.java
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/ArchiveDeploymentModelFactory.java
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/DefaultDeploymentModelFactory.java
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/DefaultEndpoint.java
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/DefaultService.java
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/DeploymentModelFactory.java
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/binding/BindingCustomizationTestCase.java
Log:
Add ctor parameters to newEndpoint(shortName, tragetBean)
Modified:
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/AbstractDeployerHook.java
===================================================================
---
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/AbstractDeployerHook.java 2007-07-30
12:53:36 UTC (rev 4026)
+++
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/AbstractDeployerHook.java 2007-07-30
14:31:05 UTC (rev 4027)
@@ -95,11 +95,11 @@
}
}
- public Endpoint newEndpoint()
+ public Endpoint newEndpoint(String shortName, String targetBean)
{
try
{
- return getDeploymentModelFactory().newEndpoint();
+ return getDeploymentModelFactory().newEndpoint(shortName, targetBean);
}
catch (Exception ex)
{
Added:
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/DeploymentAspectHttpServer.java
===================================================================
---
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/DeploymentAspectHttpServer.java
(rev 0)
+++
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/DeploymentAspectHttpServer.java 2007-07-30
14:31:05 UTC (rev 4027)
@@ -0,0 +1,108 @@
+/*
+ * 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: JBossHttpServer.java 1786 2007-01-04 14:30:04Z thomas.diesler(a)jboss.com $
+
+import javax.enterprise.deploy.spi.factories.DeploymentFactory;
+import javax.xml.ws.Endpoint;
+import javax.xml.ws.WebServiceException;
+
+import org.jboss.wsf.common.DOMUtils;
+import org.jboss.wsf.framework.DefaultExtensible;
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.DeploymentModelFactory;
+import org.jboss.wsf.spi.http.HttpContext;
+import org.jboss.wsf.spi.http.HttpContextFactory;
+import org.jboss.wsf.spi.http.HttpServer;
+import org.w3c.dom.Element;
+
+/**
+ * A HTTP Server that uses DeploymentAspects
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 07-Jul-2006
+ */
+public class DeploymentAspectHttpServer extends DefaultExtensible 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
+ {
+ SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ DeploymentModelFactory depFactory =
spiProvider.getSPI(DeploymentModelFactory.class);
+ Deployment dep = depFactory.newDeployment("jaxws-endpoint-deployment",
implClass.getClassLoader());
+ dep.getService().addEndpoint(depFactory.newEndpoint("jaxws-endpoint",
implClass.getName()));
+
+ }
+ 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
Modified:
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXRPCDeployerHookEJB21.java
===================================================================
---
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXRPCDeployerHookEJB21.java 2007-07-30
12:53:36 UTC (rev 4026)
+++
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXRPCDeployerHookEJB21.java 2007-07-30
14:31:05 UTC (rev 4027)
@@ -88,11 +88,7 @@
String ejbClass = beanMetaData.getEjbClass();
// Create the endpoint
- Endpoint ep = newEndpoint();
- ep.setShortName(ejbLink);
- ep.setService(service);
- ep.setTargetBeanName(ejbClass);
-
+ Endpoint ep = newEndpoint(ejbLink, ejbClass);
service.addEndpoint(ep);
}
}
Modified:
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXRPCDeployerHookJSE.java
===================================================================
---
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXRPCDeployerHookJSE.java 2007-07-30
12:53:36 UTC (rev 4026)
+++
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXRPCDeployerHookJSE.java 2007-07-30
14:31:05 UTC (rev 4027)
@@ -105,11 +105,7 @@
}
// Create the endpoint
- Endpoint ep = newEndpoint();
- ep.setShortName(servletLink);
- ep.setService(service);
- ep.setTargetBeanName(servletClass);
-
+ Endpoint ep = newEndpoint(servletLink, servletClass);
service.addEndpoint(ep);
}
}
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-07-30
12:53:36 UTC (rev 4026)
+++
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXWSDeployerHookEJB3.java 2007-07-30
14:31:05 UTC (rev 4027)
@@ -74,11 +74,7 @@
String epBean = container.getBeanClassName();
// Create the endpoint
- Endpoint ep = newEndpoint();
- ep.setShortName(ejbName);
- ep.setService(service);
- ep.setTargetBeanName(epBean);
-
+ Endpoint ep = newEndpoint(ejbName, epBean);
service.addEndpoint(ep);
}
}
Modified:
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXWSDeployerHookJSE.java
===================================================================
---
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXWSDeployerHookJSE.java 2007-07-30
12:53:36 UTC (rev 4026)
+++
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXWSDeployerHookJSE.java 2007-07-30
14:31:05 UTC (rev 4027)
@@ -80,11 +80,7 @@
String servletClass = servlet.getServletClass();
// Create the endpoint
- Endpoint ep = newEndpoint();
- ep.setShortName(servletName);
- ep.setService(service);
- ep.setTargetBeanName(servletClass);
-
+ Endpoint ep = newEndpoint(servletName, servletClass);
service.addEndpoint(ep);
}
Modified:
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/AbstractDeployerHook.java
===================================================================
---
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/AbstractDeployerHook.java 2007-07-30
12:53:36 UTC (rev 4026)
+++
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/AbstractDeployerHook.java 2007-07-30
14:31:05 UTC (rev 4027)
@@ -88,11 +88,11 @@
}
}
- public Endpoint newEndpoint()
+ public Endpoint newEndpoint(String shortName, String targetBean)
{
try
{
- return getDeploymentModelFactory().newEndpoint();
+ return getDeploymentModelFactory().newEndpoint(shortName, targetBean);
}
catch (Exception ex)
{
Modified:
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXRPCDeployerHookEJB21.java
===================================================================
---
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXRPCDeployerHookEJB21.java 2007-07-30
12:53:36 UTC (rev 4026)
+++
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXRPCDeployerHookEJB21.java 2007-07-30
14:31:05 UTC (rev 4027)
@@ -88,11 +88,7 @@
String ejbClass = beanMetaData.getEjbClass();
// Create the endpoint
- Endpoint ep = newEndpoint();
- ep.setShortName(ejbLink);
- ep.setService(service);
- ep.setTargetBeanName(ejbClass);
-
+ Endpoint ep = newEndpoint(ejbLink, ejbClass);
service.addEndpoint(ep);
}
}
Modified:
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXRPCDeployerHookJSE.java
===================================================================
---
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXRPCDeployerHookJSE.java 2007-07-30
12:53:36 UTC (rev 4026)
+++
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXRPCDeployerHookJSE.java 2007-07-30
14:31:05 UTC (rev 4027)
@@ -88,11 +88,7 @@
String servletClass = servlet.getServletClass();
// Create the endpoint
- Endpoint ep = newEndpoint();
- ep.setShortName(servletLink);
- ep.setService(service);
- ep.setTargetBeanName(servletClass);
-
+ Endpoint ep = newEndpoint(servletLink, servletClass);
service.addEndpoint(ep);
}
}
Modified:
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXWSDeployerHookEJB3.java
===================================================================
---
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXWSDeployerHookEJB3.java 2007-07-30
12:53:36 UTC (rev 4026)
+++
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXWSDeployerHookEJB3.java 2007-07-30
14:31:05 UTC (rev 4027)
@@ -80,11 +80,7 @@
String epBean = container.getBeanClassName();
// Create the endpoint
- Endpoint ep = newEndpoint();
- ep.setShortName(ejbName);
- ep.setService(service);
- ep.setTargetBeanName(epBean);
-
+ Endpoint ep = newEndpoint(ejbName, epBean);
service.addEndpoint(ep);
}
}
Modified:
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXWSDeployerHookJSE.java
===================================================================
---
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXWSDeployerHookJSE.java 2007-07-30
12:53:36 UTC (rev 4026)
+++
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXWSDeployerHookJSE.java 2007-07-30
14:31:05 UTC (rev 4027)
@@ -77,11 +77,7 @@
String servletClass = servlet.getServletClass();
// Create the endpoint
- Endpoint ep = newEndpoint();
- ep.setShortName(servletName);
- ep.setService(service);
- ep.setTargetBeanName(servletClass);
-
+ Endpoint ep = newEndpoint(servletName, servletClass);
service.addEndpoint(ep);
}
Modified:
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/ArchiveDeploymentModelFactory.java
===================================================================
---
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/ArchiveDeploymentModelFactory.java 2007-07-30
12:53:36 UTC (rev 4026)
+++
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/ArchiveDeploymentModelFactory.java 2007-07-30
14:31:05 UTC (rev 4027)
@@ -42,8 +42,8 @@
return new DefaultService();
}
- public Endpoint newEndpoint()
+ public Endpoint newEndpoint(String shortName, String targetBean)
{
- return new DefaultEndpoint();
+ return new DefaultEndpoint(shortName, targetBean);
}
}
Modified:
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/DefaultDeploymentModelFactory.java
===================================================================
---
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/DefaultDeploymentModelFactory.java 2007-07-30
12:53:36 UTC (rev 4026)
+++
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/DefaultDeploymentModelFactory.java 2007-07-30
14:31:05 UTC (rev 4027)
@@ -42,8 +42,8 @@
return new DefaultService();
}
- public Endpoint newEndpoint()
+ public Endpoint newEndpoint(String shortName, String targetBean)
{
- return new DefaultEndpoint();
+ return new DefaultEndpoint(shortName, targetBean);
}
}
Modified:
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/DefaultEndpoint.java
===================================================================
---
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/DefaultEndpoint.java 2007-07-30
12:53:36 UTC (rev 4026)
+++
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/DefaultEndpoint.java 2007-07-30
14:31:05 UTC (rev 4027)
@@ -57,8 +57,10 @@
private List<BindingCustomization> bindingCustomizsations = new
ArrayList<BindingCustomization>();
private String address;
- DefaultEndpoint()
+ DefaultEndpoint(String shortName, String targetBean)
{
+ this.shortName = shortName;
+ this.targetBean = targetBean;
this.state = EndpointState.UNDEFINED;
}
Modified:
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/DefaultService.java
===================================================================
---
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/DefaultService.java 2007-07-30
12:53:36 UTC (rev 4026)
+++
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/DefaultService.java 2007-07-30
14:31:05 UTC (rev 4027)
@@ -62,6 +62,7 @@
public void addEndpoint(Endpoint endpoint)
{
+ endpoint.setService(this);
endpoints.add(endpoint);
}
Modified:
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/DeploymentModelFactory.java
===================================================================
---
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/DeploymentModelFactory.java 2007-07-30
12:53:36 UTC (rev 4026)
+++
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/DeploymentModelFactory.java 2007-07-30
14:31:05 UTC (rev 4027)
@@ -31,6 +31,6 @@
{
public abstract Deployment newDeployment(String simpleName, ClassLoader
initialLoader);
public abstract Service newService();
- public abstract Endpoint newEndpoint();
+ public abstract Endpoint newEndpoint(String shortName, String targetBean);
}
Modified:
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/binding/BindingCustomizationTestCase.java
===================================================================
---
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/binding/BindingCustomizationTestCase.java 2007-07-30
12:53:36 UTC (rev 4026)
+++
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/binding/BindingCustomizationTestCase.java 2007-07-30
14:31:05 UTC (rev 4027)
@@ -49,7 +49,7 @@
public void testCustomizationWriteAccess() throws Exception
{
- Endpoint endpoint = deploymentModelFactory.newEndpoint();
+ Endpoint endpoint = deploymentModelFactory.newEndpoint(null, null);
JAXBBindingCustomization jaxbCustomization = new JAXBBindingCustomization();
jaxbCustomization.put(JAXBBindingCustomization.DEFAULT_NAMESPACE_REMAP,
"http://org.jboss.bindingCustomization");
endpoint.addAttachment(BindingCustomization.class, jaxbCustomization);
@@ -70,7 +70,7 @@
public void testCustomizationReadAccess() throws Exception
{
- Endpoint endpoint = deploymentModelFactory.newEndpoint();
+ Endpoint endpoint = deploymentModelFactory.newEndpoint(null, null);
JAXBBindingCustomization jaxbCustomization = new JAXBBindingCustomization();
jaxbCustomization.put(JAXBBindingCustomization.DEFAULT_NAMESPACE_REMAP,
"http://org.jboss.bindingCustomization");
endpoint.addAttachment(BindingCustomization.class, jaxbCustomization);