[jboss-cvs] JBossAS SVN: r95058 - in trunk: component-matrix and 20 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Oct 16 19:56:07 EDT 2009
Author: richard.opalka at jboss.com
Date: 2009-10-16 19:56:07 -0400 (Fri, 16 Oct 2009)
New Revision: 95058
Added:
trunk/testsuite/src/main/org/jboss/test/webservice/endpoint/
trunk/testsuite/src/main/org/jboss/test/webservice/endpoint/EndpointBean.java
trunk/testsuite/src/main/org/jboss/test/webservice/endpoint/EndpointInterface.java
trunk/testsuite/src/main/org/jboss/test/webservice/endpoint/EndpointServlet.java
trunk/testsuite/src/main/org/jboss/test/webservice/endpoint/EndpointTestCase.java
trunk/testsuite/src/resources/webservice/endpoint/
trunk/testsuite/src/resources/webservice/endpoint/WEB-INF/
trunk/testsuite/src/resources/webservice/endpoint/WEB-INF/web.xml
trunk/testsuite/src/resources/webservice/endpoint/WEB-INF/wsdl/
trunk/testsuite/src/resources/webservice/endpoint/WEB-INF/wsdl/TestService.wsdl
trunk/webservices/src/main/java/org/jboss/webservices/integration/config/ServerConfigFactoryImpl.java
trunk/webservices/src/main/java/org/jboss/webservices/integration/endpoint/
trunk/webservices/src/main/java/org/jboss/webservices/integration/endpoint/EndpointAPIHttpServer.java
trunk/webservices/src/main/java/org/jboss/webservices/integration/endpoint/HttpServerFactoryImpl.java
trunk/webservices/src/main/java/org/jboss/webservices/integration/ioc/
trunk/webservices/src/main/java/org/jboss/webservices/integration/ioc/IoCContainerProxyFactoryImpl.java
trunk/webservices/src/main/java/org/jboss/webservices/integration/ioc/IoCContainerProxyImpl.java
trunk/webservices/src/main/java/org/jboss/webservices/integration/util/WebMetaDataHelper.java
trunk/webservices/src/resources/jbossws-jboss.jar/META-INF/services/org.jboss.wsf.spi.http.HttpServerFactory
trunk/webservices/src/resources/jbossws-jboss.jar/META-INF/services/org.jboss.wsf.spi.ioc.IoCContainerProxyFactory
Removed:
trunk/webservices/src/main/java/org/jboss/webservices/integration/invocation/AbstractInvocationHandler.java
trunk/webservices/src/main/java/org/jboss/webservices/integration/invocation/AbstractInvocationHandlerJSE.java
trunk/webservices/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXRPC.java
trunk/webservices/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXWS.java
trunk/webservices/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataHelper.java
Modified:
trunk/build/build.xml
trunk/component-matrix/pom.xml
trunk/server/pom.xml
trunk/testsuite/imports/sections/webservice.xml
trunk/tomcat/pom.xml
trunk/webservices/src/main/java/org/jboss/webservices/integration/deployers/deployment/AbstractDeploymentModelBuilder.java
trunk/webservices/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB21.java
trunk/webservices/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB3.java
trunk/webservices/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerFactoryImpl.java
trunk/webservices/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB21.java
trunk/webservices/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB3.java
trunk/webservices/src/main/java/org/jboss/webservices/integration/metadata/AbstractMetaDataBuilderEJB.java
trunk/webservices/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataCreator.java
trunk/webservices/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataModifier.java
trunk/webservices/src/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml
trunk/webservices/src/resources/jbossws-jboss.jar/META-INF/services/org.jboss.wsf.spi.management.ServerConfigFactory
Log:
[JBAS-7382] updating to 3.2.1.Beta2
Modified: trunk/build/build.xml
===================================================================
--- trunk/build/build.xml 2009-10-16 22:58:16 UTC (rev 95057)
+++ trunk/build/build.xml 2009-10-16 23:56:07 UTC (rev 95058)
@@ -1803,7 +1803,6 @@
<!-- Endorse JBossWS jars on JDK1.6 and above -->
<copy todir="${install.lib}/endorsed" flatten="true" overwrite="true">
<fileset refid="org.jboss.ws.native:jbossws-native-jaxws:jar"/>
- <fileset refid="org.jboss.ws.native:jbossws-native-jaxws-ext:jar"/>
<fileset refid="org.jboss.ws.native:jbossws-native-saaj:jar"/>
<mapper refid="remove-versions" />
</copy>
@@ -1936,6 +1935,8 @@
<copy todir="${install.common.lib}" filtering="no">
<fileset refid="org.jboss.threads:jboss-threads:jar"/>
<fileset refid="org.jboss.xnio:xnio-api:jar"/>
+ <fileset refid="javax.xml.ws:jaxws-api:jar"/>
+ <fileset refid="javax.jws:jsr181-api:jar"/>
<fileset refid="org.jboss.ws.native:jbossws-native-jaxrpc:jar"/>
<fileset refid="org.jboss.ws.native:jbossws-native-jaxws:jar"/>
<fileset refid="org.jboss.ws.native:jbossws-native-jaxws-ext:jar"/>
@@ -2136,6 +2137,8 @@
<fileset refid="org.jboss.deployers:jboss-deployers-vfs:jar"/>
<fileset refid="org.jboss.deployers:jboss-deployers-vfs-spi:jar"/>
<fileset refid="org.jboss.remoting:jboss-remoting:jar"/>
+ <fileset refid="javax.xml.ws:jaxws-api:jar"/>
+ <fileset refid="javax.jws:jsr181-api:jar"/>
<fileset refid="org.jboss.ws.native:jbossws-native-client:jar"/>
<fileset refid="org.jboss.ws.native:jbossws-native-core:jar"/>
<fileset refid="org.jboss.ws.native:jbossws-native-jaxrpc:jar"/>
Modified: trunk/component-matrix/pom.xml
===================================================================
--- trunk/component-matrix/pom.xml 2009-10-16 22:58:16 UTC (rev 95057)
+++ trunk/component-matrix/pom.xml 2009-10-16 23:56:07 UTC (rev 95058)
@@ -38,10 +38,12 @@
<version.javax.validation>1.0.CR3</version.javax.validation>
<version.jboss.jaxr>1.2.1.GA</version.jboss.jaxr>
<version.jboss.jbossts>4.6.1.GA</version.jboss.jbossts>
- <version.jboss.jbossws-common>1.2.1.Beta1</version.jboss.jbossws-common>
- <version.jboss.jbossws-framework>3.2.1.Beta1</version.jboss.jbossws-framework>
- <version.jboss.jbossws-spi>1.2.1.Beta1</version.jboss.jbossws-spi>
- <version.jboss.jbossws>3.2.1.Beta1</version.jboss.jbossws>
+ <version.jaxws.api>2.1</version.jaxws.api>
+ <version.jsr181.api>1.0-MR1</version.jsr181.api>
+ <version.jboss.jbossws-common>1.2.1.Beta2</version.jboss.jbossws-common>
+ <version.jboss.jbossws-framework>3.2.1.Beta2</version.jboss.jbossws-framework>
+ <version.jboss.jbossws-spi>1.2.1.Beta2</version.jboss.jbossws-spi>
+ <version.jboss.jbossws>3.2.1.Beta2</version.jboss.jbossws>
<version.jboss.jms-integration-tests>1.0.1.GA</version.jboss.jms-integration-tests>
<version.jboss.messaging>1.4.1.GA</version.jboss.messaging>
<version.jboss.web>3.0.0.alpha-8</version.jboss.web>
@@ -312,7 +314,7 @@
<dependency>
<groupId>org.apache</groupId>
<artifactId>xmlsec</artifactId>
- <version>1.4.2</version>
+ <version>1.4.3</version>
</dependency>
<dependency>
@@ -727,6 +729,10 @@
<version>1.0.1.GA</version>
<exclusions>
<exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ <exclusion>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
</exclusion>
@@ -837,8 +843,38 @@
<version>${version.jboss.jbossts}</version>
<type>sar</type>
</dependency>
-
+
<dependency>
+ <groupId>javax.jws</groupId>
+ <artifactId>jsr181-api</artifactId>
+ <version>${version.jsr181.api}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.xml.ws</groupId>
+ <artifactId>jaxws-api</artifactId>
+ <version>${version.jaxws.api}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.jws</groupId>
+ <artifactId>jsr181-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.xml.soap</groupId>
+ <artifactId>saaj-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.annotation</groupId>
+ <artifactId>jsr250-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
<groupId>org.jboss.ws.native</groupId>
<artifactId>jbossws-native-client</artifactId>
<version>${version.jboss.jbossws}</version>
Modified: trunk/server/pom.xml
===================================================================
--- trunk/server/pom.xml 2009-10-16 22:58:16 UTC (rev 95057)
+++ trunk/server/pom.xml 2009-10-16 23:56:07 UTC (rev 95058)
@@ -386,8 +386,8 @@
</dependency>
<dependency>
- <groupId>org.jboss.ws.native</groupId>
- <artifactId>jbossws-native-jaxws</artifactId>
+ <groupId>javax.xml.ws</groupId>
+ <artifactId>jaxws-api</artifactId>
</dependency>
<dependency>
Modified: trunk/testsuite/imports/sections/webservice.xml
===================================================================
--- trunk/testsuite/imports/sections/webservice.xml 2009-10-16 22:58:16 UTC (rev 95057)
+++ trunk/testsuite/imports/sections/webservice.xml 2009-10-16 23:56:07 UTC (rev 95058)
@@ -118,5 +118,17 @@
<include name="jboss-app.xml"/>
</metainf>
</ear>
+
+ <!-- jaxws-endpoint-servlet -->
+ <war warfile="${build.lib}/jaxws-endpoint-servlet.war" webxml="${build.resources}/webservice/endpoint/WEB-INF/web.xml">
+ <classes dir="${build.classes}">
+ <include name="org/jboss/test/webservice/endpoint/EndpointServlet.class"/>
+ <include name="org/jboss/test/webservice/endpoint/EndpointBean.class"/>
+ <include name="org/jboss/test/webservice/endpoint/EndpointInterface.class"/>
+ </classes>
+ <webinf dir="${build.resources}/webservice/endpoint/WEB-INF">
+ <include name="wsdl/**"/>
+ </webinf>
+ </war>
</target>
</project>
\ No newline at end of file
Added: trunk/testsuite/src/main/org/jboss/test/webservice/endpoint/EndpointBean.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/webservice/endpoint/EndpointBean.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/webservice/endpoint/EndpointBean.java 2009-10-16 23:56:07 UTC (rev 95058)
@@ -0,0 +1,39 @@
+/*
+ * 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.test.webservice.endpoint;
+
+import javax.jws.WebService;
+
+/**
+ * Test Endpoint deployment
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @since 29-Apr-2005
+ */
+ at WebService(endpointInterface = "org.jboss.test.webservice.endpoint.EndpointInterface", targetNamespace = "http://org.jboss.ws/jaxws/endpoint", serviceName = "EndpointService")
+public class EndpointBean implements EndpointInterface
+{
+ public String echo(String input)
+ {
+ return input;
+ }
+}
Added: trunk/testsuite/src/main/org/jboss/test/webservice/endpoint/EndpointInterface.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/webservice/endpoint/EndpointInterface.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/webservice/endpoint/EndpointInterface.java 2009-10-16 23:56:07 UTC (rev 95058)
@@ -0,0 +1,39 @@
+/*
+ * 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.test.webservice.endpoint;
+
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+/**
+ * @author Thomas.Diesler at jboss.org
+ * @since 29-Apr-2005
+ */
+ at WebService(targetNamespace = "http://org.jboss.ws/jaxws/endpoint")
+ at SOAPBinding(style = SOAPBinding.Style.RPC)
+public interface EndpointInterface extends Remote
+{
+ String echo(String input) throws RemoteException;
+}
Added: trunk/testsuite/src/main/org/jboss/test/webservice/endpoint/EndpointServlet.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/webservice/endpoint/EndpointServlet.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/webservice/endpoint/EndpointServlet.java 2009-10-16 23:56:07 UTC (rev 95058)
@@ -0,0 +1,97 @@
+/*
+ * 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.test.webservice.endpoint;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.net.URL;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Endpoint;
+import javax.xml.ws.Service;
+import javax.xml.ws.soap.SOAPBinding;
+
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.http.HttpContext;
+import org.jboss.wsf.spi.http.HttpServer;
+import org.jboss.wsf.spi.http.HttpServerFactory;
+
+/**
+ * Test Endpoint deployment
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @since 12-Jul-2006
+ */
+public class EndpointServlet extends HttpServlet
+{
+ private Endpoint endpoint;
+
+ @Override
+ public void init(ServletConfig config) throws ServletException
+ {
+ super.init(config);
+
+ // Create the endpoint
+ EndpointBean epImpl = new EndpointBean();
+ endpoint = Endpoint.create(SOAPBinding.SOAP11HTTP_BINDING, epImpl);
+
+ // Create and start the HTTP server
+ SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ HttpServer httpServer = spiProvider.getSPI(HttpServerFactory.class).getHttpServer();
+
+ // Create the context and publish the endpoint
+ HttpContext context = httpServer.createContext("/jaxws-endpoint");
+ endpoint.publish(context);
+ }
+
+ @Override
+ public void destroy()
+ {
+ // Stop the endpoint
+ endpoint.stop();
+
+ super.destroy();
+ }
+
+ protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
+ {
+ // Create the port
+ URL wsdlURL = getServletContext().getResource("/WEB-INF/wsdl/TestService.wsdl");
+ QName qname = new QName("http://org.jboss.ws/jaxws/endpoint", "EndpointService");
+ Service service = Service.create(wsdlURL, qname);
+ EndpointInterface port = (EndpointInterface)service.getPort(EndpointInterface.class);
+
+ // Invoke the endpoint
+ String param = req.getParameter("param");
+ String retStr = port.echo(param);
+
+ // Return the result
+ PrintWriter pw = new PrintWriter(res.getWriter());
+ pw.print(retStr);
+ }
+}
Added: trunk/testsuite/src/main/org/jboss/test/webservice/endpoint/EndpointTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/webservice/endpoint/EndpointTestCase.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/webservice/endpoint/EndpointTestCase.java 2009-10-16 23:56:07 UTC (rev 95058)
@@ -0,0 +1,83 @@
+/*
+ * 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.test.webservice.endpoint;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.net.URL;
+
+import javax.wsdl.Definition;
+import javax.wsdl.factory.WSDLFactory;
+import javax.wsdl.xml.WSDLReader;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.jboss.test.webservice.WebserviceTestBase;
+
+/**
+ * Test JAXWS Endpoint deployment
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @since 29-Apr-2005
+ */
+public class EndpointTestCase extends WebserviceTestBase
+{
+ public EndpointTestCase(String name)
+ {
+ super(name);
+ }
+
+ public static Test suite() throws Exception
+ {
+ return getDeploySetup(EndpointTestCase.class, "jaxws-endpoint-servlet.war");
+ }
+
+ public void testWSDLAccess() throws Exception
+ {
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-endpoint?wsdl");
+ WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader();
+ Definition wsdlDefinition = wsdlReader.readWSDL(wsdlURL.toString());
+ assertNotNull(wsdlDefinition);
+ }
+
+ public void testClientAccess() throws Exception
+ {
+ // Create the port
+ String wsdlURL = getResourceURL("webservice/endpoint/WEB-INF/wsdl/TestService.wsdl");
+ QName qname = new QName("http://org.jboss.ws/jaxws/endpoint", "EndpointService");
+ Service service = Service.create(new URL(wsdlURL), qname);
+ EndpointInterface port = (EndpointInterface)service.getPort(EndpointInterface.class);
+
+ String helloWorld = "Hello world!";
+ Object retObj = port.echo(helloWorld);
+ assertEquals(helloWorld, retObj);
+ }
+
+ public void testServletAccess() throws Exception
+ {
+ URL url = new URL("http://" + getServerHost() + ":8080/jaxws-endpoint-servlet?param=hello-world");
+ BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
+ assertEquals("hello-world", br.readLine());
+ }
+}
Added: trunk/testsuite/src/resources/webservice/endpoint/WEB-INF/web.xml
===================================================================
--- trunk/testsuite/src/resources/webservice/endpoint/WEB-INF/web.xml (rev 0)
+++ trunk/testsuite/src/resources/webservice/endpoint/WEB-INF/web.xml 2009-10-16 23:56:07 UTC (rev 95058)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+
+ <servlet>
+ <servlet-name>TestService</servlet-name>
+ <servlet-class>org.jboss.test.webservice.endpoint.EndpointServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>TestService</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
+
Added: trunk/testsuite/src/resources/webservice/endpoint/WEB-INF/wsdl/TestService.wsdl
===================================================================
--- trunk/testsuite/src/resources/webservice/endpoint/WEB-INF/wsdl/TestService.wsdl (rev 0)
+++ trunk/testsuite/src/resources/webservice/endpoint/WEB-INF/wsdl/TestService.wsdl 2009-10-16 23:56:07 UTC (rev 95058)
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<definitions name="EndpointService" targetNamespace="http://org.jboss.ws/jaxws/endpoint" xmlns:tns="http://org.jboss.ws/jaxws/endpoint"
+ xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
+ <types/>
+ <message name="EndpointInterface_echo">
+ <part name="String_1" type="xsd:string"/>
+ </message>
+ <message name="EndpointInterface_echoResponse">
+ <part name="result" type="xsd:string"/>
+ </message>
+ <portType name="EndpointInterface">
+ <operation name="echo" parameterOrder="String_1">
+ <input message="tns:EndpointInterface_echo"/>
+ <output message="tns:EndpointInterface_echoResponse"/>
+ </operation>
+ </portType>
+ <binding name="EndpointInterfaceBinding" type="tns:EndpointInterface">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/>
+ <operation name="echo">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal" namespace="http://org.jboss.ws/jaxws/endpoint"/>
+ </input>
+ <output>
+ <soap:body use="literal" namespace="http://org.jboss.ws/jaxws/endpoint"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="EndpointService">
+ <port name="EndpointInterfacePort" binding="tns:EndpointInterfaceBinding">
+ <soap:address location="http://@jbosstest.host.name@:8080/jaxws-endpoint"/>
+ </port>
+ </service>
+</definitions>
Modified: trunk/tomcat/pom.xml
===================================================================
--- trunk/tomcat/pom.xml 2009-10-16 22:58:16 UTC (rev 95057)
+++ trunk/tomcat/pom.xml 2009-10-16 23:56:07 UTC (rev 95058)
@@ -208,8 +208,8 @@
<artifactId>jasper-jdt</artifactId>
</dependency>
<dependency>
- <groupId>org.jboss.ws.native</groupId>
- <artifactId>jbossws-native-jaxws</artifactId>
+ <groupId>javax.xml.ws</groupId>
+ <artifactId>jaxws-api</artifactId>
</dependency>
<dependency>
<groupId>jgroups</groupId>
Added: trunk/webservices/src/main/java/org/jboss/webservices/integration/config/ServerConfigFactoryImpl.java
===================================================================
--- trunk/webservices/src/main/java/org/jboss/webservices/integration/config/ServerConfigFactoryImpl.java (rev 0)
+++ trunk/webservices/src/main/java/org/jboss/webservices/integration/config/ServerConfigFactoryImpl.java 2009-10-16 23:56:07 UTC (rev 95058)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.webservices.integration.config;
+
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.ioc.IoCContainerProxy;
+import org.jboss.wsf.spi.ioc.IoCContainerProxyFactory;
+import org.jboss.wsf.spi.management.ServerConfig;
+import org.jboss.wsf.spi.management.ServerConfigFactory;
+
+/**
+ * Retrieves webservices stack specific config from MC kernel.
+ *
+ * @author <a href="mailto:hbraun at redhat.com">Heiko Braun</a>
+ * @author <a href="mailto:ropalka at redhat.com">Richard Opalka</a>
+ */
+public final class ServerConfigFactoryImpl extends ServerConfigFactory
+{
+
+ /** The bean name in the kernel registry. */
+ private static final String BEAN_NAME = "WSServerConfig";
+
+ /**
+ * Constructor.
+ */
+ public ServerConfigFactoryImpl()
+ {
+ super();
+ }
+
+ /**
+ * Returns config registered in MC kernel.
+ *
+ * @return config
+ */
+ public ServerConfig getServerConfig()
+ {
+ final SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ final IoCContainerProxyFactory iocContainerFactory = spiProvider.getSPI(IoCContainerProxyFactory.class);
+ final IoCContainerProxy iocContainer = iocContainerFactory.getContainer();
+
+ return iocContainer.getBean(ServerConfigFactoryImpl.BEAN_NAME, ServerConfig.class);
+ }
+
+}
Modified: trunk/webservices/src/main/java/org/jboss/webservices/integration/deployers/deployment/AbstractDeploymentModelBuilder.java
===================================================================
--- trunk/webservices/src/main/java/org/jboss/webservices/integration/deployers/deployment/AbstractDeploymentModelBuilder.java 2009-10-16 22:58:16 UTC (rev 95057)
+++ trunk/webservices/src/main/java/org/jboss/webservices/integration/deployers/deployment/AbstractDeploymentModelBuilder.java 2009-10-16 23:56:07 UTC (rev 95058)
@@ -12,6 +12,7 @@
import org.jboss.metadata.serviceref.VirtualFileAdaptor;
import org.jboss.virtual.VirtualFile;
import org.jboss.webservices.integration.util.ASHelper;
+import org.jboss.wsf.common.ResourceLoaderAdapter;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.deployment.ArchiveDeployment;
@@ -24,7 +25,7 @@
/**
* Base class for all deployment model builders.
- *
+ *
* @author <a href="mailto:ropalka at redhat.com">Richard Opalka</a>
*/
abstract class AbstractDeploymentModelBuilder implements DeploymentModelBuilder
@@ -53,7 +54,7 @@
/**
* @see org.jboss.webservices.integration.deployers.deployment.DeploymentModelBuilder#newDeploymentModel(DeploymentUnit)
- *
+ *
* @param unit deployment unit
*/
public final void newDeploymentModel(final DeploymentUnit unit)
@@ -68,7 +69,7 @@
/**
* Template method for subclasses to implement.
- *
+ *
* @param dep webservice deployment
* @param unit deployment unit
*/
@@ -76,7 +77,7 @@
/**
* Creates new Web Service endpoint.
- *
+ *
* @param endpointClass endpoint class name
* @param endpointName endpoint name
* @param dep deployment
@@ -103,7 +104,7 @@
/**
* Creates new Web Service deployment.
- *
+ *
* @param unit deployment unit
* @return archive deployment
*/
@@ -142,7 +143,14 @@
dep.setParent(parentDep);
}
- dep.setRootFile(new VirtualFileAdaptor(((VFSDeploymentUnit) unit).getRoot()));
+ if (unit instanceof VFSDeploymentUnit)
+ {
+ dep.setRootFile(new VirtualFileAdaptor(((VFSDeploymentUnit) unit).getRoot()));
+ }
+ else
+ {
+ dep.setRootFile(new ResourceLoaderAdapter(unit.getClassLoader()));
+ }
dep.setRuntimeClassLoader(unit.getClassLoader());
final DeploymentType deploymentType = ASHelper.getRequiredAttachment(unit, DeploymentType.class);
dep.setType(deploymentType);
@@ -152,7 +160,7 @@
/**
* Creates new archive deployment.
- *
+ *
* @param name deployment name
* @param loader deployment loader
* @return new archive deployment
@@ -166,7 +174,7 @@
* Gets specified attachment from deployment unit.
* Checks it's not null and then propagates it to <b>dep</b>
* attachments. Finally it returns attachment value.
- *
+ *
* @param <A> class type
* @param attachment attachment
* @param unit deployment unit
Added: trunk/webservices/src/main/java/org/jboss/webservices/integration/endpoint/EndpointAPIHttpServer.java
===================================================================
--- trunk/webservices/src/main/java/org/jboss/webservices/integration/endpoint/EndpointAPIHttpServer.java (rev 0)
+++ trunk/webservices/src/main/java/org/jboss/webservices/integration/endpoint/EndpointAPIHttpServer.java 2009-10-16 23:56:07 UTC (rev 95058)
@@ -0,0 +1,242 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.webservices.integration.endpoint;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.ws.Endpoint;
+
+import org.jboss.classloading.spi.dependency.ClassLoading;
+import org.jboss.classloading.spi.dependency.Module;
+import org.jboss.deployers.client.plugins.deployment.AbstractDeployment;
+import org.jboss.deployers.client.spi.DeployerClient;
+import org.jboss.deployers.client.spi.Deployment;
+import org.jboss.deployers.client.spi.DeploymentFactory;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.attachments.MutableAttachments;
+import org.jboss.deployers.structure.spi.ClassLoaderFactory;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.metadata.web.jboss.JBossServletsMetaData;
+import org.jboss.metadata.web.jboss.JBossWebMetaData;
+import org.jboss.metadata.web.spec.ServletMappingMetaData;
+import org.jboss.webservices.integration.util.WebMetaDataHelper;
+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.WSFDeploymentException;
+import org.jboss.wsf.spi.http.HttpContext;
+import org.jboss.wsf.spi.http.HttpContextFactory;
+import org.jboss.wsf.spi.http.HttpServer;
+
+/**
+ * JAXWS HTTP server implementation that nestles inside JBoss AS.
+ * This implementation simply delegates deployment of dynamically created
+ * JBoss web deployment to JBoss main deployer.
+ *
+ * @author <a href="mailto:ropalka at redhat.com">Richard Opalka</a>
+ * @author <a href="mailto:tdiesler at redhat.com">Thomas Diesler</a>
+ */
+public final class EndpointAPIHttpServer extends AbstractExtensible implements HttpServer
+{
+
+ /** JBoss deployment factory. */
+ private final DeploymentFactory factory = new DeploymentFactory();
+ /** JBoss Main deployer. */
+ private final DeployerClient mainDeployer;
+ /** JBossWS SPI provider. */
+ private final SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ /** Registered deployments. */
+ private final Map<String, Deployment> deployments = new HashMap<String, Deployment>();
+
+ /**
+ * Constructor - invoked by MC.
+ *
+ * @param mainDeployer JBoss main deployer
+ */
+ public EndpointAPIHttpServer(final DeployerClient mainDeployer)
+ {
+ super();
+ this.mainDeployer = mainDeployer;
+ }
+
+ /**
+ * Creates an requested HTTP context.
+ *
+ * @param contextRoot context root name
+ * @return context instance
+ */
+ public synchronized HttpContext createContext(final String contextRoot)
+ {
+ return this.spiProvider.getSPI(HttpContextFactory.class).newHttpContext(this, contextRoot);
+ }
+
+ /**
+ * Publishes a JAXWS endpoint to the JBoss server.
+ *
+ * @param context web context
+ * @param endpoint to publish
+ */
+ public synchronized void publish(final HttpContext context, final Endpoint endpoint)
+ {
+ final String contextRoot = context.getContextRoot();
+ if (this.deployments.keySet().contains(contextRoot))
+ {
+ throw new WSFDeploymentException("Context root '" + contextRoot + "' already exists");
+ }
+
+ final Class<?> endpointClass = this.getEndpointClass(endpoint);
+ final ClassLoader endpointClassLoader = endpointClass.getClassLoader();
+ final Deployment deployment = this.createSimpleDeployment("http://jaxws-endpoint-api" + contextRoot);
+ final MutableAttachments mutableAttachments = (MutableAttachments) deployment.getPredeterminedManagedObjects();
+ final JBossWebMetaData jbossWebMD = this.newJBossWebMetaData(contextRoot, endpointClass);
+
+ mutableAttachments.addAttachment("org.jboss.web.explicitDocBase", "/", String.class);
+ mutableAttachments.addAttachment(JBossWebMetaData.class, jbossWebMD);
+ mutableAttachments.addAttachment(ClassLoaderFactory.class, new ContextClassLoaderFactory(endpointClassLoader));
+ mutableAttachments.addAttachment(Module.class, ClassLoading.getModuleForClassLoader(endpointClassLoader));
+
+ try
+ {
+ this.mainDeployer.deploy(deployment);
+ this.deployments.put(contextRoot, deployment);
+ }
+ catch (DeploymentException de)
+ {
+ WSFDeploymentException.rethrow(de);
+ }
+ }
+
+ /**
+ * Destroys dynamically published JAXWS endpoint on the JBoss server.
+ *
+ * @param context to be destroyed
+ * @param endpoint to be unpublished
+ */
+ public synchronized void destroy(final HttpContext context, final Endpoint endpoint)
+ {
+ try
+ {
+ final String contextRoot = context.getContextRoot();
+ final Deployment deployment = this.deployments.remove(contextRoot);
+ if (deployment != null)
+ {
+ this.mainDeployer.undeploy(deployment);
+ }
+ }
+ catch (Exception ex)
+ {
+ WSFDeploymentException.rethrow(ex);
+ }
+ }
+
+ /**
+ * Returns implementor class associated with endpoint.
+ *
+ * @param endpoint to get implementor class from
+ * @return implementor class
+ */
+ private Class<?> getEndpointClass(final Endpoint endpoint)
+ {
+ final Object implementor = endpoint.getImplementor();
+ return implementor instanceof Class<?> ? (Class<?>) implementor : implementor.getClass();
+ }
+
+ /**
+ * Creates new JBoss web meta data.
+ *
+ * @param contextRoot context root
+ * @param endpointClass endpoint class
+ * @return new JBoss web meta data
+ */
+ private JBossWebMetaData newJBossWebMetaData(final String contextRoot, final Class<?> endpointClass)
+ {
+ final JBossWebMetaData jbossWebMD = new JBossWebMetaData();
+ final JBossServletsMetaData servletsMD = WebMetaDataHelper.getServlets(jbossWebMD);
+ final List<ServletMappingMetaData> servletMappingMD = WebMetaDataHelper.getServletMappings(jbossWebMD);
+ final String servletName = "jaxws-dynamic-endpoint";
+
+ WebMetaDataHelper.newServlet(servletName, endpointClass.getName(), servletsMD);
+ WebMetaDataHelper.newServletMapping(servletName, WebMetaDataHelper.getUrlPatterns("/*"), servletMappingMD);
+ jbossWebMD.setContextRoot(contextRoot);
+
+ return jbossWebMD;
+ }
+
+ /**
+ * Creates simple web deployment using deployers client api.
+ *
+ * @param name deployment name
+ * @return new deployment
+ */
+ private Deployment createSimpleDeployment(final String name)
+ {
+ final Deployment unit = new AbstractDeployment(name);
+ this.factory.addContext(unit, "");
+
+ return unit;
+ }
+
+ /**
+ * @see org.jboss.deployers.structure.spi.ClassLoaderFactory
+ */
+ private static class ContextClassLoaderFactory implements ClassLoaderFactory
+ {
+ /** Delegee. */
+ private ClassLoader classLoader;
+
+ /**
+ * Constructor.
+ *
+ * @param classLoader class loader
+ */
+ public ContextClassLoaderFactory(final ClassLoader classLoader)
+ {
+ this.classLoader = classLoader;
+ }
+
+ /**
+ * @see org.jboss.deployers.structure.spi.ClassLoaderFactory#createClassLoader(DeploymentUnit)
+ *
+ * @param unit deployment unit
+ * @return class loader
+ * @throws Exception never thrown in our case
+ */
+ public ClassLoader createClassLoader(final DeploymentUnit unit) throws Exception
+ {
+ return this.classLoader;
+ }
+
+ /**
+ * @see org.jboss.deployers.structure.spi.ClassLoaderFactory#removeClassLoader(DeploymentUnit)
+ *
+ * @param unit deployment unit
+ * @throws Exception never thrown in our case
+ */
+ public void removeClassLoader(final DeploymentUnit unit) throws Exception
+ {
+ this.classLoader = null;
+ }
+ }
+
+}
Added: trunk/webservices/src/main/java/org/jboss/webservices/integration/endpoint/HttpServerFactoryImpl.java
===================================================================
--- trunk/webservices/src/main/java/org/jboss/webservices/integration/endpoint/HttpServerFactoryImpl.java (rev 0)
+++ trunk/webservices/src/main/java/org/jboss/webservices/integration/endpoint/HttpServerFactoryImpl.java 2009-10-16 23:56:07 UTC (rev 95058)
@@ -0,0 +1,66 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.webservices.integration.endpoint;
+
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.http.HttpServer;
+import org.jboss.wsf.spi.http.HttpServerFactory;
+import org.jboss.wsf.spi.ioc.IoCContainerProxy;
+import org.jboss.wsf.spi.ioc.IoCContainerProxyFactory;
+
+/**
+ * Lookups http server inside MC container.
+ *
+ * @author <a href="mailto:tdiesler at redhat.com">Thomas Diesler</a>
+ * @author <a href="mailto:ropalka at redhat.com">Richard Opalka</a>
+ */
+public final class HttpServerFactoryImpl extends HttpServerFactory
+{
+
+ /** The default bean name. */
+ private static final String BEAN_NAME = "WSHTTPServer";
+
+ /**
+ * Constructor.
+ */
+ public HttpServerFactoryImpl()
+ {
+ super();
+ }
+
+ /**
+ * Returns http server registered in MC kernel.
+ *
+ * @return http server
+ */
+ @Override
+ public HttpServer getHttpServer()
+ {
+ final SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ final IoCContainerProxyFactory iocContainerFactory = spiProvider.getSPI(IoCContainerProxyFactory.class);
+ final IoCContainerProxy iocContainer = iocContainerFactory.getContainer();
+
+ return iocContainer.getBean(HttpServerFactoryImpl.BEAN_NAME, HttpServer.class);
+ }
+
+}
Deleted: trunk/webservices/src/main/java/org/jboss/webservices/integration/invocation/AbstractInvocationHandler.java
===================================================================
--- trunk/webservices/src/main/java/org/jboss/webservices/integration/invocation/AbstractInvocationHandler.java 2009-10-16 22:58:16 UTC (rev 95057)
+++ trunk/webservices/src/main/java/org/jboss/webservices/integration/invocation/AbstractInvocationHandler.java 2009-10-16 23:56:07 UTC (rev 95058)
@@ -1,87 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.webservices.integration.invocation;
-
-import java.lang.reflect.Method;
-
-import org.jboss.logging.Logger;
-import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.invocation.Invocation;
-import org.jboss.wsf.spi.invocation.InvocationHandler;
-
-/**
- * Base class for all Web Service invocation handlers inside AS.
- *
- * @author <a href="mailto:ropalka at redhat.com">Richard Opalka</a>
- * @author <a href="mailto:tdiesler at redhat.com">Thomas Diesler</a>
- */
-abstract class AbstractInvocationHandler extends InvocationHandler
-{
-
- /** Logger. */
- protected final Logger log = Logger.getLogger(this.getClass());
-
- /**
- * Constructor.
- */
- protected AbstractInvocationHandler()
- {
- super();
- }
-
- /**
- * Creates invocation.
- *
- * @return invocation instance
- */
- public final Invocation createInvocation()
- {
- return new Invocation();
- }
-
- /**
- * Initialization method.
- *
- * @param endpoint endpoint
- */
- public void init(final Endpoint endpoint)
- {
- // does nothing
- }
-
- /**
- * Returns implementation method that will be used for invocation.
- *
- * @param implClass implementation endpoint class
- * @param seiMethod SEI interface method used for method finding algorithm
- * @return implementation method
- * @throws NoSuchMethodException if implementation method wasn't found
- */
- protected final Method getImplMethod(final Class<?> implClass, final Method seiMethod) throws NoSuchMethodException
- {
- final String methodName = seiMethod.getName();
- final Class<?>[] paramTypes = seiMethod.getParameterTypes();
-
- return implClass.getMethod(methodName, paramTypes);
- }
-
-}
Deleted: trunk/webservices/src/main/java/org/jboss/webservices/integration/invocation/AbstractInvocationHandlerJSE.java
===================================================================
--- trunk/webservices/src/main/java/org/jboss/webservices/integration/invocation/AbstractInvocationHandlerJSE.java 2009-10-16 22:58:16 UTC (rev 95057)
+++ trunk/webservices/src/main/java/org/jboss/webservices/integration/invocation/AbstractInvocationHandlerJSE.java 2009-10-16 23:56:07 UTC (rev 95058)
@@ -1,181 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.webservices.integration.invocation;
-
-import java.lang.reflect.Method;
-
-import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.invocation.Invocation;
-import org.jboss.wsf.spi.invocation.InvocationContext;
-
-/**
- * Handles invocations on JSE endpoints.
- *
- * @author <a href="mailto:ropalka at redhat.com">Richard Opalka</a>
- * @author <a href="mailto:tdiesler at redhat.com">Thomas Diesler</a>
- */
-abstract class AbstractInvocationHandlerJSE extends AbstractInvocationHandler
-{
-
- /**
- * Constructor.
- */
- protected AbstractInvocationHandlerJSE()
- {
- super();
- }
-
- /**
- * Retrieves endpoint implementation bean that will be used in invocation process.
- *
- * This method does the following steps:
- *
- * <ul>
- * <li>tries to retrieve endpoint instance from invocation context,</li>
- * <li>if endpoint instance is not found it's created and instantiated (lazy initialization)</li>
- * <li>
- * if endpoint instance was created all subclasses will be notified about this event
- * (using {@link #onEndpointInstantiated(Endpoint, Invocation)} template method).
- * </li>
- * </ul>
- *
- * @param endpoint to lookup implementation instance for
- * @param invocation current invocation
- * @return endpoint implementation
- * @throws Exception if any error occurs
- */
- protected final Object getTargetBean(final Endpoint endpoint, final Invocation invocation) throws Exception
- {
- final InvocationContext invocationContext = invocation.getInvocationContext();
- Object targetBean = invocationContext.getTargetBean();
-
- if (targetBean == null)
- {
- try
- {
- // create endpoint instance
- final Class<?> endpointImplClass = endpoint.getTargetBeanClass();
- targetBean = endpointImplClass.newInstance();
- invocationContext.setTargetBean(targetBean);
-
- // notify subclasses
- this.onEndpointInstantiated(endpoint, invocation);
- }
- catch (Exception ex)
- {
- throw new IllegalStateException("Cannot create endpoint instance: ", ex);
- }
- }
-
- return targetBean;
- }
-
- /**
- * Invokes method on endpoint implementation.
- *
- * This method does the following steps:
- *
- * <ul>
- * <li>lookups endpoint implementation method to be invoked,</li>
- * <li>
- * notifies all subclasses about endpoint method is going to be invoked<br/>
- * (using {@link #onBeforeInvocation(Invocation)} template method),
- * </li>
- * <li>endpoint implementation method is invoked,</li>
- * <li>
- * notifies all subclasses about endpoint method invocation was completed<br/>
- * (using {@link #onAfterInvocation(Invocation)} template method).
- * </li>
- * </ul>
- *
- * @param endpoint which method is going to be invoked
- * @param invocation current invocation
- * @throws Exception if any error occurs
- */
- public final void invoke(final Endpoint endpoint, final Invocation invocation) throws Exception
- {
- try
- {
- // prepare for invocation
- final Object targetBean = this.getTargetBean(endpoint, invocation);
- final Class<?> implClass = targetBean.getClass();
- final Method seiMethod = invocation.getJavaMethod();
- final Method implMethod = this.getImplMethod(implClass, seiMethod);
- final Object[] args = invocation.getArgs();
-
- // notify subclasses
- this.onBeforeInvocation(invocation);
-
- // invoke implementation method
- final Object retObj = implMethod.invoke(targetBean, args);
-
- // set invocation result
- invocation.setReturnValue(retObj);
- }
- catch (Exception e)
- {
- this.log.error("Method invocation failed with exception: " + e.getMessage(), e);
- // propagate exception
- this.handleInvocationException(e);
- }
- finally
- {
- // notify subclasses
- this.onAfterInvocation(invocation);
- }
- }
-
- /**
- * Template method for notifying subclasses that endpoint instance have been instantiated.
- *
- * @param endpoint instantiated endpoint
- * @param invocation current invocation
- * @throws Exception subclasses have to throw exception on any failure
- */
- protected void onEndpointInstantiated(final Endpoint endpoint, final Invocation invocation) throws Exception
- {
- // does nothing
- }
-
- /**
- * Template method for notifying subclasses that endpoint method is going to be invoked.
- *
- * @param invocation current invocation
- * @throws Exception subclasses have to throw exception on any failure
- */
- protected void onBeforeInvocation(final Invocation invocation) throws Exception
- {
- // does nothing
- }
-
- /**
- * Template method for notifying subclasses that endpoint method invocation was completed.
- *
- * @param invocation current invocation
- * @throws Exception subclasses have to throw exception on any failure
- */
- protected void onAfterInvocation(final Invocation invocation) throws Exception
- {
- // does nothing
- }
-
-}
Modified: trunk/webservices/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB21.java
===================================================================
--- trunk/webservices/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB21.java 2009-10-16 22:58:16 UTC (rev 95057)
+++ trunk/webservices/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB21.java 2009-10-16 23:56:07 UTC (rev 95058)
@@ -39,6 +39,7 @@
import org.jboss.mx.util.MBeanServerLocator;
import org.jboss.wsf.common.ObjectNameFactory;
import org.jboss.wsf.common.integration.WSHelper;
+import org.jboss.wsf.common.invocation.AbstractInvocationHandler;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.deployment.Deployment;
Modified: trunk/webservices/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB3.java
===================================================================
--- trunk/webservices/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB3.java 2009-10-16 22:58:16 UTC (rev 95057)
+++ trunk/webservices/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB3.java 2009-10-16 23:56:07 UTC (rev 95058)
@@ -25,14 +25,16 @@
import javax.xml.ws.WebServiceException;
-import org.jboss.dependency.spi.ControllerContext;
-import org.jboss.kernel.spi.dependency.KernelController;
import org.jboss.webservices.integration.util.ASHelper;
+import org.jboss.wsf.common.invocation.AbstractInvocationHandler;
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.invocation.Invocation;
import org.jboss.wsf.spi.invocation.integration.InvocationContextCallback;
import org.jboss.wsf.spi.invocation.integration.ServiceEndpointContainer;
-import org.jboss.wsf.spi.util.KernelLocator;
+import org.jboss.wsf.spi.ioc.IoCContainerProxy;
+import org.jboss.wsf.spi.ioc.IoCContainerProxyFactory;
/**
* Handles invocations on EJB3 endpoints.
@@ -44,7 +46,7 @@
{
/** MC kernel controller. */
- private final KernelController controller;
+ private final IoCContainerProxy iocContainer;
/** EJB3 container name. */
private String containerName;
@@ -59,7 +61,9 @@
{
super();
- this.controller = KernelLocator.getKernel().getController();
+ final SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ final IoCContainerProxyFactory iocContainerFactory = spiProvider.getSPI(IoCContainerProxyFactory.class);
+ this.iocContainer = iocContainerFactory.getContainer();
}
/**
@@ -88,13 +92,11 @@
if (ejb3ContainerNotInitialized)
{
- final ControllerContext context = this.controller.getInstalledContext(this.containerName);
- if (context == null)
+ this.serviceEndpointContainer = this.iocContainer.getBean(this.containerName, ServiceEndpointContainer.class);
+ if (this.serviceEndpointContainer == null)
{
throw new WebServiceException("Cannot find service endpoint target: " + this.containerName);
}
-
- this.serviceEndpointContainer = (ServiceEndpointContainer) context.getTarget();
}
return this.serviceEndpointContainer;
Modified: trunk/webservices/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerFactoryImpl.java
===================================================================
--- trunk/webservices/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerFactoryImpl.java 2009-10-16 22:58:16 UTC (rev 95057)
+++ trunk/webservices/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerFactoryImpl.java 2009-10-16 23:56:07 UTC (rev 95058)
@@ -21,6 +21,8 @@
*/
package org.jboss.webservices.integration.invocation;
+import org.jboss.wsf.common.invocation.InvocationHandlerJAXRPC;
+import org.jboss.wsf.common.invocation.InvocationHandlerJAXWS;
import org.jboss.wsf.spi.invocation.InvocationHandler;
import org.jboss.wsf.spi.invocation.InvocationHandlerFactory;
import org.jboss.wsf.spi.invocation.InvocationType;
Deleted: trunk/webservices/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXRPC.java
===================================================================
--- trunk/webservices/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXRPC.java 2009-10-16 22:58:16 UTC (rev 95057)
+++ trunk/webservices/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXRPC.java 2009-10-16 23:56:07 UTC (rev 95058)
@@ -1,90 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.webservices.integration.invocation;
-
-import javax.xml.rpc.server.ServiceLifecycle;
-import javax.xml.rpc.server.ServletEndpointContext;
-
-import org.jboss.wsf.spi.invocation.Invocation;
-import org.jboss.wsf.spi.invocation.InvocationContext;
-
-/**
- * Handles invocations on JAXRPC endpoints.
- *
- * @author <a href="mailto:ropalka at redhat.com">Richard Opalka</a>
- * @author <a href="mailto:tdiesler at redhat.com">Thomas Diesler</a>
- */
-final class InvocationHandlerJAXRPC extends AbstractInvocationHandlerJSE
-{
-
- /**
- * Constructor.
- */
- InvocationHandlerJAXRPC()
- {
- super();
- }
-
- /**
- * Calls {@link javax.xml.rpc.server.ServiceLifecycle#init(Object)}
- * method on target bean if this bean implements
- * {@link javax.xml.rpc.server.ServiceLifecycle} interface.
- *
- * @param invocation current invocation
- * @throws Exception if any error occurs
- */
- @Override
- protected void onBeforeInvocation(final Invocation invocation) throws Exception
- {
- final InvocationContext invocationContext = invocation.getInvocationContext();
- final Object targetBean = invocationContext.getTargetBean();
- final boolean isJaxrpcLifecycleBean = targetBean instanceof ServiceLifecycle;
-
- if (isJaxrpcLifecycleBean)
- {
- final ServletEndpointContext sepContext = invocationContext.getAttachment(ServletEndpointContext.class);
- ((ServiceLifecycle) targetBean).init(sepContext);
- }
- }
-
- /**
- * Calls {@link javax.xml.rpc.server.ServiceLifecycle#destroy()}
- * method on target bean if this bean implements
- * {@link javax.xml.rpc.server.ServiceLifecycle} interface.
- *
- * @param invocation current invocation
- * @throws Exception if any error occurs
- */
- @Override
- protected void onAfterInvocation(final Invocation invocation) throws Exception
- {
- final InvocationContext invocationContext = invocation.getInvocationContext();
- final Object targetBean = invocationContext.getTargetBean();
- final boolean isJaxrpcLifecycleBean = targetBean instanceof ServiceLifecycle;
-
- if (isJaxrpcLifecycleBean)
- {
- ((ServiceLifecycle) targetBean).destroy();
- }
- }
-
-}
Deleted: trunk/webservices/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXWS.java
===================================================================
--- trunk/webservices/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXWS.java 2009-10-16 22:58:16 UTC (rev 95057)
+++ trunk/webservices/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXWS.java 2009-10-16 23:56:07 UTC (rev 95058)
@@ -1,143 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.webservices.integration.invocation;
-
-import javax.xml.ws.WebServiceContext;
-
-import org.jboss.wsf.common.injection.InjectionHelper;
-import org.jboss.wsf.common.injection.PreDestroyHolder;
-import org.jboss.wsf.spi.SPIProvider;
-import org.jboss.wsf.spi.SPIProviderResolver;
-import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.invocation.Invocation;
-import org.jboss.wsf.spi.invocation.InvocationContext;
-import org.jboss.wsf.spi.invocation.ResourceInjector;
-import org.jboss.wsf.spi.invocation.ResourceInjectorFactory;
-import org.jboss.wsf.spi.metadata.injection.InjectionsMetaData;
-
-/**
- * Handles invocations on JAXWS endpoints.
- *
- * @author <a href="mailto:ropalka at redhat.com">Richard Opalka</a>
- * @author <a href="mailto:tdiesler at redhat.com">Thomas Diesler</a>
- */
-final class InvocationHandlerJAXWS extends AbstractInvocationHandlerJSE
-{
-
- /** WebServiceContext injector. */
- private final ResourceInjector wsContextInjector;
-
- /**
- * Constructor.
- */
- InvocationHandlerJAXWS()
- {
- super();
-
- final SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
- final ResourceInjectorFactory resourceInjectorFactory = spiProvider.getSPI(ResourceInjectorFactory.class);
- this.wsContextInjector = resourceInjectorFactory.newResourceInjector();
- }
-
- /**
- * Injects resources on target bean and calls post construct method.
- * Finally it registers target bean for predestroy phase.
- *
- * @param endpoint used for predestroy phase registration process
- * @param invocation current invocation
- */
- @Override
- protected void onEndpointInstantiated(final Endpoint endpoint, final Invocation invocation)
- {
- final InjectionsMetaData injectionsMD = endpoint.getAttachment(InjectionsMetaData.class);
- final Object targetBean = this.getTargetBean(invocation);
-
- this.log.debug("Injecting resources on JAXWS JSE endpoint: " + targetBean);
- InjectionHelper.injectResources(targetBean, injectionsMD);
- this.log.debug("Calling postConstruct method on JAXWS JSE endpoint: " + targetBean);
- InjectionHelper.callPostConstructMethod(targetBean);
-
- endpoint.addAttachment(PreDestroyHolder.class, new PreDestroyHolder(targetBean));
- }
-
- /**
- * Injects webservice context on target bean.
- *
- * @param invocation current invocation
- */
- @Override
- protected void onBeforeInvocation(final Invocation invocation)
- {
- final WebServiceContext wsContext = this.getWebServiceContext(invocation);
-
- if (wsContext != null)
- {
- final Object targetBean = this.getTargetBean(invocation);
- this.wsContextInjector.inject(targetBean, wsContext);
- }
- }
-
- /**
- * Cleanups injected webservice context on target bean.
- *
- * @param invocation current invocation
- */
- @Override
- protected void onAfterInvocation(final Invocation invocation)
- {
- final WebServiceContext wsContext = this.getWebServiceContext(invocation);
-
- if (wsContext != null)
- {
- final Object targetBean = this.getTargetBean(invocation);
-
- this.wsContextInjector.inject(targetBean, null);
- }
- }
-
- /**
- * Returns WebServiceContext associated with this invocation.
- *
- * @param invocation current invocation
- * @return web service context or null if not available
- */
- private WebServiceContext getWebServiceContext(final Invocation invocation)
- {
- final InvocationContext invocationContext = invocation.getInvocationContext();
-
- return invocationContext.getAttachment(WebServiceContext.class);
- }
-
- /**
- * Returns endpoint instance associated with current invocation.
- *
- * @param invocation current invocation
- * @return target bean in invocation
- */
- private Object getTargetBean(final Invocation invocation)
- {
- final InvocationContext invocationContext = invocation.getInvocationContext();
-
- return invocationContext.getTargetBean();
- }
-
-}
Modified: trunk/webservices/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB21.java
===================================================================
--- trunk/webservices/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB21.java 2009-10-16 22:58:16 UTC (rev 95057)
+++ trunk/webservices/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB21.java 2009-10-16 23:56:07 UTC (rev 95058)
@@ -21,6 +21,8 @@
*/
package org.jboss.webservices.integration.invocation;
+import org.jboss.wsf.common.invocation.AbstractInvocationHandlerJSE;
+
/**
* Handles invocations on MDB EJB21 endpoints.
*
Modified: trunk/webservices/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB3.java
===================================================================
--- trunk/webservices/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB3.java 2009-10-16 22:58:16 UTC (rev 95057)
+++ trunk/webservices/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB3.java 2009-10-16 23:56:07 UTC (rev 95058)
@@ -21,6 +21,8 @@
*/
package org.jboss.webservices.integration.invocation;
+import org.jboss.wsf.common.invocation.AbstractInvocationHandlerJSE;
+
/**
* Handles invocations on MDB EJB3 endpoints.
*
Added: trunk/webservices/src/main/java/org/jboss/webservices/integration/ioc/IoCContainerProxyFactoryImpl.java
===================================================================
--- trunk/webservices/src/main/java/org/jboss/webservices/integration/ioc/IoCContainerProxyFactoryImpl.java (rev 0)
+++ trunk/webservices/src/main/java/org/jboss/webservices/integration/ioc/IoCContainerProxyFactoryImpl.java 2009-10-16 23:56:07 UTC (rev 95058)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.webservices.integration.ioc;
+
+import org.jboss.wsf.spi.ioc.IoCContainerProxy;
+import org.jboss.wsf.spi.ioc.IoCContainerProxyFactory;
+
+/**
+ * @see org.jboss.wsf.spi.ioc.IoCContainerProxyFactory
+ *
+ * @author <a href="mailto:ropalka at redhat.com">Richard Opalka</a>
+ */
+public final class IoCContainerProxyFactoryImpl implements IoCContainerProxyFactory
+{
+
+ /** Container proxy singleton. */
+ private static final IoCContainerProxy CONTAINER = IoCContainerProxyImpl.getInstance();
+
+ /**
+ * Constructor.
+ */
+ public IoCContainerProxyFactoryImpl()
+ {
+ super();
+ }
+
+ /**
+ * @see org.jboss.wsf.spi.ioc.IoCContainerProxyFactory#getContainer()
+ *
+ * @return IoC container proxy
+ */
+ public IoCContainerProxy getContainer()
+ {
+ return IoCContainerProxyFactoryImpl.CONTAINER;
+ }
+
+}
Added: trunk/webservices/src/main/java/org/jboss/webservices/integration/ioc/IoCContainerProxyImpl.java
===================================================================
--- trunk/webservices/src/main/java/org/jboss/webservices/integration/ioc/IoCContainerProxyImpl.java (rev 0)
+++ trunk/webservices/src/main/java/org/jboss/webservices/integration/ioc/IoCContainerProxyImpl.java 2009-10-16 23:56:07 UTC (rev 95058)
@@ -0,0 +1,88 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.webservices.integration.ioc;
+
+import org.jboss.dependency.spi.ControllerContext;
+import org.jboss.kernel.Kernel;
+import org.jboss.kernel.spi.dependency.KernelController;
+import org.jboss.wsf.spi.ioc.IoCContainerProxy;
+
+/**
+ * @see org.jboss.wsf.spi.ioc.IoCContainerProxy
+ *
+ * @author <a href="mailto:ropalka at redhat.com">Richard Opalka</a>
+ */
+public final class IoCContainerProxyImpl implements IoCContainerProxy
+{
+
+ /** Singleton. */
+ private static final IoCContainerProxy SINGLETON = new IoCContainerProxyImpl();
+ /** JBoss MC kernel. */
+ private static Kernel kernel;
+
+ /**
+ * Constructor.
+ */
+ public IoCContainerProxyImpl()
+ {
+ super();
+ }
+
+ /**
+ * Returns container proxy instance.
+ *
+ * @return container proxy instance
+ */
+ static IoCContainerProxy getInstance()
+ {
+ return IoCContainerProxyImpl.SINGLETON;
+ }
+
+ /**
+ * Sets JBoss kernel - invoked via MC injection.
+ *
+ * @param kernel JBoss kernel
+ */
+ public void setKernel(final Kernel kernel)
+ {
+ IoCContainerProxyImpl.kernel = kernel;
+ }
+
+ /**
+ * @see org.jboss.wsf.spi.ioc.IoCContainerProxy#getBean(java.lang.String, java.lang.Class)
+ *
+ * @param <T> bean type
+ * @param beanName bean name inside IoC registry
+ * @param clazz bean type class
+ * @return bean instance
+ * @throws IllegalArgumentException if bean is not found
+ */
+ @SuppressWarnings("unchecked")
+ public <T> T getBean(final String beanName, final Class<T> clazz)
+ {
+ final KernelController controller = IoCContainerProxyImpl.kernel.getController();
+ final ControllerContext ctx = controller.getInstalledContext(beanName);
+
+ return (T)ctx.getTarget();
+ }
+
+}
Modified: trunk/webservices/src/main/java/org/jboss/webservices/integration/metadata/AbstractMetaDataBuilderEJB.java
===================================================================
--- trunk/webservices/src/main/java/org/jboss/webservices/integration/metadata/AbstractMetaDataBuilderEJB.java 2009-10-16 22:58:16 UTC (rev 95057)
+++ trunk/webservices/src/main/java/org/jboss/webservices/integration/metadata/AbstractMetaDataBuilderEJB.java 2009-10-16 23:56:07 UTC (rev 95058)
@@ -41,6 +41,7 @@
abstract class AbstractMetaDataBuilderEJB
{
+ /** Logger. */
protected final Logger log = Logger.getLogger(this.getClass());
/**
Modified: trunk/webservices/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataCreator.java
===================================================================
--- trunk/webservices/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataCreator.java 2009-10-16 22:58:16 UTC (rev 95057)
+++ trunk/webservices/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataCreator.java 2009-10-16 23:56:07 UTC (rev 95058)
@@ -32,6 +32,7 @@
import org.jboss.metadata.web.spec.SecurityConstraintMetaData;
import org.jboss.metadata.web.spec.ServletMappingMetaData;
import org.jboss.metadata.web.spec.WebResourceCollectionsMetaData;
+import org.jboss.webservices.integration.util.WebMetaDataHelper;
import org.jboss.wsf.common.integration.WSHelper;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
@@ -266,7 +267,7 @@
/**
* Creates login-config part of web.xml descriptor.
- *
+ *
* <pre>
* <login-config>
* <auth-method>EjbDeploymentAuthMethod</auth-method>
Deleted: trunk/webservices/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataHelper.java
===================================================================
--- trunk/webservices/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataHelper.java 2009-10-16 22:58:16 UTC (rev 95057)
+++ trunk/webservices/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataHelper.java 2009-10-16 23:56:07 UTC (rev 95058)
@@ -1,424 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.webservices.integration.tomcat;
-
-import java.util.Collections;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.jboss.metadata.javaee.spec.ParamValueMetaData;
-import org.jboss.metadata.web.jboss.JBossServletMetaData;
-import org.jboss.metadata.web.jboss.JBossServletsMetaData;
-import org.jboss.metadata.web.jboss.JBossWebMetaData;
-import org.jboss.metadata.web.spec.AuthConstraintMetaData;
-import org.jboss.metadata.web.spec.LoginConfigMetaData;
-import org.jboss.metadata.web.spec.SecurityConstraintMetaData;
-import org.jboss.metadata.web.spec.ServletMappingMetaData;
-import org.jboss.metadata.web.spec.ServletMetaData;
-import org.jboss.metadata.web.spec.TransportGuaranteeType;
-import org.jboss.metadata.web.spec.UserDataConstraintMetaData;
-import org.jboss.metadata.web.spec.WebResourceCollectionMetaData;
-import org.jboss.metadata.web.spec.WebResourceCollectionsMetaData;
-
-/**
- * Utility class that simplifies work with JBossWebMetaData object structure.
- *
- * @author <a href="mailto:ropalka at redhat.com">Richard Opalka</a>
- * @author <a href="mailto:tdiesler at redhat.com">Thomas Diesler</a>
- */
-final class WebMetaDataHelper
-{
-
- /** Star utility string. */
- private static final String STAR_STRING = "*";
-
- /** GET http method utility string. */
- private static final String GET_STRING = "GET";
-
- /** POST http method utility string. */
- private static final String POST_STRING = "POST";
-
- /** GET and POST methods utility list. */
- private static List<String> getAndPostMethods;
-
- /** POST method utility list. */
- private static List<String> onlyPostMethod;
-
- /** All roles utility list. */
- private static List<String> allRoles;
-
- static
- {
- final List<String> getAndPostList = new LinkedList<String>();
- getAndPostList.add(WebMetaDataHelper.GET_STRING);
- getAndPostList.add(WebMetaDataHelper.POST_STRING);
- WebMetaDataHelper.getAndPostMethods = Collections.unmodifiableList(getAndPostList);
-
- final List<String> onlyPostList = new LinkedList<String>();
- onlyPostList.add(WebMetaDataHelper.POST_STRING);
- WebMetaDataHelper.onlyPostMethod = Collections.unmodifiableList(onlyPostList);
-
- final List<String> roleNamesList = new LinkedList<String>();
- roleNamesList.add(WebMetaDataHelper.STAR_STRING);
- WebMetaDataHelper.allRoles = Collections.unmodifiableList(roleNamesList);
- }
-
- /**
- * Constructor.
- */
- private WebMetaDataHelper()
- {
- super();
- }
-
- /**
- * Creates URL pattern list from passed string.
- *
- * @param urlPattern URL pattern
- * @return list wrapping passed parameter
- */
- static List<String> getUrlPatterns(final String urlPattern)
- {
- final List<String> linkedList = new LinkedList<String>();
-
- linkedList.add(urlPattern);
-
- return linkedList;
- }
-
- /**
- * If WSDL access is secured, it returns both POST and GET methods, otherwise only POST method.
- *
- * @param secureWsdlAccess whether WSDL is secured
- * @return web access methods
- */
- static List<String> getHttpMethods(final boolean secureWsdlAccess)
- {
- return secureWsdlAccess ? WebMetaDataHelper.getAndPostMethods : WebMetaDataHelper.onlyPostMethod;
- }
-
- /**
- * Returns all role list.
- *
- * @return all role list
- */
- static List<String> getAllRoles()
- {
- return WebMetaDataHelper.allRoles;
- }
-
- /**
- * Gests servlets meta data from jboss web meta data.
- * If not found it creates new servlets meta data
- * and associates them with jboss web meta data.
- *
- * @param jbossWebMD jboss web meta data
- * @return servlets meta data
- */
- static JBossServletsMetaData getServlets(final JBossWebMetaData jbossWebMD)
- {
- JBossServletsMetaData servletsMD = jbossWebMD.getServlets();
-
- if (servletsMD == null)
- {
- servletsMD = new JBossServletsMetaData();
- jbossWebMD.setServlets(servletsMD);
- }
-
- return servletsMD;
- }
-
- /**
- * Gests servlet mappings meta data from jboss web meta data.
- * If not found it creates new servlet mappings meta data
- * and associates them with jboss web meta data.
- *
- * @param jbossWebMD jboss web meta data
- * @return servlet mappings meta data
- */
- static List<ServletMappingMetaData> getServletMappings(final JBossWebMetaData jbossWebMD)
- {
- List<ServletMappingMetaData> servletMappingsMD = jbossWebMD.getServletMappings();
-
- if (servletMappingsMD == null)
- {
- servletMappingsMD = new LinkedList<ServletMappingMetaData>();
- jbossWebMD.setServletMappings(servletMappingsMD);
- }
-
- return servletMappingsMD;
- }
-
- /**
- * Gests security constraints meta data from jboss web meta data.
- * If not found it creates new security constraints meta data
- * and associates them with jboss web meta data.
- *
- * @param jbossWebMD jboss web meta data
- * @return security constraints meta data
- */
- static List<SecurityConstraintMetaData> getSecurityConstraints(final JBossWebMetaData jbossWebMD)
- {
- List<SecurityConstraintMetaData> securityConstraintsMD = jbossWebMD.getSecurityConstraints();
-
- if (securityConstraintsMD == null)
- {
- securityConstraintsMD = new LinkedList<SecurityConstraintMetaData>();
- jbossWebMD.setSecurityConstraints(securityConstraintsMD);
- }
-
- return securityConstraintsMD;
- }
-
- /**
- * Gests login config meta data from jboss web meta data.
- * If not found it creates new login config meta data
- * and associates them with jboss web meta data.
- *
- * @param jbossWebMD jboss web meta data
- * @return login config meta data
- */
- static LoginConfigMetaData getLoginConfig(final JBossWebMetaData jbossWebMD)
- {
- LoginConfigMetaData loginConfigMD = jbossWebMD.getLoginConfig();
-
- if (loginConfigMD == null)
- {
- loginConfigMD = new LoginConfigMetaData();
- jbossWebMD.setLoginConfig(loginConfigMD);
- }
-
- return loginConfigMD;
- }
-
- /**
- * Gests context parameters meta data from jboss web meta data.
- * If not found it creates new context parameters meta data
- * and associates them with jboss web meta data.
- *
- * @param jbossWebMD jboss web meta data
- * @return context parameters meta data
- */
- static List<ParamValueMetaData> getContextParams(final JBossWebMetaData jbossWebMD)
- {
- List<ParamValueMetaData> contextParamsMD = jbossWebMD.getContextParams();
-
- if (contextParamsMD == null)
- {
- contextParamsMD = new LinkedList<ParamValueMetaData>();
- jbossWebMD.setContextParams(contextParamsMD);
- }
-
- return contextParamsMD;
- }
-
- /**
- * Gests web resource collections meta data from security constraint meta data.
- * If not found it creates new web resource collections meta data
- * and associates them with security constraint meta data.
- *
- * @param securityConstraintMD security constraint meta data
- * @return web resource collections meta data
- */
- static WebResourceCollectionsMetaData getWebResourceCollections(final SecurityConstraintMetaData securityConstraintMD)
- {
- WebResourceCollectionsMetaData webResourceCollectionsMD = securityConstraintMD.getResourceCollections();
-
- if (webResourceCollectionsMD == null)
- {
- webResourceCollectionsMD = new WebResourceCollectionsMetaData();
- securityConstraintMD.setResourceCollections(webResourceCollectionsMD);
- }
-
- return webResourceCollectionsMD;
- }
-
- /**
- * Gests init parameters meta data from servlet meta data.
- * If not found it creates new init parameters meta data
- * and associates them with servlet meta data.
- *
- * @param servletMD servlet meta data
- * @return init parameters meta data
- */
- static List<ParamValueMetaData> getServletInitParams(final ServletMetaData servletMD)
- {
- List<ParamValueMetaData> initParamsMD = servletMD.getInitParam();
-
- if (initParamsMD == null)
- {
- initParamsMD = new LinkedList<ParamValueMetaData>();
- servletMD.setInitParam(initParamsMD);
- }
-
- return initParamsMD;
- }
-
- /**
- * Creates new security constraint meta data and associates them with security constraints meta data.
- *
- * @param securityConstraintsMD security constraints meta data
- * @return new security constraing meta data
- */
- static SecurityConstraintMetaData newSecurityConstraint(final List<SecurityConstraintMetaData> securityConstraintsMD)
- {
- final SecurityConstraintMetaData securityConstraintMD = new SecurityConstraintMetaData();
-
- securityConstraintsMD.add(securityConstraintMD);
-
- return securityConstraintMD;
- }
-
- /**
- * Creates new web resource collection meta data and associates them with web resource collections meta data.
- *
- * @param servletName servlet name
- * @param urlPattern URL pattern
- * @param securedWsdl whether WSDL access is secured
- * @param webResourceCollectionsMD web resource collections meta data
- * @return new web resource collection meta data
- */
- static WebResourceCollectionMetaData newWebResourceCollection(final String servletName, final String urlPattern,
- final boolean securedWsdl, final WebResourceCollectionsMetaData webResourceCollectionsMD)
- {
- final WebResourceCollectionMetaData webResourceCollectionMD = new WebResourceCollectionMetaData();
-
- webResourceCollectionMD.setWebResourceName(servletName);
- webResourceCollectionMD.setUrlPatterns(WebMetaDataHelper.getUrlPatterns(urlPattern));
- webResourceCollectionMD.setHttpMethods(WebMetaDataHelper.getHttpMethods(securedWsdl));
- webResourceCollectionsMD.add(webResourceCollectionMD);
-
- return webResourceCollectionMD;
- }
-
- /**
- * Creates new servlet meta data and associates them with servlets meta data.
- *
- * @param servletName servlet name
- * @param servletClass servlet class name
- * @param servletsMD servlets meta data
- * @return new servlet meta data
- */
- static JBossServletMetaData newServlet(final String servletName, final String servletClass,
- final JBossServletsMetaData servletsMD)
- {
- final JBossServletMetaData servletMD = new JBossServletMetaData();
-
- servletMD.setServletName(servletName);
- servletMD.setServletClass(servletClass);
- servletsMD.add(servletMD);
-
- return servletMD;
- }
-
- /**
- * Creates new servlet mapping meta data and associates them with servlet mappings meta data.
- *
- * @param servletName servlet name
- * @param urlPatterns URL patterns
- * @param servletMappingsMD servlet mapping meta data
- * @return new servlet mapping meta data
- */
- static ServletMappingMetaData newServletMapping(final String servletName, final List<String> urlPatterns,
- final List<ServletMappingMetaData> servletMappingsMD)
- {
- final ServletMappingMetaData servletMappingMD = new ServletMappingMetaData();
-
- servletMappingMD.setServletName(servletName);
- servletMappingMD.setUrlPatterns(urlPatterns);
- servletMappingsMD.add(servletMappingMD);
-
- return servletMappingMD;
- }
-
- /**
- * Creates new authentication constraint and associates it with security constraint meta data.
- *
- * @param roleNames roles
- * @param securityConstraintMD security constraint meta data
- * @return new authentication constraint meta data
- */
- static AuthConstraintMetaData newAuthConstraint(final List<String> roleNames,
- final SecurityConstraintMetaData securityConstraintMD)
- {
- final AuthConstraintMetaData authConstraintMD = new AuthConstraintMetaData();
-
- authConstraintMD.setRoleNames(roleNames);
- securityConstraintMD.setAuthConstraint(authConstraintMD);
-
- return authConstraintMD;
- }
-
- /**
- * Creates new user constraint meta data and associates it with security constraint meta data.
- *
- * @param transportGuarantee transport guarantee value
- * @param securityConstraintMD security constraint meta data
- * @return new user data constraint meta data
- */
- static UserDataConstraintMetaData newUserDataConstraint(final String transportGuarantee,
- final SecurityConstraintMetaData securityConstraintMD)
- {
- final UserDataConstraintMetaData userDataConstraintMD = new UserDataConstraintMetaData();
- final TransportGuaranteeType transportGuaranteeValue = TransportGuaranteeType.valueOf(transportGuarantee);
-
- userDataConstraintMD.setTransportGuarantee(transportGuaranteeValue);
- securityConstraintMD.setUserDataConstraint(userDataConstraintMD);
-
- return userDataConstraintMD;
- }
-
- /**
- * Creates new parameter meta data and associates it with parameters meta data.
- *
- * @param key parameter key
- * @param value parameter value
- * @param paramsMD parameters meta data
- * @return new parameter meta data
- */
- static ParamValueMetaData newParamValue(final String key, final String value, final List<ParamValueMetaData> paramsMD)
- {
- final ParamValueMetaData paramValueMD = WebMetaDataHelper.newParamValue(key, value);
-
- paramsMD.add(paramValueMD);
-
- return paramValueMD;
- }
-
- /**
- * Creates new parameter with specified key and value.
- *
- * @param key the key
- * @param value the value
- * @return new parameter
- */
- private static ParamValueMetaData newParamValue(final String key, final String value)
- {
- final ParamValueMetaData paramMD = new ParamValueMetaData();
-
- paramMD.setParamName(key);
- paramMD.setParamValue(value);
-
- return paramMD;
- }
-
-}
Modified: trunk/webservices/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataModifier.java
===================================================================
--- trunk/webservices/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataModifier.java 2009-10-16 22:58:16 UTC (rev 95057)
+++ trunk/webservices/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataModifier.java 2009-10-16 23:56:07 UTC (rev 95058)
@@ -29,6 +29,7 @@
import org.jboss.metadata.web.jboss.JBossWebMetaData;
import org.jboss.metadata.web.spec.ServletMetaData;
import org.jboss.webservices.integration.util.ASHelper;
+import org.jboss.webservices.integration.util.WebMetaDataHelper;
import org.jboss.wsf.common.integration.WSConstants;
import org.jboss.wsf.common.integration.WSHelper;
import org.jboss.wsf.spi.deployment.Deployment;
Added: trunk/webservices/src/main/java/org/jboss/webservices/integration/util/WebMetaDataHelper.java
===================================================================
--- trunk/webservices/src/main/java/org/jboss/webservices/integration/util/WebMetaDataHelper.java (rev 0)
+++ trunk/webservices/src/main/java/org/jboss/webservices/integration/util/WebMetaDataHelper.java 2009-10-16 23:56:07 UTC (rev 95058)
@@ -0,0 +1,424 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.webservices.integration.util;
+
+import java.util.Collections;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.jboss.metadata.javaee.spec.ParamValueMetaData;
+import org.jboss.metadata.web.jboss.JBossServletMetaData;
+import org.jboss.metadata.web.jboss.JBossServletsMetaData;
+import org.jboss.metadata.web.jboss.JBossWebMetaData;
+import org.jboss.metadata.web.spec.AuthConstraintMetaData;
+import org.jboss.metadata.web.spec.LoginConfigMetaData;
+import org.jboss.metadata.web.spec.SecurityConstraintMetaData;
+import org.jboss.metadata.web.spec.ServletMappingMetaData;
+import org.jboss.metadata.web.spec.ServletMetaData;
+import org.jboss.metadata.web.spec.TransportGuaranteeType;
+import org.jboss.metadata.web.spec.UserDataConstraintMetaData;
+import org.jboss.metadata.web.spec.WebResourceCollectionMetaData;
+import org.jboss.metadata.web.spec.WebResourceCollectionsMetaData;
+
+/**
+ * Utility class that simplifies work with JBossWebMetaData object structure.
+ *
+ * @author <a href="mailto:ropalka at redhat.com">Richard Opalka</a>
+ * @author <a href="mailto:tdiesler at redhat.com">Thomas Diesler</a>
+ */
+public final class WebMetaDataHelper
+{
+
+ /** Star utility string. */
+ private static final String STAR_STRING = "*";
+
+ /** GET http method utility string. */
+ private static final String GET_STRING = "GET";
+
+ /** POST http method utility string. */
+ private static final String POST_STRING = "POST";
+
+ /** GET and POST methods utility list. */
+ private static List<String> getAndPostMethods;
+
+ /** POST method utility list. */
+ private static List<String> onlyPostMethod;
+
+ /** All roles utility list. */
+ private static List<String> allRoles;
+
+ static
+ {
+ final List<String> getAndPostList = new LinkedList<String>();
+ getAndPostList.add(WebMetaDataHelper.GET_STRING);
+ getAndPostList.add(WebMetaDataHelper.POST_STRING);
+ WebMetaDataHelper.getAndPostMethods = Collections.unmodifiableList(getAndPostList);
+
+ final List<String> onlyPostList = new LinkedList<String>();
+ onlyPostList.add(WebMetaDataHelper.POST_STRING);
+ WebMetaDataHelper.onlyPostMethod = Collections.unmodifiableList(onlyPostList);
+
+ final List<String> roleNamesList = new LinkedList<String>();
+ roleNamesList.add(WebMetaDataHelper.STAR_STRING);
+ WebMetaDataHelper.allRoles = Collections.unmodifiableList(roleNamesList);
+ }
+
+ /**
+ * Constructor.
+ */
+ private WebMetaDataHelper()
+ {
+ super();
+ }
+
+ /**
+ * Creates URL pattern list from passed string.
+ *
+ * @param urlPattern URL pattern
+ * @return list wrapping passed parameter
+ */
+ public static List<String> getUrlPatterns(final String urlPattern)
+ {
+ final List<String> linkedList = new LinkedList<String>();
+
+ linkedList.add(urlPattern);
+
+ return linkedList;
+ }
+
+ /**
+ * If WSDL access is secured, it returns both POST and GET methods, otherwise only POST method.
+ *
+ * @param secureWsdlAccess whether WSDL is secured
+ * @return web access methods
+ */
+ public static List<String> getHttpMethods(final boolean secureWsdlAccess)
+ {
+ return secureWsdlAccess ? WebMetaDataHelper.getAndPostMethods : WebMetaDataHelper.onlyPostMethod;
+ }
+
+ /**
+ * Returns all role list.
+ *
+ * @return all role list
+ */
+ public static List<String> getAllRoles()
+ {
+ return WebMetaDataHelper.allRoles;
+ }
+
+ /**
+ * Gests servlets meta data from jboss web meta data.
+ * If not found it creates new servlets meta data
+ * and associates them with jboss web meta data.
+ *
+ * @param jbossWebMD jboss web meta data
+ * @return servlets meta data
+ */
+ public static JBossServletsMetaData getServlets(final JBossWebMetaData jbossWebMD)
+ {
+ JBossServletsMetaData servletsMD = jbossWebMD.getServlets();
+
+ if (servletsMD == null)
+ {
+ servletsMD = new JBossServletsMetaData();
+ jbossWebMD.setServlets(servletsMD);
+ }
+
+ return servletsMD;
+ }
+
+ /**
+ * Gests servlet mappings meta data from jboss web meta data.
+ * If not found it creates new servlet mappings meta data
+ * and associates them with jboss web meta data.
+ *
+ * @param jbossWebMD jboss web meta data
+ * @return servlet mappings meta data
+ */
+ public static List<ServletMappingMetaData> getServletMappings(final JBossWebMetaData jbossWebMD)
+ {
+ List<ServletMappingMetaData> servletMappingsMD = jbossWebMD.getServletMappings();
+
+ if (servletMappingsMD == null)
+ {
+ servletMappingsMD = new LinkedList<ServletMappingMetaData>();
+ jbossWebMD.setServletMappings(servletMappingsMD);
+ }
+
+ return servletMappingsMD;
+ }
+
+ /**
+ * Gests security constraints meta data from jboss web meta data.
+ * If not found it creates new security constraints meta data
+ * and associates them with jboss web meta data.
+ *
+ * @param jbossWebMD jboss web meta data
+ * @return security constraints meta data
+ */
+ public static List<SecurityConstraintMetaData> getSecurityConstraints(final JBossWebMetaData jbossWebMD)
+ {
+ List<SecurityConstraintMetaData> securityConstraintsMD = jbossWebMD.getSecurityConstraints();
+
+ if (securityConstraintsMD == null)
+ {
+ securityConstraintsMD = new LinkedList<SecurityConstraintMetaData>();
+ jbossWebMD.setSecurityConstraints(securityConstraintsMD);
+ }
+
+ return securityConstraintsMD;
+ }
+
+ /**
+ * Gests login config meta data from jboss web meta data.
+ * If not found it creates new login config meta data
+ * and associates them with jboss web meta data.
+ *
+ * @param jbossWebMD jboss web meta data
+ * @return login config meta data
+ */
+ public static LoginConfigMetaData getLoginConfig(final JBossWebMetaData jbossWebMD)
+ {
+ LoginConfigMetaData loginConfigMD = jbossWebMD.getLoginConfig();
+
+ if (loginConfigMD == null)
+ {
+ loginConfigMD = new LoginConfigMetaData();
+ jbossWebMD.setLoginConfig(loginConfigMD);
+ }
+
+ return loginConfigMD;
+ }
+
+ /**
+ * Gests context parameters meta data from jboss web meta data.
+ * If not found it creates new context parameters meta data
+ * and associates them with jboss web meta data.
+ *
+ * @param jbossWebMD jboss web meta data
+ * @return context parameters meta data
+ */
+ public static List<ParamValueMetaData> getContextParams(final JBossWebMetaData jbossWebMD)
+ {
+ List<ParamValueMetaData> contextParamsMD = jbossWebMD.getContextParams();
+
+ if (contextParamsMD == null)
+ {
+ contextParamsMD = new LinkedList<ParamValueMetaData>();
+ jbossWebMD.setContextParams(contextParamsMD);
+ }
+
+ return contextParamsMD;
+ }
+
+ /**
+ * Gests web resource collections meta data from security constraint meta data.
+ * If not found it creates new web resource collections meta data
+ * and associates them with security constraint meta data.
+ *
+ * @param securityConstraintMD security constraint meta data
+ * @return web resource collections meta data
+ */
+ public static WebResourceCollectionsMetaData getWebResourceCollections(final SecurityConstraintMetaData securityConstraintMD)
+ {
+ WebResourceCollectionsMetaData webResourceCollectionsMD = securityConstraintMD.getResourceCollections();
+
+ if (webResourceCollectionsMD == null)
+ {
+ webResourceCollectionsMD = new WebResourceCollectionsMetaData();
+ securityConstraintMD.setResourceCollections(webResourceCollectionsMD);
+ }
+
+ return webResourceCollectionsMD;
+ }
+
+ /**
+ * Gests init parameters meta data from servlet meta data.
+ * If not found it creates new init parameters meta data
+ * and associates them with servlet meta data.
+ *
+ * @param servletMD servlet meta data
+ * @return init parameters meta data
+ */
+ public static List<ParamValueMetaData> getServletInitParams(final ServletMetaData servletMD)
+ {
+ List<ParamValueMetaData> initParamsMD = servletMD.getInitParam();
+
+ if (initParamsMD == null)
+ {
+ initParamsMD = new LinkedList<ParamValueMetaData>();
+ servletMD.setInitParam(initParamsMD);
+ }
+
+ return initParamsMD;
+ }
+
+ /**
+ * Creates new security constraint meta data and associates them with security constraints meta data.
+ *
+ * @param securityConstraintsMD security constraints meta data
+ * @return new security constraing meta data
+ */
+ public static SecurityConstraintMetaData newSecurityConstraint(final List<SecurityConstraintMetaData> securityConstraintsMD)
+ {
+ final SecurityConstraintMetaData securityConstraintMD = new SecurityConstraintMetaData();
+
+ securityConstraintsMD.add(securityConstraintMD);
+
+ return securityConstraintMD;
+ }
+
+ /**
+ * Creates new web resource collection meta data and associates them with web resource collections meta data.
+ *
+ * @param servletName servlet name
+ * @param urlPattern URL pattern
+ * @param securedWsdl whether WSDL access is secured
+ * @param webResourceCollectionsMD web resource collections meta data
+ * @return new web resource collection meta data
+ */
+ public static WebResourceCollectionMetaData newWebResourceCollection(final String servletName, final String urlPattern,
+ final boolean securedWsdl, final WebResourceCollectionsMetaData webResourceCollectionsMD)
+ {
+ final WebResourceCollectionMetaData webResourceCollectionMD = new WebResourceCollectionMetaData();
+
+ webResourceCollectionMD.setWebResourceName(servletName);
+ webResourceCollectionMD.setUrlPatterns(WebMetaDataHelper.getUrlPatterns(urlPattern));
+ webResourceCollectionMD.setHttpMethods(WebMetaDataHelper.getHttpMethods(securedWsdl));
+ webResourceCollectionsMD.add(webResourceCollectionMD);
+
+ return webResourceCollectionMD;
+ }
+
+ /**
+ * Creates new servlet meta data and associates them with servlets meta data.
+ *
+ * @param servletName servlet name
+ * @param servletClass servlet class name
+ * @param servletsMD servlets meta data
+ * @return new servlet meta data
+ */
+ public static JBossServletMetaData newServlet(final String servletName, final String servletClass,
+ final JBossServletsMetaData servletsMD)
+ {
+ final JBossServletMetaData servletMD = new JBossServletMetaData();
+
+ servletMD.setServletName(servletName);
+ servletMD.setServletClass(servletClass);
+ servletsMD.add(servletMD);
+
+ return servletMD;
+ }
+
+ /**
+ * Creates new servlet mapping meta data and associates them with servlet mappings meta data.
+ *
+ * @param servletName servlet name
+ * @param urlPatterns URL patterns
+ * @param servletMappingsMD servlet mapping meta data
+ * @return new servlet mapping meta data
+ */
+ public static ServletMappingMetaData newServletMapping(final String servletName, final List<String> urlPatterns,
+ final List<ServletMappingMetaData> servletMappingsMD)
+ {
+ final ServletMappingMetaData servletMappingMD = new ServletMappingMetaData();
+
+ servletMappingMD.setServletName(servletName);
+ servletMappingMD.setUrlPatterns(urlPatterns);
+ servletMappingsMD.add(servletMappingMD);
+
+ return servletMappingMD;
+ }
+
+ /**
+ * Creates new authentication constraint and associates it with security constraint meta data.
+ *
+ * @param roleNames roles
+ * @param securityConstraintMD security constraint meta data
+ * @return new authentication constraint meta data
+ */
+ public static AuthConstraintMetaData newAuthConstraint(final List<String> roleNames,
+ final SecurityConstraintMetaData securityConstraintMD)
+ {
+ final AuthConstraintMetaData authConstraintMD = new AuthConstraintMetaData();
+
+ authConstraintMD.setRoleNames(roleNames);
+ securityConstraintMD.setAuthConstraint(authConstraintMD);
+
+ return authConstraintMD;
+ }
+
+ /**
+ * Creates new user constraint meta data and associates it with security constraint meta data.
+ *
+ * @param transportGuarantee transport guarantee value
+ * @param securityConstraintMD security constraint meta data
+ * @return new user data constraint meta data
+ */
+ public static UserDataConstraintMetaData newUserDataConstraint(final String transportGuarantee,
+ final SecurityConstraintMetaData securityConstraintMD)
+ {
+ final UserDataConstraintMetaData userDataConstraintMD = new UserDataConstraintMetaData();
+ final TransportGuaranteeType transportGuaranteeValue = TransportGuaranteeType.valueOf(transportGuarantee);
+
+ userDataConstraintMD.setTransportGuarantee(transportGuaranteeValue);
+ securityConstraintMD.setUserDataConstraint(userDataConstraintMD);
+
+ return userDataConstraintMD;
+ }
+
+ /**
+ * Creates new parameter meta data and associates it with parameters meta data.
+ *
+ * @param key parameter key
+ * @param value parameter value
+ * @param paramsMD parameters meta data
+ * @return new parameter meta data
+ */
+ public static ParamValueMetaData newParamValue(final String key, final String value, final List<ParamValueMetaData> paramsMD)
+ {
+ final ParamValueMetaData paramValueMD = WebMetaDataHelper.newParamValue(key, value);
+
+ paramsMD.add(paramValueMD);
+
+ return paramValueMD;
+ }
+
+ /**
+ * Creates new parameter with specified key and value.
+ *
+ * @param key the key
+ * @param value the value
+ * @return new parameter
+ */
+ private static ParamValueMetaData newParamValue(final String key, final String value)
+ {
+ final ParamValueMetaData paramMD = new ParamValueMetaData();
+
+ paramMD.setParamName(key);
+ paramMD.setParamValue(value);
+
+ return paramMD;
+ }
+
+}
Modified: trunk/webservices/src/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml
===================================================================
--- trunk/webservices/src/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml 2009-10-16 22:58:16 UTC (rev 95057)
+++ trunk/webservices/src/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml 2009-10-16 23:56:07 UTC (rev 95058)
@@ -2,16 +2,29 @@
<deployment xmlns="urn:jboss:bean-deployer:2.0">
- <!-- Locate the single instance of the kernel -->
- <bean name="WSKernelLocator" class="org.jboss.wsf.spi.util.KernelLocator">
+ <!-- Wraps single instance of the kernel -->
+ <bean name="WSIoCContainerProxy" class="org.jboss.webservices.integration.ioc.IoCContainerProxyImpl">
<property name="kernel"><inject bean="jboss.kernel:service=Kernel"/></property>
</bean>
<!-- Locate the single instance of the MBeanServer -->
<bean name="WSMBeanServerLocator" class="org.jboss.wsf.framework.management.MBeanServerLocator">
- <property name="mbeanServer"><inject bean="JMXKernel" property="mbeanServer"/></property>
+ <constructor>
+ <parameter>
+ <inject bean="JMXKernel" property="mbeanServer"/>
+ </parameter>
+ </constructor>
</bean>
+ <!-- Endpoint API http server -->
+ <bean name="WSHTTPServer" class="org.jboss.webservices.integration.endpoint.EndpointAPIHttpServer">
+ <constructor>
+ <parameter>
+ <inject bean="MainDeployer"/>
+ </parameter>
+ </constructor>
+ </bean>
+
<!-- An abstraction of server configuration aspects. -->
<bean name="WSServerConfig" class="org.jboss.webservices.integration.config.ServerConfigImpl">
<property name="mbeanServer"><inject bean="WSMBeanServerLocator" property="mbeanServer"/></property>
Added: trunk/webservices/src/resources/jbossws-jboss.jar/META-INF/services/org.jboss.wsf.spi.http.HttpServerFactory
===================================================================
--- trunk/webservices/src/resources/jbossws-jboss.jar/META-INF/services/org.jboss.wsf.spi.http.HttpServerFactory (rev 0)
+++ trunk/webservices/src/resources/jbossws-jboss.jar/META-INF/services/org.jboss.wsf.spi.http.HttpServerFactory 2009-10-16 23:56:07 UTC (rev 95058)
@@ -0,0 +1 @@
+org.jboss.webservices.integration.endpoint.HttpServerFactoryImpl
\ No newline at end of file
Added: trunk/webservices/src/resources/jbossws-jboss.jar/META-INF/services/org.jboss.wsf.spi.ioc.IoCContainerProxyFactory
===================================================================
--- trunk/webservices/src/resources/jbossws-jboss.jar/META-INF/services/org.jboss.wsf.spi.ioc.IoCContainerProxyFactory (rev 0)
+++ trunk/webservices/src/resources/jbossws-jboss.jar/META-INF/services/org.jboss.wsf.spi.ioc.IoCContainerProxyFactory 2009-10-16 23:56:07 UTC (rev 95058)
@@ -0,0 +1 @@
+org.jboss.webservices.integration.ioc.IoCContainerProxyFactoryImpl
\ No newline at end of file
Modified: trunk/webservices/src/resources/jbossws-jboss.jar/META-INF/services/org.jboss.wsf.spi.management.ServerConfigFactory
===================================================================
--- trunk/webservices/src/resources/jbossws-jboss.jar/META-INF/services/org.jboss.wsf.spi.management.ServerConfigFactory 2009-10-16 22:58:16 UTC (rev 95057)
+++ trunk/webservices/src/resources/jbossws-jboss.jar/META-INF/services/org.jboss.wsf.spi.management.ServerConfigFactory 2009-10-16 23:56:07 UTC (rev 95058)
@@ -1 +1 @@
-org.jboss.wsf.framework.management.ServerConfigFactoryImpl
\ No newline at end of file
+org.jboss.webservices.integration.config.ServerConfigFactoryImpl
\ No newline at end of file
More information about the jboss-cvs-commits
mailing list