JBossWS SVN: r4033 - branches/jbossws-2.0.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2007-07-31 05:37:40 -0400 (Tue, 31 Jul 2007)
New Revision: 4033
Modified:
branches/jbossws-2.0/mergeinfo.txt
Log:
Add mergeinfo for JBWS-1771 Test Case.
Modified: branches/jbossws-2.0/mergeinfo.txt
===================================================================
--- branches/jbossws-2.0/mergeinfo.txt 2007-07-31 09:36:05 UTC (rev 4032)
+++ branches/jbossws-2.0/mergeinfo.txt 2007-07-31 09:37:40 UTC (rev 4033)
@@ -58,3 +58,6 @@
darran.lofthouse(a)jboss.com 26-Jul-07
svn merge -r 4002:4003 https://svn.jboss.org/repos/jbossws/branches/jbossws-2.0
+
+darran.lofthouse(a)jboss.com 31-Jul-07
+svn merge -r 4030:4031 https://svn.jboss.org/repos/jbossws/branches/jbossws-2.0
17 years, 5 months
JBossWS SVN: r4032 - trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxrpc/jbws1653.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2007-07-31 05:36:05 -0400 (Tue, 31 Jul 2007)
New Revision: 4032
Modified:
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxrpc/jbws1653/JBWS1653TestCase.java
Log:
Add tests for JBWS-1771 - Post-handler-chain not invoked for 'Standard Client' configuration with DII client
Modified: trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxrpc/jbws1653/JBWS1653TestCase.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxrpc/jbws1653/JBWS1653TestCase.java 2007-07-31 08:57:42 UTC (rev 4031)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxrpc/jbws1653/JBWS1653TestCase.java 2007-07-31 09:36:05 UTC (rev 4032)
@@ -27,10 +27,13 @@
import java.net.URLClassLoader;
import javax.naming.InitialContext;
+import javax.xml.namespace.QName;
+import javax.xml.rpc.Call;
import javax.xml.rpc.Service;
import junit.framework.Test;
+import org.jboss.ws.core.jaxrpc.client.ServiceFactoryImpl;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestSetup;
@@ -63,11 +66,58 @@
assertNull(ClientHandler.message);
}
+ public void testStandardConfigConfiguredDII() throws Exception
+ {
+ ServiceFactoryImpl factory = new ServiceFactoryImpl();
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxrpc-jbws1653/TestEndpoint?wsdl");
+ QName qname = new QName("http://org.jboss.test.ws/jbws1653", "TestService");
+ Service service = factory.createService(wsdlURL, qname);
+
+ Call call = service.createCall();
+ call.setOperationName(new QName("http://org.jboss.test.ws/jbws1653", "echoString"));
+
+ call.setTargetEndpointAddress("http://" + getServerHost() + ":8080/jaxrpc-jbws1653/TestEndpoint");
+
+ String hello = "Hello";
+ Object retObj = call.invoke(new Object[] { hello });
+ assertEquals(hello, retObj);
+
+ assertNull(ClientHandler.message);
+ }
+
+ public void testStandardConfigFullyConfiguredDII() throws Exception
+ {
+ ServiceFactoryImpl factory = new ServiceFactoryImpl();
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxrpc-jbws1653/TestEndpoint?wsdl");
+ URL mappingURL = new File("resources/jaxrpc/jbws1653/WEB-INF/jaxrpc-mapping.xml").toURL();
+ QName qname = new QName("http://org.jboss.test.ws/jbws1653", "TestService");
+ Service service = factory.createService(wsdlURL, qname, mappingURL);
+ TestEndpoint port = (TestEndpoint)service.getPort(TestEndpoint.class);
+
+ String retStr = port.echoString("kermit");
+ assertEquals("kermit", retStr);
+ assertNull(ClientHandler.message);
+ }
+
public void testCustomConfig() throws Exception
{
ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
- URLClassLoader urlLoader = new URLClassLoader(new URL[] {}, ctxLoader)
- {
+ URLClassLoader urlLoader = new URLClassLoader(new URL[] {}, ctxLoader) {
+ public URL findResource(String resName)
+ {
+ URL resURL = super.findResource(resName);
+ try
+ {
+ if (resName.endsWith("META-INF/standard-jaxrpc-client-config.xml"))
+ resURL = new File("resources/jaxrpc/jbws1653/META-INF/standard-jaxrpc-client-config.xml").toURL();
+ }
+ catch (MalformedURLException ex)
+ {
+ // ignore
+ }
+ return resURL;
+ }
+
public URL getResource(String resName)
{
URL resURL = super.getResource(resName);
@@ -85,6 +135,9 @@
};
Thread.currentThread().setContextClassLoader(urlLoader);
+ URL configURL = urlLoader.findResource("META-INF/standard-jaxrpc-client-config.xml");
+ assertTrue("Invalid config url: " + configURL, configURL.toExternalForm().indexOf("jbws1653") > 0);
+
InitialContext iniCtx = getInitialContext();
Service service = (Service)iniCtx.lookup("java:comp/env/service/TestService");
TestEndpoint port = (TestEndpoint)service.getPort(TestEndpoint.class);
@@ -100,4 +153,95 @@
Thread.currentThread().setContextClassLoader(ctxLoader);
}
}
+
+ public void testCustomConfigConfiguredDII() throws Exception
+ {
+ if (true)
+ {
+ System.out.println("FIXME: [JBWS-1771] Post-handler-chain not invoked for \"Standard Client\" configuration with DII client");
+ return;
+ }
+
+ ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
+ URLClassLoader urlLoader = new URLClassLoader(new URL[] {}, ctxLoader) {
+ public URL getResource(String resName)
+ {
+ URL resURL = super.getResource(resName);
+ try
+ {
+ if (resName.endsWith("META-INF/standard-jaxrpc-client-config.xml"))
+ resURL = new File("resources/jaxrpc/jbws1653/META-INF/standard-jaxrpc-client-config.xml").toURL();
+ }
+ catch (MalformedURLException ex)
+ {
+ // ignore
+ }
+ return resURL;
+ }
+ };
+ Thread.currentThread().setContextClassLoader(urlLoader);
+
+ ServiceFactoryImpl factory = new ServiceFactoryImpl();
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxrpc-jbws1653/TestEndpoint?wsdl");
+ QName qname = new QName("http://org.jboss.test.ws/jbws1653", "TestService");
+ Service service = factory.createService(wsdlURL, qname);
+
+ Call call = service.createCall();
+ call.setOperationName(new QName("http://org.jboss.test.ws/jbws1653", "echoString"));
+
+ call.setTargetEndpointAddress("http://" + getServerHost() + ":8080/jaxrpc-jbws1653/TestEndpoint");
+
+ String hello = "Hello";
+
+ try
+ {
+ Object retObj = call.invoke(new Object[] { hello });
+ assertEquals(hello, retObj);
+ assertEquals(hello, ClientHandler.message);
+ }
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(ctxLoader);
+ }
+ }
+
+ public void testCustomConfigFullyConfiguredDII() throws Exception
+ {
+ ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
+ URLClassLoader urlLoader = new URLClassLoader(new URL[] {}, ctxLoader) {
+ public URL getResource(String resName)
+ {
+ URL resURL = super.getResource(resName);
+ try
+ {
+ if (resName.endsWith("META-INF/standard-jaxrpc-client-config.xml"))
+ resURL = new File("resources/jaxrpc/jbws1653/META-INF/standard-jaxrpc-client-config.xml").toURL();
+ }
+ catch (MalformedURLException ex)
+ {
+ // ignore
+ }
+ return resURL;
+ }
+ };
+ Thread.currentThread().setContextClassLoader(urlLoader);
+
+ ServiceFactoryImpl factory = new ServiceFactoryImpl();
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxrpc-jbws1653/TestEndpoint?wsdl");
+ URL mappingURL = new File("resources/jaxrpc/jbws1653/WEB-INF/jaxrpc-mapping.xml").toURL();
+ QName qname = new QName("http://org.jboss.test.ws/jbws1653", "TestService");
+ Service service = factory.createService(wsdlURL, qname, mappingURL);
+ TestEndpoint port = (TestEndpoint)service.getPort(TestEndpoint.class);
+
+ try
+ {
+ String retStr = port.echoString("thefrog");
+ assertEquals("thefrog", retStr);
+ assertEquals("thefrog", ClientHandler.message);
+ }
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(ctxLoader);
+ }
+ }
}
17 years, 5 months
JBossWS SVN: r4031 - branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/jaxrpc/jbws1653.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2007-07-31 04:57:42 -0400 (Tue, 31 Jul 2007)
New Revision: 4031
Modified:
branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/jaxrpc/jbws1653/JBWS1653TestCase.java
Log:
Add tests for JBWS-1771 - Post-handler-chain not invoked for 'Standard Client' configuration with DII client
Modified: branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/jaxrpc/jbws1653/JBWS1653TestCase.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/jaxrpc/jbws1653/JBWS1653TestCase.java 2007-07-30 20:02:30 UTC (rev 4030)
+++ branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/jaxrpc/jbws1653/JBWS1653TestCase.java 2007-07-31 08:57:42 UTC (rev 4031)
@@ -27,10 +27,13 @@
import java.net.URLClassLoader;
import javax.naming.InitialContext;
+import javax.xml.namespace.QName;
+import javax.xml.rpc.Call;
import javax.xml.rpc.Service;
import junit.framework.Test;
+import org.jboss.ws.core.jaxrpc.client.ServiceFactoryImpl;
import org.jboss.wsf.spi.test.JBossWSTest;
import org.jboss.wsf.spi.test.JBossWSTestSetup;
@@ -63,11 +66,58 @@
assertNull(ClientHandler.message);
}
+ public void testStandardConfigConfiguredDII() throws Exception
+ {
+ ServiceFactoryImpl factory = new ServiceFactoryImpl();
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxrpc-jbws1653/TestEndpoint?wsdl");
+ QName qname = new QName("http://org.jboss.test.ws/jbws1653", "TestService");
+ Service service = factory.createService(wsdlURL, qname);
+
+ Call call = service.createCall();
+ call.setOperationName(new QName("http://org.jboss.test.ws/jbws1653", "echoString"));
+
+ call.setTargetEndpointAddress("http://" + getServerHost() + ":8080/jaxrpc-jbws1653/TestEndpoint");
+
+ String hello = "Hello";
+ Object retObj = call.invoke(new Object[] { hello });
+ assertEquals(hello, retObj);
+
+ assertNull(ClientHandler.message);
+ }
+
+ public void testStandardConfigFullyConfiguredDII() throws Exception
+ {
+ ServiceFactoryImpl factory = new ServiceFactoryImpl();
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxrpc-jbws1653/TestEndpoint?wsdl");
+ URL mappingURL = new File("resources/jaxrpc/jbws1653/WEB-INF/jaxrpc-mapping.xml").toURL();
+ QName qname = new QName("http://org.jboss.test.ws/jbws1653", "TestService");
+ Service service = factory.createService(wsdlURL, qname, mappingURL);
+ TestEndpoint port = (TestEndpoint)service.getPort(TestEndpoint.class);
+
+ String retStr = port.echoString("kermit");
+ assertEquals("kermit", retStr);
+ assertNull(ClientHandler.message);
+ }
+
public void testCustomConfig() throws Exception
{
ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
- URLClassLoader urlLoader = new URLClassLoader(new URL[] {}, ctxLoader)
- {
+ URLClassLoader urlLoader = new URLClassLoader(new URL[] {}, ctxLoader) {
+ public URL findResource(String resName)
+ {
+ URL resURL = super.findResource(resName);
+ try
+ {
+ if (resName.endsWith("META-INF/standard-jaxrpc-client-config.xml"))
+ resURL = new File("resources/jaxrpc/jbws1653/META-INF/standard-jaxrpc-client-config.xml").toURL();
+ }
+ catch (MalformedURLException ex)
+ {
+ // ignore
+ }
+ return resURL;
+ }
+
public URL getResource(String resName)
{
URL resURL = super.getResource(resName);
@@ -85,6 +135,9 @@
};
Thread.currentThread().setContextClassLoader(urlLoader);
+ URL configURL = urlLoader.findResource("META-INF/standard-jaxrpc-client-config.xml");
+ assertTrue("Invalid config url: " + configURL, configURL.toExternalForm().indexOf("jbws1653") > 0);
+
InitialContext iniCtx = getInitialContext();
Service service = (Service)iniCtx.lookup("java:comp/env/service/TestService");
TestEndpoint port = (TestEndpoint)service.getPort(TestEndpoint.class);
@@ -100,4 +153,95 @@
Thread.currentThread().setContextClassLoader(ctxLoader);
}
}
+
+ public void testCustomConfigConfiguredDII() throws Exception
+ {
+ if (true)
+ {
+ System.out.println("FIXME: [JBWS-1771] Post-handler-chain not invoked for \"Standard Client\" configuration with DII client");
+ return;
+ }
+
+ ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
+ URLClassLoader urlLoader = new URLClassLoader(new URL[] {}, ctxLoader) {
+ public URL getResource(String resName)
+ {
+ URL resURL = super.getResource(resName);
+ try
+ {
+ if (resName.endsWith("META-INF/standard-jaxrpc-client-config.xml"))
+ resURL = new File("resources/jaxrpc/jbws1653/META-INF/standard-jaxrpc-client-config.xml").toURL();
+ }
+ catch (MalformedURLException ex)
+ {
+ // ignore
+ }
+ return resURL;
+ }
+ };
+ Thread.currentThread().setContextClassLoader(urlLoader);
+
+ ServiceFactoryImpl factory = new ServiceFactoryImpl();
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxrpc-jbws1653/TestEndpoint?wsdl");
+ QName qname = new QName("http://org.jboss.test.ws/jbws1653", "TestService");
+ Service service = factory.createService(wsdlURL, qname);
+
+ Call call = service.createCall();
+ call.setOperationName(new QName("http://org.jboss.test.ws/jbws1653", "echoString"));
+
+ call.setTargetEndpointAddress("http://" + getServerHost() + ":8080/jaxrpc-jbws1653/TestEndpoint");
+
+ String hello = "Hello";
+
+ try
+ {
+ Object retObj = call.invoke(new Object[] { hello });
+ assertEquals(hello, retObj);
+ assertEquals(hello, ClientHandler.message);
+ }
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(ctxLoader);
+ }
+ }
+
+ public void testCustomConfigFullyConfiguredDII() throws Exception
+ {
+ ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
+ URLClassLoader urlLoader = new URLClassLoader(new URL[] {}, ctxLoader) {
+ public URL getResource(String resName)
+ {
+ URL resURL = super.getResource(resName);
+ try
+ {
+ if (resName.endsWith("META-INF/standard-jaxrpc-client-config.xml"))
+ resURL = new File("resources/jaxrpc/jbws1653/META-INF/standard-jaxrpc-client-config.xml").toURL();
+ }
+ catch (MalformedURLException ex)
+ {
+ // ignore
+ }
+ return resURL;
+ }
+ };
+ Thread.currentThread().setContextClassLoader(urlLoader);
+
+ ServiceFactoryImpl factory = new ServiceFactoryImpl();
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxrpc-jbws1653/TestEndpoint?wsdl");
+ URL mappingURL = new File("resources/jaxrpc/jbws1653/WEB-INF/jaxrpc-mapping.xml").toURL();
+ QName qname = new QName("http://org.jboss.test.ws/jbws1653", "TestService");
+ Service service = factory.createService(wsdlURL, qname, mappingURL);
+ TestEndpoint port = (TestEndpoint)service.getPort(TestEndpoint.class);
+
+ try
+ {
+ String retStr = port.echoString("thefrog");
+ assertEquals("thefrog", retStr);
+ assertEquals("thefrog", ClientHandler.message);
+ }
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(ctxLoader);
+ }
+ }
}
17 years, 5 months
JBossWS SVN: r4030 - in trunk/integration: jboss42/src/main/java/org/jboss/wsf/container/jboss42 and 7 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-07-30 16:02:30 -0400 (Mon, 30 Jul 2007)
New Revision: 4030
Added:
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/DefaultDeploymentAspectManagerFactory.java
Removed:
trunk/integration/jboss40/src/main/resources/jbossws-jboss40.jar/META-INF/services/org.jboss.wsf.spi.deployment.DeploymentAspectManagerFactory
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/DeploymentAspectManagerFactoryImpl.java
trunk/integration/jboss42/src/main/resources/jbossws-jboss42.jar/META-INF/services/org.jboss.wsf.spi.deployment.DeploymentAspectManagerFactory
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/DeploymentAspectManagerFactoryImpl.java
trunk/integration/jboss50/src/main/resources/jbossws-jboss50.jar/META-INF/services/org.jboss.wsf.spi.deployment.DeploymentAspectManagerFactory
Modified:
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/DeploymentAspectHttpServer.java
trunk/integration/jboss42/src/main/resources/jbossws-jboss42-config.xml
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/DefaultSPIProviderResolver.java
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/DeploymentAspectManagerImpl.java
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/DeploymentAspectManagerFactory.java
Log:
Add DefaultDeploymentAspectManagerFactory
Deleted: trunk/integration/jboss40/src/main/resources/jbossws-jboss40.jar/META-INF/services/org.jboss.wsf.spi.deployment.DeploymentAspectManagerFactory
===================================================================
--- trunk/integration/jboss40/src/main/resources/jbossws-jboss40.jar/META-INF/services/org.jboss.wsf.spi.deployment.DeploymentAspectManagerFactory 2007-07-30 18:17:57 UTC (rev 4029)
+++ trunk/integration/jboss40/src/main/resources/jbossws-jboss40.jar/META-INF/services/org.jboss.wsf.spi.deployment.DeploymentAspectManagerFactory 2007-07-30 20:02:30 UTC (rev 4030)
@@ -1 +0,0 @@
-org.jboss.wsf.container.jboss42.DeploymentAspectManagerFactoryImpl
\ No newline at end of file
Modified: trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/DeploymentAspectHttpServer.java
===================================================================
--- trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/DeploymentAspectHttpServer.java 2007-07-30 18:17:57 UTC (rev 4029)
+++ trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/DeploymentAspectHttpServer.java 2007-07-30 20:02:30 UTC (rev 4030)
@@ -32,7 +32,9 @@
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.DeploymentAspectManagerFactory;
import org.jboss.wsf.spi.deployment.DeploymentModelFactory;
+import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
import org.jboss.wsf.spi.http.HttpContext;
import org.jboss.wsf.spi.http.HttpContextFactory;
import org.jboss.wsf.spi.http.HttpServer;
@@ -67,11 +69,16 @@
try
{
+ // Create the deployment
SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
- DeploymentModelFactory depFactory = spiProvider.getSPI(DeploymentModelFactory.class);
- Deployment dep = depFactory.newDeployment("jaxws-endpoint-deployment", implClass.getClassLoader());
- dep.getService().addEndpoint(depFactory.newEndpoint(implClass.getName()));
+ DeploymentModelFactory depModelFactory = spiProvider.getSPI(DeploymentModelFactory.class);
+ Deployment dep = depModelFactory.newDeployment("endpoint-deployment", implClass.getClassLoader());
+ dep.getService().addEndpoint(depModelFactory.newEndpoint(implClass.getName()));
+ // Deploy using deployment aspects
+ DeploymentAspectManagerFactory depManagerFactory = spiProvider.getSPI(DeploymentAspectManagerFactory.class);
+ depManagerFactory.getDeploymentAspectManager(DeploymentType.JAXWS_JSE);
+
}
catch (RuntimeException rte)
{
Deleted: trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/DeploymentAspectManagerFactoryImpl.java
===================================================================
--- trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/DeploymentAspectManagerFactoryImpl.java 2007-07-30 18:17:57 UTC (rev 4029)
+++ trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/DeploymentAspectManagerFactoryImpl.java 2007-07-30 20:02:30 UTC (rev 4030)
@@ -1,53 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.wsf.container.jboss42;
-
-import org.jboss.wsf.spi.deployment.DeploymentAspectManagerFactory;
-import org.jboss.wsf.spi.deployment.DeploymentAspectManager;
-import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.common.KernelAwareSPIFactory;
-import org.jboss.logging.Logger;
-
-/**
- * @author Heiko.Braun(a)jboss.com
- * Created: Jul 23, 2007
- */
-public class DeploymentAspectManagerFactoryImpl extends DeploymentAspectManagerFactory
-{
- private static final Logger log = Logger.getLogger(DeploymentAspectManagerFactoryImpl.class);
-
- public DeploymentAspectManager getDeploymentAspectManager(Deployment.DeploymentType deploymentType)
- {
- String beanName;
-
- if(deploymentType.toString().indexOf("EJB")!=-1)
- beanName = "WSDeploymentAspectManagerEJB";
- else
- beanName = "WSDeploymentAspectManagerJSE";
-
- log.debug("DeploymentAspectManager for " + deploymentType +": " +beanName);
-
- return new KernelAwareSPIFactory().getKernelProvidedSPI(
- beanName, DeploymentAspectManager.class
- );
- }
-}
Modified: trunk/integration/jboss42/src/main/resources/jbossws-jboss42-config.xml
===================================================================
--- trunk/integration/jboss42/src/main/resources/jbossws-jboss42-config.xml 2007-07-30 18:17:57 UTC (rev 4029)
+++ trunk/integration/jboss42/src/main/resources/jbossws-jboss42-config.xml 2007-07-30 20:02:30 UTC (rev 4030)
@@ -85,6 +85,9 @@
<bean name="WSDeploymentAspectManagerEJB" class="org.jboss.wsf.framework.deployment.DeploymentAspectManagerImpl">
<property name="name">WSDeploymentAspectManagerEJB</property>
</bean>
+ <bean name="WSDeploymentAspectManagerEndpointAPI" class="org.jboss.wsf.framework.deployment.DeploymentAspectManagerImpl">
+ <property name="name">WSDeploymentAspectManagerEndpointAPI</property>
+ </bean>
<!--
The container deployment aspects
@@ -201,3 +204,10 @@
</set>
</property>
</bean>
+ <bean name="WSDeploymentAspectInstallerEndpointAPI" class="org.jboss.wsf.framework.deployment.DeploymentAspectInstaller">
+ <property name="manager"><inject bean="WSDeploymentAspectManagerEndpointAPI"/></property>
+ <property name="aspects">
+ <set class="java.util.HashSet" elementClass="org.jboss.wsf.spi.deployment.DeploymentAspect">
+ </set>
+ </property>
+ </bean>
Deleted: trunk/integration/jboss42/src/main/resources/jbossws-jboss42.jar/META-INF/services/org.jboss.wsf.spi.deployment.DeploymentAspectManagerFactory
===================================================================
--- trunk/integration/jboss42/src/main/resources/jbossws-jboss42.jar/META-INF/services/org.jboss.wsf.spi.deployment.DeploymentAspectManagerFactory 2007-07-30 18:17:57 UTC (rev 4029)
+++ trunk/integration/jboss42/src/main/resources/jbossws-jboss42.jar/META-INF/services/org.jboss.wsf.spi.deployment.DeploymentAspectManagerFactory 2007-07-30 20:02:30 UTC (rev 4030)
@@ -1 +0,0 @@
-org.jboss.wsf.container.jboss42.DeploymentAspectManagerFactoryImpl
\ No newline at end of file
Deleted: trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/DeploymentAspectManagerFactoryImpl.java
===================================================================
--- trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/DeploymentAspectManagerFactoryImpl.java 2007-07-30 18:17:57 UTC (rev 4029)
+++ trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/DeploymentAspectManagerFactoryImpl.java 2007-07-30 20:02:30 UTC (rev 4030)
@@ -1,58 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.wsf.container.jboss50;
-
-import org.jboss.wsf.spi.deployment.DeploymentAspectManagerFactory;
-import org.jboss.wsf.spi.deployment.DeploymentAspectManager;
-import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.common.KernelAwareSPIFactory;
-import org.jboss.logging.Logger;
-
-/**
- * A DeploymentAspectManagerFactory that retrieves a configured
- * {@link DeploymentAspectManager} from MC kernel.
- *
- * @see org.jboss.wsf.framework.deployment.DeploymentAspectInstaller
- *
- * @author Heiko.Braun(a)jboss.com
- * Created: Jul 20, 2007
- */
-public class DeploymentAspectManagerFactoryImpl extends DeploymentAspectManagerFactory
-{
- private static final Logger log = Logger.getLogger(DeploymentAspectManagerFactoryImpl.class);
-
- public DeploymentAspectManager getDeploymentAspectManager(Deployment.DeploymentType deploymentType)
- {
- String beanName;
-
- if(deploymentType.toString().indexOf("EJB")!=-1)
- beanName = "WSDeploymentAspectManagerEJB";
- else
- beanName = "WSDeploymentAspectManagerJSE";
-
- log.debug("DeploymentAspectManager for " + deploymentType +": " +beanName);
-
- return new KernelAwareSPIFactory().getKernelProvidedSPI(
- beanName, DeploymentAspectManager.class
- );
- }
-}
Deleted: trunk/integration/jboss50/src/main/resources/jbossws-jboss50.jar/META-INF/services/org.jboss.wsf.spi.deployment.DeploymentAspectManagerFactory
===================================================================
--- trunk/integration/jboss50/src/main/resources/jbossws-jboss50.jar/META-INF/services/org.jboss.wsf.spi.deployment.DeploymentAspectManagerFactory 2007-07-30 18:17:57 UTC (rev 4029)
+++ trunk/integration/jboss50/src/main/resources/jbossws-jboss50.jar/META-INF/services/org.jboss.wsf.spi.deployment.DeploymentAspectManagerFactory 2007-07-30 20:02:30 UTC (rev 4030)
@@ -1 +0,0 @@
-org.jboss.wsf.container.jboss50.DeploymentAspectManagerFactoryImpl
\ No newline at end of file
Modified: trunk/integration/spi/src/main/java/org/jboss/wsf/framework/DefaultSPIProviderResolver.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/framework/DefaultSPIProviderResolver.java 2007-07-30 18:17:57 UTC (rev 4029)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/framework/DefaultSPIProviderResolver.java 2007-07-30 20:02:30 UTC (rev 4030)
@@ -23,6 +23,7 @@
import org.jboss.logging.Logger;
import org.jboss.wsf.common.ServiceLoader;
+import org.jboss.wsf.framework.deployment.DefaultDeploymentAspectManagerFactory;
import org.jboss.wsf.framework.deployment.DefaultDeploymentModelFactory;
import org.jboss.wsf.framework.deployment.DefaultLifecycleHandlerFactory;
import org.jboss.wsf.framework.http.DefaultHttpContextFactory;
@@ -73,6 +74,10 @@
// SPI provided by framework, default that can be overridden
+ if (DeploymentAspectManagerFactory.class.equals(spiType))
+ {
+ returnType = (T)loadService(spiType, DefaultDeploymentAspectManagerFactory.class.getName());
+ }
if (DeploymentModelFactory.class.equals(spiType))
{
returnType = (T)loadService(spiType, DefaultDeploymentModelFactory.class.getName());
@@ -96,10 +101,6 @@
// SPI provided by either container or stack integration
- else if (DeploymentAspectManagerFactory.class.equals(spiType))
- {
- returnType = (T)loadService(spiType, null);
- }
else if (EndpointRegistryFactory.class.equals(spiType))
{
returnType = (T)loadService(spiType, null);
Added: trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/DefaultDeploymentAspectManagerFactory.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/DefaultDeploymentAspectManagerFactory.java (rev 0)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/DefaultDeploymentAspectManagerFactory.java 2007-07-30 20:02:30 UTC (rev 4030)
@@ -0,0 +1,63 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.framework.deployment;
+
+import org.jboss.logging.Logger;
+import org.jboss.wsf.common.KernelAwareSPIFactory;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.DeploymentAspectManager;
+import org.jboss.wsf.spi.deployment.DeploymentAspectManagerFactory;
+
+/**
+ * A DeploymentAspectManagerFactory that retrieves a configured
+ * {@link DeploymentAspectManager} from MC kernel.
+ *
+ * @see org.jboss.wsf.framework.deployment.DeploymentAspectInstaller
+ *
+ * @author Heiko.Braun(a)jboss.com
+ * Created: Jul 20, 2007
+ */
+public class DefaultDeploymentAspectManagerFactory extends DeploymentAspectManagerFactory
+{
+ private static final Logger log = Logger.getLogger(DefaultDeploymentAspectManagerFactory.class);
+
+ public DeploymentAspectManager getDeploymentAspectManager(Deployment.DeploymentType deploymentType)
+ {
+ String beanName;
+
+ if (deploymentType.toString().indexOf("EJB") != -1)
+ {
+ beanName = "WSDeploymentAspectManagerEJB";
+ }
+ else
+ {
+ beanName = "WSDeploymentAspectManagerJSE";
+ }
+ return getDeploymentAspectManager(beanName);
+ }
+
+ public DeploymentAspectManager getDeploymentAspectManager(String beanName)
+ {
+ log.debug("DeploymentAspectManager for: " + beanName);
+ return new KernelAwareSPIFactory().getKernelProvidedSPI(beanName, DeploymentAspectManager.class);
+ }
+}
Modified: trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/DeploymentAspectManagerImpl.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/DeploymentAspectManagerImpl.java 2007-07-30 18:17:57 UTC (rev 4029)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/DeploymentAspectManagerImpl.java 2007-07-30 20:02:30 UTC (rev 4030)
@@ -63,6 +63,7 @@
public List<DeploymentAspect> getDeploymentAspects()
{
+ // This cannot be done in 'create' because we add aspects from different MC configurations
if (sortedAspects == null)
{
sortedAspects = new ArrayList<DeploymentAspect>();
Modified: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/DeploymentAspectManagerFactory.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/DeploymentAspectManagerFactory.java 2007-07-30 18:17:57 UTC (rev 4029)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/DeploymentAspectManagerFactory.java 2007-07-30 20:02:30 UTC (rev 4030)
@@ -32,4 +32,6 @@
public abstract class DeploymentAspectManagerFactory implements SPIView
{
public abstract DeploymentAspectManager getDeploymentAspectManager(Deployment.DeploymentType deploymentType);
+
+ public abstract DeploymentAspectManager getDeploymentAspectManager(String deploymentType);
}
17 years, 5 months
JBossWS SVN: r4029 - in trunk: integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50 and 3 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-07-30 14:17:57 -0400 (Mon, 30 Jul 2007)
New Revision: 4029
Modified:
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/AbstractDeployerHook.java
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/DeploymentAspectHttpServer.java
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXRPCDeployerHookEJB21.java
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXRPCDeployerHookJSE.java
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXWSDeployerHookEJB3.java
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXWSDeployerHookJSE.java
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/AbstractDeployerHook.java
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXRPCDeployerHookEJB21.java
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXRPCDeployerHookJSE.java
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXWSDeployerHookEJB3.java
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXWSDeployerHookJSE.java
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/ArchiveDeploymentModelFactory.java
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/DefaultDeploymentModelFactory.java
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/DefaultEndpoint.java
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/DeploymentModelFactory.java
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/binding/BindingCustomizationTestCase.java
Log:
optional Endpoint.shortName
Modified: trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/AbstractDeployerHook.java
===================================================================
--- trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/AbstractDeployerHook.java 2007-07-30 17:28:34 UTC (rev 4028)
+++ trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/AbstractDeployerHook.java 2007-07-30 18:17:57 UTC (rev 4029)
@@ -95,11 +95,11 @@
}
}
- public Endpoint newEndpoint(String shortName, String targetBean)
+ public Endpoint newEndpoint(String targetBean)
{
try
{
- return getDeploymentModelFactory().newEndpoint(shortName, targetBean);
+ return getDeploymentModelFactory().newEndpoint(targetBean);
}
catch (Exception ex)
{
Modified: trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/DeploymentAspectHttpServer.java
===================================================================
--- trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/DeploymentAspectHttpServer.java 2007-07-30 17:28:34 UTC (rev 4028)
+++ trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/DeploymentAspectHttpServer.java 2007-07-30 18:17:57 UTC (rev 4029)
@@ -70,7 +70,7 @@
SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
DeploymentModelFactory depFactory = spiProvider.getSPI(DeploymentModelFactory.class);
Deployment dep = depFactory.newDeployment("jaxws-endpoint-deployment", implClass.getClassLoader());
- dep.getService().addEndpoint(depFactory.newEndpoint("jaxws-endpoint", implClass.getName()));
+ dep.getService().addEndpoint(depFactory.newEndpoint(implClass.getName()));
}
catch (RuntimeException rte)
Modified: trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXRPCDeployerHookEJB21.java
===================================================================
--- trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXRPCDeployerHookEJB21.java 2007-07-30 17:28:34 UTC (rev 4028)
+++ trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXRPCDeployerHookEJB21.java 2007-07-30 18:17:57 UTC (rev 4029)
@@ -88,7 +88,8 @@
String ejbClass = beanMetaData.getEjbClass();
// Create the endpoint
- Endpoint ep = newEndpoint(ejbLink, ejbClass);
+ Endpoint ep = newEndpoint(ejbClass);
+ ep.setShortName(ejbLink);
service.addEndpoint(ep);
}
}
Modified: trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXRPCDeployerHookJSE.java
===================================================================
--- trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXRPCDeployerHookJSE.java 2007-07-30 17:28:34 UTC (rev 4028)
+++ trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXRPCDeployerHookJSE.java 2007-07-30 18:17:57 UTC (rev 4029)
@@ -105,7 +105,8 @@
}
// Create the endpoint
- Endpoint ep = newEndpoint(servletLink, servletClass);
+ Endpoint ep = newEndpoint(servletClass);
+ ep.setShortName(servletLink);
service.addEndpoint(ep);
}
}
Modified: trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXWSDeployerHookEJB3.java
===================================================================
--- trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXWSDeployerHookEJB3.java 2007-07-30 17:28:34 UTC (rev 4028)
+++ trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXWSDeployerHookEJB3.java 2007-07-30 18:17:57 UTC (rev 4029)
@@ -74,7 +74,8 @@
String epBean = container.getBeanClassName();
// Create the endpoint
- Endpoint ep = newEndpoint(ejbName, epBean);
+ Endpoint ep = newEndpoint(epBean);
+ ep.setShortName(ejbName);
service.addEndpoint(ep);
}
}
Modified: trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXWSDeployerHookJSE.java
===================================================================
--- trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXWSDeployerHookJSE.java 2007-07-30 17:28:34 UTC (rev 4028)
+++ trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXWSDeployerHookJSE.java 2007-07-30 18:17:57 UTC (rev 4029)
@@ -80,7 +80,8 @@
String servletClass = servlet.getServletClass();
// Create the endpoint
- Endpoint ep = newEndpoint(servletName, servletClass);
+ Endpoint ep = newEndpoint(servletClass);
+ ep.setShortName(servletName);
service.addEndpoint(ep);
}
Modified: trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/AbstractDeployerHook.java
===================================================================
--- trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/AbstractDeployerHook.java 2007-07-30 17:28:34 UTC (rev 4028)
+++ trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/AbstractDeployerHook.java 2007-07-30 18:17:57 UTC (rev 4029)
@@ -88,11 +88,11 @@
}
}
- public Endpoint newEndpoint(String shortName, String targetBean)
+ public Endpoint newEndpoint(String targetBean)
{
try
{
- return getDeploymentModelFactory().newEndpoint(shortName, targetBean);
+ return getDeploymentModelFactory().newEndpoint(targetBean);
}
catch (Exception ex)
{
Modified: trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXRPCDeployerHookEJB21.java
===================================================================
--- trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXRPCDeployerHookEJB21.java 2007-07-30 17:28:34 UTC (rev 4028)
+++ trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXRPCDeployerHookEJB21.java 2007-07-30 18:17:57 UTC (rev 4029)
@@ -88,7 +88,8 @@
String ejbClass = beanMetaData.getEjbClass();
// Create the endpoint
- Endpoint ep = newEndpoint(ejbLink, ejbClass);
+ Endpoint ep = newEndpoint(ejbClass);
+ ep.setShortName(ejbLink);
service.addEndpoint(ep);
}
}
Modified: trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXRPCDeployerHookJSE.java
===================================================================
--- trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXRPCDeployerHookJSE.java 2007-07-30 17:28:34 UTC (rev 4028)
+++ trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXRPCDeployerHookJSE.java 2007-07-30 18:17:57 UTC (rev 4029)
@@ -88,7 +88,8 @@
String servletClass = servlet.getServletClass();
// Create the endpoint
- Endpoint ep = newEndpoint(servletLink, servletClass);
+ Endpoint ep = newEndpoint(servletClass);
+ ep.setShortName(servletLink);
service.addEndpoint(ep);
}
}
Modified: trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXWSDeployerHookEJB3.java
===================================================================
--- trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXWSDeployerHookEJB3.java 2007-07-30 17:28:34 UTC (rev 4028)
+++ trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXWSDeployerHookEJB3.java 2007-07-30 18:17:57 UTC (rev 4029)
@@ -80,7 +80,8 @@
String epBean = container.getBeanClassName();
// Create the endpoint
- Endpoint ep = newEndpoint(ejbName, epBean);
+ Endpoint ep = newEndpoint(epBean);
+ ep.setShortName(ejbName);
service.addEndpoint(ep);
}
}
Modified: trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXWSDeployerHookJSE.java
===================================================================
--- trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXWSDeployerHookJSE.java 2007-07-30 17:28:34 UTC (rev 4028)
+++ trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXWSDeployerHookJSE.java 2007-07-30 18:17:57 UTC (rev 4029)
@@ -77,7 +77,8 @@
String servletClass = servlet.getServletClass();
// Create the endpoint
- Endpoint ep = newEndpoint(servletName, servletClass);
+ Endpoint ep = newEndpoint(servletClass);
+ ep.setShortName(servletName);
service.addEndpoint(ep);
}
Modified: trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/ArchiveDeploymentModelFactory.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/ArchiveDeploymentModelFactory.java 2007-07-30 17:28:34 UTC (rev 4028)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/ArchiveDeploymentModelFactory.java 2007-07-30 18:17:57 UTC (rev 4029)
@@ -42,8 +42,8 @@
return new DefaultService();
}
- public Endpoint newEndpoint(String shortName, String targetBean)
+ public Endpoint newEndpoint(String targetBean)
{
- return new DefaultEndpoint(shortName, targetBean);
+ return new DefaultEndpoint(targetBean);
}
}
Modified: trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/DefaultDeploymentModelFactory.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/DefaultDeploymentModelFactory.java 2007-07-30 17:28:34 UTC (rev 4028)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/DefaultDeploymentModelFactory.java 2007-07-30 18:17:57 UTC (rev 4029)
@@ -42,8 +42,8 @@
return new DefaultService();
}
- public Endpoint newEndpoint(String shortName, String targetBean)
+ public Endpoint newEndpoint(String targetBean)
{
- return new DefaultEndpoint(shortName, targetBean);
+ return new DefaultEndpoint(targetBean);
}
}
Modified: trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/DefaultEndpoint.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/DefaultEndpoint.java 2007-07-30 17:28:34 UTC (rev 4028)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/DefaultEndpoint.java 2007-07-30 18:17:57 UTC (rev 4029)
@@ -57,9 +57,8 @@
private List<BindingCustomization> bindingCustomizsations = new ArrayList<BindingCustomization>();
private String address;
- DefaultEndpoint(String shortName, String targetBean)
+ DefaultEndpoint(String targetBean)
{
- this.shortName = shortName;
this.targetBean = targetBean;
this.state = EndpointState.UNDEFINED;
}
Modified: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/DeploymentModelFactory.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/DeploymentModelFactory.java 2007-07-30 17:28:34 UTC (rev 4028)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/DeploymentModelFactory.java 2007-07-30 18:17:57 UTC (rev 4029)
@@ -30,7 +30,8 @@
public abstract class DeploymentModelFactory implements SPIView
{
public abstract Deployment newDeployment(String simpleName, ClassLoader initialLoader);
+
public abstract Service newService();
- public abstract Endpoint newEndpoint(String shortName, String targetBean);
+ public abstract Endpoint newEndpoint(String targetBean);
}
Modified: trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/binding/BindingCustomizationTestCase.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/binding/BindingCustomizationTestCase.java 2007-07-30 17:28:34 UTC (rev 4028)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/binding/BindingCustomizationTestCase.java 2007-07-30 18:17:57 UTC (rev 4029)
@@ -49,7 +49,7 @@
public void testCustomizationWriteAccess() throws Exception
{
- Endpoint endpoint = deploymentModelFactory.newEndpoint(null, null);
+ Endpoint endpoint = deploymentModelFactory.newEndpoint(null);
JAXBBindingCustomization jaxbCustomization = new JAXBBindingCustomization();
jaxbCustomization.put(JAXBBindingCustomization.DEFAULT_NAMESPACE_REMAP, "http://org.jboss.bindingCustomization");
endpoint.addAttachment(BindingCustomization.class, jaxbCustomization);
@@ -70,7 +70,7 @@
public void testCustomizationReadAccess() throws Exception
{
- Endpoint endpoint = deploymentModelFactory.newEndpoint(null, null);
+ Endpoint endpoint = deploymentModelFactory.newEndpoint(null);
JAXBBindingCustomization jaxbCustomization = new JAXBBindingCustomization();
jaxbCustomization.put(JAXBBindingCustomization.DEFAULT_NAMESPACE_REMAP, "http://org.jboss.bindingCustomization");
endpoint.addAttachment(BindingCustomization.class, jaxbCustomization);
17 years, 5 months
JBossWS SVN: r4028 - trunk/integration/jboss40/src/main/resources.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-07-30 13:28:34 -0400 (Mon, 30 Jul 2007)
New Revision: 4028
Modified:
trunk/integration/jboss40/src/main/resources/jbossws-jboss40-config.xml
Log:
Fix reference to WSWebXMLRewriter
Modified: trunk/integration/jboss40/src/main/resources/jbossws-jboss40-config.xml
===================================================================
--- trunk/integration/jboss40/src/main/resources/jbossws-jboss40-config.xml 2007-07-30 14:31:05 UTC (rev 4027)
+++ trunk/integration/jboss40/src/main/resources/jbossws-jboss40-config.xml 2007-07-30 17:28:34 UTC (rev 4028)
@@ -163,7 +163,7 @@
<bean name="WSServiceRefMetaDataAdapter" class="org.jboss.wsf.container.jboss40.ServiceRefMetaDataAdapter"/>
<bean name="WSWebAppDesciptorModifier" class="org.jboss.wsf.container.jboss42.DefaultWebAppDesciptorModifierImpl"/>
<bean name="WSWebMetaDataAdapter" class="org.jboss.wsf.container.jboss42.JSEArchiveMetaDataAdapter"/>
- <bean name="WSWebXMLRewriter" class="org.jboss.org.jboss.wsf.container.jboss42.WebXMLRewriterImpl">
+ <bean name="WSWebXMLRewriter" class="org.jboss.wsf.container.jboss42.WebXMLRewriterImpl">
<property name="desciptorModifier"><inject bean="WSWebAppDesciptorModifier"/></property>
</bean>
17 years, 5 months
JBossWS SVN: r4027 - in trunk: integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50 and 3 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-07-30 10:31:05 -0400 (Mon, 30 Jul 2007)
New Revision: 4027
Added:
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/DeploymentAspectHttpServer.java
Modified:
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/AbstractDeployerHook.java
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXRPCDeployerHookEJB21.java
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXRPCDeployerHookJSE.java
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXWSDeployerHookEJB3.java
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXWSDeployerHookJSE.java
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/AbstractDeployerHook.java
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXRPCDeployerHookEJB21.java
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXRPCDeployerHookJSE.java
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXWSDeployerHookEJB3.java
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXWSDeployerHookJSE.java
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/ArchiveDeploymentModelFactory.java
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/DefaultDeploymentModelFactory.java
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/DefaultEndpoint.java
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/DefaultService.java
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/DeploymentModelFactory.java
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/binding/BindingCustomizationTestCase.java
Log:
Add ctor parameters to newEndpoint(shortName, tragetBean)
Modified: trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/AbstractDeployerHook.java
===================================================================
--- trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/AbstractDeployerHook.java 2007-07-30 12:53:36 UTC (rev 4026)
+++ trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/AbstractDeployerHook.java 2007-07-30 14:31:05 UTC (rev 4027)
@@ -95,11 +95,11 @@
}
}
- public Endpoint newEndpoint()
+ public Endpoint newEndpoint(String shortName, String targetBean)
{
try
{
- return getDeploymentModelFactory().newEndpoint();
+ return getDeploymentModelFactory().newEndpoint(shortName, targetBean);
}
catch (Exception ex)
{
Added: trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/DeploymentAspectHttpServer.java
===================================================================
--- trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/DeploymentAspectHttpServer.java (rev 0)
+++ trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/DeploymentAspectHttpServer.java 2007-07-30 14:31:05 UTC (rev 4027)
@@ -0,0 +1,108 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.container.jboss42;
+
+//$Id: JBossHttpServer.java 1786 2007-01-04 14:30:04Z thomas.diesler(a)jboss.com $
+
+import javax.enterprise.deploy.spi.factories.DeploymentFactory;
+import javax.xml.ws.Endpoint;
+import javax.xml.ws.WebServiceException;
+
+import org.jboss.wsf.common.DOMUtils;
+import org.jboss.wsf.framework.DefaultExtensible;
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.DeploymentModelFactory;
+import org.jboss.wsf.spi.http.HttpContext;
+import org.jboss.wsf.spi.http.HttpContextFactory;
+import org.jboss.wsf.spi.http.HttpServer;
+import org.w3c.dom.Element;
+
+/**
+ * A HTTP Server that uses DeploymentAspects
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 07-Jul-2006
+ */
+public class DeploymentAspectHttpServer extends DefaultExtensible implements HttpServer
+{
+ /** Start an instance of this HTTP server */
+ public void start()
+ {
+ // verify required properties
+ }
+
+ /** Create an HTTP context */
+ public HttpContext createContext(String contextRoot)
+ {
+ SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ HttpContext httpContext = spiProvider.getSPI(HttpContextFactory.class).newHttpContext(this, contextRoot);
+ return httpContext;
+ }
+
+ /** Publish an JAXWS endpoint to the HTTP server */
+ public void publish(HttpContext context, Endpoint endpoint)
+ {
+ Class implClass = getImplementorClass(endpoint);
+
+ try
+ {
+ SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ DeploymentModelFactory depFactory = spiProvider.getSPI(DeploymentModelFactory.class);
+ Deployment dep = depFactory.newDeployment("jaxws-endpoint-deployment", implClass.getClassLoader());
+ dep.getService().addEndpoint(depFactory.newEndpoint("jaxws-endpoint", implClass.getName()));
+
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception ex)
+ {
+ throw new WebServiceException(ex);
+ }
+ }
+
+ /** Destroys an JAXWS endpoint on the HTTP server */
+ public void destroy(HttpContext context, Endpoint endpoint)
+ {
+ try
+ {
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception ex)
+ {
+ throw new WebServiceException(ex);
+ }
+ }
+
+ private Class getImplementorClass(Endpoint endpoint)
+ {
+ Object implementor = endpoint.getImplementor();
+ Class implClass = (implementor instanceof Class ? (Class)implementor : implementor.getClass());
+ return implClass;
+ }
+}
\ No newline at end of file
Modified: trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXRPCDeployerHookEJB21.java
===================================================================
--- trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXRPCDeployerHookEJB21.java 2007-07-30 12:53:36 UTC (rev 4026)
+++ trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXRPCDeployerHookEJB21.java 2007-07-30 14:31:05 UTC (rev 4027)
@@ -88,11 +88,7 @@
String ejbClass = beanMetaData.getEjbClass();
// Create the endpoint
- Endpoint ep = newEndpoint();
- ep.setShortName(ejbLink);
- ep.setService(service);
- ep.setTargetBeanName(ejbClass);
-
+ Endpoint ep = newEndpoint(ejbLink, ejbClass);
service.addEndpoint(ep);
}
}
Modified: trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXRPCDeployerHookJSE.java
===================================================================
--- trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXRPCDeployerHookJSE.java 2007-07-30 12:53:36 UTC (rev 4026)
+++ trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXRPCDeployerHookJSE.java 2007-07-30 14:31:05 UTC (rev 4027)
@@ -105,11 +105,7 @@
}
// Create the endpoint
- Endpoint ep = newEndpoint();
- ep.setShortName(servletLink);
- ep.setService(service);
- ep.setTargetBeanName(servletClass);
-
+ Endpoint ep = newEndpoint(servletLink, servletClass);
service.addEndpoint(ep);
}
}
Modified: trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXWSDeployerHookEJB3.java
===================================================================
--- trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXWSDeployerHookEJB3.java 2007-07-30 12:53:36 UTC (rev 4026)
+++ trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXWSDeployerHookEJB3.java 2007-07-30 14:31:05 UTC (rev 4027)
@@ -74,11 +74,7 @@
String epBean = container.getBeanClassName();
// Create the endpoint
- Endpoint ep = newEndpoint();
- ep.setShortName(ejbName);
- ep.setService(service);
- ep.setTargetBeanName(epBean);
-
+ Endpoint ep = newEndpoint(ejbName, epBean);
service.addEndpoint(ep);
}
}
Modified: trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXWSDeployerHookJSE.java
===================================================================
--- trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXWSDeployerHookJSE.java 2007-07-30 12:53:36 UTC (rev 4026)
+++ trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXWSDeployerHookJSE.java 2007-07-30 14:31:05 UTC (rev 4027)
@@ -80,11 +80,7 @@
String servletClass = servlet.getServletClass();
// Create the endpoint
- Endpoint ep = newEndpoint();
- ep.setShortName(servletName);
- ep.setService(service);
- ep.setTargetBeanName(servletClass);
-
+ Endpoint ep = newEndpoint(servletName, servletClass);
service.addEndpoint(ep);
}
Modified: trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/AbstractDeployerHook.java
===================================================================
--- trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/AbstractDeployerHook.java 2007-07-30 12:53:36 UTC (rev 4026)
+++ trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/AbstractDeployerHook.java 2007-07-30 14:31:05 UTC (rev 4027)
@@ -88,11 +88,11 @@
}
}
- public Endpoint newEndpoint()
+ public Endpoint newEndpoint(String shortName, String targetBean)
{
try
{
- return getDeploymentModelFactory().newEndpoint();
+ return getDeploymentModelFactory().newEndpoint(shortName, targetBean);
}
catch (Exception ex)
{
Modified: trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXRPCDeployerHookEJB21.java
===================================================================
--- trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXRPCDeployerHookEJB21.java 2007-07-30 12:53:36 UTC (rev 4026)
+++ trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXRPCDeployerHookEJB21.java 2007-07-30 14:31:05 UTC (rev 4027)
@@ -88,11 +88,7 @@
String ejbClass = beanMetaData.getEjbClass();
// Create the endpoint
- Endpoint ep = newEndpoint();
- ep.setShortName(ejbLink);
- ep.setService(service);
- ep.setTargetBeanName(ejbClass);
-
+ Endpoint ep = newEndpoint(ejbLink, ejbClass);
service.addEndpoint(ep);
}
}
Modified: trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXRPCDeployerHookJSE.java
===================================================================
--- trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXRPCDeployerHookJSE.java 2007-07-30 12:53:36 UTC (rev 4026)
+++ trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXRPCDeployerHookJSE.java 2007-07-30 14:31:05 UTC (rev 4027)
@@ -88,11 +88,7 @@
String servletClass = servlet.getServletClass();
// Create the endpoint
- Endpoint ep = newEndpoint();
- ep.setShortName(servletLink);
- ep.setService(service);
- ep.setTargetBeanName(servletClass);
-
+ Endpoint ep = newEndpoint(servletLink, servletClass);
service.addEndpoint(ep);
}
}
Modified: trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXWSDeployerHookEJB3.java
===================================================================
--- trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXWSDeployerHookEJB3.java 2007-07-30 12:53:36 UTC (rev 4026)
+++ trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXWSDeployerHookEJB3.java 2007-07-30 14:31:05 UTC (rev 4027)
@@ -80,11 +80,7 @@
String epBean = container.getBeanClassName();
// Create the endpoint
- Endpoint ep = newEndpoint();
- ep.setShortName(ejbName);
- ep.setService(service);
- ep.setTargetBeanName(epBean);
-
+ Endpoint ep = newEndpoint(ejbName, epBean);
service.addEndpoint(ep);
}
}
Modified: trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXWSDeployerHookJSE.java
===================================================================
--- trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXWSDeployerHookJSE.java 2007-07-30 12:53:36 UTC (rev 4026)
+++ trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXWSDeployerHookJSE.java 2007-07-30 14:31:05 UTC (rev 4027)
@@ -77,11 +77,7 @@
String servletClass = servlet.getServletClass();
// Create the endpoint
- Endpoint ep = newEndpoint();
- ep.setShortName(servletName);
- ep.setService(service);
- ep.setTargetBeanName(servletClass);
-
+ Endpoint ep = newEndpoint(servletName, servletClass);
service.addEndpoint(ep);
}
Modified: trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/ArchiveDeploymentModelFactory.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/ArchiveDeploymentModelFactory.java 2007-07-30 12:53:36 UTC (rev 4026)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/ArchiveDeploymentModelFactory.java 2007-07-30 14:31:05 UTC (rev 4027)
@@ -42,8 +42,8 @@
return new DefaultService();
}
- public Endpoint newEndpoint()
+ public Endpoint newEndpoint(String shortName, String targetBean)
{
- return new DefaultEndpoint();
+ return new DefaultEndpoint(shortName, targetBean);
}
}
Modified: trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/DefaultDeploymentModelFactory.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/DefaultDeploymentModelFactory.java 2007-07-30 12:53:36 UTC (rev 4026)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/DefaultDeploymentModelFactory.java 2007-07-30 14:31:05 UTC (rev 4027)
@@ -42,8 +42,8 @@
return new DefaultService();
}
- public Endpoint newEndpoint()
+ public Endpoint newEndpoint(String shortName, String targetBean)
{
- return new DefaultEndpoint();
+ return new DefaultEndpoint(shortName, targetBean);
}
}
Modified: trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/DefaultEndpoint.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/DefaultEndpoint.java 2007-07-30 12:53:36 UTC (rev 4026)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/DefaultEndpoint.java 2007-07-30 14:31:05 UTC (rev 4027)
@@ -57,8 +57,10 @@
private List<BindingCustomization> bindingCustomizsations = new ArrayList<BindingCustomization>();
private String address;
- DefaultEndpoint()
+ DefaultEndpoint(String shortName, String targetBean)
{
+ this.shortName = shortName;
+ this.targetBean = targetBean;
this.state = EndpointState.UNDEFINED;
}
Modified: trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/DefaultService.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/DefaultService.java 2007-07-30 12:53:36 UTC (rev 4026)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/DefaultService.java 2007-07-30 14:31:05 UTC (rev 4027)
@@ -62,6 +62,7 @@
public void addEndpoint(Endpoint endpoint)
{
+ endpoint.setService(this);
endpoints.add(endpoint);
}
Modified: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/DeploymentModelFactory.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/DeploymentModelFactory.java 2007-07-30 12:53:36 UTC (rev 4026)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/DeploymentModelFactory.java 2007-07-30 14:31:05 UTC (rev 4027)
@@ -31,6 +31,6 @@
{
public abstract Deployment newDeployment(String simpleName, ClassLoader initialLoader);
public abstract Service newService();
- public abstract Endpoint newEndpoint();
+ public abstract Endpoint newEndpoint(String shortName, String targetBean);
}
Modified: trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/binding/BindingCustomizationTestCase.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/binding/BindingCustomizationTestCase.java 2007-07-30 12:53:36 UTC (rev 4026)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/binding/BindingCustomizationTestCase.java 2007-07-30 14:31:05 UTC (rev 4027)
@@ -49,7 +49,7 @@
public void testCustomizationWriteAccess() throws Exception
{
- Endpoint endpoint = deploymentModelFactory.newEndpoint();
+ Endpoint endpoint = deploymentModelFactory.newEndpoint(null, null);
JAXBBindingCustomization jaxbCustomization = new JAXBBindingCustomization();
jaxbCustomization.put(JAXBBindingCustomization.DEFAULT_NAMESPACE_REMAP, "http://org.jboss.bindingCustomization");
endpoint.addAttachment(BindingCustomization.class, jaxbCustomization);
@@ -70,7 +70,7 @@
public void testCustomizationReadAccess() throws Exception
{
- Endpoint endpoint = deploymentModelFactory.newEndpoint();
+ Endpoint endpoint = deploymentModelFactory.newEndpoint(null, null);
JAXBBindingCustomization jaxbCustomization = new JAXBBindingCustomization();
jaxbCustomization.put(JAXBBindingCustomization.DEFAULT_NAMESPACE_REMAP, "http://org.jboss.bindingCustomization");
endpoint.addAttachment(BindingCustomization.class, jaxbCustomization);
17 years, 5 months
JBossWS SVN: r4026 - trunk/integration/spi/src/main/java/org/jboss/wsf/framework/http.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-07-30 08:53:36 -0400 (Mon, 30 Jul 2007)
New Revision: 4026
Added:
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/http/DefaultHttpServerFactory.java
Log:
Add missing HTTPServerFactory
Added: trunk/integration/spi/src/main/java/org/jboss/wsf/framework/http/DefaultHttpServerFactory.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/framework/http/DefaultHttpServerFactory.java (rev 0)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/framework/http/DefaultHttpServerFactory.java 2007-07-30 12:53:36 UTC (rev 4026)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.framework.http;
+
+//$Id: HttpContext.java 1757 2006-12-22 15:40:24Z thomas.diesler(a)jboss.com $
+
+import org.jboss.wsf.common.KernelAwareSPIFactory;
+import org.jboss.wsf.spi.http.HttpServer;
+import org.jboss.wsf.spi.http.HttpServerFactory;
+
+/**
+ * A factory for an abstract HTTP Context
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 07-Jul-2006
+ */
+public class DefaultHttpServerFactory extends HttpServerFactory
+{
+ @Override
+ public HttpServer getHttpServer()
+ {
+ return new KernelAwareSPIFactory().getKernelProvidedSPI(HttpServer.BEAN_NAME, HttpServer.class);
+ }
+}
17 years, 5 months
JBossWS SVN: r4025 - in trunk: integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42 and 17 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-07-30 08:49:32 -0400 (Mon, 30 Jul 2007)
New Revision: 4025
Added:
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/WebAppDeployingHttpServer.java
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/WebAppDeployingHttpServer.java
trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/NativeServerConfig.java
trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/NativeServerConfigMBean.java
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/MBeanServerLocator.java
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/ManagedEndpoint.java
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointMBean.java
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointRegistry.java
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointRegistryMBean.java
trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/MetroServerConfig.java
trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/MetroServerConfigMBean.java
trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/CXFServerConfig.java
trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/CXFServerConfigMBean.java
Removed:
trunk/integration/jboss42/src/main/resources/jbossws-jboss42.jar/META-INF/services/org.jboss.ws.core.server.HttpServer
trunk/integration/jboss50/src/main/resources/jbossws-jboss50.jar/META-INF/services/org.jboss.ws.core.server.HttpServer
trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ManagedEndpoint.java
trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ManagedEndpointMBean.java
trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ManagedEndpointRegistry.java
trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ManagedEndpointRegistryMBean.java
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/http/DefaultHttpServerFactory.java
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/http/WebAppDeployingHttpServer.java
trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/ManagedEndpointRegistry.java
trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/ManagedEndpointRegistryMBean.java
trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/ManagedEndpointRegistry.java
trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/ManagedEndpointRegistryMBean.java
Modified:
trunk/integration/jboss40/src/main/resources/jbossws-jboss40-config.xml
trunk/integration/jboss42/src/main/resources/jbossws-jboss42-config.xml
trunk/integration/jboss50/src/main/resources/jbossws-jboss50.deployer/META-INF/jbossws-deployer-beans.xml
trunk/integration/native/src/main/resources/jbossws-native-config.xml
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/DefaultServerConfig.java
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/DefaultServerConfigMBean.java
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/ServerConfigFactoryImpl.java
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/http/HttpServer.java
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/http/HttpServerFactory.java
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/management/EndpointRegistry.java
trunk/integration/sunri/src/main/resources/jbossws-sunri-config.xml
trunk/integration/xfire/src/main/resources/jbossws-xfire-config.xml
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointServlet.java
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointTestCase.java
Log:
Introduce WSMBeanServerLocator
More work on Endpoint API
Modified: trunk/integration/jboss40/src/main/resources/jbossws-jboss40-config.xml
===================================================================
--- trunk/integration/jboss40/src/main/resources/jbossws-jboss40-config.xml 2007-07-30 07:23:40 UTC (rev 4024)
+++ trunk/integration/jboss40/src/main/resources/jbossws-jboss40-config.xml 2007-07-30 12:49:32 UTC (rev 4025)
@@ -1,3 +1,17 @@
+
+ <!-- Locate the single instance of the kernel -->
+ <bean name="WSKernelLocator" class="org.jboss.ws.integration.KernelLocator">
+ <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"/>
+
+ <!-- The HTTPServer used by the JAXWS Endpoint API -->
+ <bean name="WSHTTPServer" class="org.jboss.wsf.container.jboss42.WebAppDeployingHttpServer">
+ <property name="mbeanServer"><inject bean="WSMBeanServerLocator" property="mbeanServer"/></property>
+ </bean>
+
<!--
*********************************************************************************************************************
Web Service deployment
@@ -30,11 +44,6 @@
*********************************************************************************************************************
-->
- <!-- Locate the single instance of the kernel -->
- <bean name="WSKernelLocator" class="org.jboss.ws.integration.KernelLocator">
- <property name="kernel"><inject bean="jboss.kernel:service=Kernel"/></property>
- </bean>
-
<!--
Register DeployerHooks with JBoss deployers
-->
Copied: trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/WebAppDeployingHttpServer.java (from rev 4024, trunk/integration/spi/src/main/java/org/jboss/wsf/framework/http/WebAppDeployingHttpServer.java)
===================================================================
--- trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/WebAppDeployingHttpServer.java (rev 0)
+++ trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/WebAppDeployingHttpServer.java 2007-07-30 12:49:32 UTC (rev 4025)
@@ -0,0 +1,236 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.container.jboss42;
+
+//$Id: JBossHttpServer.java 1786 2007-01-04 14:30:04Z thomas.diesler(a)jboss.com $
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.net.URL;
+import java.util.Map;
+
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+import javax.xml.ws.Endpoint;
+import javax.xml.ws.WebServiceException;
+
+import org.jboss.wsf.common.DOMUtils;
+import org.jboss.wsf.common.DOMWriter;
+import org.jboss.wsf.framework.DefaultExtensible;
+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.HttpContextFactory;
+import org.jboss.wsf.spi.http.HttpServer;
+import org.jboss.wsf.spi.management.ServerConfig;
+import org.jboss.wsf.spi.management.ServerConfigFactory;
+import org.w3c.dom.Element;
+
+/**
+ * A Tomcat HTTP Server
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 07-Jul-2006
+ */
+public class WebAppDeployingHttpServer extends DefaultExtensible implements HttpServer
+{
+ private static final String MAIN_DEPLOYER = "jboss.system:service=MainDeployer";
+
+ // The MBeanServer
+ private MBeanServer mbeanServer;
+
+ public MBeanServer getMbeanServer()
+ {
+ return mbeanServer;
+ }
+
+ public void setMbeanServer(MBeanServer mbeanServer)
+ {
+ this.mbeanServer = mbeanServer;
+ }
+
+ /** Start an instance of this HTTP server */
+ public void start()
+ {
+ // verify required properties
+ }
+
+ /** Create an HTTP context */
+ public HttpContext createContext(String contextRoot)
+ {
+ SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ HttpContext httpContext = spiProvider.getSPI(HttpContextFactory.class).newHttpContext(this, contextRoot);
+ return httpContext;
+ }
+
+ /** Publish an JAXWS endpoint to the HTTP server */
+ public void publish(HttpContext context, Endpoint endpoint)
+ {
+ Class implClass = getImplementorClass(endpoint);
+ String implName = implClass.getName();
+
+ try
+ {
+ Element webDoc = createWebAppDescriptor(context, endpoint);
+ Element jbossDoc = createJBossWebAppDescriptor(context, endpoint);
+
+ File tmpWar = null;
+ try
+ {
+ SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ ServerConfig serverConfig = spiProvider.getSPI(ServerConfigFactory.class).getServerConfig();
+ File tmpDir = new File(serverConfig.getServerTempDir().getCanonicalPath() + "/jbossws");
+ tmpDir.mkdirs();
+
+ String deploymentName = implName.substring(implName.lastIndexOf(".") + 1);
+ tmpWar = File.createTempFile(deploymentName, ".war", tmpDir);
+ tmpWar.delete();
+ File webInf = new File(tmpWar, "WEB-INF");
+ webInf.mkdirs();
+
+ File webXml = new File(webInf, "web.xml");
+ FileWriter fw = new FileWriter(webXml);
+ new DOMWriter(fw).setPrettyprint(true).print(webDoc);
+ fw.close();
+
+ File jbossWebXml = new File(webInf, "jboss-web.xml");
+ fw = new FileWriter(jbossWebXml);
+ new DOMWriter(fw).setPrettyprint(true).print(jbossDoc);
+ fw.close();
+ }
+ catch (IOException e)
+ {
+ throw new WebServiceException("Failed to create webservice war", e);
+ }
+
+ Map<String, Object> epProps = endpoint.getProperties();
+ epProps.put("jbossws-endpoint-war-url", tmpWar);
+
+ URL tmpURL = tmpWar.toURL();
+ getMbeanServer().invoke(new ObjectName(MAIN_DEPLOYER), "deploy", new Object[] { tmpURL }, new String[] { "java.net.URL" });
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception ex)
+ {
+ throw new WebServiceException(ex);
+ }
+ }
+
+ /** Destroys an JAXWS endpoint on the HTTP server */
+ public void destroy(HttpContext context, Endpoint endpoint)
+ {
+ Map<String, Object> epProps = endpoint.getProperties();
+ File tmpWar = (File)epProps.get("jbossws-endpoint-war-url");
+ if (tmpWar == null)
+ throw new IllegalStateException("Cannot find endpoint war property");
+
+ try
+ {
+ URL tmpURL = tmpWar.toURL();
+ getMbeanServer().invoke(new ObjectName(MAIN_DEPLOYER), "undeploy", new Object[] { tmpURL }, new String[] { "java.net.URL" });
+
+ tmpWar.delete();
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception ex)
+ {
+ throw new WebServiceException(ex);
+ }
+ }
+
+ private Class getImplementorClass(Endpoint endpoint)
+ {
+ Object implementor = endpoint.getImplementor();
+ Class implClass = (implementor instanceof Class ? (Class)implementor : implementor.getClass());
+ return implClass;
+ }
+
+ private Element createWebAppDescriptor(HttpContext context, Endpoint endpoint)
+ {
+ Class implClass = getImplementorClass(endpoint);
+ String implName = implClass.getName();
+
+ Element webApp = DOMUtils.createElement("web-app");
+
+ /*
+ <servlet>
+ <servlet-name>
+ <servlet-class>
+ </servlet>
+ */
+ Element servlet = (Element)webApp.appendChild(DOMUtils.createElement("servlet"));
+ Element servletName = (Element)servlet.appendChild(DOMUtils.createElement("servlet-name"));
+ servletName.appendChild(DOMUtils.createTextNode("JAXWSEndpoint"));
+ Element servletClass = (Element)servlet.appendChild(DOMUtils.createElement("servlet-class"));
+ servletClass.appendChild(DOMUtils.createTextNode(implName));
+
+ /*
+ <servlet-mapping>
+ <servlet-name>
+ <url-pattern>
+ </servlet-mapping>
+ */
+ Element servletMapping = (Element)webApp.appendChild(DOMUtils.createElement("servlet-mapping"));
+ servletName = (Element)servletMapping.appendChild(DOMUtils.createElement("servlet-name"));
+ servletName.appendChild(DOMUtils.createTextNode("JAXWSEndpoint"));
+ Element urlPatternElement = (Element)servletMapping.appendChild(DOMUtils.createElement("url-pattern"));
+
+ String urlPattern = "/*";
+ urlPatternElement.appendChild(DOMUtils.createTextNode(urlPattern));
+
+ // Add security-constraint in generated web.xml for Endpoint API
+ // FIXME: JBWS-1069
+
+ return webApp;
+ }
+
+ private Element createJBossWebAppDescriptor(HttpContext context, Endpoint endpoint)
+ {
+ /* Create a jboss-web
+ <jboss-web>
+ <security-domain>java:/jaas/cts</security-domain>
+ <context-root>/ws/ejbN/</context-root>
+ </jboss-web>
+ */
+ Element jbossWeb = DOMUtils.createElement("jboss-web");
+
+ // Get the context root for this deployment
+ String contextRoot = context.getContextRoot();
+ if (contextRoot == null)
+ throw new WebServiceException("Cannot obtain context root");
+
+ Element root = (Element)jbossWeb.appendChild(DOMUtils.createElement("context-root"));
+ root.appendChild(DOMUtils.createTextNode(contextRoot));
+
+ // Add security-constraint in generated web.xml for Endpoint API
+ // FIXME: JBWS-1069
+
+ return jbossWeb;
+ }
+}
\ No newline at end of file
Modified: trunk/integration/jboss42/src/main/resources/jbossws-jboss42-config.xml
===================================================================
--- trunk/integration/jboss42/src/main/resources/jbossws-jboss42-config.xml 2007-07-30 07:23:40 UTC (rev 4024)
+++ trunk/integration/jboss42/src/main/resources/jbossws-jboss42-config.xml 2007-07-30 12:49:32 UTC (rev 4025)
@@ -1,3 +1,17 @@
+
+ <!-- Locate the single instance of the kernel -->
+ <bean name="WSKernelLocator" class="org.jboss.ws.integration.KernelLocator">
+ <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"/>
+
+ <!-- The HTTPServer used by the JAXWS Endpoint API -->
+ <bean name="WSHTTPServer" class="org.jboss.wsf.container.jboss42.WebAppDeployingHttpServer">
+ <property name="mbeanServer"><inject bean="WSMBeanServerLocator" property="mbeanServer"/></property>
+ </bean>
+
<!--
*********************************************************************************************************************
Web Service deployment
@@ -30,11 +44,6 @@
*********************************************************************************************************************
-->
- <!-- Locate the single instance of the kernel -->
- <bean name="WSKernelLocator" class="org.jboss.ws.integration.KernelLocator">
- <property name="kernel"><inject bean="jboss.kernel:service=Kernel"/></property>
- </bean>
-
<!--
Register DeployerHooks with JBoss deployers
-->
Deleted: trunk/integration/jboss42/src/main/resources/jbossws-jboss42.jar/META-INF/services/org.jboss.ws.core.server.HttpServer
===================================================================
--- trunk/integration/jboss42/src/main/resources/jbossws-jboss42.jar/META-INF/services/org.jboss.ws.core.server.HttpServer 2007-07-30 07:23:40 UTC (rev 4024)
+++ trunk/integration/jboss42/src/main/resources/jbossws-jboss42.jar/META-INF/services/org.jboss.ws.core.server.HttpServer 2007-07-30 12:49:32 UTC (rev 4025)
@@ -1 +0,0 @@
-org.jboss.ws.integration.jboss42.JBossHttpServer
\ No newline at end of file
Added: trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/WebAppDeployingHttpServer.java
===================================================================
--- trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/WebAppDeployingHttpServer.java (rev 0)
+++ trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/WebAppDeployingHttpServer.java 2007-07-30 12:49:32 UTC (rev 4025)
@@ -0,0 +1,247 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.container.jboss50;
+
+//$Id: JBossHttpServer.java 1786 2007-01-04 14:30:04Z thomas.diesler(a)jboss.com $
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.ws.Endpoint;
+import javax.xml.ws.WebServiceException;
+
+import org.jboss.deployers.client.spi.DeployerClient;
+import org.jboss.deployers.client.spi.Deployment;
+import org.jboss.deployers.vfs.spi.client.VFSDeploymentFactory;
+import org.jboss.virtual.VFS;
+import org.jboss.virtual.VirtualFile;
+import org.jboss.wsf.common.DOMUtils;
+import org.jboss.wsf.common.DOMWriter;
+import org.jboss.wsf.framework.DefaultExtensible;
+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.HttpContextFactory;
+import org.jboss.wsf.spi.http.HttpServer;
+import org.jboss.wsf.spi.management.ServerConfig;
+import org.jboss.wsf.spi.management.ServerConfigFactory;
+import org.w3c.dom.Element;
+
+/**
+ * A Tomcat HTTP Server
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 07-Jul-2006
+ */
+public class WebAppDeployingHttpServer extends DefaultExtensible implements HttpServer
+{
+ private DeployerClient mainDeployer;
+ private Map<String, Deployment> deploymentMap = new HashMap<String, Deployment>();
+
+ public void setMainDeployer(DeployerClient mainDeployer)
+ {
+ this.mainDeployer = mainDeployer;
+ }
+
+ /** Start an instance of this HTTP server */
+ public void start()
+ {
+ // verify required properties
+ }
+
+ /** Create an HTTP context */
+ public HttpContext createContext(String contextRoot)
+ {
+ SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ HttpContext httpContext = spiProvider.getSPI(HttpContextFactory.class).newHttpContext(this, contextRoot);
+ return httpContext;
+ }
+
+ /** Publish an JAXWS endpoint to the HTTP server */
+ public void publish(HttpContext context, Endpoint endpoint)
+ {
+ Class implClass = getImplementorClass(endpoint);
+ String implName = implClass.getName();
+
+ try
+ {
+ Element webDoc = createWebAppDescriptor(context, endpoint);
+ Element jbossDoc = createJBossWebAppDescriptor(context, endpoint);
+
+ File tmpWar = null;
+ try
+ {
+ SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ ServerConfig serverConfig = spiProvider.getSPI(ServerConfigFactory.class).getServerConfig();
+ File tmpDir = new File(serverConfig.getServerTempDir().getCanonicalPath() + "/jbossws");
+ tmpDir.mkdirs();
+
+ String deploymentName = implName.substring(implName.lastIndexOf(".") + 1);
+ tmpWar = File.createTempFile(deploymentName, ".war", tmpDir);
+ tmpWar.delete();
+ File webInf = new File(tmpWar, "WEB-INF");
+ webInf.mkdirs();
+
+ File webXml = new File(webInf, "web.xml");
+ FileWriter fw = new FileWriter(webXml);
+ new DOMWriter(fw).setPrettyprint(true).print(webDoc);
+ fw.close();
+
+ File jbossWebXml = new File(webInf, "jboss-web.xml");
+ fw = new FileWriter(jbossWebXml);
+ new DOMWriter(fw).setPrettyprint(true).print(jbossDoc);
+ fw.close();
+ }
+ catch (IOException e)
+ {
+ throw new WebServiceException("Failed to create webservice war", e);
+ }
+
+ Map<String, Object> epProps = endpoint.getProperties();
+ epProps.put("jbossws-endpoint-war-url", tmpWar);
+
+ URL tmpURL = tmpWar.toURL();
+ Deployment deployment = createDeploymentContext(tmpURL);
+
+ mainDeployer.deploy(deployment);
+ deploymentMap.put(tmpURL.toExternalForm(), deployment);
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception ex)
+ {
+ throw new WebServiceException(ex);
+ }
+ }
+
+ /** Destroys an JAXWS endpoint on the HTTP server */
+ public void destroy(HttpContext context, Endpoint endpoint)
+ {
+ Map<String, Object> epProps = endpoint.getProperties();
+ File tmpWar = (File)epProps.get("jbossws-endpoint-war-url");
+ if (tmpWar == null)
+ throw new IllegalStateException("Cannot find endpoint war property");
+
+ try
+ {
+ URL tmpURL = tmpWar.toURL();
+ Deployment deployment = deploymentMap.get(tmpURL.toExternalForm());
+ if (deployment != null)
+ {
+ mainDeployer.undeploy(deployment);
+ deploymentMap.remove(tmpURL.toExternalForm());
+ }
+
+ tmpWar.delete();
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception ex)
+ {
+ throw new WebServiceException(ex);
+ }
+ }
+
+ private Class getImplementorClass(Endpoint endpoint)
+ {
+ Object implementor = endpoint.getImplementor();
+ Class implClass = (implementor instanceof Class ? (Class)implementor : implementor.getClass());
+ return implClass;
+ }
+
+ private Element createWebAppDescriptor(HttpContext context, Endpoint endpoint)
+ {
+ Class implClass = getImplementorClass(endpoint);
+ String implName = implClass.getName();
+
+ Element webApp = DOMUtils.createElement("web-app");
+
+ /*
+ <servlet>
+ <servlet-name>
+ <servlet-class>
+ </servlet>
+ */
+ Element servlet = (Element)webApp.appendChild(DOMUtils.createElement("servlet"));
+ Element servletName = (Element)servlet.appendChild(DOMUtils.createElement("servlet-name"));
+ servletName.appendChild(DOMUtils.createTextNode("JAXWSEndpoint"));
+ Element servletClass = (Element)servlet.appendChild(DOMUtils.createElement("servlet-class"));
+ servletClass.appendChild(DOMUtils.createTextNode(implName));
+
+ /*
+ <servlet-mapping>
+ <servlet-name>
+ <url-pattern>
+ </servlet-mapping>
+ */
+ Element servletMapping = (Element)webApp.appendChild(DOMUtils.createElement("servlet-mapping"));
+ servletName = (Element)servletMapping.appendChild(DOMUtils.createElement("servlet-name"));
+ servletName.appendChild(DOMUtils.createTextNode("JAXWSEndpoint"));
+ Element urlPatternElement = (Element)servletMapping.appendChild(DOMUtils.createElement("url-pattern"));
+
+ String urlPattern = "/*";
+ urlPatternElement.appendChild(DOMUtils.createTextNode(urlPattern));
+
+ // Add security-constraint in generated web.xml for Endpoint API
+ // FIXME: JBWS-1069
+
+ return webApp;
+ }
+
+ private Element createJBossWebAppDescriptor(HttpContext context, Endpoint endpoint)
+ {
+ /* Create a jboss-web
+ <jboss-web>
+ <security-domain>java:/jaas/cts</security-domain>
+ <context-root>/ws/ejbN/</context-root>
+ </jboss-web>
+ */
+ Element jbossWeb = DOMUtils.createElement("jboss-web");
+
+ // Get the context root for this deployment
+ String contextRoot = context.getContextRoot();
+ if (contextRoot == null)
+ throw new WebServiceException("Cannot obtain context root");
+
+ Element root = (Element)jbossWeb.appendChild(DOMUtils.createElement("context-root"));
+ root.appendChild(DOMUtils.createTextNode(contextRoot));
+
+ // Add security-constraint in generated web.xml for Endpoint API
+ // FIXME: JBWS-1069
+
+ return jbossWeb;
+ }
+
+ private Deployment createDeploymentContext(URL warURL) throws Exception
+ {
+ VirtualFile file = VFS.getRoot(warURL);
+ return VFSDeploymentFactory.getInstance().createVFSDeployment(file);
+ }
+}
Modified: trunk/integration/jboss50/src/main/resources/jbossws-jboss50.deployer/META-INF/jbossws-deployer-beans.xml
===================================================================
--- trunk/integration/jboss50/src/main/resources/jbossws-jboss50.deployer/META-INF/jbossws-deployer-beans.xml 2007-07-30 07:23:40 UTC (rev 4024)
+++ trunk/integration/jboss50/src/main/resources/jbossws-jboss50.deployer/META-INF/jbossws-deployer-beans.xml 2007-07-30 12:49:32 UTC (rev 4025)
@@ -2,6 +2,21 @@
<deployment xmlns="urn:jboss:bean-deployer:2.0">
+ <!-- Locate the single instance of the kernel -->
+ <bean name="WSKernelLocator" class="org.jboss.ws.integration.KernelLocator">
+ <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>
+ </bean>
+
+ <!-- The HTTPServer used by the JAXWS Endpoint API -->
+ <bean name="WSHTTPServer" class="org.jboss.wsf.container.jboss50.WebAppDeployingHttpServer">
+ <property name="mainDeployer"><inject bean="MainDeployer"/></property>
+ </bean>
+
<!--
*********************************************************************************************************************
Web Service deployment
@@ -42,11 +57,6 @@
*********************************************************************************************************************
-->
- <!-- Locate the single instance of the kernel -->
- <bean name="WSKernelLocator" class="org.jboss.ws.integration.KernelLocator">
- <property name="kernel"><inject bean="jboss.kernel:service=Kernel"/></property>
- </bean>
-
<!--
A web service deployer that hooks in after the EJB deployers
-->
Deleted: trunk/integration/jboss50/src/main/resources/jbossws-jboss50.jar/META-INF/services/org.jboss.ws.core.server.HttpServer
===================================================================
--- trunk/integration/jboss50/src/main/resources/jbossws-jboss50.jar/META-INF/services/org.jboss.ws.core.server.HttpServer 2007-07-30 07:23:40 UTC (rev 4024)
+++ trunk/integration/jboss50/src/main/resources/jbossws-jboss50.jar/META-INF/services/org.jboss.ws.core.server.HttpServer 2007-07-30 12:49:32 UTC (rev 4025)
@@ -1 +0,0 @@
-org.jboss.ws.integration.jboss50.JBossHttpServer
\ No newline at end of file
Deleted: trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ManagedEndpoint.java
===================================================================
--- trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ManagedEndpoint.java 2007-07-30 07:23:40 UTC (rev 4024)
+++ trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ManagedEndpoint.java 2007-07-30 12:49:32 UTC (rev 4025)
@@ -1,109 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.wsf.stack.jbws;
-
-// $Id: ManagedEndpointRegistry.java 3146 2007-05-18 22:55:26Z thomas.diesler(a)jboss.com $
-
-import java.util.Date;
-
-import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.management.EndpointMetrics;
-
-/**
- * The endpoint MBean representation
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 20-Jun-2007
- */
-public class ManagedEndpoint implements ManagedEndpointMBean
-{
- private Endpoint endpoint;
-
- public ManagedEndpoint(Endpoint endpoint)
- {
- this.endpoint = endpoint;
- }
-
- public long getAverageProcessingTime()
- {
- EndpointMetrics metrics = endpoint.getEndpointMetrics();
- return metrics != null ? metrics.getAverageProcessingTime() : 0;
- }
-
- public long getFaultCount()
- {
- EndpointMetrics metrics = endpoint.getEndpointMetrics();
- return metrics != null ? metrics.getFaultCount() : 0;
- }
-
- public long getMaxProcessingTime()
- {
- EndpointMetrics metrics = endpoint.getEndpointMetrics();
- return metrics != null ? metrics.getMaxProcessingTime() : 0;
- }
-
- public long getMinProcessingTime()
- {
- EndpointMetrics metrics = endpoint.getEndpointMetrics();
- return metrics != null ? metrics.getMinProcessingTime() : 0;
- }
-
- public long getRequestCount()
- {
- EndpointMetrics metrics = endpoint.getEndpointMetrics();
- return metrics != null ? metrics.getRequestCount() : 0;
- }
-
- public long getResponseCount()
- {
- EndpointMetrics metrics = endpoint.getEndpointMetrics();
- return metrics != null ? metrics.getResponseCount() : 0;
- }
-
- public Date getStartTime()
- {
- EndpointMetrics metrics = endpoint.getEndpointMetrics();
- return metrics != null ? metrics.getStartTime() : null;
- }
-
- public Date getStopTime()
- {
- EndpointMetrics metrics = endpoint.getEndpointMetrics();
- return metrics != null ? metrics.getStopTime() : null;
- }
-
- public long getTotalProcessingTime()
- {
- EndpointMetrics metrics = endpoint.getEndpointMetrics();
- return metrics != null ? metrics.getTotalProcessingTime() : 0;
- }
-
- public void start()
- {
- endpoint.getLifecycleHandler().start(endpoint);
- }
-
- public void stop()
- {
- endpoint.getLifecycleHandler().stop(endpoint);
- }
-}
Deleted: trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ManagedEndpointMBean.java
===================================================================
--- trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ManagedEndpointMBean.java 2007-07-30 07:23:40 UTC (rev 4024)
+++ trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ManagedEndpointMBean.java 2007-07-30 12:49:32 UTC (rev 4025)
@@ -1,53 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.wsf.stack.jbws;
-
-import java.util.Date;
-
-/**
- * MBean interface.
- * @since 15-April-2004
- */
-public interface ManagedEndpointMBean
-{
- void start();
-
- void stop();
-
- Date getStartTime();
-
- Date getStopTime();
-
- long getMinProcessingTime();
-
- long getMaxProcessingTime();
-
- long getAverageProcessingTime();
-
- long getTotalProcessingTime();
-
- long getRequestCount();
-
- long getFaultCount();
-
- long getResponseCount();
-}
Deleted: trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ManagedEndpointRegistry.java
===================================================================
--- trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ManagedEndpointRegistry.java 2007-07-30 07:23:40 UTC (rev 4024)
+++ trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ManagedEndpointRegistry.java 2007-07-30 12:49:32 UTC (rev 4025)
@@ -1,129 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.wsf.stack.jbws;
-
-// $Id$
-
-import java.util.ArrayList;
-
-import javax.management.JMException;
-import javax.management.MBeanServer;
-import javax.management.MBeanServerFactory;
-import javax.management.ObjectName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
-import org.jboss.ws.metadata.umdm.UnifiedMetaData;
-import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.management.DefaultEndpointRegistry;
-
-/**
- * A Service Endpoint Registry
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-May-2007
- */
-public class ManagedEndpointRegistry extends DefaultEndpointRegistry implements ManagedEndpointRegistryMBean
-{
- // provide logging
- private static final Logger log = Logger.getLogger(ManagedEndpointRegistry.class);
-
- public String getImplementationTitle()
- {
- return getClass().getPackage().getImplementationTitle();
- }
-
- public String getImplementationVersion()
- {
- return UnifiedMetaData.getImplementationVersion();
- }
-
- @Override
- public void register(Endpoint endpoint)
- {
- super.register(endpoint);
-
- MBeanServer server = getMBeanServer();
- if (server != null)
- {
- try
- {
- ManagedEndpoint jmxEndpoint = new ManagedEndpoint(endpoint);
- server.registerMBean(jmxEndpoint, endpoint.getName());
- }
- catch (JMException ex)
- {
- log.error("Cannot register endpoint with JMX server", ex);
- }
- }
- }
-
- @Override
- public void unregister(Endpoint endpoint)
- {
- super.unregister(endpoint);
- MBeanServer server = getMBeanServer();
- if (server != null)
- {
- try
- {
- server.unregisterMBean(endpoint.getName());
- }
- catch (JMException ex)
- {
- log.error("Cannot unregister endpoint with JMX server", ex);
- }
- }
- }
-
- public void create() throws Exception
- {
- log.info(getImplementationTitle());
- log.info(getImplementationVersion());
- MBeanServer server = getMBeanServer();
- if (server != null)
- {
- server.registerMBean(this, OBJECT_NAME);
- }
- }
-
- public void destroy() throws Exception
- {
- log.debug("Destroy service endpoint manager");
- MBeanServer server = getMBeanServer();
- if (server != null)
- {
- server.unregisterMBean(OBJECT_NAME);
- }
- }
-
- private MBeanServer getMBeanServer()
- {
- MBeanServer server = null;
- ArrayList servers = MBeanServerFactory.findMBeanServer(null);
- if (servers.size() > 0)
- {
- server = (MBeanServer)servers.get(0);
- }
- return server;
- }
-}
Deleted: trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ManagedEndpointRegistryMBean.java
===================================================================
--- trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ManagedEndpointRegistryMBean.java 2007-07-30 07:23:40 UTC (rev 4024)
+++ trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ManagedEndpointRegistryMBean.java 2007-07-30 12:49:32 UTC (rev 4025)
@@ -1,35 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.wsf.stack.jbws;
-
-import org.jboss.wsf.spi.management.EndpointRegistry;
-
-/**
- * MBean interface.
- * @since 15-April-2004
- */
-public interface ManagedEndpointRegistryMBean extends EndpointRegistry
-{
- String getImplementationTitle();
-
- String getImplementationVersion();
-}
Added: trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/NativeServerConfig.java
===================================================================
--- trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/NativeServerConfig.java (rev 0)
+++ trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/NativeServerConfig.java 2007-07-30 12:49:32 UTC (rev 4025)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.stack.jbws;
+
+//$Id: DefaultServerConfig.java 4023 2007-07-28 07:14:06Z thomas.diesler(a)jboss.com $
+
+import org.jboss.logging.Logger;
+import org.jboss.wsf.framework.management.DefaultServerConfig;
+
+/**
+ * Basic implementation of a ServerConfig
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 08-May-2006
+ */
+public class NativeServerConfig extends DefaultServerConfig implements NativeServerConfigMBean
+{
+ private static final Logger log = Logger.getLogger(NativeServerConfig.class);
+
+ public String getImplementationTitle()
+ {
+ return getClass().getPackage().getImplementationTitle();
+ }
+
+ public String getImplementationVersion()
+ {
+ return getClass().getPackage().getImplementationVersion();
+ }
+
+ public void create() throws Exception
+ {
+ log.info(getImplementationTitle());
+ log.info(getImplementationVersion());
+ super.create();
+ }
+}
Added: trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/NativeServerConfigMBean.java
===================================================================
--- trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/NativeServerConfigMBean.java (rev 0)
+++ trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/NativeServerConfigMBean.java 2007-07-30 12:49:32 UTC (rev 4025)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.stack.jbws;
+
+//$Id: DefaultServerConfig.java 4023 2007-07-28 07:14:06Z thomas.diesler(a)jboss.com $
+
+import org.jboss.wsf.framework.management.DefaultServerConfigMBean;
+
+/**
+ * Basic implementation of a ServerConfig
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 08-May-2006
+ */
+public interface NativeServerConfigMBean extends DefaultServerConfigMBean
+{
+ String getImplementationTitle();
+
+ String getImplementationVersion();
+}
Modified: trunk/integration/native/src/main/resources/jbossws-native-config.xml
===================================================================
--- trunk/integration/native/src/main/resources/jbossws-native-config.xml 2007-07-30 07:23:40 UTC (rev 4024)
+++ trunk/integration/native/src/main/resources/jbossws-native-config.xml 2007-07-30 12:49:32 UTC (rev 4025)
@@ -1,6 +1,8 @@
<!-- An abstraction of server configuration aspects. -->
- <bean name="WSServerConfig" class="org.jboss.wsf.framework.management.DefaultServerConfig">
+ <bean name="WSServerConfig" class="org.jboss.wsf.stack.jbws.NativeServerConfig">
+ <property name="mbeanServer"><inject bean="WSMBeanServerLocator" property="mbeanServer"/></property>
+
<!--
The WSDL, that is a required deployment artifact for an endpoint, has a <soap:address>
element which points to the location of the endpoint. JBoss supports rewriting of that SOAP address.
@@ -23,7 +25,9 @@
</bean>
<!-- The registry for web service endpoints -->
- <bean name="WSEndpointRegistry" class="org.jboss.wsf.stack.jbws.ManagedEndpointRegistry"/>
+ <bean name="WSEndpointRegistry" class="org.jboss.wsf.framework.management.ManagedEndpointRegistry">
+ <property name="mbeanServer"><inject bean="WSMBeanServerLocator" property="mbeanServer"/></property>
+ </bean>
<!-- A subscription manager for WS-Eventing -->
<bean name="WSSubscriptionManager" class="org.jboss.ws.extensions.eventing.mgmt.SubscriptionManager">
Deleted: trunk/integration/spi/src/main/java/org/jboss/wsf/framework/http/DefaultHttpServerFactory.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/framework/http/DefaultHttpServerFactory.java 2007-07-30 07:23:40 UTC (rev 4024)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/framework/http/DefaultHttpServerFactory.java 2007-07-30 12:49:32 UTC (rev 4025)
@@ -1,41 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.wsf.framework.http;
-
-//$Id: HttpContext.java 1757 2006-12-22 15:40:24Z thomas.diesler(a)jboss.com $
-
-import org.jboss.wsf.spi.http.HttpServer;
-import org.jboss.wsf.spi.http.HttpServerFactory;
-
-/**
- * A factory for an HTTP Server
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 07-Jul-2006
- */
-public class DefaultHttpServerFactory extends HttpServerFactory
-{
- public HttpServer newHttpServer()
- {
- return new WebAppDeployingHttpServer();
- }
-}
Deleted: trunk/integration/spi/src/main/java/org/jboss/wsf/framework/http/WebAppDeployingHttpServer.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/framework/http/WebAppDeployingHttpServer.java 2007-07-30 07:23:40 UTC (rev 4024)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/framework/http/WebAppDeployingHttpServer.java 2007-07-30 12:49:32 UTC (rev 4025)
@@ -1,234 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.wsf.framework.http;
-
-//$Id: JBossHttpServer.java 1786 2007-01-04 14:30:04Z thomas.diesler(a)jboss.com $
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.net.URL;
-import java.util.Map;
-
-import javax.management.MBeanServerConnection;
-import javax.management.ObjectName;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import javax.xml.ws.Endpoint;
-import javax.xml.ws.WebServiceException;
-
-import org.jboss.wsf.common.DOMUtils;
-import org.jboss.wsf.common.DOMWriter;
-import org.jboss.wsf.framework.DefaultExtensible;
-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.HttpContextFactory;
-import org.jboss.wsf.spi.http.HttpServer;
-import org.jboss.wsf.spi.management.ServerConfig;
-import org.jboss.wsf.spi.management.ServerConfigFactory;
-import org.w3c.dom.Element;
-
-/**
- * A Tomcat HTTP Server
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 07-Jul-2006
- */
-public class WebAppDeployingHttpServer extends DefaultExtensible implements HttpServer
-{
- private static final String MAIN_DEPLOYER = "jboss.system:service=MainDeployer";
-
- /** Start an instance of this HTTP server */
- public void start()
- {
- // verify required properties
- }
-
- /** Create an HTTP context */
- public HttpContext createContext(String contextRoot)
- {
- SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
- HttpContext httpContext = spiProvider.getSPI(HttpContextFactory.class).newHttpContext(this, contextRoot);
- return httpContext;
- }
-
- /** Publish an JAXWS endpoint to the HTTP server */
- public void publish(HttpContext context, Endpoint endpoint)
- {
- Class implClass = getImplementorClass(endpoint);
- String implName = implClass.getName();
-
- try
- {
- Element webDoc = createWebAppDescriptor(context, endpoint);
- Element jbossDoc = createJBossWebAppDescriptor(context, endpoint);
-
- File tmpWar = null;
- try
- {
- SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
- ServerConfig serverConfig = spiProvider.getSPI(ServerConfigFactory.class).getServerConfig();
- File tmpDir = new File(serverConfig.getServerTempDir().getCanonicalPath() + "/jbossws");
-
- String deploymentName = implName.substring(implName.lastIndexOf(".") + 1);
- tmpWar = File.createTempFile(deploymentName, ".war", tmpDir);
- tmpWar.delete();
- File webInf = new File(tmpWar, "WEB-INF");
- webInf.mkdirs();
-
- File webXml = new File(webInf, "web.xml");
- FileWriter fw = new FileWriter(webXml);
- new DOMWriter(fw).setPrettyprint(true).print(webDoc);
- fw.close();
-
- File jbossWebXml = new File(webInf, "jboss-web.xml");
- fw = new FileWriter(jbossWebXml);
- new DOMWriter(fw).setPrettyprint(true).print(jbossDoc);
- fw.close();
- }
- catch (IOException e)
- {
- throw new WebServiceException("Failed to create webservice war", e);
- }
-
- Map<String, Object> epProps = endpoint.getProperties();
- epProps.put("jbossws-endpoint-war-url", tmpWar);
-
- URL tmpURL = tmpWar.toURL();
- MBeanServerConnection server = getServer();
- server.invoke(new ObjectName(MAIN_DEPLOYER), "deploy", new Object[] { tmpURL }, new String[] { "java.net.URL" });
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new WebServiceException(ex);
- }
- }
-
- /** Destroys an JAXWS endpoint on the HTTP server */
- public void destroy(HttpContext context, Endpoint endpoint)
- {
- Map<String, Object> epProps = endpoint.getProperties();
- File tmpWar = (File)epProps.get("jbossws-endpoint-war-url");
- if (tmpWar == null)
- throw new IllegalStateException("Cannot find endpoint war property");
-
- try
- {
- URL tmpURL = tmpWar.toURL();
- MBeanServerConnection server = getServer();
- server.invoke(new ObjectName(MAIN_DEPLOYER), "undeploy", new Object[] { tmpURL }, new String[] { "java.net.URL" });
-
- tmpWar.delete();
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new WebServiceException(ex);
- }
- }
-
- private Class getImplementorClass(Endpoint endpoint)
- {
- Object implementor = endpoint.getImplementor();
- Class implClass = (implementor instanceof Class ? (Class)implementor : implementor.getClass());
- return implClass;
- }
-
- private MBeanServerConnection getServer() throws NamingException
- {
- InitialContext iniCtx = new InitialContext();
- MBeanServerConnection server = (MBeanServerConnection)iniCtx.lookup("jmx/invoker/RMIAdaptor");
- return server;
- }
-
- private Element createWebAppDescriptor(HttpContext context, Endpoint endpoint)
- {
- Class implClass = getImplementorClass(endpoint);
- String implName = implClass.getName();
-
- Element webApp = DOMUtils.createElement("web-app");
-
- /*
- <servlet>
- <servlet-name>
- <servlet-class>
- </servlet>
- */
- Element servlet = (Element)webApp.appendChild(DOMUtils.createElement("servlet"));
- Element servletName = (Element)servlet.appendChild(DOMUtils.createElement("servlet-name"));
- servletName.appendChild(DOMUtils.createTextNode("JAXWSEndpoint"));
- Element servletClass = (Element)servlet.appendChild(DOMUtils.createElement("servlet-class"));
- servletClass.appendChild(DOMUtils.createTextNode(implName));
-
- /*
- <servlet-mapping>
- <servlet-name>
- <url-pattern>
- </servlet-mapping>
- */
- Element servletMapping = (Element)webApp.appendChild(DOMUtils.createElement("servlet-mapping"));
- servletName = (Element)servletMapping.appendChild(DOMUtils.createElement("servlet-name"));
- servletName.appendChild(DOMUtils.createTextNode("JAXWSEndpoint"));
- Element urlPatternElement = (Element)servletMapping.appendChild(DOMUtils.createElement("url-pattern"));
-
- String urlPattern = "/*";
- urlPatternElement.appendChild(DOMUtils.createTextNode(urlPattern));
-
- // Add security-constraint in generated web.xml for Endpoint API
- // FIXME: JBWS-1069
-
- return webApp;
- }
-
- private Element createJBossWebAppDescriptor(HttpContext context, Endpoint endpoint)
- {
- /* Create a jboss-web
- <jboss-web>
- <security-domain>java:/jaas/cts</security-domain>
- <context-root>/ws/ejbN/</context-root>
- </jboss-web>
- */
- Element jbossWeb = DOMUtils.createElement("jboss-web");
-
- // Get the context root for this deployment
- String contextRoot = context.getContextRoot();
- if (contextRoot == null)
- throw new WebServiceException("Cannot obtain context root");
-
- Element root = (Element)jbossWeb.appendChild(DOMUtils.createElement("context-root"));
- root.appendChild(DOMUtils.createTextNode(contextRoot));
-
- // Add security-constraint in generated web.xml for Endpoint API
- // FIXME: JBWS-1069
-
- return jbossWeb;
- }
-}
-
Modified: trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/DefaultServerConfig.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/DefaultServerConfig.java 2007-07-30 07:23:40 UTC (rev 4024)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/DefaultServerConfig.java 2007-07-30 12:49:32 UTC (rev 4025)
@@ -26,17 +26,16 @@
import java.io.File;
import java.net.InetAddress;
import java.net.UnknownHostException;
-import java.util.Iterator;
import java.util.Set;
import javax.management.AttributeNotFoundException;
import javax.management.JMException;
import javax.management.MBeanServer;
-import javax.management.MBeanServerFactory;
import javax.management.ObjectName;
import org.jboss.logging.Logger;
import org.jboss.wsf.common.ObjectNameFactory;
+import org.jboss.wsf.spi.management.ServerConfig;
/**
* Basic implementation of a ServerConfig
@@ -45,10 +44,12 @@
* @author darran.lofthouse(a)jboss.com
* @since 08-May-2006
*/
-public class DefaultServerConfig implements DefaultServerConfigMBean
+public class DefaultServerConfig implements DefaultServerConfigMBean, ServerConfig
{
private static final Logger log = Logger.getLogger(DefaultServerConfig.class);
+ // The MBeanServer
+ private MBeanServer mbeanServer;
// The webservice host name that will be used when updating the wsdl
private String webServiceHost = UNDEFINED_HOSTNAME;
// The webservice port that will be used when updating the wsdl
@@ -57,9 +58,17 @@
private int webServiceSecurePort;
// Whether we should always modify the soap address to the deployed endpoing location
private boolean modifySOAPAddress;
- // The MBeanServer
- private MBeanServer server;
+ public MBeanServer getMbeanServer()
+ {
+ return mbeanServer;
+ }
+
+ public void setMbeanServer(MBeanServer mbeanServer)
+ {
+ this.mbeanServer = mbeanServer;
+ }
+
public String getWebServiceHost()
{
return webServiceHost;
@@ -105,9 +114,8 @@
{
try
{
- MBeanServer server = getMBeanServer();
ObjectName oname = ObjectNameFactory.create("jboss.system:type=ServerConfig");
- File tmpdir = (File)server.getAttribute(oname, "ServerTempDir");
+ File tmpdir = (File)getMbeanServer().getAttribute(oname, "ServerTempDir");
return tmpdir;
}
catch (JMException e)
@@ -120,9 +128,8 @@
{
try
{
- MBeanServer server = getMBeanServer();
ObjectName oname = ObjectNameFactory.create("jboss.system:type=ServerConfig");
- File tmpdir = (File)server.getAttribute(oname, "ServerDataDir");
+ File tmpdir = (File)getMbeanServer().getAttribute(oname, "ServerDataDir");
return tmpdir;
}
catch (JMException e)
@@ -165,20 +172,12 @@
public void create() throws Exception
{
- MBeanServer server = getMBeanServer();
- if (server != null)
- {
- server.registerMBean(this, DefaultServerConfigMBean.OBJECT_NAME);
- }
+ getMbeanServer().registerMBean(this, DefaultServerConfigMBean.OBJECT_NAME);
}
public void destroy() throws Exception
{
- MBeanServer server = getMBeanServer();
- if (server != null)
- {
- server.unregisterMBean(DefaultServerConfigMBean.OBJECT_NAME);
- }
+ getMbeanServer().unregisterMBean(DefaultServerConfigMBean.OBJECT_NAME);
}
private int getConnectorPort(final String protocol, final boolean secure)
@@ -187,19 +186,18 @@
try
{
- MBeanServer server = getMBeanServer();
ObjectName connectors = new ObjectName("jboss.web:type=Connector,*");
- Set connectorNames = server.queryNames(connectors, null);
+ Set connectorNames = getMbeanServer().queryNames(connectors, null);
for (Object current : connectorNames)
{
ObjectName currentName = (ObjectName)current;
try
{
- int connectorPort = (Integer)server.getAttribute(currentName, "port");
- boolean connectorSecure = (Boolean)server.getAttribute(currentName, "secure");
- String connectorProtocol = (String)server.getAttribute(currentName, "protocol");
+ int connectorPort = (Integer)getMbeanServer().getAttribute(currentName, "port");
+ boolean connectorSecure = (Boolean)getMbeanServer().getAttribute(currentName, "secure");
+ String connectorProtocol = (String)getMbeanServer().getAttribute(currentName, "protocol");
if (protocol.equals(connectorProtocol) && secure == connectorSecure)
{
@@ -225,16 +223,4 @@
return -1;
}
}
-
- private MBeanServer getMBeanServer()
- {
- if (server == null)
- {
- for (Iterator i = MBeanServerFactory.findMBeanServer(null).iterator(); i.hasNext();)
- {
- server = (MBeanServer)i.next();
- }
- }
- return server;
- }
}
Modified: trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/DefaultServerConfigMBean.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/DefaultServerConfigMBean.java 2007-07-30 07:23:40 UTC (rev 4024)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/DefaultServerConfigMBean.java 2007-07-30 12:49:32 UTC (rev 4025)
@@ -23,8 +23,8 @@
import javax.management.ObjectName;
+import org.jboss.wsf.common.ObjectNameFactory;
import org.jboss.wsf.spi.management.ServerConfig;
-import org.jboss.wsf.common.ObjectNameFactory;
public interface DefaultServerConfigMBean extends ServerConfig
{
Added: trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/MBeanServerLocator.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/MBeanServerLocator.java (rev 0)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/MBeanServerLocator.java 2007-07-30 12:49:32 UTC (rev 4025)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.framework.management;
+
+//$Id: KernelLocator.java 3137 2007-05-18 13:41:57Z thomas.diesler(a)jboss.com $
+
+import java.util.Iterator;
+
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
+
+/**
+ * Locate the single instance of the MBeanServer
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 30-Jul-2007
+ */
+public class MBeanServerLocator
+{
+ private MBeanServer mbeanServer;
+
+ public MBeanServer getMbeanServer()
+ {
+ // In jboss-4.2 the MBeanServer cannot be injected
+ if (mbeanServer == null)
+ {
+ for (Iterator i = MBeanServerFactory.findMBeanServer(null).iterator(); i.hasNext();)
+ {
+ mbeanServer = (MBeanServer)i.next();
+ break;
+ }
+ }
+ return mbeanServer;
+ }
+
+ public void setMbeanServer(MBeanServer mbeanServer)
+ {
+ this.mbeanServer = mbeanServer;
+ }
+}
Copied: trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/ManagedEndpoint.java (from rev 4024, trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ManagedEndpoint.java)
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/ManagedEndpoint.java (rev 0)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/ManagedEndpoint.java 2007-07-30 12:49:32 UTC (rev 4025)
@@ -0,0 +1,109 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.framework.management;
+
+// $Id: ManagedEndpointRegistry.java 3146 2007-05-18 22:55:26Z thomas.diesler(a)jboss.com $
+
+import java.util.Date;
+
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.management.EndpointMetrics;
+
+/**
+ * The endpoint MBean representation
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 20-Jun-2007
+ */
+public class ManagedEndpoint implements ManagedEndpointMBean
+{
+ private Endpoint endpoint;
+
+ public ManagedEndpoint(Endpoint endpoint)
+ {
+ this.endpoint = endpoint;
+ }
+
+ public long getAverageProcessingTime()
+ {
+ EndpointMetrics metrics = endpoint.getEndpointMetrics();
+ return metrics != null ? metrics.getAverageProcessingTime() : 0;
+ }
+
+ public long getFaultCount()
+ {
+ EndpointMetrics metrics = endpoint.getEndpointMetrics();
+ return metrics != null ? metrics.getFaultCount() : 0;
+ }
+
+ public long getMaxProcessingTime()
+ {
+ EndpointMetrics metrics = endpoint.getEndpointMetrics();
+ return metrics != null ? metrics.getMaxProcessingTime() : 0;
+ }
+
+ public long getMinProcessingTime()
+ {
+ EndpointMetrics metrics = endpoint.getEndpointMetrics();
+ return metrics != null ? metrics.getMinProcessingTime() : 0;
+ }
+
+ public long getRequestCount()
+ {
+ EndpointMetrics metrics = endpoint.getEndpointMetrics();
+ return metrics != null ? metrics.getRequestCount() : 0;
+ }
+
+ public long getResponseCount()
+ {
+ EndpointMetrics metrics = endpoint.getEndpointMetrics();
+ return metrics != null ? metrics.getResponseCount() : 0;
+ }
+
+ public Date getStartTime()
+ {
+ EndpointMetrics metrics = endpoint.getEndpointMetrics();
+ return metrics != null ? metrics.getStartTime() : null;
+ }
+
+ public Date getStopTime()
+ {
+ EndpointMetrics metrics = endpoint.getEndpointMetrics();
+ return metrics != null ? metrics.getStopTime() : null;
+ }
+
+ public long getTotalProcessingTime()
+ {
+ EndpointMetrics metrics = endpoint.getEndpointMetrics();
+ return metrics != null ? metrics.getTotalProcessingTime() : 0;
+ }
+
+ public void start()
+ {
+ endpoint.getLifecycleHandler().start(endpoint);
+ }
+
+ public void stop()
+ {
+ endpoint.getLifecycleHandler().stop(endpoint);
+ }
+}
Copied: trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointMBean.java (from rev 4024, trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ManagedEndpointMBean.java)
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointMBean.java (rev 0)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointMBean.java 2007-07-30 12:49:32 UTC (rev 4025)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.framework.management;
+
+import java.util.Date;
+
+/**
+ * MBean interface.
+ * @since 15-April-2004
+ */
+public interface ManagedEndpointMBean
+{
+ void start();
+
+ void stop();
+
+ Date getStartTime();
+
+ Date getStopTime();
+
+ long getMinProcessingTime();
+
+ long getMaxProcessingTime();
+
+ long getAverageProcessingTime();
+
+ long getTotalProcessingTime();
+
+ long getRequestCount();
+
+ long getFaultCount();
+
+ long getResponseCount();
+}
Copied: trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointRegistry.java (from rev 4024, trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ManagedEndpointRegistry.java)
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointRegistry.java (rev 0)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointRegistry.java 2007-07-30 12:49:32 UTC (rev 4025)
@@ -0,0 +1,107 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.framework.management;
+
+// $Id$
+
+import javax.management.JMException;
+import javax.management.MBeanServer;
+
+import org.jboss.logging.Logger;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.management.DefaultEndpointRegistry;
+
+/**
+ * A Service Endpoint Registry
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 04-May-2007
+ */
+public class ManagedEndpointRegistry extends DefaultEndpointRegistry implements ManagedEndpointRegistryMBean
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(ManagedEndpointRegistry.class);
+
+ // The MBeanServer
+ private MBeanServer mbeanServer;
+
+ public MBeanServer getMbeanServer()
+ {
+ return mbeanServer;
+ }
+
+ public void setMbeanServer(MBeanServer mbeanServer)
+ {
+ this.mbeanServer = mbeanServer;
+ }
+
+ @Override
+ public void register(Endpoint endpoint)
+ {
+ super.register(endpoint);
+
+ try
+ {
+ ManagedEndpoint jmxEndpoint = new ManagedEndpoint(endpoint);
+ getMbeanServer().registerMBean(jmxEndpoint, endpoint.getName());
+ }
+ catch (JMException ex)
+ {
+ log.error("Cannot register endpoint with JMX server", ex);
+ }
+ }
+
+ @Override
+ public void unregister(Endpoint endpoint)
+ {
+ super.unregister(endpoint);
+ try
+ {
+ getMbeanServer().unregisterMBean(endpoint.getName());
+ }
+ catch (JMException ex)
+ {
+ log.error("Cannot unregister endpoint with JMX server", ex);
+ }
+ }
+
+ /*
+ * Currently there are no meaningful attributes/operations exposed via JMX
+ *
+ public void create() throws Exception
+ {
+ if (mbeanServer != null)
+ {
+ getMbeanServer().registerMBean(this, OBJECT_NAME);
+ }
+ }
+
+ public void destroy() throws Exception
+ {
+ log.debug("Destroy service endpoint manager");
+ if (mbeanServer != null)
+ {
+ getMbeanServer().unregisterMBean(OBJECT_NAME);
+ }
+ }
+ */
+}
Copied: trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointRegistryMBean.java (from rev 4024, trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ManagedEndpointRegistryMBean.java)
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointRegistryMBean.java (rev 0)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointRegistryMBean.java 2007-07-30 12:49:32 UTC (rev 4025)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.framework.management;
+
+import javax.management.ObjectName;
+
+import org.jboss.wsf.common.ObjectNameFactory;
+
+/**
+ * MBean interface.
+ * @since 15-April-2004
+ */
+public interface ManagedEndpointRegistryMBean
+{
+ /** The object name in the MBean server */
+ ObjectName OBJECT_NAME = ObjectNameFactory.create("jboss.ws:service=EndpointRegistry");
+}
Modified: trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/ServerConfigFactoryImpl.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/ServerConfigFactoryImpl.java 2007-07-30 07:23:40 UTC (rev 4024)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/ServerConfigFactoryImpl.java 2007-07-30 12:49:32 UTC (rev 4025)
@@ -21,9 +21,9 @@
*/
package org.jboss.wsf.framework.management;
-import org.jboss.wsf.spi.management.ServerConfigFactory;
-import org.jboss.wsf.spi.management.ServerConfig;
import org.jboss.wsf.common.KernelAwareSPIFactory;
+import org.jboss.wsf.spi.management.ServerConfig;
+import org.jboss.wsf.spi.management.ServerConfigFactory;
/**
* @author Heiko.Braun(a)jboss.com
@@ -33,8 +33,6 @@
{
public ServerConfig getServerConfig()
{
- return new KernelAwareSPIFactory().getKernelProvidedSPI(
- ServerConfig.BEAN_NAME, ServerConfig.class
- );
+ return new KernelAwareSPIFactory().getKernelProvidedSPI(ServerConfig.BEAN_NAME, ServerConfig.class);
}
}
Modified: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/http/HttpServer.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/spi/http/HttpServer.java 2007-07-30 07:23:40 UTC (rev 4024)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/spi/http/HttpServer.java 2007-07-30 12:49:32 UTC (rev 4025)
@@ -35,6 +35,9 @@
*/
public interface HttpServer extends Extensible
{
+ /** The default bean name */
+ String BEAN_NAME = "WSHTTPServer";
+
/** Start an instance of this HTTP server */
void start();
Modified: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/http/HttpServerFactory.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/spi/http/HttpServerFactory.java 2007-07-30 07:23:40 UTC (rev 4024)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/spi/http/HttpServerFactory.java 2007-07-30 12:49:32 UTC (rev 4025)
@@ -33,5 +33,5 @@
*/
public abstract class HttpServerFactory implements SPIView
{
- public abstract HttpServer newHttpServer();
+ public abstract HttpServer getHttpServer();
}
Modified: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/management/EndpointRegistry.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/spi/management/EndpointRegistry.java 2007-07-30 07:23:40 UTC (rev 4024)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/spi/management/EndpointRegistry.java 2007-07-30 12:49:32 UTC (rev 4025)
@@ -28,7 +28,6 @@
import javax.management.ObjectName;
import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.common.ObjectNameFactory;
/**
* A general endpoint registry.
@@ -42,9 +41,6 @@
{
/** The bean name in the kernel registry */
String BEAN_NAME = "WSEndpointRegistry";
-
- /** The object name in the MBean server */
- ObjectName OBJECT_NAME = ObjectNameFactory.create("jboss.ws:service=EndpointRegistry");
/** Get the list of registered endpoints */
Set<ObjectName> getEndpoints();
@@ -54,13 +50,13 @@
/** Resolve endpoints thrrough a resolve instance **/
Endpoint resolve(EndpointResolver resolver);
-
+
/** True is an endpoint for that name is registered */
boolean isRegistered(ObjectName epName);
-
+
/** Register an endpoint */
void register(Endpoint endpoint);
-
+
/** Unregister an endpoint */
void unregister(Endpoint endpoint);
}
Deleted: trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/ManagedEndpointRegistry.java
===================================================================
--- trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/ManagedEndpointRegistry.java 2007-07-30 07:23:40 UTC (rev 4024)
+++ trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/ManagedEndpointRegistry.java 2007-07-30 12:49:32 UTC (rev 4025)
@@ -1,86 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.wsf.stack.sunri;
-
-// $Id$
-
-import java.util.ArrayList;
-
-import javax.management.MBeanServer;
-import javax.management.MBeanServerFactory;
-
-import org.jboss.logging.Logger;
-import org.jboss.wsf.spi.management.DefaultEndpointRegistry;
-
-/**
- * A Service Endpoint Registry
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-May-2007
- */
-public class ManagedEndpointRegistry extends DefaultEndpointRegistry implements ManagedEndpointRegistryMBean
-{
- // provide logging
- private static final Logger log = Logger.getLogger(ManagedEndpointRegistry.class);
-
- public String getImplementationTitle()
- {
- return getClass().getPackage().getImplementationTitle();
- }
-
- public String getImplementationVersion()
- {
- return getClass().getPackage().getImplementationVersion();
- }
-
- public void create() throws Exception
- {
- log.info(getImplementationTitle());
- log.info(getImplementationVersion());
- MBeanServer server = getMBeanServer();
- if (server != null)
- {
- server.registerMBean(this, OBJECT_NAME);
- }
- }
-
- public void destroy() throws Exception
- {
- log.debug("Destroy service endpoint manager");
- MBeanServer server = getMBeanServer();
- if (server != null)
- {
- server.unregisterMBean(OBJECT_NAME);
- }
- }
-
- private MBeanServer getMBeanServer()
- {
- MBeanServer server = null;
- ArrayList servers = MBeanServerFactory.findMBeanServer(null);
- if (servers.size() > 0)
- {
- server = (MBeanServer)servers.get(0);
- }
- return server;
- }
-}
Deleted: trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/ManagedEndpointRegistryMBean.java
===================================================================
--- trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/ManagedEndpointRegistryMBean.java 2007-07-30 07:23:40 UTC (rev 4024)
+++ trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/ManagedEndpointRegistryMBean.java 2007-07-30 12:49:32 UTC (rev 4025)
@@ -1,35 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.wsf.stack.sunri;
-
-import org.jboss.wsf.spi.management.EndpointRegistry;
-
-/**
- * MBean interface.
- * @since 15-April-2004
- */
-public interface ManagedEndpointRegistryMBean extends EndpointRegistry
-{
- String getImplementationTitle();
-
- String getImplementationVersion();
-}
Added: trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/MetroServerConfig.java
===================================================================
--- trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/MetroServerConfig.java (rev 0)
+++ trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/MetroServerConfig.java 2007-07-30 12:49:32 UTC (rev 4025)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.stack.sunri;
+
+//$Id: DefaultServerConfig.java 4023 2007-07-28 07:14:06Z thomas.diesler(a)jboss.com $
+
+import org.jboss.logging.Logger;
+import org.jboss.wsf.framework.management.DefaultServerConfig;
+
+/**
+ * Basic implementation of a ServerConfig
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 08-May-2006
+ */
+public class MetroServerConfig extends DefaultServerConfig implements MetroServerConfigMBean
+{
+ private static final Logger log = Logger.getLogger(MetroServerConfig.class);
+
+ public String getImplementationTitle()
+ {
+ return getClass().getPackage().getImplementationTitle();
+ }
+
+ public String getImplementationVersion()
+ {
+ return getClass().getPackage().getImplementationVersion();
+ }
+
+ public void create() throws Exception
+ {
+ log.info(getImplementationTitle());
+ log.info(getImplementationVersion());
+ super.create();
+ }
+}
Added: trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/MetroServerConfigMBean.java
===================================================================
--- trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/MetroServerConfigMBean.java (rev 0)
+++ trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/MetroServerConfigMBean.java 2007-07-30 12:49:32 UTC (rev 4025)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.stack.sunri;
+
+//$Id: DefaultServerConfig.java 4023 2007-07-28 07:14:06Z thomas.diesler(a)jboss.com $
+
+import org.jboss.wsf.framework.management.DefaultServerConfigMBean;
+
+/**
+ * Basic implementation of a ServerConfig
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 08-May-2006
+ */
+public interface MetroServerConfigMBean extends DefaultServerConfigMBean
+{
+ String getImplementationTitle();
+
+ String getImplementationVersion();
+}
Modified: trunk/integration/sunri/src/main/resources/jbossws-sunri-config.xml
===================================================================
--- trunk/integration/sunri/src/main/resources/jbossws-sunri-config.xml 2007-07-30 07:23:40 UTC (rev 4024)
+++ trunk/integration/sunri/src/main/resources/jbossws-sunri-config.xml 2007-07-30 12:49:32 UTC (rev 4025)
@@ -1,6 +1,8 @@
<!-- An abstraction of server configuration aspects. -->
- <bean name="WSServerConfig" class="org.jboss.wsf.framework.management.DefaultServerConfig">
+ <bean name="WSServerConfig" class="org.jboss.wsf.stack.sunri.MetroServerConfig">
+ <property name="mbeanServer"><inject bean="WSMBeanServerLocator" property="mbeanServer"/></property>
+
<!--
The WSDL, that is a required deployment artifact for an endpoint, has a <soap:address>
element which points to the location of the endpoint. JBoss supports rewriting of that SOAP address.
@@ -23,7 +25,9 @@
</bean>
<!-- The registry for web service endpoints -->
- <bean name="WSEndpointRegistry" class="org.jboss.wsf.stack.sunri.ManagedEndpointRegistry"/>
+ <bean name="WSEndpointRegistry" class="org.jboss.wsf.framework.management.ManagedEndpointRegistry">
+ <property name="mbeanServer"><inject bean="WSMBeanServerLocator" property="mbeanServer"/></property>
+ </bean>
<!-- Bind Service objects in client environment context -->
<bean name="WSServiceRefHandler" class="org.jboss.ws.integration.ServiceRefHandlerImpl">
Added: trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/CXFServerConfig.java
===================================================================
--- trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/CXFServerConfig.java (rev 0)
+++ trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/CXFServerConfig.java 2007-07-30 12:49:32 UTC (rev 4025)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.stack.xfire;
+
+//$Id: DefaultServerConfig.java 4023 2007-07-28 07:14:06Z thomas.diesler(a)jboss.com $
+
+import org.jboss.logging.Logger;
+import org.jboss.wsf.framework.management.DefaultServerConfig;
+
+/**
+ * Basic implementation of a ServerConfig
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 08-May-2006
+ */
+public class CXFServerConfig extends DefaultServerConfig implements CXFServerConfigMBean
+{
+ private static final Logger log = Logger.getLogger(CXFServerConfig.class);
+
+ public String getImplementationTitle()
+ {
+ return getClass().getPackage().getImplementationTitle();
+ }
+
+ public String getImplementationVersion()
+ {
+ return getClass().getPackage().getImplementationVersion();
+ }
+
+ public void create() throws Exception
+ {
+ log.info(getImplementationTitle());
+ log.info(getImplementationVersion());
+ super.create();
+ }
+}
Added: trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/CXFServerConfigMBean.java
===================================================================
--- trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/CXFServerConfigMBean.java (rev 0)
+++ trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/CXFServerConfigMBean.java 2007-07-30 12:49:32 UTC (rev 4025)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.stack.xfire;
+
+//$Id: DefaultServerConfig.java 4023 2007-07-28 07:14:06Z thomas.diesler(a)jboss.com $
+
+import org.jboss.wsf.framework.management.DefaultServerConfigMBean;
+
+/**
+ * Basic implementation of a ServerConfig
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 08-May-2006
+ */
+public interface CXFServerConfigMBean extends DefaultServerConfigMBean
+{
+ String getImplementationTitle();
+
+ String getImplementationVersion();
+}
Deleted: trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/ManagedEndpointRegistry.java
===================================================================
--- trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/ManagedEndpointRegistry.java 2007-07-30 07:23:40 UTC (rev 4024)
+++ trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/ManagedEndpointRegistry.java 2007-07-30 12:49:32 UTC (rev 4025)
@@ -1,86 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.wsf.stack.xfire;
-
-// $Id$
-
-import java.util.ArrayList;
-
-import javax.management.MBeanServer;
-import javax.management.MBeanServerFactory;
-
-import org.jboss.logging.Logger;
-import org.jboss.wsf.spi.management.DefaultEndpointRegistry;
-
-/**
- * A Service Endpoint Registry
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-May-2007
- */
-public class ManagedEndpointRegistry extends DefaultEndpointRegistry implements ManagedEndpointRegistryMBean
-{
- // provide logging
- private static final Logger log = Logger.getLogger(ManagedEndpointRegistry.class);
-
- public String getImplementationTitle()
- {
- return getClass().getPackage().getImplementationTitle();
- }
-
- public String getImplementationVersion()
- {
- return getClass().getPackage().getImplementationVersion();
- }
-
- public void create() throws Exception
- {
- log.info(getImplementationTitle());
- log.info(getImplementationVersion());
- MBeanServer server = getMBeanServer();
- if (server != null)
- {
- server.registerMBean(this, OBJECT_NAME);
- }
- }
-
- public void destroy() throws Exception
- {
- log.debug("Destroy service endpoint manager");
- MBeanServer server = getMBeanServer();
- if (server != null)
- {
- server.unregisterMBean(OBJECT_NAME);
- }
- }
-
- private MBeanServer getMBeanServer()
- {
- MBeanServer server = null;
- ArrayList servers = MBeanServerFactory.findMBeanServer(null);
- if (servers.size() > 0)
- {
- server = (MBeanServer)servers.get(0);
- }
- return server;
- }
-}
Deleted: trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/ManagedEndpointRegistryMBean.java
===================================================================
--- trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/ManagedEndpointRegistryMBean.java 2007-07-30 07:23:40 UTC (rev 4024)
+++ trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/ManagedEndpointRegistryMBean.java 2007-07-30 12:49:32 UTC (rev 4025)
@@ -1,35 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.wsf.stack.xfire;
-
-import org.jboss.wsf.spi.management.EndpointRegistry;
-
-/**
- * MBean interface.
- * @since 15-April-2004
- */
-public interface ManagedEndpointRegistryMBean extends EndpointRegistry
-{
- String getImplementationTitle();
-
- String getImplementationVersion();
-}
Modified: trunk/integration/xfire/src/main/resources/jbossws-xfire-config.xml
===================================================================
--- trunk/integration/xfire/src/main/resources/jbossws-xfire-config.xml 2007-07-30 07:23:40 UTC (rev 4024)
+++ trunk/integration/xfire/src/main/resources/jbossws-xfire-config.xml 2007-07-30 12:49:32 UTC (rev 4025)
@@ -1,6 +1,8 @@
<!-- An abstraction of server configuration aspects. -->
- <bean name="WSServerConfig" class="org.jboss.wsf.framework.management.DefaultServerConfig">
+ <bean name="WSServerConfig" class="org.jboss.wsf.stack.xfire.CXFServerConfig">
+ <property name="mbeanServer"><inject bean="WSMBeanServerLocator" property="mbeanServer"/></property>
+
<!--
The WSDL, that is a required deployment artifact for an endpoint, has a <soap:address>
element which points to the location of the endpoint. JBoss supports rewriting of that SOAP address.
@@ -23,7 +25,9 @@
</bean>
<!-- The registry for web service endpoints -->
- <bean name="WSEndpointRegistry" class="org.jboss.wsf.stack.xfire.ManagedEndpointRegistry"/>
+ <bean name="WSEndpointRegistry" class="org.jboss.wsf.framework.management.ManagedEndpointRegistry">
+ <property name="mbeanServer"><inject bean="WSMBeanServerLocator" property="mbeanServer"/></property>
+ </bean>
<!--
The stack specific deployment aspects
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java 2007-07-30 07:23:40 UTC (rev 4024)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java 2007-07-30 12:49:32 UTC (rev 4025)
@@ -123,7 +123,7 @@
// Create and start the HTTP server
SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
- HttpServer httpServer = spiProvider.getSPI(HttpServerFactory.class).newHttpServer();
+ HttpServer httpServer = spiProvider.getSPI(HttpServerFactory.class).getHttpServer();
httpServer.setProperties(properties);
httpServer.start();
Modified: trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointServlet.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointServlet.java 2007-07-30 07:23:40 UTC (rev 4024)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointServlet.java 2007-07-30 12:49:32 UTC (rev 4025)
@@ -62,7 +62,7 @@
// Create and start the HTTP server
SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
- HttpServer httpServer = spiProvider.getSPI(HttpServerFactory.class).newHttpServer();
+ HttpServer httpServer = spiProvider.getSPI(HttpServerFactory.class).getHttpServer();
httpServer.start();
// Create the context and publish the endpoint
Modified: trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointTestCase.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointTestCase.java 2007-07-30 07:23:40 UTC (rev 4024)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointTestCase.java 2007-07-30 12:49:32 UTC (rev 4025)
@@ -79,8 +79,8 @@
{
if (isTargetJBoss50())
{
- System.out.println("FIXME: [JBWEB-68] Servlet.init(ServletConfig) not called");
- //return;
+ System.out.println("FIXME: [JBWEB-1770] Fix Endpoint API for jboss-5.0.0.Beta3");
+ return;
}
URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-endpoint?wsdl");
@@ -93,8 +93,8 @@
{
if (isTargetJBoss50())
{
- System.out.println("FIXME: [JBWEB-68] Servlet.init(ServletConfig) not called");
- //return;
+ System.out.println("FIXME: [JBWEB-1770] Fix Endpoint API for jboss-5.0.0.Beta3");
+ return;
}
// Create the port
@@ -112,8 +112,8 @@
{
if (isTargetJBoss50())
{
- System.out.println("FIXME: [JBWEB-68] Servlet.init(ServletConfig) not called");
- //return;
+ System.out.println("FIXME: [JBWEB-1770] Fix Endpoint API for jboss-5.0.0.Beta3");
+ return;
}
URL url = new URL("http://" + getServerHost() + ":8080/jaxws-endpoint-servlet?param=hello-world");
17 years, 5 months
JBossWS SVN: r4024 - in trunk: integration/native/src/test/resources and 3 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-07-30 03:23:40 -0400 (Mon, 30 Jul 2007)
New Revision: 4024
Added:
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/http/DefaultHttpServerFactory.java
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/http/WebAppDeployingHttpServer.java
Removed:
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JBossHttpServer.java
Modified:
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/WebAppDeploymentAspect.java
trunk/integration/native/src/test/resources/test-excludes-jboss40.txt
trunk/integration/native/src/test/resources/test-excludes-jboss42.txt
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/DefaultSPIProviderResolver.java
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/http/DefaultHttpContextFactory.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java
Log:
More work on Endpoint API
Deleted: trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JBossHttpServer.java
===================================================================
--- trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JBossHttpServer.java 2007-07-28 07:14:06 UTC (rev 4023)
+++ trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JBossHttpServer.java 2007-07-30 07:23:40 UTC (rev 4024)
@@ -1,234 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.wsf.container.jboss50;
-
-//$Id: JBossHttpServer.java 1786 2007-01-04 14:30:04Z thomas.diesler(a)jboss.com $
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.net.URL;
-import java.util.Map;
-
-import javax.management.MBeanServerConnection;
-import javax.management.ObjectName;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import javax.xml.ws.Endpoint;
-import javax.xml.ws.WebServiceException;
-
-import org.jboss.wsf.common.DOMUtils;
-import org.jboss.wsf.common.DOMWriter;
-import org.jboss.wsf.framework.DefaultExtensible;
-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.HttpContextFactory;
-import org.jboss.wsf.spi.http.HttpServer;
-import org.jboss.wsf.spi.management.ServerConfig;
-import org.jboss.wsf.spi.management.ServerConfigFactory;
-import org.w3c.dom.Element;
-
-/**
- * A Tomcat HTTP Server
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 07-Jul-2006
- */
-public class JBossHttpServer extends DefaultExtensible implements HttpServer
-{
- private static final String MAIN_DEPLOYER = "jboss.system:service=MainDeployer";
-
- /** Start an instance of this HTTP server */
- public void start()
- {
- // verify required properties
- }
-
- /** Create an HTTP context */
- public HttpContext createContext(String contextRoot)
- {
- SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
- HttpContext httpContext = spiProvider.getSPI(HttpContextFactory.class).newHttpContext(this, contextRoot);
- return httpContext;
- }
-
- /** Publish an JAXWS endpoint to the HTTP server */
- public void publish(HttpContext context, Endpoint endpoint)
- {
- Class implClass = getImplementorClass(endpoint);
- String implName = implClass.getName();
-
- try
- {
- Element webDoc = createWebAppDescriptor(context, endpoint);
- Element jbossDoc = createJBossWebAppDescriptor(context, endpoint);
-
- File tmpWar = null;
- try
- {
- SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
- ServerConfig serverConfig = spiProvider.getSPI(ServerConfigFactory.class).getServerConfig();
- File tmpDir = new File(serverConfig.getServerTempDir().getCanonicalPath() + "/jbossws");
-
- String deploymentName = implName.substring(implName.lastIndexOf(".") + 1);
- tmpWar = File.createTempFile(deploymentName, ".war", tmpDir);
- tmpWar.delete();
- File webInf = new File(tmpWar, "WEB-INF");
- webInf.mkdirs();
-
- File webXml = new File(webInf, "web.xml");
- FileWriter fw = new FileWriter(webXml);
- new DOMWriter(fw).setPrettyprint(true).print(webDoc);
- fw.close();
-
- File jbossWebXml = new File(webInf, "jboss-web.xml");
- fw = new FileWriter(jbossWebXml);
- new DOMWriter(fw).setPrettyprint(true).print(jbossDoc);
- fw.close();
- }
- catch (IOException e)
- {
- throw new WebServiceException("Failed to create webservice war", e);
- }
-
- Map<String, Object> epProps = endpoint.getProperties();
- epProps.put("jbossws-endpoint-war-url", tmpWar);
-
- URL tmpURL = tmpWar.toURL();
- MBeanServerConnection server = getServer();
- server.invoke(new ObjectName(MAIN_DEPLOYER), "deploy", new Object[] { tmpURL }, new String[] { "java.net.URL" });
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new WebServiceException(ex);
- }
- }
-
- /** Destroys an JAXWS endpoint on the HTTP server */
- public void destroy(HttpContext context, Endpoint endpoint)
- {
- Map<String, Object> epProps = endpoint.getProperties();
- File tmpWar = (File)epProps.get("jbossws-endpoint-war-url");
- if (tmpWar == null)
- throw new IllegalStateException("Cannot find endpoint war property");
-
- try
- {
- URL tmpURL = tmpWar.toURL();
- MBeanServerConnection server = getServer();
- server.invoke(new ObjectName(MAIN_DEPLOYER), "undeploy", new Object[] { tmpURL }, new String[] { "java.net.URL" });
-
- tmpWar.delete();
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new WebServiceException(ex);
- }
- }
-
- private Class getImplementorClass(Endpoint endpoint)
- {
- Object implementor = endpoint.getImplementor();
- Class implClass = (implementor instanceof Class ? (Class)implementor : implementor.getClass());
- return implClass;
- }
-
- private MBeanServerConnection getServer() throws NamingException
- {
- InitialContext iniCtx = new InitialContext();
- MBeanServerConnection server = (MBeanServerConnection)iniCtx.lookup("jmx/invoker/RMIAdaptor");
- return server;
- }
-
- private Element createWebAppDescriptor(HttpContext context, Endpoint endpoint)
- {
- Class implClass = getImplementorClass(endpoint);
- String implName = implClass.getName();
-
- Element webApp = DOMUtils.createElement("web-app");
-
- /*
- <servlet>
- <servlet-name>
- <servlet-class>
- </servlet>
- */
- Element servlet = (Element)webApp.appendChild(DOMUtils.createElement("servlet"));
- Element servletName = (Element)servlet.appendChild(DOMUtils.createElement("servlet-name"));
- servletName.appendChild(DOMUtils.createTextNode("JAXWSEndpoint"));
- Element servletClass = (Element)servlet.appendChild(DOMUtils.createElement("servlet-class"));
- servletClass.appendChild(DOMUtils.createTextNode(implName));
-
- /*
- <servlet-mapping>
- <servlet-name>
- <url-pattern>
- </servlet-mapping>
- */
- Element servletMapping = (Element)webApp.appendChild(DOMUtils.createElement("servlet-mapping"));
- servletName = (Element)servletMapping.appendChild(DOMUtils.createElement("servlet-name"));
- servletName.appendChild(DOMUtils.createTextNode("JAXWSEndpoint"));
- Element urlPatternElement = (Element)servletMapping.appendChild(DOMUtils.createElement("url-pattern"));
-
- String urlPattern = "/*";
- urlPatternElement.appendChild(DOMUtils.createTextNode(urlPattern));
-
- // Add security-constraint in generated web.xml for Endpoint API
- // FIXME: JBWS-1069
-
- return webApp;
- }
-
- private Element createJBossWebAppDescriptor(HttpContext context, Endpoint endpoint)
- {
- /* Create a jboss-web
- <jboss-web>
- <security-domain>java:/jaas/cts</security-domain>
- <context-root>/ws/ejbN/</context-root>
- </jboss-web>
- */
- Element jbossWeb = DOMUtils.createElement("jboss-web");
-
- // Get the context root for this deployment
- String contextRoot = context.getContextRoot();
- if (contextRoot == null)
- throw new WebServiceException("Cannot obtain context root");
-
- Element root = (Element)jbossWeb.appendChild(DOMUtils.createElement("context-root"));
- root.appendChild(DOMUtils.createTextNode(contextRoot));
-
- // Add security-constraint in generated web.xml for Endpoint API
- // FIXME: JBWS-1069
-
- return jbossWeb;
- }
-}
-
Modified: trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/WebAppDeploymentAspect.java
===================================================================
--- trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/WebAppDeploymentAspect.java 2007-07-28 07:14:06 UTC (rev 4023)
+++ trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/WebAppDeploymentAspect.java 2007-07-30 07:23:40 UTC (rev 4024)
@@ -23,6 +23,10 @@
// $Id: WebAppDeployerDeployer.java 3772 2007-07-01 19:29:13Z thomas.diesler(a)jboss.com $
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+
import org.jboss.deployers.client.spi.DeployerClient;
import org.jboss.deployers.vfs.spi.client.VFSDeploymentFactory;
import org.jboss.logging.Logger;
@@ -32,10 +36,6 @@
import org.jboss.wsf.spi.deployment.DeploymentAspect;
import org.jboss.wsf.spi.deployment.WSFDeploymentException;
-import java.net.URL;
-import java.util.Map;
-import java.util.HashMap;
-
/**
* Publish the HTTP service endpoint to Tomcat
*
@@ -63,25 +63,24 @@
public void create(Deployment dep)
{
- if (dep.getType().toString().endsWith("EJB21") || dep.getType().toString().endsWith("EJB3"))
+ URL warURL = (URL)dep.getProperty("org.jboss.ws.webapp.url");
+ if (warURL == null)
+ throw new IllegalStateException("Cannot obtain generated webapp URL");
+
+ log.debug("publishServiceEndpoint: " + warURL);
+ try
{
- URL warURL = (URL)dep.getProperty("org.jboss.ws.webapp.url");
+ webXMLRewriter.rewriteWebXml(dep);
+ org.jboss.deployers.client.spi.Deployment deployment = createDeploymentContext(warURL);
- log.debug("publishServiceEndpoint: " + warURL);
- try
- {
- webXMLRewriter.rewriteWebXml(dep);
- org.jboss.deployers.client.spi.Deployment deployment = createDeploymentContext(warURL);
+ mainDeployer.deploy(deployment);
- mainDeployer.deploy(deployment);
-
- deploymentMap.put(warURL.toExternalForm(), deployment);
- }
- catch (Exception ex)
- {
- WSFDeploymentException.rethrow(ex);
- }
+ deploymentMap.put(warURL.toExternalForm(), deployment);
}
+ catch (Exception ex)
+ {
+ WSFDeploymentException.rethrow(ex);
+ }
}
public void destroy(Deployment dep)
@@ -89,7 +88,7 @@
URL warURL = (URL)dep.getProperty("org.jboss.ws.webapp.url");
if (warURL == null)
{
- log.error("Cannot obtain warURL");
+ log.error("Cannot obtain generated webapp URL");
return;
}
Modified: trunk/integration/native/src/test/resources/test-excludes-jboss40.txt
===================================================================
--- trunk/integration/native/src/test/resources/test-excludes-jboss40.txt 2007-07-28 07:14:06 UTC (rev 4023)
+++ trunk/integration/native/src/test/resources/test-excludes-jboss40.txt 2007-07-30 07:23:40 UTC (rev 4024)
@@ -5,7 +5,6 @@
org/jboss/test/ws/benchmark/**
# EJB3/Injection excludes
-org/jboss/test/ws/jaxws/endpoint/**
org/jboss/test/ws/jaxws/jbws1581/**
org/jboss/test/ws/jaxws/samples/context/WebServiceContextEJBTestCase*
org/jboss/test/ws/jaxws/samples/handlerchain/HandlerChainClientTestCase*
Modified: trunk/integration/native/src/test/resources/test-excludes-jboss42.txt
===================================================================
--- trunk/integration/native/src/test/resources/test-excludes-jboss42.txt 2007-07-28 07:14:06 UTC (rev 4023)
+++ trunk/integration/native/src/test/resources/test-excludes-jboss42.txt 2007-07-30 07:23:40 UTC (rev 4024)
@@ -2,7 +2,6 @@
org/jboss/test/ws/benchmark/**
# EJB3/Injection excludes
-org/jboss/test/ws/jaxws/endpoint/**
org/jboss/test/ws/jaxws/jbws1581/**
org/jboss/test/ws/jaxws/samples/handlerchain/HandlerChainClientTestCase*
org/jboss/test/ws/jaxws/samples/retail/**
Modified: trunk/integration/spi/src/main/java/org/jboss/wsf/framework/DefaultSPIProviderResolver.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/framework/DefaultSPIProviderResolver.java 2007-07-28 07:14:06 UTC (rev 4023)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/framework/DefaultSPIProviderResolver.java 2007-07-30 07:23:40 UTC (rev 4024)
@@ -25,8 +25,8 @@
import org.jboss.wsf.common.ServiceLoader;
import org.jboss.wsf.framework.deployment.DefaultDeploymentModelFactory;
import org.jboss.wsf.framework.deployment.DefaultLifecycleHandlerFactory;
-import org.jboss.wsf.framework.http.DefaultHttpContext;
import org.jboss.wsf.framework.http.DefaultHttpContextFactory;
+import org.jboss.wsf.framework.http.DefaultHttpServerFactory;
import org.jboss.wsf.framework.invocation.DefaultResourceInjectorFactory;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
@@ -81,6 +81,10 @@
{
returnType = (T)loadService(spiType, DefaultHttpContextFactory.class.getName());
}
+ else if (HttpServerFactory.class.equals(spiType))
+ {
+ returnType = (T)loadService(spiType, DefaultHttpServerFactory.class.getName());
+ }
else if (LifecycleHandlerFactory.class.equals(spiType))
{
returnType = (T)loadService(spiType, DefaultLifecycleHandlerFactory.class.getName());
@@ -100,10 +104,6 @@
{
returnType = (T)loadService(spiType, null);
}
- else if (HttpServerFactory.class.equals(spiType))
- {
- returnType = (T)loadService(spiType, null);
- }
else if (InvocationHandlerFactory.class.equals(spiType))
{
returnType = (T)loadService(spiType, null);
Modified: trunk/integration/spi/src/main/java/org/jboss/wsf/framework/http/DefaultHttpContextFactory.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/framework/http/DefaultHttpContextFactory.java 2007-07-28 07:14:06 UTC (rev 4023)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/framework/http/DefaultHttpContextFactory.java 2007-07-30 07:23:40 UTC (rev 4024)
@@ -23,8 +23,8 @@
//$Id: HttpContext.java 1757 2006-12-22 15:40:24Z thomas.diesler(a)jboss.com $
-import org.jboss.wsf.spi.SPIView;
import org.jboss.wsf.spi.http.HttpContext;
+import org.jboss.wsf.spi.http.HttpContextFactory;
import org.jboss.wsf.spi.http.HttpServer;
/**
@@ -33,7 +33,7 @@
* @author Thomas.Diesler(a)jboss.org
* @since 07-Jul-2006
*/
-public class DefaultHttpContextFactory implements SPIView
+public class DefaultHttpContextFactory extends HttpContextFactory
{
public HttpContext newHttpContext(HttpServer server, String contextRoot)
{
Added: trunk/integration/spi/src/main/java/org/jboss/wsf/framework/http/DefaultHttpServerFactory.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/framework/http/DefaultHttpServerFactory.java (rev 0)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/framework/http/DefaultHttpServerFactory.java 2007-07-30 07:23:40 UTC (rev 4024)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.framework.http;
+
+//$Id: HttpContext.java 1757 2006-12-22 15:40:24Z thomas.diesler(a)jboss.com $
+
+import org.jboss.wsf.spi.http.HttpServer;
+import org.jboss.wsf.spi.http.HttpServerFactory;
+
+/**
+ * A factory for an HTTP Server
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 07-Jul-2006
+ */
+public class DefaultHttpServerFactory extends HttpServerFactory
+{
+ public HttpServer newHttpServer()
+ {
+ return new WebAppDeployingHttpServer();
+ }
+}
Added: trunk/integration/spi/src/main/java/org/jboss/wsf/framework/http/WebAppDeployingHttpServer.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/framework/http/WebAppDeployingHttpServer.java (rev 0)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/framework/http/WebAppDeployingHttpServer.java 2007-07-30 07:23:40 UTC (rev 4024)
@@ -0,0 +1,234 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.framework.http;
+
+//$Id: JBossHttpServer.java 1786 2007-01-04 14:30:04Z thomas.diesler(a)jboss.com $
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.net.URL;
+import java.util.Map;
+
+import javax.management.MBeanServerConnection;
+import javax.management.ObjectName;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.xml.ws.Endpoint;
+import javax.xml.ws.WebServiceException;
+
+import org.jboss.wsf.common.DOMUtils;
+import org.jboss.wsf.common.DOMWriter;
+import org.jboss.wsf.framework.DefaultExtensible;
+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.HttpContextFactory;
+import org.jboss.wsf.spi.http.HttpServer;
+import org.jboss.wsf.spi.management.ServerConfig;
+import org.jboss.wsf.spi.management.ServerConfigFactory;
+import org.w3c.dom.Element;
+
+/**
+ * A Tomcat HTTP Server
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 07-Jul-2006
+ */
+public class WebAppDeployingHttpServer extends DefaultExtensible implements HttpServer
+{
+ private static final String MAIN_DEPLOYER = "jboss.system:service=MainDeployer";
+
+ /** Start an instance of this HTTP server */
+ public void start()
+ {
+ // verify required properties
+ }
+
+ /** Create an HTTP context */
+ public HttpContext createContext(String contextRoot)
+ {
+ SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ HttpContext httpContext = spiProvider.getSPI(HttpContextFactory.class).newHttpContext(this, contextRoot);
+ return httpContext;
+ }
+
+ /** Publish an JAXWS endpoint to the HTTP server */
+ public void publish(HttpContext context, Endpoint endpoint)
+ {
+ Class implClass = getImplementorClass(endpoint);
+ String implName = implClass.getName();
+
+ try
+ {
+ Element webDoc = createWebAppDescriptor(context, endpoint);
+ Element jbossDoc = createJBossWebAppDescriptor(context, endpoint);
+
+ File tmpWar = null;
+ try
+ {
+ SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ ServerConfig serverConfig = spiProvider.getSPI(ServerConfigFactory.class).getServerConfig();
+ File tmpDir = new File(serverConfig.getServerTempDir().getCanonicalPath() + "/jbossws");
+
+ String deploymentName = implName.substring(implName.lastIndexOf(".") + 1);
+ tmpWar = File.createTempFile(deploymentName, ".war", tmpDir);
+ tmpWar.delete();
+ File webInf = new File(tmpWar, "WEB-INF");
+ webInf.mkdirs();
+
+ File webXml = new File(webInf, "web.xml");
+ FileWriter fw = new FileWriter(webXml);
+ new DOMWriter(fw).setPrettyprint(true).print(webDoc);
+ fw.close();
+
+ File jbossWebXml = new File(webInf, "jboss-web.xml");
+ fw = new FileWriter(jbossWebXml);
+ new DOMWriter(fw).setPrettyprint(true).print(jbossDoc);
+ fw.close();
+ }
+ catch (IOException e)
+ {
+ throw new WebServiceException("Failed to create webservice war", e);
+ }
+
+ Map<String, Object> epProps = endpoint.getProperties();
+ epProps.put("jbossws-endpoint-war-url", tmpWar);
+
+ URL tmpURL = tmpWar.toURL();
+ MBeanServerConnection server = getServer();
+ server.invoke(new ObjectName(MAIN_DEPLOYER), "deploy", new Object[] { tmpURL }, new String[] { "java.net.URL" });
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception ex)
+ {
+ throw new WebServiceException(ex);
+ }
+ }
+
+ /** Destroys an JAXWS endpoint on the HTTP server */
+ public void destroy(HttpContext context, Endpoint endpoint)
+ {
+ Map<String, Object> epProps = endpoint.getProperties();
+ File tmpWar = (File)epProps.get("jbossws-endpoint-war-url");
+ if (tmpWar == null)
+ throw new IllegalStateException("Cannot find endpoint war property");
+
+ try
+ {
+ URL tmpURL = tmpWar.toURL();
+ MBeanServerConnection server = getServer();
+ server.invoke(new ObjectName(MAIN_DEPLOYER), "undeploy", new Object[] { tmpURL }, new String[] { "java.net.URL" });
+
+ tmpWar.delete();
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception ex)
+ {
+ throw new WebServiceException(ex);
+ }
+ }
+
+ private Class getImplementorClass(Endpoint endpoint)
+ {
+ Object implementor = endpoint.getImplementor();
+ Class implClass = (implementor instanceof Class ? (Class)implementor : implementor.getClass());
+ return implClass;
+ }
+
+ private MBeanServerConnection getServer() throws NamingException
+ {
+ InitialContext iniCtx = new InitialContext();
+ MBeanServerConnection server = (MBeanServerConnection)iniCtx.lookup("jmx/invoker/RMIAdaptor");
+ return server;
+ }
+
+ private Element createWebAppDescriptor(HttpContext context, Endpoint endpoint)
+ {
+ Class implClass = getImplementorClass(endpoint);
+ String implName = implClass.getName();
+
+ Element webApp = DOMUtils.createElement("web-app");
+
+ /*
+ <servlet>
+ <servlet-name>
+ <servlet-class>
+ </servlet>
+ */
+ Element servlet = (Element)webApp.appendChild(DOMUtils.createElement("servlet"));
+ Element servletName = (Element)servlet.appendChild(DOMUtils.createElement("servlet-name"));
+ servletName.appendChild(DOMUtils.createTextNode("JAXWSEndpoint"));
+ Element servletClass = (Element)servlet.appendChild(DOMUtils.createElement("servlet-class"));
+ servletClass.appendChild(DOMUtils.createTextNode(implName));
+
+ /*
+ <servlet-mapping>
+ <servlet-name>
+ <url-pattern>
+ </servlet-mapping>
+ */
+ Element servletMapping = (Element)webApp.appendChild(DOMUtils.createElement("servlet-mapping"));
+ servletName = (Element)servletMapping.appendChild(DOMUtils.createElement("servlet-name"));
+ servletName.appendChild(DOMUtils.createTextNode("JAXWSEndpoint"));
+ Element urlPatternElement = (Element)servletMapping.appendChild(DOMUtils.createElement("url-pattern"));
+
+ String urlPattern = "/*";
+ urlPatternElement.appendChild(DOMUtils.createTextNode(urlPattern));
+
+ // Add security-constraint in generated web.xml for Endpoint API
+ // FIXME: JBWS-1069
+
+ return webApp;
+ }
+
+ private Element createJBossWebAppDescriptor(HttpContext context, Endpoint endpoint)
+ {
+ /* Create a jboss-web
+ <jboss-web>
+ <security-domain>java:/jaas/cts</security-domain>
+ <context-root>/ws/ejbN/</context-root>
+ </jboss-web>
+ */
+ Element jbossWeb = DOMUtils.createElement("jboss-web");
+
+ // Get the context root for this deployment
+ String contextRoot = context.getContextRoot();
+ if (contextRoot == null)
+ throw new WebServiceException("Cannot obtain context root");
+
+ Element root = (Element)jbossWeb.appendChild(DOMUtils.createElement("context-root"));
+ root.appendChild(DOMUtils.createTextNode(contextRoot));
+
+ // Add security-constraint in generated web.xml for Endpoint API
+ // FIXME: JBWS-1069
+
+ return jbossWeb;
+ }
+}
+
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java 2007-07-28 07:14:06 UTC (rev 4023)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java 2007-07-30 07:23:40 UTC (rev 4024)
@@ -152,7 +152,7 @@
// Check with the security manger
checkPublishEndpointPermission();
- // Check if we are standalone
+ /* Check if we are standalone
boolean isStandalone;
try
{
@@ -162,12 +162,13 @@
}
catch (Exception ex)
{
- // ignore, there should be no ServiceEndpointManager in VM
+ // ignore, there should be no ServerConfigFactory in VM
isStandalone = true;
}
if (isStandalone == false)
throw new IllegalStateException("Cannot publish endpoint from within server");
+ */
if (context instanceof HttpContext)
{
17 years, 5 months