Author: thomas.diesler(a)jboss.com
Date: 2007-04-27 14:55:01 -0400 (Fri, 27 Apr 2007)
New Revision: 2947
Added:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/AbstractWebServiceDeployer.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/WebServiceDeployerEJB.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/WebServiceDeployerJSE.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/WebServiceMainDeployer.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/ApplicationMetaDataAdaptor.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/ApplicationMetaDataAdaptorEJB3.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/DeploymentInfoAdaptor.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/JBossContextServlet.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/LifecycleHandlerImpl.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/MainDeployerHook.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/PortComponentLinkServlet.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/SecurityAssociationAdaptorFactoryImpl.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/ServiceEndpointGeneratorEJB21.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/ServiceEndpointGeneratorEJB3.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/ServiceEndpointInterceptor.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/VirtualFileAdaptor.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/WebMetaDataAdaptor.java
trunk/integration/src/main/java/org/jboss/ws/integration/EndpointImpl.java
trunk/integration/src/main/java/org/jboss/ws/integration/LifecycleHandlerImpl.java
trunk/integration/src/main/java/org/jboss/ws/integration/ServiceImpl.java
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/DeployerManager.java
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/DeployerManagerImpl.java
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/DeploymentContextImpl.java
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/DeploymentImpl.java
trunk/integration/src/main/java/org/jboss/ws/integration/management/EndpointRegistryImpl.java
trunk/integration/src/main/java/org/jboss/ws/integration/management/ServerConfig.java
trunk/integration/src/main/java/org/jboss/ws/integration/management/ServerConfigFactory.java
trunk/integration/src/main/java/org/jboss/ws/integration/management/ServerConfigImpl.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/UnifiedDeploymentInfo.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/legacy/
trunk/jbossws-core/src/java/org/jboss/ws/core/server/legacy/AbstractServiceEndpointInvoker.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/legacy/AbstractServiceEndpointServlet.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/legacy/CommonContextServlet.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/legacy/ServiceEndpoint.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/legacy/ServiceEndpointDTO.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/legacy/ServiceEndpointDeployer.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/legacy/ServiceEndpointInfo.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/legacy/ServiceEndpointInvoker.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/legacy/ServiceEndpointInvokerJSE.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/legacy/ServiceEndpointManager.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/legacy/ServiceEndpointManagerFactory.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/legacy/ServiceEndpointManagerMBean.java
Removed:
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/ServerConfigImpl.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/AbstractDeployer.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/AbstractDeployerEJB.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/AbstractDeployerJSE.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ApplicationMetaDataAdaptor.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ApplicationMetaDataAdaptorEJB3.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/DeploymentInfoAdaptor.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerEJB21.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerJSE.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/JAXWSDeployerEJB3.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/JAXWSDeployerJSE.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/JBossContextServlet.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/JBossHttpServer.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/JBossServiceEndpointServlet.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/PortComponentLinkServlet.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/SecurityAssociationAdaptorFactoryImpl.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServerConfigImpl.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceEndpointGeneratorEJB21.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceEndpointGeneratorEJB3.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceEndpointInterceptor.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceEndpointInvokerEJB21.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceEndpointInvokerEJB3.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceEndpointLifecycleDeployer.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceEndpointPublisher.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/VirtualFileAdaptor.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/WebMetaDataAdaptor.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/WebServiceAbstractDeployer.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/WebServiceDeployerEJB.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/WebServiceDeployerJSE.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/WebServiceLifecycleDeployer.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/BasicDeployerHook.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/LifecycleHandlerImpl.java
trunk/integration-tomcat/src/java/org/jboss/ws/integration/tomcat/ServerConfigImpl.java
trunk/integration/src/main/java/org/jboss/ws/integration/BasicEndpoint.java
trunk/integration/src/main/java/org/jboss/ws/integration/BasicLifecycleHandler.java
trunk/integration/src/main/java/org/jboss/ws/integration/BasicService.java
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/BasicDeployment.java
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/BasicDeploymentContext.java
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/BasicDeploymentManager.java
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/DeploymentManager.java
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/DeploymentManagerFactory.java
trunk/integration/src/main/java/org/jboss/ws/integration/management/BasicEndpointRegistry.java
trunk/jbossws-core/src/java/org/jboss/ws/core/CommonContextServlet.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointServlet.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServerConfig.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServerConfigFactory.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpoint.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointDTO.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointDeployer.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointInfo.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointInvokerJSE.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManager.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManagerFactory.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManagerMBean.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/UnifiedDeploymentInfo.java
Modified:
trunk/build/ant-import/build-deploy.xml
trunk/build/ant-import/build-thirdparty.xml
trunk/build/eclipse/jbossws.userlibraries
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/DeployerInterceptor.java
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/JBossContextServlet.java
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/JBossHttpServer.java
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/JBossServiceEndpointServlet.java
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/PortComponentLinkServlet.java
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/ServiceEndpointInvokerEJB21.java
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/ServiceEndpointInvokerEJB3.java
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/ServiceEndpointInvokerMDB.java
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/jms/JMSMessageDispatcher.java
trunk/integration-jboss50/build.xml
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/AbstractDeployerHook.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/AbstractInvocationHandler.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/ArchiveDeployerHook.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/EndpointNameDeployer.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/InvocationHandlerEJB21.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/InvocationHandlerEJB3.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/InvocationHandlerJSE.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/JAXRPCDeployerHookEJB21.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/JAXRPCDeployerHookJSE.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/JAXWSDeployerHookEJB3.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/JAXWSDeployerHookJSE.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/RequestHandlerImpl.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/UnifiedDeploymentInfoDeployer.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/WebAppGeneratorDeployer.java
trunk/integration-jboss50/src/resources/jbossws.deployer/META-INF/jbossws-deployer-beans.xml
trunk/integration-jboss50/src/resources/jbossws.sar/META-INF/jbossws-beans.xml
trunk/integration-tomcat/src/java/org/jboss/ws/integration/tomcat/TomcatContextServlet.java
trunk/integration-tomcat/src/java/org/jboss/ws/integration/tomcat/TomcatServiceEndpointServlet.java
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/AbstractDeployer.java
trunk/integration/src/test/java/org/jboss/test/ws/integration/KernelBasedTest.java
trunk/integration/src/test/java/org/jboss/test/ws/integration/KernelTestSetup.java
trunk/integration/src/test/java/org/jboss/test/ws/integration/basic/BasicDeploymentTest.java
trunk/integration/src/test/resources/basic/basic-deployers.xml
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/client/ServiceObjectFactoryJAXRPC.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/client/ServiceReferenceable.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointGeneratorEJB.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointMetrics.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/WSDLFilePublisher.java
trunk/jbossws-core/src/java/org/jboss/ws/core/utils/IOUtils.java
trunk/jbossws-core/src/java/org/jboss/ws/extensions/eventing/deployment/EventingEndpoint.java
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java
trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/UnifiedMetaData.java
trunk/jbossws-core/src/java/org/jboss/ws/metadata/wsdl/xsd/SchemaUtils.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1190/TestEndpointImpl.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1205/TestEndpointImpl.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpointImpl.java
Log:
Refactor to reflect new deployer architecture
Modified: trunk/build/ant-import/build-deploy.xml
===================================================================
--- trunk/build/ant-import/build-deploy.xml 2007-04-27 14:04:25 UTC (rev 2946)
+++ trunk/build/ant-import/build-deploy.xml 2007-04-27 18:55:01 UTC (rev 2947)
@@ -74,6 +74,9 @@
<include name="jboss-jaxws.jar"/>
<include name="jboss-saaj.jar"/>
</fileset>
+ <fileset dir="${integration.output.lib.dir}">
+ <include name="jbossws-integration.jar"/>
+ </fileset>
</copy>
<delete
dir="${jboss50.home}/server/${jboss.server.instance}/deployers/jbossws.deployer"/>
<mkdir
dir="${jboss50.home}/server/${jboss.server.instance}/deployers/jbossws.deployer"/>
Modified: trunk/build/ant-import/build-thirdparty.xml
===================================================================
--- trunk/build/ant-import/build-thirdparty.xml 2007-04-27 14:04:25 UTC (rev 2946)
+++ trunk/build/ant-import/build-thirdparty.xml 2007-04-27 18:55:01 UTC (rev 2947)
@@ -127,6 +127,8 @@
<pathelement location="${jboss50.lib}/jboss-system-jmx.jar"/>
<pathelement location="${jboss50.lib}/jboss-vfs.jar"/>
<pathelement location="${jboss50.server.lib}/jboss.jar"/>
+ <pathelement location="${jboss50.server.lib}/jbosssx.jar"/>
+ <pathelement
location="${jboss50.server.lib}/jboss-security-spi.jar"/>
<pathelement location="${jboss50.server.lib}/jnpserver.jar"/>
<pathelement
location="${jboss50.server.deployers}/jboss-aop-jboss5.deployer/jboss-aspect-library-jdk50.jar"/>
<pathelement
location="${jboss50.server.deployers}/ejb3.deployer/jboss-annotations-ejb3.jar"/>
Modified: trunk/build/eclipse/jbossws.userlibraries
===================================================================
--- trunk/build/eclipse/jbossws.userlibraries 2007-04-27 14:04:25 UTC (rev 2946)
+++ trunk/build/eclipse/jbossws.userlibraries 2007-04-27 18:55:01 UTC (rev 2947)
@@ -22,9 +22,11 @@
<archive
path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta2/lib/jboss-aop-jdk50.jar"/>
<archive
path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta2/lib/jboss-deployers.jar"/>
<archive
path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta2/lib/jboss-j2se.jar"/>
+<archive
path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta2/lib/jboss-security-spi.jar"/>
<archive
path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta2/lib/jboss-system.jar"/>
<archive
path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta2/lib/jboss-system-jmx.jar"/>
<archive
path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta2/lib/jboss-vfs.jar"/>
+<archive
path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta2/lib/jbosssx.jar"/>
<archive
path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta2/server/default/lib/jboss.jar"
source="/home/tdiesler/svn/jbossas/trunk/server/src/main"/>
<archive
path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta2/server/default/lib/jnpserver.jar"/>
<archive
path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta2/server/default/deployers/jboss-aop-jboss5.deployer/jboss-aspect-library-jdk50.jar"/>
Deleted: trunk/integration/src/main/java/org/jboss/ws/integration/BasicEndpoint.java
===================================================================
--- trunk/integration/src/main/java/org/jboss/ws/integration/BasicEndpoint.java 2007-04-27
14:04:25 UTC (rev 2946)
+++ trunk/integration/src/main/java/org/jboss/ws/integration/BasicEndpoint.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,173 +0,0 @@
-/*
- * ====================================================================
- *
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 1999 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution, if
- * any, must include the following acknowlegement:
- * "This product includes software developed by the
- * Apache Software Foundation (
http://www.apache.org/)."
- * Alternately, this acknowlegement may appear in the software itself,
- * if and wherever such third-party acknowlegements normally appear.
- *
- * 4. The names "The Jakarta Project", "Tomcat", and "Apache
Software
- * Foundation" must not be used to endorse or promote products derived
- * from this software without prior written permission. For written
- * permission, please contact apache(a)apache.org.
- *
- * 5. Products derived from this software may not be called "Apache"
- * nor may "Apache" appear in their names without prior written
- * permission of the Apache Group.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <
http://www.apache.org/>.
- */
-package org.jboss.ws.integration;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.management.ObjectName;
-
-import org.jboss.ws.integration.invocation.InvocationHandler;
-
-/**
- * A general JAXWS endpoint.
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 20-Apr-2007
- */
-public class BasicEndpoint implements Endpoint
-{
- private Service service;
- private ObjectName name;
- private Class endpointImpl;
- private EndpointState state;
- private RequestHandler requestHandler;
- private InvocationHandler invocationHandler;
- private LifecycleHandler lifecycleHandler;
- private Map<Class, Object> metaData = new HashMap<Class, Object>();
-
- public BasicEndpoint(Service service, Class impl)
- {
- this.service = service;
- this.endpointImpl = impl;
- this.state = EndpointState.UNDEFINED;
- }
-
- public Service getService()
- {
- return service;
- }
-
- public void setService(Service service)
- {
- this.service = service;
- }
-
- public Class getEndpointImpl()
- {
- return endpointImpl;
- }
-
- public void setEndpointImpl(Class endpointImpl)
- {
- this.endpointImpl = endpointImpl;
- }
-
- public EndpointState getState()
- {
- return state;
- }
-
- public void setState(EndpointState state)
- {
- this.state = state;
- }
-
- public ObjectName getName()
- {
- return name;
- }
-
- public void setName(ObjectName name)
- {
- this.name = name;
- }
-
- public RequestHandler getRequestHandler()
- {
- return requestHandler;
- }
-
- public void setRequestHandler(RequestHandler handler)
- {
- this.requestHandler = handler;
- }
-
- public LifecycleHandler getLifecycleHandler()
- {
- return lifecycleHandler;
- }
-
- public void setLifecycleHandler(LifecycleHandler handler)
- {
- this.lifecycleHandler = handler;
- }
-
- public InvocationHandler getInvocationHandler()
- {
- return invocationHandler;
- }
-
- public void setInvocationHandler(InvocationHandler handler)
- {
- this.invocationHandler = handler;
- }
-
- public <T> T addMetaData(Class<T> key, Object value)
- {
- return (T)metaData.put(key, value);
- }
-
- public <T> T getMetaData(Class<T> key)
- {
- return (T)metaData.get(key);
- }
-
- public <T> T removeMetaData(Class<T> key)
- {
- return (T)metaData.get(key);
- }
-}
Deleted:
trunk/integration/src/main/java/org/jboss/ws/integration/BasicLifecycleHandler.java
===================================================================
---
trunk/integration/src/main/java/org/jboss/ws/integration/BasicLifecycleHandler.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration/src/main/java/org/jboss/ws/integration/BasicLifecycleHandler.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,81 +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.ws.integration;
-
-//$Id$
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.integration.Endpoint;
-import org.jboss.ws.integration.LifecycleHandler;
-import org.jboss.ws.integration.Endpoint.EndpointState;
-import org.jboss.ws.integration.invocation.InvocationHandler;
-
-/**
- * A basic lifecycle handler
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 31-Oct-2006
- */
-public class BasicLifecycleHandler implements LifecycleHandler
-{
- // provide logging
- protected final Logger log = Logger.getLogger(getClass());
-
- public void create(Endpoint endpoint)
- {
- log.debug("Create: " + endpoint.getName());
-
- // Initialize the invoker
- InvocationHandler invoker = endpoint.getInvocationHandler();
- invoker.init(endpoint);
-
- endpoint.setState(EndpointState.CREATED);
- }
-
- public void start(Endpoint endpoint)
- {
- log.debug("Start: " + endpoint.getName());
-
- EndpointState state = endpoint.getState();
- if (state == EndpointState.UNDEFINED || state == EndpointState.DESTROYED)
- throw new IllegalStateException("Cannot start endpoint in state: " +
state);
-
- endpoint.setState(EndpointState.STARTED);
- }
-
- public void stop(Endpoint endpoint)
- {
- log.debug("Stop: " + endpoint.getName());
-
- EndpointState state = endpoint.getState();
- if (state != EndpointState.STARTED)
- throw new IllegalStateException("Cannot stop endpoint in state: " +
state);
-
- endpoint.setState(EndpointState.STOPED);
- }
-
- public void destroy(Endpoint endpoint)
- {
- log.debug("Destroy: " + endpoint.getName());
- endpoint.setState(EndpointState.DESTROYED);
- }
-}
Deleted: trunk/integration/src/main/java/org/jboss/ws/integration/BasicService.java
===================================================================
--- trunk/integration/src/main/java/org/jboss/ws/integration/BasicService.java 2007-04-27
14:04:25 UTC (rev 2946)
+++ trunk/integration/src/main/java/org/jboss/ws/integration/BasicService.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,104 +0,0 @@
-/*
- * ====================================================================
- *
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 1999 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution, if
- * any, must include the following acknowlegement:
- * "This product includes software developed by the
- * Apache Software Foundation (
http://www.apache.org/)."
- * Alternately, this acknowlegement may appear in the software itself,
- * if and wherever such third-party acknowlegements normally appear.
- *
- * 4. The names "The Jakarta Project", "Tomcat", and "Apache
Software
- * Foundation" must not be used to endorse or promote products derived
- * from this software without prior written permission. For written
- * permission, please contact apache(a)apache.org.
- *
- * 5. Products derived from this software may not be called "Apache"
- * nor may "Apache" appear in their names without prior written
- * permission of the Apache Group.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <
http://www.apache.org/>.
- */
-package org.jboss.ws.integration;
-
-// $Id$
-
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Set;
-
-import org.jboss.ws.integration.deployment.Deployment;
-
-/**
- * A general service.
- *
- * Maintains a named set of Endpoints
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 20-Apr-2007
- */
-public class BasicService implements Service
-{
- private Deployment unit;
- private List<Endpoint> endpoints = new LinkedList<Endpoint>();
-
- public BasicService(Deployment unit)
- {
- this.unit = unit;
- this.unit.setService(this);
- }
-
- public Deployment getDeployment()
- {
- return unit;
- }
-
- public void setDeployment(Deployment unit)
- {
- this.unit = unit;
- }
-
- public void addEndpoint(Endpoint endpoint)
- {
- endpoints.add(endpoint);
- }
-
- public List<Endpoint> getEndpoints()
- {
- return endpoints;
- }
-}
Copied: trunk/integration/src/main/java/org/jboss/ws/integration/EndpointImpl.java (from
rev 2936, trunk/integration/src/main/java/org/jboss/ws/integration/BasicEndpoint.java)
===================================================================
--- trunk/integration/src/main/java/org/jboss/ws/integration/EndpointImpl.java
(rev 0)
+++ trunk/integration/src/main/java/org/jboss/ws/integration/EndpointImpl.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -0,0 +1,173 @@
+/*
+ * ====================================================================
+ *
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 1999 The Apache Software Foundation. All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if
+ * any, must include the following acknowlegement:
+ * "This product includes software developed by the
+ * Apache Software Foundation (
http://www.apache.org/)."
+ * Alternately, this acknowlegement may appear in the software itself,
+ * if and wherever such third-party acknowlegements normally appear.
+ *
+ * 4. The names "The Jakarta Project", "Tomcat", and "Apache
Software
+ * Foundation" must not be used to endorse or promote products derived
+ * from this software without prior written permission. For written
+ * permission, please contact apache(a)apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache"
+ * nor may "Apache" appear in their names without prior written
+ * permission of the Apache Group.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation. For more
+ * information on the Apache Software Foundation, please see
+ * <
http://www.apache.org/>.
+ */
+package org.jboss.ws.integration;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.management.ObjectName;
+
+import org.jboss.ws.integration.invocation.InvocationHandler;
+
+/**
+ * A general JAXWS endpoint.
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 20-Apr-2007
+ */
+public class EndpointImpl implements Endpoint
+{
+ private Service service;
+ private ObjectName name;
+ private Class endpointImpl;
+ private EndpointState state;
+ private RequestHandler requestHandler;
+ private InvocationHandler invocationHandler;
+ private LifecycleHandler lifecycleHandler;
+ private Map<Class, Object> metaData = new HashMap<Class, Object>();
+
+ public EndpointImpl(Service service, Class impl)
+ {
+ this.service = service;
+ this.endpointImpl = impl;
+ this.state = EndpointState.UNDEFINED;
+ }
+
+ public Service getService()
+ {
+ return service;
+ }
+
+ public void setService(Service service)
+ {
+ this.service = service;
+ }
+
+ public Class getEndpointImpl()
+ {
+ return endpointImpl;
+ }
+
+ public void setEndpointImpl(Class endpointImpl)
+ {
+ this.endpointImpl = endpointImpl;
+ }
+
+ public EndpointState getState()
+ {
+ return state;
+ }
+
+ public void setState(EndpointState state)
+ {
+ this.state = state;
+ }
+
+ public ObjectName getName()
+ {
+ return name;
+ }
+
+ public void setName(ObjectName name)
+ {
+ this.name = name;
+ }
+
+ public RequestHandler getRequestHandler()
+ {
+ return requestHandler;
+ }
+
+ public void setRequestHandler(RequestHandler handler)
+ {
+ this.requestHandler = handler;
+ }
+
+ public LifecycleHandler getLifecycleHandler()
+ {
+ return lifecycleHandler;
+ }
+
+ public void setLifecycleHandler(LifecycleHandler handler)
+ {
+ this.lifecycleHandler = handler;
+ }
+
+ public InvocationHandler getInvocationHandler()
+ {
+ return invocationHandler;
+ }
+
+ public void setInvocationHandler(InvocationHandler handler)
+ {
+ this.invocationHandler = handler;
+ }
+
+ public <T> T addMetaData(Class<T> key, Object value)
+ {
+ return (T)metaData.put(key, value);
+ }
+
+ public <T> T getMetaData(Class<T> key)
+ {
+ return (T)metaData.get(key);
+ }
+
+ public <T> T removeMetaData(Class<T> key)
+ {
+ return (T)metaData.get(key);
+ }
+}
Copied: trunk/integration/src/main/java/org/jboss/ws/integration/LifecycleHandlerImpl.java
(from rev 2936,
trunk/integration/src/main/java/org/jboss/ws/integration/BasicLifecycleHandler.java)
===================================================================
--- trunk/integration/src/main/java/org/jboss/ws/integration/LifecycleHandlerImpl.java
(rev 0)
+++
trunk/integration/src/main/java/org/jboss/ws/integration/LifecycleHandlerImpl.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -0,0 +1,79 @@
+/*
+ * 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.ws.integration;
+
+//$Id$
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.integration.Endpoint.EndpointState;
+import org.jboss.ws.integration.invocation.InvocationHandler;
+
+/**
+ * A basic lifecycle handler
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 31-Oct-2006
+ */
+public class LifecycleHandlerImpl implements LifecycleHandler
+{
+ // provide logging
+ protected final Logger log = Logger.getLogger(getClass());
+
+ public void create(Endpoint endpoint)
+ {
+ log.debug("Create: " + endpoint.getName());
+
+ // Initialize the invoker
+ InvocationHandler invoker = endpoint.getInvocationHandler();
+ invoker.init(endpoint);
+
+ endpoint.setState(EndpointState.CREATED);
+ }
+
+ public void start(Endpoint endpoint)
+ {
+ log.debug("Start: " + endpoint.getName());
+
+ EndpointState state = endpoint.getState();
+ if (state == EndpointState.UNDEFINED || state == EndpointState.DESTROYED)
+ throw new IllegalStateException("Cannot start endpoint in state: " +
state);
+
+ endpoint.setState(EndpointState.STARTED);
+ }
+
+ public void stop(Endpoint endpoint)
+ {
+ log.debug("Stop: " + endpoint.getName());
+
+ EndpointState state = endpoint.getState();
+ if (state != EndpointState.STARTED)
+ throw new IllegalStateException("Cannot stop endpoint in state: " +
state);
+
+ endpoint.setState(EndpointState.STOPED);
+ }
+
+ public void destroy(Endpoint endpoint)
+ {
+ log.debug("Destroy: " + endpoint.getName());
+ endpoint.setState(EndpointState.DESTROYED);
+ }
+}
Copied: trunk/integration/src/main/java/org/jboss/ws/integration/ServiceImpl.java (from
rev 2936, trunk/integration/src/main/java/org/jboss/ws/integration/BasicService.java)
===================================================================
--- trunk/integration/src/main/java/org/jboss/ws/integration/ServiceImpl.java
(rev 0)
+++ trunk/integration/src/main/java/org/jboss/ws/integration/ServiceImpl.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -0,0 +1,103 @@
+/*
+ * ====================================================================
+ *
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 1999 The Apache Software Foundation. All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if
+ * any, must include the following acknowlegement:
+ * "This product includes software developed by the
+ * Apache Software Foundation (
http://www.apache.org/)."
+ * Alternately, this acknowlegement may appear in the software itself,
+ * if and wherever such third-party acknowlegements normally appear.
+ *
+ * 4. The names "The Jakarta Project", "Tomcat", and "Apache
Software
+ * Foundation" must not be used to endorse or promote products derived
+ * from this software without prior written permission. For written
+ * permission, please contact apache(a)apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache"
+ * nor may "Apache" appear in their names without prior written
+ * permission of the Apache Group.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation. For more
+ * information on the Apache Software Foundation, please see
+ * <
http://www.apache.org/>.
+ */
+package org.jboss.ws.integration;
+
+// $Id$
+
+import java.util.LinkedList;
+import java.util.List;
+
+import org.jboss.ws.integration.deployment.Deployment;
+
+/**
+ * A general service.
+ *
+ * Maintains a named set of Endpoints
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 20-Apr-2007
+ */
+public class ServiceImpl implements Service
+{
+ private Deployment unit;
+ private List<Endpoint> endpoints = new LinkedList<Endpoint>();
+
+ public ServiceImpl(Deployment unit)
+ {
+ this.unit = unit;
+ this.unit.setService(this);
+ }
+
+ public Deployment getDeployment()
+ {
+ return unit;
+ }
+
+ public void setDeployment(Deployment unit)
+ {
+ this.unit = unit;
+ }
+
+ public void addEndpoint(Endpoint endpoint)
+ {
+ endpoints.add(endpoint);
+ }
+
+ public List<Endpoint> getEndpoints()
+ {
+ return endpoints;
+ }
+}
Modified:
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/AbstractDeployer.java
===================================================================
---
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/AbstractDeployer.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/AbstractDeployer.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -68,7 +68,7 @@
*/
public abstract class AbstractDeployer implements Deployer
{
- // logging support
+ // provide logging
protected final Logger log = Logger.getLogger(getClass());
public void create(Deployment dep)
Deleted:
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/BasicDeployment.java
===================================================================
---
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/BasicDeployment.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/BasicDeployment.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,140 +0,0 @@
-/*
- * ====================================================================
- *
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 1999 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution, if
- * any, must include the following acknowlegement:
- * "This product includes software developed by the
- * Apache Software Foundation (
http://www.apache.org/)."
- * Alternately, this acknowlegement may appear in the software itself,
- * if and wherever such third-party acknowlegements normally appear.
- *
- * 4. The names "The Jakarta Project", "Tomcat", and "Apache
Software
- * Foundation" must not be used to endorse or promote products derived
- * from this software without prior written permission. For written
- * permission, please contact apache(a)apache.org.
- *
- * 5. Products derived from this software may not be called "Apache"
- * nor may "Apache" appear in their names without prior written
- * permission of the Apache Group.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <
http://www.apache.org/>.
- */
-package org.jboss.ws.integration.deployment;
-
-//$Id$
-
-import org.jboss.ws.integration.BasicService;
-import org.jboss.ws.integration.Service;
-
-/**
- * A general web service deployment dep.
- *
- * It has no notion of J2EE deployment packages.
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 20-Apr-2007
- */
-public class BasicDeployment implements Deployment
-{
- // The context for this deployment dep
- private DeploymentContext context;
- // A deployment has one service
- private Service service;
- // The type of this deployment
- private DeploymentType type;
- // The state for this deployment
- private DeploymentState state;
- // The deployment class loader
- private ClassLoader classLoader;
-
- public BasicDeployment()
- {
- context = new BasicDeploymentContext();
- service = new BasicService(this);
- state = DeploymentState.UNDEFINED;
- }
-
- public DeploymentContext getContext()
- {
- return context;
- }
-
- public void setContext(DeploymentContext context)
- {
- this.context = context;
- }
-
- public void setClassLoader(ClassLoader loader)
- {
- this.classLoader = loader;
- }
-
- public ClassLoader getClassLoader()
- {
- return classLoader;
- }
-
- public Service getService()
- {
- return service;
- }
-
- public void setService(Service service)
- {
- this.service = service;
- }
-
- public DeploymentState getState()
- {
- return state;
- }
-
- public void setState(DeploymentState deploymentState)
- {
- this.state = deploymentState;
- }
-
- public DeploymentType getType()
- {
- return type;
- }
-
- public void setType(DeploymentType deploymentType)
- {
- this.type = deploymentType;
- }
-}
Deleted:
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/BasicDeploymentContext.java
===================================================================
---
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/BasicDeploymentContext.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/BasicDeploymentContext.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,82 +0,0 @@
-/*
- * ====================================================================
- *
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 1999 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution, if
- * any, must include the following acknowlegement:
- * "This product includes software developed by the
- * Apache Software Foundation (
http://www.apache.org/)."
- * Alternately, this acknowlegement may appear in the software itself,
- * if and wherever such third-party acknowlegements normally appear.
- *
- * 4. The names "The Jakarta Project", "Tomcat", and "Apache
Software
- * Foundation" must not be used to endorse or promote products derived
- * from this software without prior written permission. For written
- * permission, please contact apache(a)apache.org.
- *
- * 5. Products derived from this software may not be called "Apache"
- * nor may "Apache" appear in their names without prior written
- * permission of the Apache Group.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <
http://www.apache.org/>.
- */
-package org.jboss.ws.integration.deployment;
-
-//$Id$
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * A general web service deployment context.
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 20-Apr-2007
- */
-public class BasicDeploymentContext implements DeploymentContext
-{
- private Map<Class, Object> attachments = new HashMap<Class, Object>();
-
- public <T> T getAttachment(Class<T> clazz)
- {
- return (T)attachments.get(clazz);
- }
-
- public <T> T addAttachment(Class<T> clazz, Object obj)
- {
- return (T)attachments.put(clazz, obj);
- }
-}
Deleted:
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/BasicDeploymentManager.java
===================================================================
---
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/BasicDeploymentManager.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/BasicDeploymentManager.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,168 +0,0 @@
-/*
- * ====================================================================
- *
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 1999 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution, if
- * any, must include the following acknowlegement:
- * "This product includes software developed by the
- * Apache Software Foundation (
http://www.apache.org/)."
- * Alternately, this acknowlegement may appear in the software itself,
- * if and wherever such third-party acknowlegements normally appear.
- *
- * 4. The names "The Jakarta Project", "Tomcat", and "Apache
Software
- * Foundation" must not be used to endorse or promote products derived
- * from this software without prior written permission. For written
- * permission, please contact apache(a)apache.org.
- *
- * 5. Products derived from this software may not be called "Apache"
- * nor may "Apache" appear in their names without prior written
- * permission of the Apache Group.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <
http://www.apache.org/>.
- */
-package org.jboss.ws.integration.deployment;
-
-// $Id$
-
-import java.util.LinkedList;
-import java.util.List;
-
-import org.jboss.ws.integration.deployment.Deployment.DeploymentState;
-
-/**
- * A general service deployment manger.
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 20-Apr-2007
- */
-public class BasicDeploymentManager implements DeploymentManager
-{
- private List<Deployer> deployers = new LinkedList<Deployer>();
-
- public List<Deployer> getDeployers()
- {
- return deployers;
- }
-
- public void setDeployers(List<Deployer> deployers)
- {
- this.deployers = deployers;
- }
-
- /**
- * Iterate over the registered deployers calls create on each.
- * Iterate over the registered deployers again and calls start on each.
- * If start fails it automaticall calls destroy in the reverse order
- * starting with the deployer that failed
- */
- public void deploy(Deployment dep)
- {
- // create the deployment
- for (int i = 0; i < deployers.size(); i++)
- {
- Deployer deployer = deployers.get(i);
- deployer.create(dep);
- }
-
- dep.setState(DeploymentState.CREATED);
-
- // start the deployment
- for (int i = 0; i < deployers.size(); i++)
- {
- Deployer deployer = deployers.get(i);
- try
- {
- deployer.start(dep);
- }
- catch (RuntimeException rte)
- {
- while (i-- >= 0)
- {
- // destroy the deployment
- failsafeDestroy(deployer, dep);
- }
- throw rte;
- }
- }
-
- dep.setState(DeploymentState.STARTED);
- }
-
- public void undeploy(Deployment dep)
- {
- // stop the deployment
- for (int i = deployers.size(); 0 < i; i--)
- {
- Deployer deployer = deployers.get(i - 1);
- failsafeStop(deployer, dep);
- }
-
- dep.setState(DeploymentState.STOPED);
-
- // destroy the deployment
- for (int i = deployers.size(); 0 < i; i--)
- {
- Deployer deployer = deployers.get(i - 1);
- failsafeDestroy(deployer, dep);
- }
-
- dep.setState(DeploymentState.DESTROYED);
- }
-
- private void failsafeStop(Deployer deployer, Deployment dep)
- {
- try
- {
- deployer.stop(dep);
- }
- catch (RuntimeException rte)
- {
- WSDeploymentException.rethrow(rte);
- }
- }
-
- private void failsafeDestroy(Deployer deployer, Deployment dep)
- {
- try
- {
- deployer.destroy(dep);
- }
- catch (RuntimeException rte)
- {
- WSDeploymentException.rethrow(rte);
- }
- }
-}
Added:
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/DeployerManager.java
===================================================================
---
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/DeployerManager.java
(rev 0)
+++
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/DeployerManager.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -0,0 +1,81 @@
+/*
+ * ====================================================================
+ *
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 1999 The Apache Software Foundation. All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if
+ * any, must include the following acknowlegement:
+ * "This product includes software developed by the
+ * Apache Software Foundation (
http://www.apache.org/)."
+ * Alternately, this acknowlegement may appear in the software itself,
+ * if and wherever such third-party acknowlegements normally appear.
+ *
+ * 4. The names "The Jakarta Project", "Tomcat", and "Apache
Software
+ * Foundation" must not be used to endorse or promote products derived
+ * from this software without prior written permission. For written
+ * permission, please contact apache(a)apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache"
+ * nor may "Apache" appear in their names without prior written
+ * permission of the Apache Group.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation. For more
+ * information on the Apache Software Foundation, please see
+ * <
http://www.apache.org/>.
+ */
+package org.jboss.ws.integration.deployment;
+
+// $Id$
+
+import java.util.List;
+
+/**
+ * A general service deployment manger.
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 20-Apr-2007
+ */
+public interface DeployerManager
+{
+ /** Get the list of registered deployers */
+ List<Deployer> getDeployers();
+
+ /** Set the list of registered deployers */
+ void setDeployers(List<Deployer> deployers);
+
+ /** Deploy a web service */
+ void deploy(Deployment dep);
+
+ /** Undeploy a web service */
+ void undeploy(Deployment dep);
+}
Added:
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/DeployerManagerImpl.java
===================================================================
---
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/DeployerManagerImpl.java
(rev 0)
+++
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/DeployerManagerImpl.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -0,0 +1,184 @@
+/*
+ * ====================================================================
+ *
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 1999 The Apache Software Foundation. All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if
+ * any, must include the following acknowlegement:
+ * "This product includes software developed by the
+ * Apache Software Foundation (
http://www.apache.org/)."
+ * Alternately, this acknowlegement may appear in the software itself,
+ * if and wherever such third-party acknowlegements normally appear.
+ *
+ * 4. The names "The Jakarta Project", "Tomcat", and "Apache
Software
+ * Foundation" must not be used to endorse or promote products derived
+ * from this software without prior written permission. For written
+ * permission, please contact apache(a)apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache"
+ * nor may "Apache" appear in their names without prior written
+ * permission of the Apache Group.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation. For more
+ * information on the Apache Software Foundation, please see
+ * <
http://www.apache.org/>.
+ */
+package org.jboss.ws.integration.deployment;
+
+// $Id$
+
+import java.util.LinkedList;
+import java.util.List;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.integration.deployment.Deployment.DeploymentState;
+
+/**
+ * A general service deployment manger.
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 20-Apr-2007
+ */
+public class DeployerManagerImpl implements DeployerManager
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(DeployerManagerImpl.class);
+
+
+ private List<Deployer> deployers = new LinkedList<Deployer>();
+
+ public List<Deployer> getDeployers()
+ {
+ return deployers;
+ }
+
+ public void setDeployers(List<Deployer> deployers)
+ {
+ this.deployers = deployers;
+ }
+
+ /**
+ * Iterate over the registered deployers calls create on each.
+ * Iterate over the registered deployers again and calls start on each.
+ * If start fails it automaticall calls destroy in the reverse order
+ * starting with the deployer that failed
+ */
+ public void deploy(Deployment dep)
+ {
+ // create the deployment
+ for (int i = 0; i < deployers.size(); i++)
+ {
+ Deployer deployer = deployers.get(i);
+ logInvocation(deployer, "Create");
+ deployer.create(dep);
+ }
+
+ dep.setState(DeploymentState.CREATED);
+
+ // start the deployment
+ for (int i = 0; i < deployers.size(); i++)
+ {
+ Deployer deployer = deployers.get(i);
+ try
+ {
+ logInvocation(deployer, "Start");
+ deployer.start(dep);
+ }
+ catch (RuntimeException rte)
+ {
+ while (i-- >= 0)
+ {
+ // destroy the deployment
+ failsafeDestroy(deployer, dep);
+ }
+ throw rte;
+ }
+ }
+
+ dep.setState(DeploymentState.STARTED);
+ }
+
+ public void undeploy(Deployment dep)
+ {
+ // stop the deployment
+ for (int i = deployers.size(); 0 < i; i--)
+ {
+ Deployer deployer = deployers.get(i - 1);
+ failsafeStop(deployer, dep);
+ }
+
+ dep.setState(DeploymentState.STOPED);
+
+ // destroy the deployment
+ for (int i = deployers.size(); 0 < i; i--)
+ {
+ Deployer deployer = deployers.get(i - 1);
+ failsafeDestroy(deployer, dep);
+ }
+
+ dep.setState(DeploymentState.DESTROYED);
+ }
+
+ private void failsafeStop(Deployer deployer, Deployment dep)
+ {
+ try
+ {
+ logInvocation(deployer, "Stop");
+ deployer.stop(dep);
+ }
+ catch (RuntimeException rte)
+ {
+ WSDeploymentException.rethrow(rte);
+ }
+ }
+
+ private void failsafeDestroy(Deployer deployer, Deployment dep)
+ {
+ try
+ {
+ logInvocation(deployer, "Destroy");
+ deployer.destroy(dep);
+ }
+ catch (RuntimeException rte)
+ {
+ WSDeploymentException.rethrow(rte);
+ }
+ }
+
+ private void logInvocation(Deployer deployer, String method)
+ {
+ String name = deployer.getClass().getName();
+ name = name.substring(name.lastIndexOf(".") + 1);
+ log.debug(name + ":" + method);
+ }
+}
Property changes on:
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/DeployerManagerImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied:
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/DeploymentContextImpl.java
(from rev 2936,
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/BasicDeploymentContext.java)
===================================================================
---
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/DeploymentContextImpl.java
(rev 0)
+++
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/DeploymentContextImpl.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -0,0 +1,82 @@
+/*
+ * ====================================================================
+ *
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 1999 The Apache Software Foundation. All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if
+ * any, must include the following acknowlegement:
+ * "This product includes software developed by the
+ * Apache Software Foundation (
http://www.apache.org/)."
+ * Alternately, this acknowlegement may appear in the software itself,
+ * if and wherever such third-party acknowlegements normally appear.
+ *
+ * 4. The names "The Jakarta Project", "Tomcat", and "Apache
Software
+ * Foundation" must not be used to endorse or promote products derived
+ * from this software without prior written permission. For written
+ * permission, please contact apache(a)apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache"
+ * nor may "Apache" appear in their names without prior written
+ * permission of the Apache Group.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation. For more
+ * information on the Apache Software Foundation, please see
+ * <
http://www.apache.org/>.
+ */
+package org.jboss.ws.integration.deployment;
+
+//$Id$
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * A general web service deployment context.
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 20-Apr-2007
+ */
+public class DeploymentContextImpl implements DeploymentContext
+{
+ private Map<Class, Object> attachments = new HashMap<Class, Object>();
+
+ public <T> T getAttachment(Class<T> clazz)
+ {
+ return (T)attachments.get(clazz);
+ }
+
+ public <T> T addAttachment(Class<T> clazz, Object obj)
+ {
+ return (T)attachments.put(clazz, obj);
+ }
+}
Copied:
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/DeploymentImpl.java
(from rev 2936,
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/BasicDeployment.java)
===================================================================
---
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/DeploymentImpl.java
(rev 0)
+++
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/DeploymentImpl.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -0,0 +1,140 @@
+/*
+ * ====================================================================
+ *
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 1999 The Apache Software Foundation. All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if
+ * any, must include the following acknowlegement:
+ * "This product includes software developed by the
+ * Apache Software Foundation (
http://www.apache.org/)."
+ * Alternately, this acknowlegement may appear in the software itself,
+ * if and wherever such third-party acknowlegements normally appear.
+ *
+ * 4. The names "The Jakarta Project", "Tomcat", and "Apache
Software
+ * Foundation" must not be used to endorse or promote products derived
+ * from this software without prior written permission. For written
+ * permission, please contact apache(a)apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache"
+ * nor may "Apache" appear in their names without prior written
+ * permission of the Apache Group.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation. For more
+ * information on the Apache Software Foundation, please see
+ * <
http://www.apache.org/>.
+ */
+package org.jboss.ws.integration.deployment;
+
+//$Id$
+
+import org.jboss.ws.integration.ServiceImpl;
+import org.jboss.ws.integration.Service;
+
+/**
+ * A general web service deployment dep.
+ *
+ * It has no notion of J2EE deployment packages.
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 20-Apr-2007
+ */
+public class DeploymentImpl implements Deployment
+{
+ // The context for this deployment dep
+ private DeploymentContext context;
+ // A deployment has one service
+ private Service service;
+ // The type of this deployment
+ private DeploymentType type;
+ // The state for this deployment
+ private DeploymentState state;
+ // The deployment class loader
+ private ClassLoader classLoader;
+
+ public DeploymentImpl()
+ {
+ context = new DeploymentContextImpl();
+ service = new ServiceImpl(this);
+ state = DeploymentState.UNDEFINED;
+ }
+
+ public DeploymentContext getContext()
+ {
+ return context;
+ }
+
+ public void setContext(DeploymentContext context)
+ {
+ this.context = context;
+ }
+
+ public void setClassLoader(ClassLoader loader)
+ {
+ this.classLoader = loader;
+ }
+
+ public ClassLoader getClassLoader()
+ {
+ return classLoader;
+ }
+
+ public Service getService()
+ {
+ return service;
+ }
+
+ public void setService(Service service)
+ {
+ this.service = service;
+ }
+
+ public DeploymentState getState()
+ {
+ return state;
+ }
+
+ public void setState(DeploymentState deploymentState)
+ {
+ this.state = deploymentState;
+ }
+
+ public DeploymentType getType()
+ {
+ return type;
+ }
+
+ public void setType(DeploymentType deploymentType)
+ {
+ this.type = deploymentType;
+ }
+}
Deleted:
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/DeploymentManager.java
===================================================================
---
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/DeploymentManager.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/DeploymentManager.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,84 +0,0 @@
-/*
- * ====================================================================
- *
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 1999 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution, if
- * any, must include the following acknowlegement:
- * "This product includes software developed by the
- * Apache Software Foundation (
http://www.apache.org/)."
- * Alternately, this acknowlegement may appear in the software itself,
- * if and wherever such third-party acknowlegements normally appear.
- *
- * 4. The names "The Jakarta Project", "Tomcat", and "Apache
Software
- * Foundation" must not be used to endorse or promote products derived
- * from this software without prior written permission. For written
- * permission, please contact apache(a)apache.org.
- *
- * 5. Products derived from this software may not be called "Apache"
- * nor may "Apache" appear in their names without prior written
- * permission of the Apache Group.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <
http://www.apache.org/>.
- */
-package org.jboss.ws.integration.deployment;
-
-// $Id$
-
-import java.util.List;
-
-/**
- * A general service deployment manger.
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 20-Apr-2007
- */
-public interface DeploymentManager
-{
- /** The bean name in the kernel registry */
- static String BEAN_NAME = "WSDeploymentManager";
-
- /** Get the list of registered deployers */
- List<Deployer> getDeployers();
-
- /** Set the list of registered deployers */
- void setDeployers(List<Deployer> deployers);
-
- /** Deploy a web service */
- void deploy(Deployment dep);
-
- /** Undeploy a web service */
- void undeploy(Deployment dep);
-}
Deleted:
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/DeploymentManagerFactory.java
===================================================================
---
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/DeploymentManagerFactory.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/DeploymentManagerFactory.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,86 +0,0 @@
-/*
- * ====================================================================
- *
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 1999 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution, if
- * any, must include the following acknowlegement:
- * "This product includes software developed by the
- * Apache Software Foundation (
http://www.apache.org/)."
- * Alternately, this acknowlegement may appear in the software itself,
- * if and wherever such third-party acknowlegements normally appear.
- *
- * 4. The names "The Jakarta Project", "Tomcat", and "Apache
Software
- * Foundation" must not be used to endorse or promote products derived
- * from this software without prior written permission. For written
- * permission, please contact apache(a)apache.org.
- *
- * 5. Products derived from this software may not be called "Apache"
- * nor may "Apache" appear in their names without prior written
- * permission of the Apache Group.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <
http://www.apache.org/>.
- */
-package org.jboss.ws.integration.deployment;
-
-//$Id$
-
-import org.jboss.kernel.Kernel;
-import org.jboss.kernel.spi.registry.KernelRegistry;
-import org.jboss.kernel.spi.registry.KernelRegistryEntry;
-import org.jboss.ws.integration.KernelLocator;
-
-/**
- * Get the deployment manager from the kernel
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 20-Apr-2007
- */
-public class DeploymentManagerFactory
-{
- private static DeploymentManager epRegistry;
-
- public static DeploymentManager getDeploymentManager()
- {
- if (epRegistry == null)
- {
- Kernel kernel = KernelLocator.getKernel();
- KernelRegistry registry = kernel.getRegistry();
- KernelRegistryEntry entry = registry.getEntry(DeploymentManager.BEAN_NAME);
- epRegistry = (DeploymentManager)entry.getTarget();
- }
- return epRegistry;
- }
-}
Deleted:
trunk/integration/src/main/java/org/jboss/ws/integration/management/BasicEndpointRegistry.java
===================================================================
---
trunk/integration/src/main/java/org/jboss/ws/integration/management/BasicEndpointRegistry.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration/src/main/java/org/jboss/ws/integration/management/BasicEndpointRegistry.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,129 +0,0 @@
-/*
- * ====================================================================
- *
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 1999 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution, if
- * any, must include the following acknowlegement:
- * "This product includes software developed by the
- * Apache Software Foundation (
http://www.apache.org/)."
- * Alternately, this acknowlegement may appear in the software itself,
- * if and wherever such third-party acknowlegements normally appear.
- *
- * 4. The names "The Jakarta Project", "Tomcat", and "Apache
Software
- * Foundation" must not be used to endorse or promote products derived
- * from this software without prior written permission. For written
- * permission, please contact apache(a)apache.org.
- *
- * 5. Products derived from this software may not be called "Apache"
- * nor may "Apache" appear in their names without prior written
- * permission of the Apache Group.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <
http://www.apache.org/>.
- */
-package org.jboss.ws.integration.management;
-
-// $Id$
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-import javax.management.ObjectName;
-
-import org.jboss.ws.integration.Endpoint;
-
-/**
- * A general endpoint registry.
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 20-Apr-2007
- */
-public class BasicEndpointRegistry implements EndpointRegistry
-{
- private Map<ObjectName, Endpoint> endpoints = new HashMap<ObjectName,
Endpoint>();
-
- public Endpoint getEndpoint(ObjectName epName)
- {
- if (epName == null)
- throw new IllegalArgumentException("Endpoint name cannot be null");
-
- if (isRegistered(epName) == false)
- throw new IllegalStateException("Endpoint not registered: " +
epName);
-
- Endpoint endpoint = endpoints.get(epName);
- return endpoint;
- }
-
- public boolean isRegistered(ObjectName epName)
- {
- if (epName == null)
- throw new IllegalArgumentException("Endpoint name cannot be null");
-
- return endpoints.get(epName) != null;
- }
-
- public Set<ObjectName> getEndpoints()
- {
- return endpoints.keySet();
- }
-
- public void register(Endpoint endpoint)
- {
- if (endpoint == null)
- throw new IllegalArgumentException("Endpoint cannot be null");
-
- ObjectName epName = endpoint.getName();
- if (epName == null)
- throw new IllegalStateException("Endpoint name cannot be null for: " +
endpoint);
-
- if (isRegistered(epName))
- throw new IllegalStateException("Endpoint already registered: " +
epName);
-
- endpoints.put(epName, endpoint);
- }
-
- public void unregister(Endpoint endpoint)
- {
- if (endpoint == null)
- throw new IllegalArgumentException("Endpoint cannot be null");
-
- ObjectName epName = endpoint.getName();
- if (isRegistered(epName) == false)
- throw new IllegalStateException("Endpoint not registered: " +
epName);
-
- endpoints.remove(epName);
- }
-}
Copied:
trunk/integration/src/main/java/org/jboss/ws/integration/management/EndpointRegistryImpl.java
(from rev 2936,
trunk/integration/src/main/java/org/jboss/ws/integration/management/BasicEndpointRegistry.java)
===================================================================
---
trunk/integration/src/main/java/org/jboss/ws/integration/management/EndpointRegistryImpl.java
(rev 0)
+++
trunk/integration/src/main/java/org/jboss/ws/integration/management/EndpointRegistryImpl.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -0,0 +1,135 @@
+/*
+ * ====================================================================
+ *
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 1999 The Apache Software Foundation. All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if
+ * any, must include the following acknowlegement:
+ * "This product includes software developed by the
+ * Apache Software Foundation (
http://www.apache.org/)."
+ * Alternately, this acknowlegement may appear in the software itself,
+ * if and wherever such third-party acknowlegements normally appear.
+ *
+ * 4. The names "The Jakarta Project", "Tomcat", and "Apache
Software
+ * Foundation" must not be used to endorse or promote products derived
+ * from this software without prior written permission. For written
+ * permission, please contact apache(a)apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache"
+ * nor may "Apache" appear in their names without prior written
+ * permission of the Apache Group.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation. For more
+ * information on the Apache Software Foundation, please see
+ * <
http://www.apache.org/>.
+ */
+package org.jboss.ws.integration.management;
+
+// $Id$
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+import javax.management.ObjectName;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.integration.Endpoint;
+
+/**
+ * A general endpoint registry.
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 20-Apr-2007
+ */
+public class EndpointRegistryImpl implements EndpointRegistry
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(EndpointRegistryImpl.class);
+
+ private Map<ObjectName, Endpoint> endpoints = new HashMap<ObjectName,
Endpoint>();
+
+ public Endpoint getEndpoint(ObjectName epName)
+ {
+ if (epName == null)
+ throw new IllegalArgumentException("Endpoint name cannot be null");
+
+ if (isRegistered(epName) == false)
+ throw new IllegalStateException("Endpoint not registered: " +
epName);
+
+ Endpoint endpoint = endpoints.get(epName);
+ return endpoint;
+ }
+
+ public boolean isRegistered(ObjectName epName)
+ {
+ if (epName == null)
+ throw new IllegalArgumentException("Endpoint name cannot be null");
+
+ return endpoints.get(epName) != null;
+ }
+
+ public Set<ObjectName> getEndpoints()
+ {
+ return endpoints.keySet();
+ }
+
+ public void register(Endpoint endpoint)
+ {
+ if (endpoint == null)
+ throw new IllegalArgumentException("Endpoint cannot be null");
+
+ ObjectName epName = endpoint.getName();
+ if (epName == null)
+ throw new IllegalStateException("Endpoint name cannot be null for: " +
endpoint);
+
+ if (isRegistered(epName))
+ throw new IllegalStateException("Endpoint already registered: " +
epName);
+
+ log.info("register: " + epName);
+ endpoints.put(epName, endpoint);
+ }
+
+ public void unregister(Endpoint endpoint)
+ {
+ if (endpoint == null)
+ throw new IllegalArgumentException("Endpoint cannot be null");
+
+ ObjectName epName = endpoint.getName();
+ if (isRegistered(epName) == false)
+ throw new IllegalStateException("Endpoint not registered: " +
epName);
+
+ log.info("remove: " + epName);
+ endpoints.remove(epName);
+ }
+}
Copied:
trunk/integration/src/main/java/org/jboss/ws/integration/management/ServerConfig.java
(from rev 2936, trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServerConfig.java)
===================================================================
--- trunk/integration/src/main/java/org/jboss/ws/integration/management/ServerConfig.java
(rev 0)
+++
trunk/integration/src/main/java/org/jboss/ws/integration/management/ServerConfig.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -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.ws.integration.management;
+
+// $Id: ServiceEndpointManagerFactory.java 293 2006-05-08 16:31:50Z
thomas.diesler(a)jboss.com $
+
+import java.io.File;
+
+/**
+ * Interface to container independent config
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 08-May-2006
+ */
+public interface ServerConfig
+{
+ // The host name that is returned if there is no other defined
+ static String UNDEFINED_HOSTNAME = "jbossws.undefined.host";
+
+ // The default bean name
+ static final String BEAN_NAME = "WSServerConfig";
+
+ File getServerTempDir();
+
+ File getServerDataDir();
+
+ String getWebServiceHost();
+
+ int getWebServicePort();
+
+ int getWebServiceSecurePort();
+
+ boolean isModifySOAPAddress();
+}
Copied:
trunk/integration/src/main/java/org/jboss/ws/integration/management/ServerConfigFactory.java
(from rev 2936,
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServerConfigFactory.java)
===================================================================
---
trunk/integration/src/main/java/org/jboss/ws/integration/management/ServerConfigFactory.java
(rev 0)
+++
trunk/integration/src/main/java/org/jboss/ws/integration/management/ServerConfigFactory.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -0,0 +1,58 @@
+/*
+ * 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.ws.integration.management;
+
+import org.jboss.ws.integration.KernelLocator;
+import org.jboss.kernel.spi.registry.KernelRegistry;
+import org.jboss.logging.Logger;
+
+// $Id: ServiceEndpointManagerFactory.java 293 2006-05-08 16:31:50Z
thomas.diesler(a)jboss.com $
+
+/**
+ * Factory to container independent config
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 08-May-2006
+ */
+public class ServerConfigFactory
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(ServerConfigFactory.class);
+
+ private static ServerConfigFactory instance = new ServerConfigFactory();
+
+ // Hide ctor
+ protected ServerConfigFactory()
+ {
+ }
+
+ public static ServerConfigFactory getInstance()
+ {
+ return instance;
+ }
+
+ public ServerConfig getServerConfig()
+ {
+ KernelRegistry registry = KernelLocator.getKernel().getRegistry();
+ return (ServerConfig)registry.getEntry(ServerConfig.BEAN_NAME).getTarget();
+ }
+}
Copied:
trunk/integration/src/main/java/org/jboss/ws/integration/management/ServerConfigImpl.java
(from rev 2936,
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServerConfigImpl.java)
===================================================================
---
trunk/integration/src/main/java/org/jboss/ws/integration/management/ServerConfigImpl.java
(rev 0)
+++
trunk/integration/src/main/java/org/jboss/ws/integration/management/ServerConfigImpl.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -0,0 +1,218 @@
+/*
+ * 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.ws.integration.management;
+
+//$Id$
+
+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.ws.integration.ObjectNameFactory;
+
+/**
+ * JBoss specific implementation of a ServerConfig
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author darran.lofthouse(a)jboss.com
+ * @since 08-May-2006
+ */
+public class ServerConfigImpl implements ServerConfig
+{
+ private static final Logger log = Logger.getLogger(ServerConfigImpl.class);
+
+ // 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
+ private int webServicePort;
+ // The webservice port that will be used when updating the wsdl
+ 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 String getWebServiceHost()
+ {
+ return webServiceHost;
+ }
+
+ public void setWebServiceHost(String host) throws UnknownHostException
+ {
+ if (host == null || host.trim().length() == 0)
+ {
+ log.debug("Using undefined host: " + UNDEFINED_HOSTNAME);
+ host = UNDEFINED_HOSTNAME;
+ }
+ if ("0.0.0.0".equals(host))
+ {
+ InetAddress localHost = InetAddress.getLocalHost();
+ log.debug("Using local host: " + localHost.getHostName());
+ host = localHost.getHostName();
+ }
+ this.webServiceHost = host;
+ }
+
+ public void setWebServicePort(int port)
+ {
+ this.webServicePort = port;
+ }
+
+ public void setWebServiceSecurePort(int port)
+ {
+ this.webServiceSecurePort = port;
+ }
+
+ public boolean isModifySOAPAddress()
+ {
+ return modifySOAPAddress;
+ }
+
+ public void setModifySOAPAddress(boolean modify)
+ {
+ this.modifySOAPAddress = modify;
+ }
+
+ public File getServerTempDir()
+ {
+ try
+ {
+ MBeanServer server = getMBeanServer();
+ ObjectName oname =
ObjectNameFactory.create("jboss.system:type=ServerConfig");
+ File tmpdir = (File)server.getAttribute(oname, "ServerTempDir");
+ return tmpdir;
+ }
+ catch (JMException e)
+ {
+ return null;
+ }
+ }
+
+ public File getServerDataDir()
+ {
+ try
+ {
+ MBeanServer server = getMBeanServer();
+ ObjectName oname =
ObjectNameFactory.create("jboss.system:type=ServerConfig");
+ File tmpdir = (File)server.getAttribute(oname, "ServerDataDir");
+ return tmpdir;
+ }
+ catch (JMException e)
+ {
+ return null;
+ }
+ }
+
+ public int getWebServicePort()
+ {
+ if (webServicePort == 0)
+ webServicePort = getConnectorPort("HTTP/1.1", false);
+
+ if (webServicePort == 0)
+ {
+ log.warn("Unable to calculate 'WebServicePort', using default
'8080'");
+ webServicePort = 8080;
+ }
+
+ return webServicePort;
+ }
+
+ public int getWebServiceSecurePort()
+ {
+ if (webServiceSecurePort == 0)
+ webServiceSecurePort = getConnectorPort("HTTP/1.1", true);
+
+ if (webServiceSecurePort == 0)
+ {
+ log.warn("Unable to calculate 'WebServiceSecurePort', using default
'8443'");
+ webServiceSecurePort = 8443;
+ }
+
+ return webServiceSecurePort;
+ }
+
+ private int getConnectorPort(final String protocol, final boolean secure)
+ {
+ int port = -1;
+
+ try
+ {
+ MBeanServer server = getMBeanServer();
+ ObjectName connectors = new ObjectName("jboss.web:type=Connector,*");
+
+ Set connectorNames = server.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");
+
+ if (protocol.equals(connectorProtocol) && secure ==
connectorSecure)
+ {
+ if (port > -1)
+ {
+ log.warn("Found multiple connectors for protocol='" +
protocol + "' and secure='" + secure + "', using first port
found '" + port + "'");
+ }
+ else
+ {
+ port = connectorPort;
+ }
+ }
+ }
+ catch (AttributeNotFoundException ignored)
+ {
+ }
+ }
+
+ return port;
+ }
+ catch (JMException e)
+ {
+ 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/src/test/java/org/jboss/test/ws/integration/KernelBasedTest.java
===================================================================
---
trunk/integration/src/test/java/org/jboss/test/ws/integration/KernelBasedTest.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration/src/test/java/org/jboss/test/ws/integration/KernelBasedTest.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -67,4 +67,11 @@
*/
public abstract class KernelBasedTest extends TestCase
{
+ public Object getRegisteredBean(String beanName)
+ {
+ if (KernelTestSetup.getKernel() == null)
+ throw new IllegalStateException("Test does not use a
KernelTestSetup");
+
+ return KernelTestSetup.getRegisteredBean(beanName);
+ }
}
Modified:
trunk/integration/src/test/java/org/jboss/test/ws/integration/KernelTestSetup.java
===================================================================
---
trunk/integration/src/test/java/org/jboss/test/ws/integration/KernelTestSetup.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration/src/test/java/org/jboss/test/ws/integration/KernelTestSetup.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -61,7 +61,6 @@
import java.net.URL;
import junit.extensions.TestSetup;
-import junit.framework.Test;
import junit.framework.TestSuite;
import org.jboss.kernel.Kernel;
@@ -79,7 +78,7 @@
public class KernelTestSetup extends TestSetup
{
private String beansXML;
- private Kernel kernel;
+ private static Kernel kernel;
public KernelTestSetup(Class test, String beansXML) throws Exception
{
@@ -94,7 +93,7 @@
{
BasicBootstrap bootstrap = new BasicBootstrap();
bootstrap.run();
-
+
kernel = bootstrap.getKernel();
BeanXMLDeployer deployer = new BeanXMLDeployer(kernel);
@@ -108,12 +107,19 @@
}
}
- public Kernel getKernel()
+ @Override
+ protected void tearDown() throws Exception
{
+ super.tearDown();
+ kernel = null;
+ }
+
+ public static Kernel getKernel()
+ {
return kernel;
}
- public Object getRegisteredBean(String beanName)
+ public static Object getRegisteredBean(String beanName)
{
KernelRegistry registry = kernel.getRegistry();
KernelRegistryEntry entry = registry.getEntry(beanName);
Modified:
trunk/integration/src/test/java/org/jboss/test/ws/integration/basic/BasicDeploymentTest.java
===================================================================
---
trunk/integration/src/test/java/org/jboss/test/ws/integration/basic/BasicDeploymentTest.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration/src/test/java/org/jboss/test/ws/integration/basic/BasicDeploymentTest.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -63,11 +63,10 @@
import org.jboss.test.ws.integration.KernelBasedTest;
import org.jboss.test.ws.integration.KernelTestSetup;
-import org.jboss.ws.integration.BasicEndpoint;
-import org.jboss.ws.integration.BasicService;
-import org.jboss.ws.integration.deployment.BasicDeployment;
-import org.jboss.ws.integration.deployment.DeploymentManager;
-import org.jboss.ws.integration.deployment.DeploymentManagerFactory;
+import org.jboss.ws.integration.EndpointImpl;
+import org.jboss.ws.integration.ServiceImpl;
+import org.jboss.ws.integration.deployment.DeployerManager;
+import org.jboss.ws.integration.deployment.DeploymentImpl;
import org.jboss.ws.integration.management.EndpointRegistry;
import org.jboss.ws.integration.management.EndpointRegistryFactory;
@@ -88,13 +87,13 @@
public void testDeployerOrder()
{
- DeploymentManager depManager = DeploymentManagerFactory.getDeploymentManager();
+ DeployerManager depManager =
(DeployerManager)getRegisteredBean("WSDeployerManager");
EndpointRegistry epRegistry = EndpointRegistryFactory.getEndpointRegistry();
// create the deployment unit
- BasicDeployment unit = new BasicDeployment();
- BasicService service = new BasicService(unit);
- service.addEndpoint(new BasicEndpoint(service, BasicEndpointImp.class));
+ DeploymentImpl unit = new DeploymentImpl();
+ ServiceImpl service = new ServiceImpl(unit);
+ service.addEndpoint(new EndpointImpl(service, BasicEndpointImp.class));
// deploy the endpoints
depManager.deploy(unit);
Modified: trunk/integration/src/test/resources/basic/basic-deployers.xml
===================================================================
--- trunk/integration/src/test/resources/basic/basic-deployers.xml 2007-04-27 14:04:25 UTC
(rev 2946)
+++ trunk/integration/src/test/resources/basic/basic-deployers.xml 2007-04-27 18:55:01 UTC
(rev 2947)
@@ -6,7 +6,7 @@
<bean name="KernelLocator"
class="org.jboss.kernel.plugins.util.KernelLocator"/>
<!-- The deployment manger registers the list of web service deployers -->
- <bean name="WSDeploymentManager"
class="org.jboss.ws.integration.deployment.BasicDeploymentManager">
+ <bean name="WSDeployerManager"
class="org.jboss.ws.integration.deployment.BasicDeploymentManager">
<property name="deployers">
<list class="java.util.LinkedList"
elementClass="org.jboss.ws.integration.deployment.Deployer">
<inject bean="WSValidatingDeployer"/>
Modified:
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/DeployerInterceptor.java
===================================================================
---
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/DeployerInterceptor.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/DeployerInterceptor.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -33,8 +33,8 @@
import org.jboss.mx.server.Invocation;
import org.jboss.mx.util.MBeanProxy;
import org.jboss.ws.core.server.AbstractServiceEndpointPublisher;
-import org.jboss.ws.core.server.ServiceEndpointDeployer;
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+import org.jboss.ws.core.server.legacy.ServiceEndpointDeployer;
import org.jboss.ws.integration.KernelLocator;
import org.jboss.ws.integration.deployment.WSDeploymentException;
Modified:
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/JBossContextServlet.java
===================================================================
---
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/JBossContextServlet.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/JBossContextServlet.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -24,8 +24,8 @@
// $Id$
import org.jboss.logging.Logger;
-import org.jboss.ws.core.CommonContextServlet;
-import org.jboss.ws.core.server.ServiceEndpointManagerFactory;
+import org.jboss.ws.core.server.legacy.CommonContextServlet;
+import org.jboss.ws.core.server.legacy.ServiceEndpointManagerFactory;
/**
* The servlet that that is associated with context /jbossws
Modified:
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/JBossHttpServer.java
===================================================================
---
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/JBossHttpServer.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/JBossHttpServer.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -38,10 +38,10 @@
import org.jboss.ws.WSException;
import org.jboss.ws.core.server.HttpContext;
import org.jboss.ws.core.server.HttpServer;
-import org.jboss.ws.core.server.ServerConfig;
-import org.jboss.ws.core.server.ServerConfigFactory;
import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.core.utils.DOMWriter;
+import org.jboss.ws.integration.management.ServerConfig;
+import org.jboss.ws.integration.management.ServerConfigFactory;
import org.w3c.dom.Element;
/**
Modified:
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/JBossServiceEndpointServlet.java
===================================================================
---
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/JBossServiceEndpointServlet.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/JBossServiceEndpointServlet.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -27,8 +27,8 @@
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
-import org.jboss.ws.core.server.AbstractServiceEndpointServlet;
-import org.jboss.ws.core.server.ServiceEndpoint;
+import org.jboss.ws.core.server.legacy.AbstractServiceEndpointServlet;
+import org.jboss.ws.core.server.legacy.ServiceEndpoint;
import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
/**
Modified:
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/PortComponentLinkServlet.java
===================================================================
---
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/PortComponentLinkServlet.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/PortComponentLinkServlet.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -34,9 +34,9 @@
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
-import org.jboss.ws.core.server.ServiceEndpoint;
-import org.jboss.ws.core.server.ServiceEndpointManager;
-import org.jboss.ws.core.server.ServiceEndpointManagerFactory;
+import org.jboss.ws.core.server.legacy.ServiceEndpoint;
+import org.jboss.ws.core.server.legacy.ServiceEndpointManager;
+import org.jboss.ws.core.server.legacy.ServiceEndpointManagerFactory;
/**
* A servlet that reports the serviceURL for a given service ID.
Deleted:
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/ServerConfigImpl.java
===================================================================
---
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/ServerConfigImpl.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/ServerConfigImpl.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,149 +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.ws.integration.jboss42;
-
-//$Id$
-
-import java.io.File;
-import java.util.Set;
-
-import javax.management.AttributeNotFoundException;
-import javax.management.JMException;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-
-import org.jboss.logging.Logger;
-import org.jboss.mx.util.MBeanServerLocator;
-import org.jboss.ws.core.server.ServerConfig;
-import org.jboss.ws.integration.ObjectNameFactory;
-
-/**
- * JBoss specific implementation of a ServerConfig
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author darran.lofthouse(a)jboss.com
- * @since 08-May-2006
- */
-public class ServerConfigImpl implements ServerConfig
-{
-
- private static final Logger log = Logger.getLogger(ServerConfigImpl.class);
-
- public File getServerTempDir()
- {
- try
- {
- MBeanServer server = MBeanServerLocator.locateJBoss();
- ObjectName oname =
ObjectNameFactory.create("jboss.system:type=ServerConfig");
- File tmpdir = (File)server.getAttribute(oname, "ServerTempDir");
- return tmpdir;
- }
- catch (JMException e)
- {
- return null;
- }
- }
-
- public File getServerDataDir()
- {
- try
- {
- MBeanServer server = MBeanServerLocator.locateJBoss();
- ObjectName oname =
ObjectNameFactory.create("jboss.system:type=ServerConfig");
- File tmpdir = (File)server.getAttribute(oname, "ServerDataDir");
- return tmpdir;
- }
- catch (JMException e)
- {
- return null;
- }
- }
-
- public int getWebServicePort()
- {
- int port = getConnectorPort("HTTP/1.1", false);
- if (port > -1)
- {
- return port;
- }
-
- log.warn("Unable to calculate 'WebServicePort', using default
'8080'");
- return 8080;
- }
-
- public int getWebServiceSecurePort()
- {
- int port = getConnectorPort("HTTP/1.1", true);
- if (port > -1)
- {
- return port;
- }
-
- log.warn("Unable to calculate 'WebServiceSecurePort', using default
'8443'");
- return 8443;
- }
-
- private int getConnectorPort(final String protocol, final boolean secure)
- {
- int port = -1;
-
- try
- {
- MBeanServer server = MBeanServerLocator.locateJBoss();
- ObjectName connectors = new ObjectName("jboss.web:type=Connector,*");
-
- Set connectorNames = server.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");
-
- if (protocol.equals(connectorProtocol) && secure ==
connectorSecure)
- {
- if (port > -1)
- {
- log.warn("Found multiple connectors for protocol='" +
protocol + "' and secure='" + secure + "', using first port
found '" + port + "'");
- }
- else
- {
- port = connectorPort;
- }
- }
- }
- catch (AttributeNotFoundException ignored)
- {
- }
- }
-
- return port;
- }
- catch (JMException e)
- {
- return -1;
- }
- }
-}
Modified:
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/ServiceEndpointInvokerEJB21.java
===================================================================
---
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/ServiceEndpointInvokerEJB21.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/ServiceEndpointInvokerEJB21.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -43,9 +43,9 @@
import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.core.EndpointInvocation;
import org.jboss.ws.core.jaxrpc.handler.SOAPMessageContextJAXRPC;
-import org.jboss.ws.core.server.AbstractServiceEndpointInvoker;
-import org.jboss.ws.core.server.ServiceEndpointInfo;
-import org.jboss.ws.core.server.ServiceEndpointInvoker;
+import org.jboss.ws.core.server.legacy.AbstractServiceEndpointInvoker;
+import org.jboss.ws.core.server.legacy.ServiceEndpointInfo;
+import org.jboss.ws.core.server.legacy.ServiceEndpointInvoker;
import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.integration.ObjectNameFactory;
import org.jboss.ws.metadata.j2ee.UnifiedApplicationMetaData;
Modified:
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/ServiceEndpointInvokerEJB3.java
===================================================================
---
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/ServiceEndpointInvokerEJB3.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/ServiceEndpointInvokerEJB3.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -34,10 +34,10 @@
import org.jboss.mx.util.MBeanServerLocator;
import org.jboss.ws.WSException;
import org.jboss.ws.core.EndpointInvocation;
-import org.jboss.ws.core.server.AbstractServiceEndpointInvoker;
-import org.jboss.ws.core.server.ServiceEndpointInfo;
-import org.jboss.ws.core.server.ServiceEndpointInvoker;
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+import org.jboss.ws.core.server.legacy.AbstractServiceEndpointInvoker;
+import org.jboss.ws.core.server.legacy.ServiceEndpointInfo;
+import org.jboss.ws.core.server.legacy.ServiceEndpointInvoker;
import org.jboss.ws.integration.ObjectNameFactory;
/**
Modified:
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/ServiceEndpointInvokerMDB.java
===================================================================
---
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/ServiceEndpointInvokerMDB.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/ServiceEndpointInvokerMDB.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -27,8 +27,8 @@
import org.jboss.logging.Logger;
import org.jboss.ws.core.EndpointInvocation;
-import org.jboss.ws.core.server.AbstractServiceEndpointInvoker;
-import org.jboss.ws.core.server.ServiceEndpointInvoker;
+import org.jboss.ws.core.server.legacy.AbstractServiceEndpointInvoker;
+import org.jboss.ws.core.server.legacy.ServiceEndpointInvoker;
import org.jboss.ws.core.utils.ThreadLocalAssociation;
/**
Modified:
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/jms/JMSMessageDispatcher.java
===================================================================
---
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/jms/JMSMessageDispatcher.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/jms/JMSMessageDispatcher.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -38,10 +38,10 @@
import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.core.MessageAbstraction;
import org.jboss.ws.core.jaxrpc.handler.SOAPMessageContextJAXRPC;
-import org.jboss.ws.core.server.ServiceEndpoint;
-import org.jboss.ws.core.server.ServiceEndpointInvoker;
-import org.jboss.ws.core.server.ServiceEndpointManager;
-import org.jboss.ws.core.server.ServiceEndpointManagerFactory;
+import org.jboss.ws.core.server.legacy.ServiceEndpoint;
+import org.jboss.ws.core.server.legacy.ServiceEndpointInvoker;
+import org.jboss.ws.core.server.legacy.ServiceEndpointManager;
+import org.jboss.ws.core.server.legacy.ServiceEndpointManagerFactory;
import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.integration.jboss42.ServiceEndpointInvokerMDB;
import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
Modified: trunk/integration-jboss50/build.xml
===================================================================
--- trunk/integration-jboss50/build.xml 2007-04-27 14:04:25 UTC (rev 2946)
+++ trunk/integration-jboss50/build.xml 2007-04-27 18:55:01 UTC (rev 2947)
@@ -124,9 +124,6 @@
<!-- Build jbossws50.deployer -->
<zip zipfile="${jboss50.output.lib.dir}/jbossws50-deployer.zip">
- <fileset dir="${integration.output.lib.dir}">
- <include name="jbossws-integration.jar"/>
- </fileset>
<fileset dir="${jboss50.output.lib.dir}">
<include name="jbossws-jboss50-integration.jar"/>
</fileset>
Deleted:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/AbstractDeployer.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/AbstractDeployer.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/AbstractDeployer.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,163 +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.ws.integration.jboss50;
-
-//$Id$
-
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
-import org.jboss.kernel.spi.registry.KernelRegistry;
-import org.jboss.kernel.spi.registry.KernelRegistryEntry;
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.server.AbstractServiceEndpointPublisher;
-import org.jboss.ws.core.server.ServiceEndpointDeployer;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-import org.jboss.ws.integration.KernelLocator;
-import org.jboss.ws.integration.deployment.Deployment.DeploymentType;
-
-/**
- * An abstract web service deployer.
- *
- * deploy(unit)
- * if(isWebServiceDeployment)
- * deployServiceEndoint
- * udi = createUnifiedDeploymentInfo()
- * ServiceEndpointDeployer.create(udi)
- *
- * undeploy(unit)
- * undeployServiceEndoint
- * ServiceEndpointDeployer.destroy(udi)
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 31-Oct-2006
- */
-public abstract class AbstractDeployer implements DeployerHook
-{
- // provide logging
- protected final Logger log = Logger.getLogger(getClass());
-
- /** Depending on the type of deployment, this method should return true
- * if the deployment contains web service endpoints.
- */
- public abstract boolean isWebServiceDeployment(DeploymentUnit unit);
-
- /** Deploy the web service endpoints if there are any
- */
- public final void deploy(DeploymentUnit unit) throws DeploymentException
- {
- boolean isComponent = unit.getDeploymentContext().isComponent();
- if (isComponent == false && isWebServiceDeployment(unit))
- deployInternal(unit);
- }
-
- /**
- * Called when the deployment contains web service endpoints.
- * Is private and handles recovery of failed deployments
- */
- private final void deployInternal(DeploymentUnit unit) throws DeploymentException
- {
- try
- {
- deployServiceEndpoint(unit);
- }
- catch (Exception ex)
- {
- UnifiedDeploymentInfo udi = getUnifiedDeploymentInfo(unit);
- if (udi != null)
- undeployInternal(unit, udi);
-
- DeploymentException.rethrowAsDeploymentException("Cannot create service
endpoint", ex);
- }
- }
-
- /** Undeploy the web service endpoints if there are any
- */
- public final void undeploy(DeploymentUnit unit)
- {
- boolean isComponent = unit.getDeploymentContext().isComponent();
- UnifiedDeploymentInfo udi = getUnifiedDeploymentInfo(unit);
- if (isComponent == false && udi != null)
- undeployInternal(unit, udi);
- }
-
- private void undeployInternal(DeploymentUnit unit, UnifiedDeploymentInfo udi)
- {
- undeployServiceEndpoint(unit, udi);
- }
-
- /** Create the unified deployment info from the deployment unit
- */
- protected abstract UnifiedDeploymentInfo createUnifiedDeploymentInfo(DeploymentUnit
unit) throws Exception;
-
- /** Create the unified deployment info and create the service endpoints
- * through the ServiceEndpointDeployer
- */
- protected void deployServiceEndpoint(DeploymentUnit unit) throws Exception
- {
- UnifiedDeploymentInfo udi = createUnifiedDeploymentInfo(unit);
- unit.addAttachment(UnifiedDeploymentInfo.class, udi);
- createServiceEndpoint(udi, unit);
- }
-
- /** Stop and destroy the service endpoints through the ServiceEndpointDeployer
- */
- protected void undeployServiceEndpoint(DeploymentUnit unit, UnifiedDeploymentInfo
udi)
- {
- destroyServiceEndpoint(udi, unit);
- }
-
- protected void createServiceEndpoint(UnifiedDeploymentInfo udi, DeploymentUnit unit)
throws Exception
- {
- log.debug("Create ServiceEndpoint: " + udi.getCanonicalName());
- getServiceEndpointDeployer().create(udi);
- }
-
- protected void destroyServiceEndpoint(UnifiedDeploymentInfo udi, DeploymentUnit unit)
- {
- log.debug("Destroy ServiceEndpoint: " + udi.getCanonicalName());
- getServiceEndpointDeployer().destroy(udi);
- }
-
- /** Override to provide the deployment type
- */
- protected abstract DeploymentType getDeploymentType();
-
- protected UnifiedDeploymentInfo getUnifiedDeploymentInfo(DeploymentUnit unit)
- {
- UnifiedDeploymentInfo udi = unit.getAttachment(UnifiedDeploymentInfo.class);
- return (udi != null && udi.type == getDeploymentType() ? udi : null);
- }
-
- protected ServiceEndpointDeployer getServiceEndpointDeployer()
- {
- KernelRegistry registry = KernelLocator.getKernel().getRegistry();
- KernelRegistryEntry entry = registry.getEntry(ServiceEndpointDeployer.BEAN_NAME);
- return (ServiceEndpointDeployer)entry.getTarget();
- }
-
- protected ServiceEndpointPublisher getServiceEndpointPublisher()
- {
- KernelRegistry registry = KernelLocator.getKernel().getRegistry();
- KernelRegistryEntry entry =
registry.getEntry(AbstractServiceEndpointPublisher.BEAN_NAME);
- return (ServiceEndpointPublisher)entry.getTarget();
- }
-}
Deleted:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/AbstractDeployerEJB.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/AbstractDeployerEJB.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/AbstractDeployerEJB.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,96 +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.ws.integration.jboss50;
-
-//$Id$
-
-import java.net.URL;
-
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-import org.jboss.ws.metadata.umdm.UnifiedMetaData;
-
-/**
- * An abstract deployer for EJB Endpoints
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 31-Oct-2006
- */
-public abstract class AbstractDeployerEJB extends AbstractDeployer
-{
- // provide logging
- protected static final Logger log = Logger.getLogger(AbstractDeployerEJB.class);
-
- @Override
- protected void createServiceEndpoint(UnifiedDeploymentInfo udi, DeploymentUnit unit)
throws Exception
- {
- // Create the service endpoint
- super.createServiceEndpoint(udi, unit);
-
- // Generate the webapp and publish through th publisher
- try
- {
- UnifiedMetaData wsMetaData =
getServiceEndpointDeployer().getUnifiedMetaData(udi);
- udi.webappURL = new
ServiceEndpointGeneratorEJB3().generatWebDeployment(wsMetaData, udi);
- unit.addAttachment(ServiceEndpointWebApp.class, new
ServiceEndpointWebApp(udi.webappURL));
- getServiceEndpointPublisher().publishServiceEndpoint(udi);
- }
- catch (Exception ex)
- {
- DeploymentException.rethrowAsDeploymentException(ex.getMessage(), ex);
- }
- }
-
- @Override
- protected void destroyServiceEndpoint(UnifiedDeploymentInfo udi, DeploymentUnit unit)
- {
- // Destroy the webapp
- try
- {
- getServiceEndpointPublisher().destroyServiceEndpoint(udi);
- }
- catch (Exception ex)
- {
- log.error("Cannot destroy service endpoint", ex);
- }
-
- // Destroy the service endpoint
- super.destroyServiceEndpoint(udi, unit);
- }
-
- static class ServiceEndpointWebApp
- {
- private URL warURL;
-
- ServiceEndpointWebApp(URL warURL)
- {
- this.warURL = warURL;
- }
-
- public URL getWarURL()
- {
- return warURL;
- }
- }
-}
Deleted:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/AbstractDeployerJSE.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/AbstractDeployerJSE.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/AbstractDeployerJSE.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,134 +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.ws.integration.jboss50;
-
-//$Id$
-
-import java.util.Iterator;
-import java.util.Set;
-
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
-import org.jboss.logging.Logger;
-import org.jboss.metadata.NameValuePair;
-import org.jboss.metadata.WebMetaData;
-import org.jboss.metadata.web.Servlet;
-import org.jboss.ws.core.server.AbstractServiceEndpointPublisher;
-import org.jboss.ws.core.utils.JavaUtils;
-import org.jboss.ws.integration.Endpoint;
-
-/**
- * An abstract deployer for JSE Endpoints
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 31-Oct-2006
- */
-public abstract class AbstractDeployerJSE extends AbstractDeployer
-{
- public AbstractDeployerJSE()
- {
- super();
- }
-
- /**
- * After the service endpoint has successfully been deployed to the
ServiceEndpointManager,
- *
- */
- @Override
- protected void deployServiceEndpoint(DeploymentUnit unit) throws Exception
- {
- // Call the super implementation
- super.deployServiceEndpoint(unit);
-
- modifyWebMetaData(unit);
- }
-
- private void modifyWebMetaData(DeploymentUnit unit) throws Exception
- {
- Set<? extends WebMetaData> allMetaData =
unit.getAllMetaData(WebMetaData.class);
- if (allMetaData.size() < 1)
- throw new DeploymentException("Cannot find WebMetaData");
-
- WebMetaData webMetaData = allMetaData.iterator().next();
- String servletClass = getServiceEndpointPublisher().getServletClass();
-
- Iterator it = webMetaData.getServlets().iterator();
- while (it.hasNext())
- {
- Servlet servlet = (Servlet)it.next();
- String servletClassName = servlet.getServletClass();
-
- // JSP
- if (servletClassName == null)
- continue;
-
- // Nothing to do if we have an <init-param>
- if (isAlreadyModified(servlet) == false && isAServlet(servletClassName,
unit.getClassLoader()) == false)
- {
- servlet.setServletClass(servletClass);
- NameValuePair initParam = new NameValuePair(Endpoint.SEPID_DOMAIN_ENDPOINT,
servletClassName);
- servlet.addInitParam(initParam);
- }
-
- }
-
- }
-
- private boolean isAServlet(String servletClassName, ClassLoader cl)
- {
- boolean isAServlet = false;
-
- if (cl != null)
- {
- try
- {
- Class servletClass = cl.loadClass(servletClassName);
-
- isAServlet = JavaUtils.isAssignableFrom(javax.servlet.Servlet.class,
servletClass);
-
- if (isAServlet == true)
- {
- log.info("Ignore servlet: " + servletClassName);
- }
- }
- catch (ClassNotFoundException e)
- {
- log.warn("Cannot load servlet class: " + servletClassName);
- }
-
- }
-
- return isAServlet;
- }
-
- private boolean isAlreadyModified(Servlet servlet)
- {
- Iterator itParams = servlet.getInitParams().iterator();
- while (itParams.hasNext())
- {
- NameValuePair pair = (NameValuePair)itParams.next();
- if (Endpoint.SEPID_DOMAIN_ENDPOINT.equals(pair.getName()))
- return true;
- }
- return false;
- }
-}
Added:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/AbstractWebServiceDeployer.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/AbstractWebServiceDeployer.java
(rev 0)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/AbstractWebServiceDeployer.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -0,0 +1,72 @@
+/*
+ * 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.ws.integration.jboss50;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import org.jboss.deployers.plugins.deployer.AbstractSimpleDeployer;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.DeploymentUnit;
+import org.jboss.logging.Logger;
+
+//$Id$
+
+/**
+ * This deployer that calls the registered DeployerHooks
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 24-Apr-2007
+ */
+public abstract class AbstractWebServiceDeployer extends AbstractSimpleDeployer
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(AbstractWebServiceDeployer.class);
+
+ private List<DeployerHook> deployerHooks = new
LinkedList<DeployerHook>();
+
+ public void addDeployerHook(DeployerHook deployer)
+ {
+ log.debug("Add deployer hook: " + deployer);
+ deployerHooks.add(deployer);
+ }
+
+ public void removeDeployerHook(DeployerHook deployer)
+ {
+ log.debug("Remove deployer hook: " + deployer);
+ deployerHooks.remove(deployer);
+ }
+
+ @Override
+ public void deploy(DeploymentUnit unit) throws DeploymentException
+ {
+ for (DeployerHook deployer : deployerHooks)
+ deployer.deploy(unit);
+ }
+
+ @Override
+ public void undeploy(DeploymentUnit unit)
+ {
+ for (DeployerHook deployer : deployerHooks)
+ deployer.undeploy(unit);
+ }
+}
Property changes on:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/AbstractWebServiceDeployer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ApplicationMetaDataAdaptor.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ApplicationMetaDataAdaptor.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ApplicationMetaDataAdaptor.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,163 +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.ws.integration.jboss50;
-
-// $Id$
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
-import org.jboss.logging.Logger;
-import org.jboss.metadata.ApplicationMetaData;
-import org.jboss.metadata.BeanMetaData;
-import org.jboss.metadata.EjbPortComponentMetaData;
-import org.jboss.metadata.MessageDrivenMetaData;
-import org.jboss.metadata.SessionMetaData;
-import org.jboss.metadata.ApplicationMetaData.WebserviceDescription;
-import org.jboss.metadata.ApplicationMetaData.Webservices;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-import org.jboss.ws.metadata.j2ee.UnifiedApplicationMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedBeanMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedEjbPortComponentMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedMessageDrivenMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedSessionMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedApplicationMetaData.PublishLocationAdapter;
-
-/**
- * Build container independent application meta data
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class ApplicationMetaDataAdaptor
-{
- // logging support
- private static Logger log = Logger.getLogger(ApplicationMetaDataAdaptor.class);
-
- public static UnifiedApplicationMetaData
buildUnifiedApplicationMetaData(UnifiedDeploymentInfo udi, DeploymentUnit unit)
- {
- ApplicationMetaData appMetaData = unit.getAttachment(ApplicationMetaData.class);
- udi.addAttachment(ApplicationMetaData.class, appMetaData);
-
- UnifiedApplicationMetaData umd = new UnifiedApplicationMetaData();
- buildUnifiedBeanMetaData(umd, appMetaData);
- buildWebservicesMetaData(umd, appMetaData);
- umd.setSecurityDomain(appMetaData.getSecurityDomain());
- return umd;
- }
-
- private static void buildWebservicesMetaData(UnifiedApplicationMetaData umd,
ApplicationMetaData apmd)
- {
- Webservices webservices = apmd.getWebservices();
- if (webservices != null)
- {
- String contextRoot = webservices.getContextRoot();
- umd.setPublishLocationAdapter(getPublishLocationAdpater(webservices));
-
- List<WebserviceDescription> wsDescriptions =
webservices.getWebserviceDescriptions();
- if (wsDescriptions.size() > 1)
- log.warn("Multiple <webservice-description> elements not
supported");
-
- if (wsDescriptions.size() > 0)
- {
- WebserviceDescription wsd = wsDescriptions.get(0);
- umd.setConfigName(wsd.getConfigName());
- umd.setConfigFile(wsd.getConfigFile());
- }
-
- umd.setWebServiceContextRoot(contextRoot);
- }
- }
-
- private static PublishLocationAdapter getPublishLocationAdpater(final Webservices
webservices)
- {
- return new PublishLocationAdapter()
- {
- public String getWsdlPublishLocationByName(String name)
- {
- String wsdlPublishLocation = null;
- for (WebserviceDescription wsd : webservices.getWebserviceDescriptions())
- {
- if (wsd.getDescriptionName().equals(name))
- {
- wsdlPublishLocation = wsd.getWsdlPublishLocation();
- }
- }
- return wsdlPublishLocation;
- }
- };
- }
-
- private static void buildUnifiedBeanMetaData(UnifiedApplicationMetaData umd,
ApplicationMetaData appMetaData)
- {
- List<UnifiedBeanMetaData> beans = new
ArrayList<UnifiedBeanMetaData>();
- Iterator it = appMetaData.getEnterpriseBeans();
- while (it.hasNext())
- {
- BeanMetaData bmd = (BeanMetaData)it.next();
- buildUnifiedBeanMetaData(beans, bmd);
- }
- umd.setEnterpriseBeans(beans);
- }
-
- private static UnifiedBeanMetaData
buildUnifiedBeanMetaData(List<UnifiedBeanMetaData> beans, BeanMetaData bmd)
- {
- UnifiedBeanMetaData ubmd = null;
- if (bmd instanceof SessionMetaData)
- {
- ubmd = new UnifiedSessionMetaData();
- }
- else if (bmd instanceof MessageDrivenMetaData)
- {
- ubmd = new UnifiedMessageDrivenMetaData();
-
((UnifiedMessageDrivenMetaData)ubmd).setDestinationJndiName(((MessageDrivenMetaData)bmd).getDestinationJndiName());
- }
-
- if (ubmd != null)
- {
- ubmd.setEjbName(bmd.getEjbName());
- ubmd.setEjbClass(bmd.getEjbClass());
- ubmd.setServiceEndpointInterface(bmd.getServiceEndpoint());
- ubmd.setHome(bmd.getHome());
- ubmd.setLocalHome(bmd.getLocalHome());
- ubmd.setJndiName(bmd.getJndiName());
- ubmd.setLocalJndiName(bmd.getLocalJndiName());
-
- EjbPortComponentMetaData pcmd = bmd.getPortComponent();
- if (pcmd != null)
- {
- UnifiedEjbPortComponentMetaData upcmd = new
UnifiedEjbPortComponentMetaData();
- upcmd.setPortComponentName(pcmd.getPortComponentName());
- upcmd.setPortComponentURI(pcmd.getPortComponentURI());
- upcmd.setAuthMethod(pcmd.getAuthMethod());
- upcmd.setTransportGuarantee(pcmd.getTransportGuarantee());
- upcmd.setSecureWSDLAccess(pcmd.getSecureWSDLAccess());
- ubmd.setPortComponent(upcmd);
- }
-
- beans.add(ubmd);
- }
- return ubmd;
- }
-}
Deleted:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ApplicationMetaDataAdaptorEJB3.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ApplicationMetaDataAdaptorEJB3.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ApplicationMetaDataAdaptorEJB3.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,167 +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.ws.integration.jboss50;
-
-// $Id$
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
-import org.jboss.ejb3.Container;
-import org.jboss.ejb3.EJBContainer;
-import org.jboss.ejb3.Ejb3Deployment;
-import org.jboss.ejb3.SessionContainer;
-import org.jboss.ejb3.mdb.MessagingContainer;
-import org.jboss.ejb3.metamodel.Ejb3PortComponent;
-import org.jboss.ejb3.metamodel.EjbJarDD;
-import org.jboss.ejb3.metamodel.EnterpriseBean;
-import org.jboss.ejb3.metamodel.WebserviceDescription;
-import org.jboss.ejb3.metamodel.Webservices;
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-import org.jboss.ws.metadata.j2ee.UnifiedApplicationMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedBeanMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedEjbPortComponentMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedMessageDrivenMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedSessionMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedApplicationMetaData.PublishLocationAdapter;
-
-/**
- * Build container independent application meta data
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 14-Apr-2007
- */
-public class ApplicationMetaDataAdaptorEJB3
-{
- // logging support
- private static Logger log = Logger.getLogger(ApplicationMetaDataAdaptorEJB3.class);
-
- public static UnifiedApplicationMetaData
buildUnifiedApplicationMetaData(UnifiedDeploymentInfo udi, DeploymentUnit unit)
- {
- Ejb3Deployment ejb3Deployment = unit.getAttachment(Ejb3Deployment.class);
- udi.addAttachment(Ejb3Deployment.class, ejb3Deployment);
-
- EjbJarDD jarDD = unit.getAttachment(EjbJarDD.class);
- UnifiedApplicationMetaData umd = new UnifiedApplicationMetaData();
- buildUnifiedBeanMetaData(umd, ejb3Deployment);
- buildWebservicesMetaData(umd, jarDD);
- return umd;
- }
-
- private static void buildWebservicesMetaData(UnifiedApplicationMetaData umd, EjbJarDD
jarDD)
- {
- // nothing to do
- if (jarDD == null)
- return;
-
- Webservices webservices = jarDD.getWebservices();
- if (webservices != null)
- {
- String contextRoot = webservices.getContextRoot();
- umd.setPublishLocationAdapter(getPublishLocationAdpater(webservices));
-
- List<WebserviceDescription> wsDescriptions =
webservices.getWebserviceDescriptions();
- if (wsDescriptions.size() > 1)
- log.warn("Multiple <webservice-description> elements not
supported");
-
- if (wsDescriptions.size() > 0)
- {
- WebserviceDescription wsd = wsDescriptions.get(0);
- umd.setConfigName(wsd.getConfigName());
- umd.setConfigFile(wsd.getConfigFile());
-
- // com/sun/ts/tests/webservices12/ejb/annotations/WSEjbWebServiceRefTest1
- // WSEjbWebServiceRefTest1VerifyTargetEndpointAddress
- if (contextRoot == null)
- contextRoot = "/" + wsd.getDescriptionName();
- }
-
- umd.setWebServiceContextRoot(contextRoot);
- }
- }
-
- private static void buildUnifiedBeanMetaData(UnifiedApplicationMetaData umd,
Ejb3Deployment ejb3Deployment)
- {
- List<UnifiedBeanMetaData> ubmdList = new
ArrayList<UnifiedBeanMetaData>();
- Iterator<Container> it =
ejb3Deployment.getEjbContainers().values().iterator();
- while (it.hasNext())
- {
- EJBContainer container = (EJBContainer)it.next();
- UnifiedBeanMetaData ubmd = null;
- if (container instanceof SessionContainer)
- {
- ubmd = new UnifiedSessionMetaData();
- }
- else if (container instanceof MessagingContainer)
- {
- ubmd = new UnifiedMessageDrivenMetaData();
- log.warn("No implemented: initialize MDB destination");
-
//((UnifiedMessageDrivenMetaData)ubmd).setDestinationJndiName(((MessagingContainer)container).getDestination());
- }
-
- if (ubmd != null)
- {
- ubmd.setEjbName(container.getEjbName());
- ubmd.setEjbClass(container.getBeanClassName());
-
- EnterpriseBean bean = container.getXml();
- Ejb3PortComponent pcMetaData = (bean != null ? bean.getPortComponent() :
null);
- if (pcMetaData != null)
- {
- UnifiedEjbPortComponentMetaData ejbPortComp = new
UnifiedEjbPortComponentMetaData();
- ejbPortComp.setPortComponentName(pcMetaData.getPortComponentName());
- ejbPortComp.setPortComponentURI(pcMetaData.getPortComponentURI());
- ejbPortComp.setAuthMethod(pcMetaData.getAuthMethod());
- ejbPortComp.setTransportGuarantee(pcMetaData.getTransportGuarantee());
- ejbPortComp.setSecureWSDLAccess(pcMetaData.getSecureWSDLAccess());
-
- ubmd.setPortComponent(ejbPortComp);
- }
-
- ubmdList.add(ubmd);
- }
- }
- umd.setEnterpriseBeans(ubmdList);
- }
-
- private static PublishLocationAdapter getPublishLocationAdpater(final Webservices
webservices)
- {
- return new PublishLocationAdapter()
- {
- public String getWsdlPublishLocationByName(String name)
- {
- String wsdlPublishLocation = null;
- for (WebserviceDescription wsd : webservices.getWebserviceDescriptions())
- {
- if (wsd.getDescriptionName().equals(name))
- {
- wsdlPublishLocation = wsd.getWsdlPublishLocation();
- }
- }
- return wsdlPublishLocation;
- }
- };
- }
-}
Deleted:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/DeploymentInfoAdaptor.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/DeploymentInfoAdaptor.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/DeploymentInfoAdaptor.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,99 +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.ws.integration.jboss50;
-
-import java.net.URL;
-import java.net.URLClassLoader;
-
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
-import org.jboss.ejb3.Ejb3Deployment;
-import org.jboss.logging.Logger;
-import org.jboss.metadata.ApplicationMetaData;
-import org.jboss.metadata.WebMetaData;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-
-// $Id$
-
-/**
- * Build container independent deployment info.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class DeploymentInfoAdaptor
-{
- // logging support
- private static Logger log = Logger.getLogger(DeploymentInfoAdaptor.class);
-
- public static void buildDeploymentInfo(UnifiedDeploymentInfo udi, DeploymentUnit
unit)
- {
- try
- {
- if (unit.getDeploymentContext().getParent() != null)
- {
- udi.parent = new UnifiedDeploymentInfo(null);
- buildDeploymentInfo(udi.parent,
unit.getDeploymentContext().getParent().getDeploymentUnit());
- }
-
- udi.vfRoot = new VirtualFileAdaptor(unit.getDeploymentContext().getRoot());
-
- udi.name = unit.getName();
- udi.simpleName = unit.getSimpleName();
- udi.url = udi.vfRoot.toURL();
-
- buildMetaData(udi, unit);
-
- // Since we create temporary classes, we need to create a delegate loader
- // This prevents CCE problems where the parent loader is available at deploy
time,
- // and a child loader is available at start time.
- udi.classLoader = new URLClassLoader(new URL[] {}, unit.getClassLoader());
-
- log.debug("UnifiedDeploymentInfo:\n" + udi);
- }
- catch (Exception ex)
- {
- WSException.rethrow(ex.getMessage(), ex);
- }
- }
-
- private static void buildMetaData(UnifiedDeploymentInfo udi, DeploymentUnit unit)
throws Exception
- {
- if (unit.getAttachment(Ejb3Deployment.class) != null)
- {
- udi.metaData =
ApplicationMetaDataAdaptorEJB3.buildUnifiedApplicationMetaData(udi, unit);
- }
- else if (unit.getAttachment(ApplicationMetaData.class) != null)
- {
- udi.metaData = ApplicationMetaDataAdaptor.buildUnifiedApplicationMetaData(udi,
unit);
- }
- else if (unit.getAttachment(WebMetaData.class) != null)
- {
- udi.metaData = WebMetaDataAdaptor.buildUnifiedWebMetaData(udi, unit);
- udi.webappURL = udi.vfRoot.toURL();
- }
- else
- {
- throw new IllegalStateException("Cannot build meta data");
- }
- }
-}
Deleted:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerEJB21.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerEJB21.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerEJB21.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,92 +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.ws.integration.jboss50;
-
-//$Id$
-
-import java.io.IOException;
-
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
-import org.jboss.metadata.ApplicationMetaData;
-import org.jboss.virtual.VirtualFile;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-import org.jboss.ws.core.utils.DOMUtils;
-import org.jboss.ws.integration.deployment.Deployment.DeploymentType;
-import org.jboss.ws.metadata.builder.jaxrpc.JAXRPCDeployment;
-import org.w3c.dom.Element;
-
-/**
- * A deployer JAXRPC EJB21 Endpoints
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 06-Jan-2007
- */
-public class JAXRPCDeployerEJB21 extends AbstractDeployerEJB
-{
- private static final String WEBSERVICES_XML = "webservices.xml";
-
- @Override
- protected DeploymentType getDeploymentType()
- {
- return DeploymentType.JAXRPC_EJB21;
- }
-
- @Override
- protected UnifiedDeploymentInfo createUnifiedDeploymentInfo(DeploymentUnit unit)
throws DeploymentException
- {
- VirtualFileAdaptor vfWebservices = new
VirtualFileAdaptor(getWebServicesFile(unit));
- UnifiedDeploymentInfo udi = new JAXRPCDeployment(getDeploymentType(),
vfWebservices);
- DeploymentInfoAdaptor.buildDeploymentInfo(udi, unit);
- return udi;
- }
-
- @Override
- public boolean isWebServiceDeployment(DeploymentUnit unit)
- {
- boolean isWebserviceDeployment =
unit.getAllMetaData(ApplicationMetaData.class).size() > 0;
- isWebserviceDeployment = (isWebserviceDeployment &&
getWebServicesFile(unit) != null);
-
- if(isWebserviceDeployment)
- {
- // verify the DD namespace
- try
- {
- Element root = DOMUtils.parse(
unit.getMetaDataFile(WEBSERVICES_XML).openStream() );
- isWebserviceDeployment = (isWebserviceDeployment &&
root.getNamespaceURI().equals("http://java.sun.com/xml/ns/j2ee"));
- }
- catch (IOException e)
- {
- throw new IllegalArgumentException("Failed to parse
webservice.xml", e);
- }
- }
-
- return isWebserviceDeployment;
-
- }
-
- private VirtualFile getWebServicesFile(DeploymentUnit unit)
- {
- VirtualFile vfile = unit.getMetaDataFile("webservices.xml");
- return vfile;
- }
-}
\ No newline at end of file
Deleted:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerJSE.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerJSE.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerJSE.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,92 +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.ws.integration.jboss50;
-
-//$Id$
-
-import java.io.IOException;
-
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
-import org.jboss.metadata.WebMetaData;
-import org.jboss.virtual.VirtualFile;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-import org.jboss.ws.core.utils.DOMUtils;
-import org.jboss.ws.integration.UnifiedVirtualFile;
-import org.jboss.ws.integration.deployment.Deployment.DeploymentType;
-import org.jboss.ws.metadata.builder.jaxrpc.JAXRPCDeployment;
-import org.w3c.dom.Element;
-
-/**
- * A deployer JAXRPC JSE Endpoints
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 31-Oct-2005
- */
-public class JAXRPCDeployerJSE extends AbstractDeployerJSE
-{
- private static final String WEBSERVICES_XML = "webservices.xml";
-
- @Override
- protected DeploymentType getDeploymentType()
- {
- return DeploymentType.JAXRPC_JSE;
- }
-
- @Override
- protected UnifiedDeploymentInfo createUnifiedDeploymentInfo(DeploymentUnit unit)
throws DeploymentException
- {
- UnifiedVirtualFile vfWebservices = getWebServicesFile(unit);
- UnifiedDeploymentInfo udi = new JAXRPCDeployment(getDeploymentType(),
vfWebservices);
- DeploymentInfoAdaptor.buildDeploymentInfo(udi, unit);
- return udi;
- }
-
- @Override
- public boolean isWebServiceDeployment(DeploymentUnit unit)
- {
- boolean isWebserviceDeployment = unit.getAllMetaData(WebMetaData.class).size() >
0;
- isWebserviceDeployment = (isWebserviceDeployment &&
getWebServicesFile(unit) != null);
-
- if(isWebserviceDeployment)
- {
- // verify the DD namespace
- try
- {
- Element root = DOMUtils.parse(
unit.getMetaDataFile(WEBSERVICES_XML).openStream() );
- isWebserviceDeployment = (isWebserviceDeployment &&
root.getNamespaceURI().equals("http://java.sun.com/xml/ns/j2ee"));
- }
- catch (IOException e)
- {
- throw new IllegalArgumentException("Failed to parse
webservice.xml", e);
- }
- }
-
- return isWebserviceDeployment;
- }
-
- private UnifiedVirtualFile getWebServicesFile(DeploymentUnit unit)
- {
- VirtualFile vfile = unit.getMetaDataFile(WEBSERVICES_XML);
- return vfile != null ? new VirtualFileAdaptor(vfile) : null;
- }
-}
Deleted:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/JAXWSDeployerEJB3.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/JAXWSDeployerEJB3.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/JAXWSDeployerEJB3.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,96 +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.ws.integration.jboss50;
-
-//$Id$
-
-import java.util.Iterator;
-
-import javax.jws.WebService;
-import javax.xml.ws.WebServiceProvider;
-
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
-import org.jboss.ejb3.EJBContainer;
-import org.jboss.ejb3.Ejb3Deployment;
-import org.jboss.ejb3.stateless.StatelessContainer;
-import org.jboss.ws.core.server.JAXWSDeployment;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-import org.jboss.ws.integration.deployment.Deployment.DeploymentType;
-
-/**
- * A deployer JAXWS EJB3 Endpoints
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 31-Oct-2005
- */
-public class JAXWSDeployerEJB3 extends AbstractDeployerEJB
-{
- @Override
- protected DeploymentType getDeploymentType()
- {
- return DeploymentType.JAXWS_EJB3;
- }
-
- @Override
- protected UnifiedDeploymentInfo createUnifiedDeploymentInfo(DeploymentUnit unit)
throws DeploymentException
- {
- UnifiedDeploymentInfo udi = new JAXWSDeployment(getDeploymentType());
- DeploymentInfoAdaptor.buildDeploymentInfo(udi, unit);
- return udi;
- }
-
- @Override
- public boolean isWebServiceDeployment(DeploymentUnit unit)
- {
- boolean isWebServiceDeployment = false;
-
- Ejb3Deployment ejb3Deployment = unit.getAttachment(Ejb3Deployment.class);
- if (ejb3Deployment != null)
- {
- Iterator it = ejb3Deployment.getEjbContainers().values().iterator();
- while (it.hasNext())
- {
- EJBContainer container = (EJBContainer)it.next();
- if (isWebServiceBean(container))
- {
- isWebServiceDeployment = true;
- break;
- }
- }
- }
-
- return isWebServiceDeployment;
- }
-
- private boolean isWebServiceBean(EJBContainer container)
- {
- boolean isWebServiceBean = false;
- if (container instanceof StatelessContainer)
- {
- boolean isWebService = container.resolveAnnotation(WebService.class) != null;
- boolean isWebServiceProvider =
container.resolveAnnotation(WebServiceProvider.class) != null;
- isWebServiceBean = isWebService || isWebServiceProvider;
- }
- return isWebServiceBean;
- }
-}
\ No newline at end of file
Deleted:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/JAXWSDeployerJSE.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/JAXWSDeployerJSE.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/JAXWSDeployerJSE.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,108 +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.ws.integration.jboss50;
-
-//$Id$
-
-import java.util.Iterator;
-import java.util.Set;
-
-import javax.jws.WebService;
-import javax.xml.ws.WebServiceProvider;
-
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
-import org.jboss.metadata.WebMetaData;
-import org.jboss.metadata.web.Servlet;
-import org.jboss.ws.core.server.JAXWSDeployment;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-import org.jboss.ws.integration.deployment.Deployment.DeploymentType;
-
-/**
- * A deployer JAXWS JSE Endpoints
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 31-Oct-2005
- */
-public class JAXWSDeployerJSE extends AbstractDeployerJSE
-{
- @Override
- protected DeploymentType getDeploymentType()
- {
- return DeploymentType.JAXWS_JSE;
- }
-
- @Override
- public boolean isWebServiceDeployment(DeploymentUnit unit)
- {
- boolean isWebServiceDeployment = false;
-
- Set<? extends WebMetaData> allMetaData =
unit.getAllMetaData(WebMetaData.class);
- if (allMetaData.size() > 0)
- {
- WebMetaData webMetaData = allMetaData.iterator().next();
- try
- {
- Iterator it = webMetaData.getServlets().iterator();
- while (it.hasNext())
- {
- Servlet servlet = (Servlet)it.next();
- String servletClass = servlet.getServletClass();
-
- // Skip JSPs
- if (servletClass == null)
- continue;
-
- try
- {
- ClassLoader loader = unit.getClassLoader();
- Class<?> epBean = loader.loadClass(servletClass.trim());
-
- if (epBean.isAnnotationPresent(WebService.class) ||
epBean.isAnnotationPresent(WebServiceProvider.class))
- {
- isWebServiceDeployment = true;
- break;
- }
- }
- catch (ClassNotFoundException ex)
- {
- log.warn("Cannot load servlet class: " + servletClass);
- }
- }
- }
- catch (Exception ex)
- {
- log.error("Cannot process web deployment", ex);
- }
- }
-
- return isWebServiceDeployment;
- }
-
- @Override
- protected UnifiedDeploymentInfo createUnifiedDeploymentInfo(DeploymentUnit unit)
throws DeploymentException
- {
- UnifiedDeploymentInfo udi = new JAXWSDeployment(getDeploymentType());
- DeploymentInfoAdaptor.buildDeploymentInfo(udi, unit);
- return udi;
- }
-}
\ No newline at end of file
Deleted:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/JBossContextServlet.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/JBossContextServlet.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/JBossContextServlet.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,46 +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.ws.integration.jboss50;
-
-// $Id$
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.CommonContextServlet;
-import org.jboss.ws.core.server.ServiceEndpointManagerFactory;
-
-/**
- * The servlet that that is associated with context /jbossws
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 21-Mar-2005
- */
-public class JBossContextServlet extends CommonContextServlet
-{
- // provide logging
- protected final Logger log = Logger.getLogger(JBossContextServlet.class);
-
- protected void initServiceEndpointManager()
- {
- ServiceEndpointManagerFactory factory =
ServiceEndpointManagerFactory.getInstance();
- epManager = factory.getServiceEndpointManager();
- }
-}
Deleted:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/JBossHttpServer.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/JBossHttpServer.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/JBossHttpServer.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,231 +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.ws.integration.jboss50;
-
-//$Id$
-
-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 org.jboss.ws.WSException;
-import org.jboss.ws.core.server.HttpContext;
-import org.jboss.ws.core.server.HttpServer;
-import org.jboss.ws.core.server.ServerConfig;
-import org.jboss.ws.core.server.ServerConfigFactory;
-import org.jboss.ws.core.utils.DOMUtils;
-import org.jboss.ws.core.utils.DOMWriter;
-import org.w3c.dom.Element;
-
-/**
- * A Tomcat HTTP Server
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 07-Jul-2006
- */
-public class JBossHttpServer extends HttpServer
-{
- private static final String MAIN_DEPLOYER =
"jboss.system:service=MainDeployer";
-
- /** Start an instance of this HTTP server */
- @Override
- public void start()
- {
- // verify required properties
- }
-
- /** Create an HTTP context */
- public HttpContext createContext(String contextRoot)
- {
- return new HttpContext(this, contextRoot);
- }
-
- /** Publish an JAXWS endpoint to the HTTP server */
- @Override
- 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
- {
- ServerConfigFactory factory = ServerConfigFactory.getInstance();
- ServerConfig serverConfig = factory.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 WSException("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 WSException(ex);
- }
- }
-
- /** Destroys an JAXWS endpoint on the HTTP server */
- @Override
- 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 WSException(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 WSException("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;
- }
-}
-
Deleted:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/JBossServiceEndpointServlet.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/JBossServiceEndpointServlet.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/JBossServiceEndpointServlet.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,69 +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.ws.integration.jboss50;
-
-// $Id$
-
-import javax.servlet.ServletContext;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.server.AbstractServiceEndpointServlet;
-import org.jboss.ws.core.server.ServiceEndpoint;
-import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
-
-/**
- * A servlet that is installed for every web service endpoint.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 16-May-2006
- */
-public class JBossServiceEndpointServlet extends AbstractServiceEndpointServlet
-{
- // provide logging
- private static final Logger log =
Logger.getLogger(JBossServiceEndpointServlet.class);
-
- /** Initialize the service endpoint
- */
- protected void initServiceEndpoint(String contextPath)
- {
- super.initServiceEndpoint(contextPath);
-
- ServiceEndpoint wsEndpoint = epManager.getServiceEndpointByID(sepId);
- if (wsEndpoint == null)
- throw new WSException("Cannot obtain endpoint for: " + sepId);
-
- // read the config name/file from web.xml
- ServletContext ctx = getServletContext();
- String configName = ctx.getInitParameter("jbossws-config-name");
- String configFile = ctx.getInitParameter("jbossws-config-file");
- if (configName != null || configFile != null)
- {
- log.debug("Updating service endpoint config\n config-name: " +
configName + "\n config-file: " + configFile);
- ServerEndpointMetaData sepMetaData =
wsEndpoint.getServiceEndpointInfo().getServerEndpointMetaData();
-
- sepMetaData.setConfigName(configName, configFile);
-
- log.debug("Updated server meta data" + sepMetaData);
- }
- }
-}
Deleted:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/PortComponentLinkServlet.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/PortComponentLinkServlet.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/PortComponentLinkServlet.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,93 +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.ws.integration.jboss50;
-
-// $Id$
-
-import java.io.IOException;
-import java.io.PrintWriter;
-
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.server.ServiceEndpoint;
-import org.jboss.ws.core.server.ServiceEndpointManager;
-import org.jboss.ws.core.server.ServiceEndpointManagerFactory;
-
-/**
- * A servlet that reports the serviceURL for a given service ID.
- * <p/>
- * When the web service client ENC is setup, it may contain port-component-link
- * entries that point to service endpoints in the same top level deployment.
- * The final serviceURL of those endpoints will become available after the
- * reference to the javax.xml.rpc.Service is bound to JNDI.
- * <p/>
- * When the client does a lookup of the javax.xml.rpc.Service from JNDI the
ObjectFactory
- * will contact this servlet for the final serviceURL. It is acceptable that the client
- * wsdl does not contain the correct serviceURL if the client is using the
port-component-link element.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 29-May-2004
- */
-public class PortComponentLinkServlet extends HttpServlet
-{
- // provide logging
- private static final Logger log = Logger.getLogger(PortComponentLinkServlet.class);
-
- protected ServiceEndpointManager epManager;
-
- public void init(ServletConfig config) throws ServletException
- {
- super.init(config);
- ServiceEndpointManagerFactory factory =
ServiceEndpointManagerFactory.getInstance();
- epManager = factory.getServiceEndpointManager();
- }
-
- /**
- * Get the serviceURL as string for a given serviceID.
- */
- public void doGet(HttpServletRequest req, HttpServletResponse res) throws
ServletException, IOException
- {
- String pcLink = req.getParameter("pcLink");
- if (pcLink == null)
- throw new IllegalArgumentException("Cannot obtain request parameter
'pcLink'");
-
- ServiceEndpoint serviceEndpoint = epManager.resolvePortComponentLink(pcLink);
- ;
- if (serviceEndpoint == null)
- throw new WSException("Cannot resolve port-component-link: " +
pcLink);
-
- res.setContentType("text/plain");
- PrintWriter out = res.getWriter();
-
- String endpointAddress =
serviceEndpoint.getServiceEndpointInfo().getServerEndpointMetaData().getEndpointAddress();
- out.println(endpointAddress);
-
- log.debug("Resolved " + pcLink + " to: " + endpointAddress);
- out.close();
- }
-}
Deleted:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/SecurityAssociationAdaptorFactoryImpl.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/SecurityAssociationAdaptorFactoryImpl.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/SecurityAssociationAdaptorFactoryImpl.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,57 +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.ws.integration.jboss50;
-
-// $Id$
-
-import java.security.Principal;
-
-import org.jboss.security.SecurityAssociation;
-import org.jboss.ws.extensions.security.SecurityAssociationAdaptor;
-import org.jboss.ws.extensions.security.SecurityAssociationAdaptorFactory;
-
-/**
- * A JBoss specific SecurityAdaptorFactory
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class SecurityAssociationAdaptorFactoryImpl implements
SecurityAssociationAdaptorFactory
-{
- public SecurityAssociationAdaptor getSecurityAssociationAdaptor()
- {
- return new SecurityAccociationAdaptorImpl();
- }
-
- public class SecurityAccociationAdaptorImpl implements SecurityAssociationAdaptor
- {
- public void setPrincipal(Principal pricipal)
- {
- SecurityAssociation.setPrincipal(pricipal);
- }
-
- public void setCredential(Object credential)
- {
- SecurityAssociation.setCredential(credential);
- }
- }
-}
Deleted:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServerConfigImpl.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServerConfigImpl.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServerConfigImpl.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,148 +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.ws.integration.jboss50;
-
-//$Id$
-
-import java.io.File;
-import java.util.Set;
-
-import javax.management.AttributeNotFoundException;
-import javax.management.JMException;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-
-import org.jboss.logging.Logger;
-import org.jboss.mx.util.MBeanServerLocator;
-import org.jboss.ws.core.server.ServerConfig;
-import org.jboss.ws.integration.ObjectNameFactory;
-
-/**
- * JBoss specific implementation of a ServerConfig
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author darran.lofthouse(a)jboss.com
- * @since 08-May-2006
- */
-public class ServerConfigImpl implements ServerConfig
-{
- private static final Logger log = Logger.getLogger(ServerConfigImpl.class);
-
- public File getServerTempDir()
- {
- try
- {
- MBeanServer server = MBeanServerLocator.locateJBoss();
- ObjectName oname =
ObjectNameFactory.create("jboss.system:type=ServerConfig");
- File tmpdir = (File)server.getAttribute(oname, "ServerTempDir");
- return tmpdir;
- }
- catch (JMException e)
- {
- return null;
- }
- }
-
- public File getServerDataDir()
- {
- try
- {
- MBeanServer server = MBeanServerLocator.locateJBoss();
- ObjectName oname =
ObjectNameFactory.create("jboss.system:type=ServerConfig");
- File tmpdir = (File)server.getAttribute(oname, "ServerDataDir");
- return tmpdir;
- }
- catch (JMException e)
- {
- return null;
- }
- }
-
- public int getWebServicePort()
- {
- int port = getConnectorPort("HTTP/1.1", false);
- if (port > -1)
- {
- return port;
- }
-
- log.warn("Unable to calculate 'WebServicePort', using default
'8080'");
- return 8080;
- }
-
- public int getWebServiceSecurePort()
- {
- int port = getConnectorPort("HTTP/1.1", true);
- if (port > -1)
- {
- return port;
- }
-
- log.warn("Unable to calculate 'WebServiceSecurePort', using default
'8443'");
- return 8443;
- }
-
- private int getConnectorPort(final String protocol, final boolean secure)
- {
- int port = -1;
-
- try
- {
- MBeanServer server = MBeanServerLocator.locateJBoss();
- ObjectName connectors = new ObjectName("jboss.web:type=Connector,*");
-
- Set connectorNames = server.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");
-
- if (protocol.equals(connectorProtocol) && secure ==
connectorSecure)
- {
- if (port > -1)
- {
- log.warn("Found multiple connectors for protocol='" +
protocol + "' and secure='" + secure + "', using first port
found '" + port + "'");
- }
- else
- {
- port = connectorPort;
- }
- }
- }
- catch (AttributeNotFoundException ignored)
- {
- }
- }
-
- return port;
- }
- catch (JMException e)
- {
- return -1;
- }
- }
-}
Deleted:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceEndpointGeneratorEJB21.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceEndpointGeneratorEJB21.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceEndpointGeneratorEJB21.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,70 +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.ws.integration.jboss50;
-
-//$Id$
-
-import java.util.Iterator;
-import java.util.Map;
-
-import org.jboss.logging.Logger;
-import org.jboss.metadata.ApplicationMetaData;
-import org.jboss.metadata.AssemblyDescriptorMetaData;
-import org.jboss.ws.core.server.ServiceEndpointGeneratorEJB;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-import org.jboss.ws.core.utils.DOMUtils;
-import org.w3c.dom.Element;
-
-/**
- * Generate a service endpoint deployment for EJB endpoints
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 12-May-2006
- */
-public class ServiceEndpointGeneratorEJB21 extends ServiceEndpointGeneratorEJB
-{
- // logging support
- protected Logger log = Logger.getLogger(ServiceEndpointGeneratorEJB21.class);
-
- /** Add the roles from ejb-jar.xml to the security roles
- */
- protected void addEJBSecurityRoles(Element webApp, UnifiedDeploymentInfo udi)
- {
- // Fix:
http://jira.jboss.org/jira/browse/JBWS-309
- ApplicationMetaData applMetaData =
(ApplicationMetaData)udi.getAttachment(ApplicationMetaData.class);
- AssemblyDescriptorMetaData assemblyDescriptor =
applMetaData.getAssemblyDescriptor();
- if (assemblyDescriptor != null)
- {
- Map securityRoles = assemblyDescriptor.getSecurityRoles();
- if (securityRoles != null)
- {
- Iterator it = securityRoles.keySet().iterator();
- while (it.hasNext())
- {
- Element securityRole =
(Element)webApp.appendChild(DOMUtils.createElement("security-role"));
- Element roleName =
(Element)securityRole.appendChild(DOMUtils.createElement("role-name"));
- roleName.appendChild(DOMUtils.createTextNode((String)it.next()));
- }
- }
- }
- }
-}
Deleted:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceEndpointGeneratorEJB3.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceEndpointGeneratorEJB3.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceEndpointGeneratorEJB3.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,73 +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.ws.integration.jboss50;
-
-//$Id$
-
-import java.util.Iterator;
-
-import javax.annotation.security.RolesAllowed;
-
-import org.jboss.ejb3.EJBContainer;
-import org.jboss.ejb3.Ejb3Deployment;
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.server.ServiceEndpointGeneratorEJB;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-import org.jboss.ws.core.utils.DOMUtils;
-import org.w3c.dom.Element;
-
-/**
- * Generate a service endpoint deployment for EJB endpoints
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 12-May-2006
- */
-public class ServiceEndpointGeneratorEJB3 extends ServiceEndpointGeneratorEJB
-{
- // logging support
- protected Logger log = Logger.getLogger(ServiceEndpointGeneratorEJB3.class);
-
- /** Add the roles from ejb-jar.xml to the security roles
- */
- protected void addEJBSecurityRoles(Element webApp, UnifiedDeploymentInfo udi)
- {
- Ejb3Deployment ejb3Deployment = udi.getAttachment(Ejb3Deployment.class);
- if (ejb3Deployment != null)
- {
- Iterator it = ejb3Deployment.getEjbContainers().values().iterator();
- while (it.hasNext())
- {
- EJBContainer container = (EJBContainer)it.next();
- RolesAllowed anRolesAllowed =
(RolesAllowed)container.resolveAnnotation(RolesAllowed.class);
- if (anRolesAllowed != null)
- {
- for (String role : anRolesAllowed.value())
- {
- Element securityRole =
(Element)webApp.appendChild(DOMUtils.createElement("security-role"));
- Element roleName =
(Element)securityRole.appendChild(DOMUtils.createElement("role-name"));
- roleName.appendChild(DOMUtils.createTextNode(role));
- }
- }
- }
- }
- }
-}
Deleted:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceEndpointInterceptor.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceEndpointInterceptor.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceEndpointInterceptor.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,145 +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.ws.integration.jboss50;
-
-// $Id$
-
-import javax.xml.soap.SOAPMessage;
-
-import org.jboss.ejb.plugins.AbstractInterceptor;
-import org.jboss.invocation.Invocation;
-import org.jboss.invocation.InvocationKey;
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.CommonBinding;
-import org.jboss.ws.core.CommonBindingProvider;
-import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.EndpointInvocation;
-import org.jboss.ws.core.jaxrpc.SOAPFaultHelperJAXRPC;
-import org.jboss.ws.core.jaxrpc.handler.HandlerCallback;
-import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.ws.metadata.umdm.OperationMetaData;
-import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
-
-/**
- * This Interceptor does the ws4ee handler processing.
- *
- * According to the ws4ee spec the handler logic must be invoked after the container
- * applied method level security to the invocation.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 21-Sep-2005
- */
-public class ServiceEndpointInterceptor extends AbstractInterceptor
-{
- // provide logging
- private static Logger log = Logger.getLogger(ServiceEndpointInterceptor.class);
-
- // Interceptor implementation --------------------------------------
-
- /** Before and after we call the service endpoint bean, we process the handler
chains.
- */
- public Object invoke(final Invocation mi) throws Exception
- {
- // If no msgContext, it's not for us
- CommonMessageContext msgContext =
(CommonMessageContext)mi.getPayloadValue(InvocationKey.SOAP_MESSAGE_CONTEXT);
- if (msgContext == null)
- {
- return getNext().invoke(mi);
- }
-
- // Get the endpoint invocation
- EndpointInvocation epInv =
(EndpointInvocation)mi.getValue(EndpointInvocation.class.getName());
- OperationMetaData opMetaData = epInv.getOperationMetaData();
-
- // Get the handler callback
- HandlerCallback callback =
(HandlerCallback)mi.getValue(HandlerCallback.class.getName());
-
- // Handlers need to be Tx. Therefore we must invoke the handler chain after the
TransactionInterceptor.
- if (callback != null && epInv != null)
- {
- try
- {
- // call the request handlers
- boolean handlersPass =
callback.callRequestHandlerChain(HandlerType.ENDPOINT);
- handlersPass = handlersPass &&
callback.callRequestHandlerChain(HandlerType.POST);
-
- // Call the next interceptor in the chain
- if (handlersPass)
- {
- CommonBindingProvider bindingProvider = new
CommonBindingProvider(opMetaData.getEndpointMetaData());
- CommonBinding binding = bindingProvider.getCommonBinding();
-
- // Verify that the the message has not been mofified
- CommonMessageContext messageContext =
MessageContextAssociation.peekMessageContext();
- if (messageContext.isModified())
- {
- log.debug("Handler modified payload, unbind message and update
invocation args");
- epInv =
bindingProvider.getCommonBinding().unbindRequestMessage(opMetaData,
messageContext.getMessageAbstraction());
- }
-
- // The SOAPContentElements stored in the EndpointInvocation might have
changed after
- // handler processing. Get the updated request payload. This should be a
noop if request
- // handlers did not modify the incomming SOAP message.
- Object[] reqParams = epInv.getRequestPayload();
- mi.setArguments(reqParams);
- Object resObj = getNext().invoke(mi);
- epInv.setReturnValue(resObj);
-
- // Bind the response message
- SOAPMessage resMessage =
(SOAPMessage)binding.bindResponseMessage(opMetaData, epInv);
- msgContext.setSOAPMessage(resMessage);
- }
-
- // call the response handlers
- handlersPass = callback.callResponseHandlerChain(HandlerType.POST);
- handlersPass = handlersPass &&
callback.callResponseHandlerChain(HandlerType.ENDPOINT);
-
- // update the return value after response handler processing
- Object resObj = epInv.getReturnValue();
-
- return resObj;
- }
- catch (Exception ex)
- {
- try
- {
- SOAPMessage faultMessage =
SOAPFaultHelperJAXRPC.exceptionToFaultMessage(ex);
- msgContext.setSOAPMessage(faultMessage);
-
- // call the fault handlers
- boolean handlersPass = callback.callFaultHandlerChain(HandlerType.POST,
ex);
- handlersPass = handlersPass &&
callback.callFaultHandlerChain(HandlerType.ENDPOINT, ex);
- }
- catch (Exception subEx)
- {
- log.warn("Cannot process handlerChain.handleFault, ignoring: ",
subEx);
- }
- throw ex;
- }
- }
- else
- {
- log.warn("Handler callback not available");
- return getNext().invoke(mi);
- }
- }
-}
Deleted:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceEndpointInvokerEJB21.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceEndpointInvokerEJB21.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceEndpointInvokerEJB21.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,267 +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.ws.integration.jboss50;
-
-// $Id$
-
-import java.lang.reflect.Method;
-import java.security.Principal;
-
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-
-import org.jboss.ejb.EjbModule;
-import org.jboss.ejb.Interceptor;
-import org.jboss.ejb.StatelessSessionContainer;
-import org.jboss.invocation.Invocation;
-import org.jboss.invocation.InvocationKey;
-import org.jboss.invocation.InvocationType;
-import org.jboss.invocation.PayloadKey;
-import org.jboss.logging.Logger;
-import org.jboss.mx.util.MBeanServerLocator;
-import org.jboss.security.SecurityAssociation;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.EndpointInvocation;
-import org.jboss.ws.core.jaxrpc.handler.HandlerCallback;
-import org.jboss.ws.core.jaxrpc.handler.SOAPMessageContextJAXRPC;
-import org.jboss.ws.core.server.AbstractServiceEndpointInvoker;
-import org.jboss.ws.core.server.ServiceEndpointInfo;
-import org.jboss.ws.core.server.ServiceEndpointInvoker;
-import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.ws.integration.ObjectNameFactory;
-import org.jboss.ws.metadata.j2ee.UnifiedApplicationMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedBeanMetaData;
-import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
-import org.jboss.ws.metadata.umdm.EndpointMetaData.Type;
-import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
-
-/**
- * Handles invocations on EJB2.1 endpoints.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 19-Jan-2005
- */
-public class ServiceEndpointInvokerEJB21 extends AbstractServiceEndpointInvoker
implements ServiceEndpointInvoker
-{
- // provide logging
- private Logger log = Logger.getLogger(ServiceEndpointInvokerEJB21.class);
-
- private String jndiName;
- private MBeanServer server;
- private ObjectName objectName;
-
- public ServiceEndpointInvokerEJB21()
- {
- server = MBeanServerLocator.locateJBoss();
- }
-
- /** Initialize the service endpoint */
- @Override
- public void init(ServiceEndpointInfo seInfo)
- {
- super.init(seInfo);
-
- ServerEndpointMetaData epMetaData = seInfo.getServerEndpointMetaData();
- String ejbName = epMetaData.getLinkName();
- if (ejbName == null)
- throw new WSException("Cannot obtain ejb-link from port component");
-
- UnifiedApplicationMetaData applMetaData =
(UnifiedApplicationMetaData)seInfo.getUnifiedDeploymentInfo().metaData;
- UnifiedBeanMetaData beanMetaData =
(UnifiedBeanMetaData)applMetaData.getBeanByEjbName(ejbName);
- if (beanMetaData == null)
- throw new WSException("Cannot obtain ejb meta data for: " + ejbName);
-
- // verify the service endpoint
- String seiName = epMetaData.getServiceEndpointInterfaceName();
- if (epMetaData.getType() == Type.JAXRPC && seiName != null)
- {
- String bmdSEI = beanMetaData.getServiceEndpointInterface();
- if (seiName.equals(bmdSEI) == false)
- throw new WSException("Endpoint meta data defines SEI '" +
seiName + "', <service-endpoint> in ejb-jar.xml defines '" +
bmdSEI + "'");
- }
-
- // get the bean's JNDI name
- jndiName = beanMetaData.getContainerObjectNameJndiName();
- if (jndiName == null)
- throw new WSException("Cannot obtain JNDI name for: " + ejbName);
-
- objectName = ObjectNameFactory.create("jboss.j2ee:jndiName=" + jndiName +
",service=EJB");
-
- // Dynamically add the service endpoint interceptor
- //
http://jira.jboss.org/jira/browse/JBWS-758
- try
- {
- EjbModule ejbModule = (EjbModule)server.getAttribute(objectName,
"EjbModule");
- StatelessSessionContainer container =
(StatelessSessionContainer)ejbModule.getContainer(ejbName);
-
- boolean injectionPointFound = false;
- Interceptor prev = container.getInterceptor();
- while (prev != null && prev.getNext() != null)
- {
- Interceptor next = prev.getNext();
- if (next.getNext() == null)
- {
- log.debug("Inject service endpoint interceptor after: " +
prev.getClass().getName());
- ServiceEndpointInterceptor sepInterceptor = new
ServiceEndpointInterceptor();
- prev.setNext(sepInterceptor);
- sepInterceptor.setNext(next);
- injectionPointFound = true;
- }
- prev = next;
- }
- if (injectionPointFound == false)
- log.warn("Cannot service endpoint interceptor injection point");
- }
- catch (Exception ex)
- {
- log.warn("Cannot add service endpoint interceptor", ex);
- }
- }
-
- /** Load the SEI implementation bean if necessary
- */
- public Class loadServiceEndpoint()
- {
- if (server.isRegistered(objectName) == false)
- throw new WSException("Cannot find service endpoint target: " +
objectName);
-
- return null;
- }
-
- /** Create an instance of the SEI implementation bean if necessary */
- public Object createServiceEndpointInstance(Object endpointContext, Class
seiImplClass)
- {
- return null;
- }
-
- /** Invoke an instance of the SEI implementation bean */
- public void invokeServiceEndpointInstance(Object seiImpl, EndpointInvocation epInv)
throws Exception
- {
- log.debug("invokeServiceEndpoint: " + epInv.getJavaMethod().getName());
-
- // these are provided by the ServerLoginHandler
- Principal principal = SecurityAssociation.getPrincipal();
- Object credential = SecurityAssociation.getCredential();
-
- CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
-
- // invoke on the container
- try
- {
- // setup the invocation
- Method method = epInv.getJavaMethod();
- Object[] args = epInv.getRequestPayload();
- Invocation inv = new Invocation(null, method, args, null, principal,
credential);
-
- // EJB2.1 endpoints will only get an JAXRPC context
- if ((msgContext instanceof javax.xml.rpc.handler.MessageContext) == false)
- msgContext = new SOAPMessageContextJAXRPC(msgContext);
-
- inv.setValue(InvocationKey.SOAP_MESSAGE_CONTEXT, msgContext);
- inv.setValue(InvocationKey.SOAP_MESSAGE, msgContext.getSOAPMessage());
- inv.setType(InvocationType.SERVICE_ENDPOINT);
-
- // Set the handler callback and endpoint invocation
- ServerEndpointMetaData sepMetaData = seInfo.getServerEndpointMetaData();
- inv.setValue(HandlerCallback.class.getName(), new
HandlerCallbackImpl(sepMetaData), PayloadKey.TRANSIENT);
- inv.setValue(EndpointInvocation.class.getName(), epInv, PayloadKey.TRANSIENT);
-
- String[] sig = { Invocation.class.getName() };
- Object retObj = server.invoke(objectName, "invoke", new Object[] { inv
}, sig);
- epInv.setReturnValue(retObj);
- }
- catch (Exception e)
- {
- handleInvocationException(e);
- }
- }
-
- /** Create an instance of the SEI implementation bean if necessary */
- public void destroyServiceEndpointInstance(Object seiImpl)
- {
- // do nothing
- }
-
- /** Handlers are beeing called through the HandlerCallback from the EJB interceptor
*/
- @Override
- public boolean callRequestHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType
type)
- {
- if (type == HandlerType.PRE)
- return delegate.callRequestHandlerChain(sepMetaData, type);
- else
- return true;
- }
-
- /** Handlers are beeing called through the HandlerCallback from the EJB interceptor
*/
- public boolean callResponseHandlerChain(ServerEndpointMetaData sepMetaData,
HandlerType type)
- {
- if (type == HandlerType.PRE)
- return delegate.callResponseHandlerChain(sepMetaData, type);
- else
- return true;
- }
-
- /** Handlers are beeing called through the HandlerCallback from the EJB interceptor
*/
- public boolean callFaultHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType
type, Exception ex)
- {
- if (type == HandlerType.PRE)
- return delegate.callFaultHandlerChain(sepMetaData, type, ex);
- else
- return true;
- }
-
- // The ServiceEndpointInterceptor calls the methods in this callback
- public class HandlerCallbackImpl implements HandlerCallback
- {
- private ServerEndpointMetaData sepMetaData;
-
- public HandlerCallbackImpl(ServerEndpointMetaData sepMetaData)
- {
- this.sepMetaData = sepMetaData;
- }
-
- public boolean callRequestHandlerChain(HandlerType type)
- {
- if (type == HandlerType.PRE)
- return true;
- else
- return delegate.callRequestHandlerChain(sepMetaData, type);
- }
-
- public boolean callResponseHandlerChain(HandlerType type)
- {
- if (type == HandlerType.PRE)
- return true;
- else
- return delegate.callResponseHandlerChain(sepMetaData, type);
- }
-
- public boolean callFaultHandlerChain(HandlerType type, Exception ex)
- {
- if (type == HandlerType.PRE)
- return true;
- else
- return delegate.callFaultHandlerChain(sepMetaData, type, ex);
- }
- }
-}
Deleted:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceEndpointInvokerEJB3.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceEndpointInvokerEJB3.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceEndpointInvokerEJB3.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,188 +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.ws.integration.jboss50;
-
-// $Id$
-
-import java.lang.reflect.Method;
-
-import javax.ejb.EJBContext;
-import javax.management.ObjectName;
-import javax.xml.rpc.soap.SOAPFaultException;
-
-import org.jboss.aop.Dispatcher;
-import org.jboss.aop.MethodInfo;
-import org.jboss.ejb3.BeanContext;
-import org.jboss.ejb3.BeanContextLifecycleCallback;
-import org.jboss.ejb3.EJBContainerInvocation;
-import org.jboss.ejb3.stateless.StatelessBeanContext;
-import org.jboss.ejb3.stateless.StatelessContainer;
-import org.jboss.injection.lang.reflect.BeanProperty;
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.EndpointInvocation;
-import org.jboss.ws.core.jaxrpc.handler.SOAPMessageContextJAXRPC;
-import org.jboss.ws.core.jaxws.WebServiceContextEJB;
-import org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS;
-import org.jboss.ws.core.server.AbstractServiceEndpointInvoker;
-import org.jboss.ws.core.server.ServiceEndpointInfo;
-import org.jboss.ws.core.server.ServiceEndpointInvoker;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.ws.integration.ObjectNameFactory;
-
-/**
- * Handles invocations on EJB3 endpoints.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 23-Jul-2005
- */
-public class ServiceEndpointInvokerEJB3 extends AbstractServiceEndpointInvoker implements
ServiceEndpointInvoker
-{
- // provide logging
- private Logger log = Logger.getLogger(ServiceEndpointInvokerEJB3.class);
-
- private ObjectName objectName;
-
- public ServiceEndpointInvokerEJB3()
- {
- }
-
- /** Initialize the service endpoint */
- @Override
- public void init(ServiceEndpointInfo seInfo)
- {
- super.init(seInfo);
-
- String ejbName = seInfo.getServerEndpointMetaData().getLinkName();
- UnifiedDeploymentInfo udi = seInfo.getUnifiedDeploymentInfo();
- String nameStr = "jboss.j2ee:name=" + ejbName +
",service=EJB3,jar=" + udi.simpleName;
- if (udi.parent != null)
- {
- nameStr += ",ear=" + udi.parent.simpleName;
- }
-
- objectName = ObjectNameFactory.create(nameStr.toString());
- }
-
- /** Load the SEI implementation bean if necessary
- */
- public Class loadServiceEndpoint()
- {
- Dispatcher dispatcher = Dispatcher.singleton;
- if (dispatcher.getRegistered(objectName.getCanonicalName()) == null)
- throw new WSException("Cannot find service endpoint target: " +
objectName);
-
- return null;
- }
-
- /** Create an instance of the SEI implementation bean if necessary */
- public Object createServiceEndpointInstance(Object endpointContext, Class
seiImplClass)
- {
- return null;
- }
-
- /** Invoke an instance of the SEI implementation bean */
- public void invokeServiceEndpointInstance(Object beanInstance, EndpointInvocation
epInv) throws SOAPFaultException, Exception
- {
- log.debug("invokeServiceEndpoint: " + epInv.getJavaMethod().getName());
-
- // invoke on the container
- try
- {
- // setup the invocation
- Method seiMethod = epInv.getJavaMethod();
- Object[] args = epInv.getRequestPayload();
-
- Dispatcher dispatcher = Dispatcher.singleton;
- StatelessContainer container =
(StatelessContainer)dispatcher.getRegistered(objectName.getCanonicalName());
- Class beanClass = container.getBeanClass();
-
- Method implMethod = getImplMethod(beanClass, seiMethod);
- MethodInfo info = container.getMethodInfo(implMethod);
-
- EJBContainerInvocation<StatelessContainer, StatelessBeanContext> ejb3Inv =
new EJBContainerInvocation<StatelessContainer, StatelessBeanContext>(info);
- ejb3Inv.setAdvisor(container);
- ejb3Inv.setArguments(args);
- ejb3Inv.setContextCallback(new CallbackImpl());
-
- Object retObj = ejb3Inv.invokeNext();
-
- epInv.setReturnValue(retObj);
- }
- catch (Throwable th)
- {
- handleInvocationException(th);
- }
- }
-
- /** Create an instance of the SEI implementation bean if necessary */
- public void destroyServiceEndpointInstance(Object seiImpl)
- {
- // do nothing
- }
-
- class CallbackImpl implements BeanContextLifecycleCallback
- {
- private SOAPMessageContextJAXWS jaxwsMessageContext;
- private SOAPMessageContextJAXRPC jaxrpcMessageContext;
-
- public CallbackImpl()
- {
- CommonMessageContext msgContext =
MessageContextAssociation.peekMessageContext();
- if (msgContext instanceof SOAPMessageContextJAXRPC)
- {
- jaxrpcMessageContext = (SOAPMessageContextJAXRPC)msgContext;
- jaxwsMessageContext = new SOAPMessageContextJAXWS(msgContext);
- }
- else if (msgContext instanceof SOAPMessageContextJAXWS)
- {
- jaxwsMessageContext = (SOAPMessageContextJAXWS)msgContext;
- jaxrpcMessageContext = new SOAPMessageContextJAXRPC(msgContext);
- }
- }
-
- public void attached(BeanContext beanCtx)
- {
- StatelessBeanContext sbc = (StatelessBeanContext)beanCtx;
- sbc.setMessageContextJAXRPC(jaxrpcMessageContext);
-
- BeanProperty beanProp = sbc.getWebServiceContextProperty();
- if (beanProp != null)
- {
- EJBContext ejbCtx = beanCtx.getEJBContext();
- beanProp.set(beanCtx.getInstance(), new
WebServiceContextEJB(jaxwsMessageContext, ejbCtx));
- }
- }
-
- public void released(BeanContext beanCtx)
- {
- StatelessBeanContext sbc = (StatelessBeanContext)beanCtx;
- sbc.setMessageContextJAXRPC(null);
-
- BeanProperty beanProp = sbc.getWebServiceContextProperty();
- if (beanProp != null)
- beanProp.set(beanCtx.getInstance(), null);
- }
- }
-}
Deleted:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceEndpointLifecycleDeployer.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceEndpointLifecycleDeployer.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceEndpointLifecycleDeployer.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,87 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.integration.jboss50;
-
-//$Id$
-
-import java.util.Set;
-
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
-import org.jboss.kernel.spi.registry.KernelRegistry;
-import org.jboss.kernel.spi.registry.KernelRegistryEntry;
-import org.jboss.logging.Logger;
-import org.jboss.metadata.WebMetaData;
-import org.jboss.ws.core.server.ServiceEndpointDeployer;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-import org.jboss.ws.integration.KernelLocator;
-
-/**
- * A deployer that starts and stops web service deployments
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 31-Oct-2006
- */
-public class ServiceEndpointLifecycleDeployer implements DeployerHook
-{
- // provide logging
- private static final Logger log =
Logger.getLogger(ServiceEndpointLifecycleDeployer.class);
-
- /** Start the service endpoint
- */
- public void deploy(DeploymentUnit unit) throws DeploymentException
- {
- UnifiedDeploymentInfo udi = unit.getAttachment(UnifiedDeploymentInfo.class);
- if (udi != null && udi.name.equals(unit.getName()))
- {
- // Get the webapp context classloader and use it as the deploymet class loader
- Set<? extends WebMetaData> allMetaData =
unit.getAllMetaData(WebMetaData.class);
- if (allMetaData.size() > 0)
- {
- WebMetaData webMetaData = allMetaData.iterator().next();
- udi.classLoader = webMetaData.getContextLoader();
- }
-
- log.debug("Start ServiceEndpoint: " + udi.getCanonicalName());
- getServiceEndpointDeployer().start(udi);
- }
- }
-
- /** Stop the service endpoint
- */
- public void undeploy(DeploymentUnit unit)
- {
- UnifiedDeploymentInfo udi = unit.getAttachment(UnifiedDeploymentInfo.class);
- if (udi != null && udi.name.equals(unit.getName()))
- {
- log.debug("Stop ServiceEndpoint: " + udi.getCanonicalName());
- getServiceEndpointDeployer().stop(udi);
- }
- }
-
- protected ServiceEndpointDeployer getServiceEndpointDeployer()
- {
- KernelRegistry registry = KernelLocator.getKernel().getRegistry();
- KernelRegistryEntry entry = registry.getEntry(ServiceEndpointDeployer.BEAN_NAME);
- return (ServiceEndpointDeployer)entry.getTarget();
- }
-}
Deleted:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceEndpointPublisher.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceEndpointPublisher.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceEndpointPublisher.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,107 +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.ws.integration.jboss50;
-
-// $Id$
-
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.jboss.deployers.plugins.structure.AbstractDeploymentContext;
-import org.jboss.deployers.spi.deployment.MainDeployer;
-import org.jboss.deployers.spi.structure.DeploymentContext;
-import org.jboss.deployers.spi.structure.DeploymentState;
-import org.jboss.logging.Logger;
-import org.jboss.virtual.VFS;
-import org.jboss.virtual.VirtualFile;
-import org.jboss.ws.core.server.AbstractServiceEndpointPublisher;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-
-/**
- * Publish the HTTP service endpoint to Tomcat
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 12-May-2006
- */
-public class ServiceEndpointPublisher extends AbstractServiceEndpointPublisher
-{
- // provide logging
- private static Logger log = Logger.getLogger(ServiceEndpointPublisher.class);
-
- private MainDeployer mainDeployer;
- private Map<String, DeploymentContext> contextMap = new HashMap<String,
DeploymentContext>();
-
- public MainDeployer getMainDeployer()
- {
- return mainDeployer;
- }
-
- public void setMainDeployer(MainDeployer mainDeployer)
- {
- this.mainDeployer = mainDeployer;
- }
-
- public String publishServiceEndpoint(UnifiedDeploymentInfo udi) throws Exception
- {
- URL warURL = udi.webappURL;
- log.debug("publishServiceEndpoint: " + warURL);
-
- rewriteWebXml(udi);
- DeploymentContext context = createDeploymentContext(warURL);
-
- mainDeployer.addDeploymentContext(context);
- mainDeployer.process();
-
- contextMap.put(warURL.toExternalForm(), context);
- return "OK";
- }
-
- public String destroyServiceEndpoint(UnifiedDeploymentInfo udi) throws Exception
- {
- URL warURL = udi.webappURL;
- if (warURL == null)
- {
- log.error("Cannot obtain warURL for: " + udi.name);
- return "FAIL";
- }
-
- log.debug("destroyServiceEndpoint: " + warURL);
-
- DeploymentContext context = contextMap.get(warURL.toExternalForm());
- if (context != null)
- {
- context.setState(DeploymentState.UNDEPLOYING);
- mainDeployer.process();
- mainDeployer.removeDeploymentContext(context.getName());
-
- contextMap.remove(warURL.toExternalForm());
- }
- return "OK";
- }
-
- private DeploymentContext createDeploymentContext(URL warURL) throws Exception
- {
- VirtualFile file = VFS.getRoot(warURL);
- return new AbstractDeploymentContext(file);
- }
-}
Deleted:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/VirtualFileAdaptor.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/VirtualFileAdaptor.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/VirtualFileAdaptor.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,66 +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.ws.integration.jboss50;
-
-import java.io.IOException;
-import java.net.URL;
-
-import org.jboss.virtual.VirtualFile;
-import org.jboss.ws.integration.UnifiedVirtualFile;
-
-// $Id$
-
-/**
- * A JBoss50 VirtualFile adaptor
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class VirtualFileAdaptor implements UnifiedVirtualFile
-{
- private static final long serialVersionUID = 6547394037548338042L;
-
- private VirtualFile root;
-
- public VirtualFileAdaptor(VirtualFile root)
- {
- this.root = root;
- }
-
- public UnifiedVirtualFile findChild(String child) throws IOException
- {
- VirtualFile vf = root.findChild(child);
- return new VirtualFileAdaptor(vf);
- }
-
- public URL toURL()
- {
- try
- {
- return root.toURL();
- }
- catch (Exception e)
- {
- return null;
- }
- }
-}
Deleted:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/WebMetaDataAdaptor.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/WebMetaDataAdaptor.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/WebMetaDataAdaptor.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,136 +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.ws.integration.jboss50;
-
-// $Id$
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
-import org.jboss.metadata.WebMetaData;
-import org.jboss.metadata.WebSecurityMetaData;
-import org.jboss.metadata.WebSecurityMetaData.WebResourceCollection;
-import org.jboss.metadata.web.Servlet;
-import org.jboss.metadata.web.ServletMapping;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-import org.jboss.ws.metadata.j2ee.UnifiedWebMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedWebSecurityMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedWebMetaData.PublishLocationAdapter;
-import
org.jboss.ws.metadata.j2ee.UnifiedWebSecurityMetaData.UnifiedWebResourceCollection;
-
-/**
- * Build container independent web meta data
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class WebMetaDataAdaptor
-{
- public static UnifiedWebMetaData buildUnifiedWebMetaData(UnifiedDeploymentInfo udi,
DeploymentUnit unit)
- {
- WebMetaData wmd = unit.getAttachment(WebMetaData.class);
- udi.addAttachment(WebMetaData.class, wmd);
-
- UnifiedWebMetaData umd = new UnifiedWebMetaData();
- umd.setContextRoot(wmd.getContextRoot());
- umd.setServletMappings(getServletMappings(wmd));
- umd.setServletClassNames(getServletClassMap(wmd));
- umd.setConfigName(wmd.getConfigName());
- umd.setConfigFile(wmd.getConfigFile());
- umd.setSecurityDomain(wmd.getSecurityDomain());
- umd.setPublishLocationAdapter(getPublishLocationAdpater(wmd));
- umd.setSecurityMetaData(getSecurityMetaData(wmd.getSecurityContraints()));
-
- return umd;
- }
-
- private static PublishLocationAdapter getPublishLocationAdpater(final WebMetaData
wmd)
- {
- return new PublishLocationAdapter()
- {
- public String getWsdlPublishLocationByName(String name)
- {
- return wmd.getWsdlPublishLocationByName(name);
- }
- };
- }
-
- protected static List<UnifiedWebSecurityMetaData> getSecurityMetaData(final
Iterator securityConstraints)
- {
- ArrayList<UnifiedWebSecurityMetaData> unifiedsecurityMetaData = new
ArrayList<UnifiedWebSecurityMetaData>();
-
- while (securityConstraints.hasNext())
- {
- WebSecurityMetaData securityMetaData =
(WebSecurityMetaData)securityConstraints.next();
-
- UnifiedWebSecurityMetaData current = new UnifiedWebSecurityMetaData();
- unifiedsecurityMetaData.add(current);
-
- current.setTransportGuarantee(securityMetaData.getTransportGuarantee());
-
- Map<String, WebResourceCollection> resources =
securityMetaData.getWebResources();
- for (WebResourceCollection webResource : resources.values())
- {
- UnifiedWebResourceCollection currentResource =
current.addWebResource(webResource.getName());
- for (String currentPattern : webResource.getUrlPatterns())
- {
- currentResource.addPattern(currentPattern);
- }
- }
- }
-
- return unifiedsecurityMetaData;
- }
-
- private static Map<String, String> getServletMappings(WebMetaData wmd)
- {
- Map<String, String> mappings = new HashMap<String, String>();
- Iterator it = wmd.getServletMappings().iterator();
- while (it.hasNext())
- {
- ServletMapping sm = (ServletMapping)it.next();
- // FIXME - Add support for multiple mappings
- mappings.put(sm.getName(), sm.getUrlPatterns().get(0));
- }
- return mappings;
- }
-
- private static Map<String, String> getServletClassMap(WebMetaData wmd)
- {
- Map<String, String> mappings = new HashMap<String, String>();
- Iterator it = wmd.getServlets().iterator();
- while (it.hasNext())
- {
- Servlet servlet = (Servlet)it.next();
- // Skip JSPs
- if (servlet.getServletClass() == null || servlet.getServletClass().length() ==
0)
- continue;
-
- mappings.put(servlet.getName(), servlet.getServletClass());
- }
- return mappings;
- }
-}
Deleted:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/WebServiceAbstractDeployer.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/WebServiceAbstractDeployer.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/WebServiceAbstractDeployer.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,74 +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.ws.integration.jboss50;
-
-//$Id$
-
-import java.util.LinkedList;
-import java.util.List;
-
-import org.jboss.deployers.plugins.deployer.AbstractSimpleDeployer;
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
-import org.jboss.logging.Logger;
-
-/**
- * This deployer delegates to registerd web service deployers
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 24-Apr-2007
- */
-public abstract class WebServiceAbstractDeployer extends AbstractSimpleDeployer
-{
- // provide logging
- protected final Logger log = Logger.getLogger(getClass());
-
- private List<DeployerHook> deployers = new LinkedList<DeployerHook>();
-
- public void addDeployerHook(DeployerHook deployer)
- {
- log.debug("Add deployer hook: " + deployer);
- deployers.add(deployer);
- }
-
- public void removeDeployerHook(DeployerHook deployer)
- {
- log.debug("Remove deployer hook: " + deployer);
- deployers.remove(deployer);
- }
-
- @Override
- public void deploy(DeploymentUnit unit) throws DeploymentException
- {
- log.debug("Deploy: " + unit.getName());
- for (DeployerHook deployer : deployers)
- deployer.deploy(unit);
- }
-
- @Override
- public void undeploy(DeploymentUnit unit)
- {
- log.debug("Undeploy: " + unit.getName());
- for (DeployerHook deployer : deployers)
- deployer.undeploy(unit);
- }
-}
Deleted:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/WebServiceDeployerEJB.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/WebServiceDeployerEJB.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/WebServiceDeployerEJB.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,34 +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.ws.integration.jboss50;
-
-//$Id$
-
-/**
- * This deployer delegates to registerd web service deployers
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 24-Apr-2007
- */
-public class WebServiceDeployerEJB extends WebServiceAbstractDeployer
-{
-}
Added:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/WebServiceDeployerEJB.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/WebServiceDeployerEJB.java
(rev 0)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/WebServiceDeployerEJB.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -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.ws.integration.jboss50;
+
+//$Id$
+
+/**
+ * This web service deployer for EJB
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 24-Apr-2007
+ */
+public class WebServiceDeployerEJB extends AbstractWebServiceDeployer
+{
+ private int relOrderEJB2x;
+ private int relOrderEJB3;
+
+ public void setRelOrderEJB2x(int relOrderEJB2x)
+ {
+ this.relOrderEJB2x = relOrderEJB2x;
+ }
+
+ public void setRelOrderEJB3(int relOrderEJB3)
+ {
+ this.relOrderEJB3 = relOrderEJB3;
+ }
+
+ @Override
+ public int getRelativeOrder()
+ {
+ return Math.max(relOrderEJB2x, relOrderEJB3) + 1;
+ }
+
+}
Deleted:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/WebServiceDeployerJSE.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/WebServiceDeployerJSE.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/WebServiceDeployerJSE.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,34 +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.ws.integration.jboss50;
-
-//$Id$
-
-/**
- * This deployer delegates to registerd web service deployers
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 24-Apr-2007
- */
-public class WebServiceDeployerJSE extends WebServiceAbstractDeployer
-{
-}
Added:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/WebServiceDeployerJSE.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/WebServiceDeployerJSE.java
(rev 0)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/WebServiceDeployerJSE.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -0,0 +1,46 @@
+/*
+ * 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.ws.integration.jboss50;
+
+//$Id$
+
+/**
+ * This web service deployer for JSE
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 24-Apr-2007
+ */
+public class WebServiceDeployerJSE extends AbstractWebServiceDeployer
+{
+ private int relOrderWar;
+
+ public void setRelOrderWar(int relOrderWar)
+ {
+ this.relOrderWar = relOrderWar;
+ }
+
+ @Override
+ public int getRelativeOrder()
+ {
+ return relOrderWar - 1;
+ }
+}
Deleted:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/WebServiceLifecycleDeployer.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/WebServiceLifecycleDeployer.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/WebServiceLifecycleDeployer.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,34 +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.ws.integration.jboss50;
-
-//$Id$
-
-/**
- * This deployer delegates to registerd web service deployers
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 24-Apr-2007
- */
-public class WebServiceLifecycleDeployer extends WebServiceAbstractDeployer
-{
-}
Added:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/WebServiceMainDeployer.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/WebServiceMainDeployer.java
(rev 0)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/WebServiceMainDeployer.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -0,0 +1,52 @@
+/*
+ * 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.ws.integration.jboss50;
+
+//$Id$
+
+/**
+ * The main web service deployer
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 24-Apr-2007
+ */
+public class WebServiceMainDeployer extends AbstractWebServiceDeployer
+{
+ private int relOrderJSE;
+ private int relOrderEJB;
+
+ public void setRelOrderEJB(int relOrderEJB)
+ {
+ this.relOrderEJB = relOrderEJB;
+ }
+
+ public void setRelOrderJSE(int relOrderJSE)
+ {
+ this.relOrderJSE = relOrderJSE;
+ }
+
+ @Override
+ public int getRelativeOrder()
+ {
+ return Math.max(relOrderEJB, relOrderJSE) + 1;
+ }
+}
Property changes on:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/WebServiceMainDeployer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/AbstractDeployerHook.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/AbstractDeployerHook.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/AbstractDeployerHook.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -25,7 +25,7 @@
import org.jboss.deployers.spi.deployer.DeploymentUnit;
import org.jboss.logging.Logger;
-import org.jboss.ws.integration.deployment.DeploymentManager;
+import org.jboss.ws.integration.deployment.DeployerManager;
import org.jboss.ws.integration.jboss50.DeployerHook;
/**
@@ -39,16 +39,16 @@
// provide logging
protected final Logger log = Logger.getLogger(getClass());
- protected DeploymentManager deploymentManager;
+ protected DeployerManager deployerManager;
- public DeploymentManager getDeploymentManager()
+ public DeployerManager getDeployerManager()
{
- return deploymentManager;
+ return deployerManager;
}
- public void setDeploymentManager(DeploymentManager deploymentManager)
+ public void setDeployerManager(DeployerManager deploymentManager)
{
- this.deploymentManager = deploymentManager;
+ this.deployerManager = deploymentManager;
}
/** Return true if this deployment should be ignored
Modified:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/AbstractInvocationHandler.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/AbstractInvocationHandler.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/AbstractInvocationHandler.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -75,7 +75,7 @@
public abstract class AbstractInvocationHandler implements InvocationHandler
{
// provide logging
- protected Logger log = Logger.getLogger(getClass());
+ private static final Logger log = Logger.getLogger(AbstractInvocationHandler.class);
protected Endpoint endpoint;
protected CommonBindingProvider bindingProvider;
Copied:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/ApplicationMetaDataAdaptor.java
(from rev 2936,
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ApplicationMetaDataAdaptor.java)
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/ApplicationMetaDataAdaptor.java
(rev 0)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/ApplicationMetaDataAdaptor.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -0,0 +1,163 @@
+/*
+ * 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.ws.integration.jboss50.jbossws;
+
+// $Id$
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.jboss.deployers.spi.deployer.DeploymentUnit;
+import org.jboss.logging.Logger;
+import org.jboss.metadata.ApplicationMetaData;
+import org.jboss.metadata.BeanMetaData;
+import org.jboss.metadata.EjbPortComponentMetaData;
+import org.jboss.metadata.MessageDrivenMetaData;
+import org.jboss.metadata.SessionMetaData;
+import org.jboss.metadata.ApplicationMetaData.WebserviceDescription;
+import org.jboss.metadata.ApplicationMetaData.Webservices;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+import org.jboss.ws.metadata.j2ee.UnifiedApplicationMetaData;
+import org.jboss.ws.metadata.j2ee.UnifiedBeanMetaData;
+import org.jboss.ws.metadata.j2ee.UnifiedEjbPortComponentMetaData;
+import org.jboss.ws.metadata.j2ee.UnifiedMessageDrivenMetaData;
+import org.jboss.ws.metadata.j2ee.UnifiedSessionMetaData;
+import org.jboss.ws.metadata.j2ee.UnifiedApplicationMetaData.PublishLocationAdapter;
+
+/**
+ * Build container independent application meta data
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 05-May-2006
+ */
+public class ApplicationMetaDataAdaptor
+{
+ // logging support
+ private static Logger log = Logger.getLogger(ApplicationMetaDataAdaptor.class);
+
+ public static UnifiedApplicationMetaData
buildUnifiedApplicationMetaData(UnifiedDeploymentInfo udi, DeploymentUnit unit)
+ {
+ ApplicationMetaData appMetaData = unit.getAttachment(ApplicationMetaData.class);
+ udi.addAttachment(ApplicationMetaData.class, appMetaData);
+
+ UnifiedApplicationMetaData umd = new UnifiedApplicationMetaData();
+ buildUnifiedBeanMetaData(umd, appMetaData);
+ buildWebservicesMetaData(umd, appMetaData);
+ umd.setSecurityDomain(appMetaData.getSecurityDomain());
+ return umd;
+ }
+
+ private static void buildWebservicesMetaData(UnifiedApplicationMetaData umd,
ApplicationMetaData apmd)
+ {
+ Webservices webservices = apmd.getWebservices();
+ if (webservices != null)
+ {
+ String contextRoot = webservices.getContextRoot();
+ umd.setPublishLocationAdapter(getPublishLocationAdpater(webservices));
+
+ List<WebserviceDescription> wsDescriptions =
webservices.getWebserviceDescriptions();
+ if (wsDescriptions.size() > 1)
+ log.warn("Multiple <webservice-description> elements not
supported");
+
+ if (wsDescriptions.size() > 0)
+ {
+ WebserviceDescription wsd = wsDescriptions.get(0);
+ umd.setConfigName(wsd.getConfigName());
+ umd.setConfigFile(wsd.getConfigFile());
+ }
+
+ umd.setWebServiceContextRoot(contextRoot);
+ }
+ }
+
+ private static PublishLocationAdapter getPublishLocationAdpater(final Webservices
webservices)
+ {
+ return new PublishLocationAdapter()
+ {
+ public String getWsdlPublishLocationByName(String name)
+ {
+ String wsdlPublishLocation = null;
+ for (WebserviceDescription wsd : webservices.getWebserviceDescriptions())
+ {
+ if (wsd.getDescriptionName().equals(name))
+ {
+ wsdlPublishLocation = wsd.getWsdlPublishLocation();
+ }
+ }
+ return wsdlPublishLocation;
+ }
+ };
+ }
+
+ private static void buildUnifiedBeanMetaData(UnifiedApplicationMetaData umd,
ApplicationMetaData appMetaData)
+ {
+ List<UnifiedBeanMetaData> beans = new
ArrayList<UnifiedBeanMetaData>();
+ Iterator it = appMetaData.getEnterpriseBeans();
+ while (it.hasNext())
+ {
+ BeanMetaData bmd = (BeanMetaData)it.next();
+ buildUnifiedBeanMetaData(beans, bmd);
+ }
+ umd.setEnterpriseBeans(beans);
+ }
+
+ private static UnifiedBeanMetaData
buildUnifiedBeanMetaData(List<UnifiedBeanMetaData> beans, BeanMetaData bmd)
+ {
+ UnifiedBeanMetaData ubmd = null;
+ if (bmd instanceof SessionMetaData)
+ {
+ ubmd = new UnifiedSessionMetaData();
+ }
+ else if (bmd instanceof MessageDrivenMetaData)
+ {
+ ubmd = new UnifiedMessageDrivenMetaData();
+
((UnifiedMessageDrivenMetaData)ubmd).setDestinationJndiName(((MessageDrivenMetaData)bmd).getDestinationJndiName());
+ }
+
+ if (ubmd != null)
+ {
+ ubmd.setEjbName(bmd.getEjbName());
+ ubmd.setEjbClass(bmd.getEjbClass());
+ ubmd.setServiceEndpointInterface(bmd.getServiceEndpoint());
+ ubmd.setHome(bmd.getHome());
+ ubmd.setLocalHome(bmd.getLocalHome());
+ ubmd.setJndiName(bmd.getJndiName());
+ ubmd.setLocalJndiName(bmd.getLocalJndiName());
+
+ EjbPortComponentMetaData pcmd = bmd.getPortComponent();
+ if (pcmd != null)
+ {
+ UnifiedEjbPortComponentMetaData upcmd = new
UnifiedEjbPortComponentMetaData();
+ upcmd.setPortComponentName(pcmd.getPortComponentName());
+ upcmd.setPortComponentURI(pcmd.getPortComponentURI());
+ upcmd.setAuthMethod(pcmd.getAuthMethod());
+ upcmd.setTransportGuarantee(pcmd.getTransportGuarantee());
+ upcmd.setSecureWSDLAccess(pcmd.getSecureWSDLAccess());
+ ubmd.setPortComponent(upcmd);
+ }
+
+ beans.add(ubmd);
+ }
+ return ubmd;
+ }
+}
Copied:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/ApplicationMetaDataAdaptorEJB3.java
(from rev 2936,
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ApplicationMetaDataAdaptorEJB3.java)
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/ApplicationMetaDataAdaptorEJB3.java
(rev 0)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/ApplicationMetaDataAdaptorEJB3.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -0,0 +1,167 @@
+/*
+ * 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.ws.integration.jboss50.jbossws;
+
+// $Id$
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.jboss.deployers.spi.deployer.DeploymentUnit;
+import org.jboss.ejb3.Container;
+import org.jboss.ejb3.EJBContainer;
+import org.jboss.ejb3.Ejb3Deployment;
+import org.jboss.ejb3.SessionContainer;
+import org.jboss.ejb3.mdb.MessagingContainer;
+import org.jboss.ejb3.metamodel.Ejb3PortComponent;
+import org.jboss.ejb3.metamodel.EjbJarDD;
+import org.jboss.ejb3.metamodel.EnterpriseBean;
+import org.jboss.ejb3.metamodel.WebserviceDescription;
+import org.jboss.ejb3.metamodel.Webservices;
+import org.jboss.logging.Logger;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+import org.jboss.ws.metadata.j2ee.UnifiedApplicationMetaData;
+import org.jboss.ws.metadata.j2ee.UnifiedBeanMetaData;
+import org.jboss.ws.metadata.j2ee.UnifiedEjbPortComponentMetaData;
+import org.jboss.ws.metadata.j2ee.UnifiedMessageDrivenMetaData;
+import org.jboss.ws.metadata.j2ee.UnifiedSessionMetaData;
+import org.jboss.ws.metadata.j2ee.UnifiedApplicationMetaData.PublishLocationAdapter;
+
+/**
+ * Build container independent application meta data
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-Apr-2007
+ */
+public class ApplicationMetaDataAdaptorEJB3
+{
+ // logging support
+ private static Logger log = Logger.getLogger(ApplicationMetaDataAdaptorEJB3.class);
+
+ public static UnifiedApplicationMetaData
buildUnifiedApplicationMetaData(UnifiedDeploymentInfo udi, DeploymentUnit unit)
+ {
+ Ejb3Deployment ejb3Deployment = unit.getAttachment(Ejb3Deployment.class);
+ udi.addAttachment(Ejb3Deployment.class, ejb3Deployment);
+
+ EjbJarDD jarDD = unit.getAttachment(EjbJarDD.class);
+ UnifiedApplicationMetaData umd = new UnifiedApplicationMetaData();
+ buildUnifiedBeanMetaData(umd, ejb3Deployment);
+ buildWebservicesMetaData(umd, jarDD);
+ return umd;
+ }
+
+ private static void buildWebservicesMetaData(UnifiedApplicationMetaData umd, EjbJarDD
jarDD)
+ {
+ // nothing to do
+ if (jarDD == null)
+ return;
+
+ Webservices webservices = jarDD.getWebservices();
+ if (webservices != null)
+ {
+ String contextRoot = webservices.getContextRoot();
+ umd.setPublishLocationAdapter(getPublishLocationAdpater(webservices));
+
+ List<WebserviceDescription> wsDescriptions =
webservices.getWebserviceDescriptions();
+ if (wsDescriptions.size() > 1)
+ log.warn("Multiple <webservice-description> elements not
supported");
+
+ if (wsDescriptions.size() > 0)
+ {
+ WebserviceDescription wsd = wsDescriptions.get(0);
+ umd.setConfigName(wsd.getConfigName());
+ umd.setConfigFile(wsd.getConfigFile());
+
+ // com/sun/ts/tests/webservices12/ejb/annotations/WSEjbWebServiceRefTest1
+ // WSEjbWebServiceRefTest1VerifyTargetEndpointAddress
+ if (contextRoot == null)
+ contextRoot = "/" + wsd.getDescriptionName();
+ }
+
+ umd.setWebServiceContextRoot(contextRoot);
+ }
+ }
+
+ private static void buildUnifiedBeanMetaData(UnifiedApplicationMetaData umd,
Ejb3Deployment ejb3Deployment)
+ {
+ List<UnifiedBeanMetaData> ubmdList = new
ArrayList<UnifiedBeanMetaData>();
+ Iterator<Container> it =
ejb3Deployment.getEjbContainers().values().iterator();
+ while (it.hasNext())
+ {
+ EJBContainer container = (EJBContainer)it.next();
+ UnifiedBeanMetaData ubmd = null;
+ if (container instanceof SessionContainer)
+ {
+ ubmd = new UnifiedSessionMetaData();
+ }
+ else if (container instanceof MessagingContainer)
+ {
+ ubmd = new UnifiedMessageDrivenMetaData();
+ log.warn("No implemented: initialize MDB destination");
+
//((UnifiedMessageDrivenMetaData)ubmd).setDestinationJndiName(((MessagingContainer)container).getDestination());
+ }
+
+ if (ubmd != null)
+ {
+ ubmd.setEjbName(container.getEjbName());
+ ubmd.setEjbClass(container.getBeanClassName());
+
+ EnterpriseBean bean = container.getXml();
+ Ejb3PortComponent pcMetaData = (bean != null ? bean.getPortComponent() :
null);
+ if (pcMetaData != null)
+ {
+ UnifiedEjbPortComponentMetaData ejbPortComp = new
UnifiedEjbPortComponentMetaData();
+ ejbPortComp.setPortComponentName(pcMetaData.getPortComponentName());
+ ejbPortComp.setPortComponentURI(pcMetaData.getPortComponentURI());
+ ejbPortComp.setAuthMethod(pcMetaData.getAuthMethod());
+ ejbPortComp.setTransportGuarantee(pcMetaData.getTransportGuarantee());
+ ejbPortComp.setSecureWSDLAccess(pcMetaData.getSecureWSDLAccess());
+
+ ubmd.setPortComponent(ejbPortComp);
+ }
+
+ ubmdList.add(ubmd);
+ }
+ }
+ umd.setEnterpriseBeans(ubmdList);
+ }
+
+ private static PublishLocationAdapter getPublishLocationAdpater(final Webservices
webservices)
+ {
+ return new PublishLocationAdapter()
+ {
+ public String getWsdlPublishLocationByName(String name)
+ {
+ String wsdlPublishLocation = null;
+ for (WebserviceDescription wsd : webservices.getWebserviceDescriptions())
+ {
+ if (wsd.getDescriptionName().equals(name))
+ {
+ wsdlPublishLocation = wsd.getWsdlPublishLocation();
+ }
+ }
+ return wsdlPublishLocation;
+ }
+ };
+ }
+}
Modified:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/ArchiveDeployerHook.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/ArchiveDeployerHook.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/ArchiveDeployerHook.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -26,15 +26,11 @@
import java.io.InputStream;
import java.net.URL;
-import javax.management.ObjectName;
-
import org.jboss.deployers.spi.DeploymentException;
import org.jboss.deployers.spi.deployer.DeploymentUnit;
import org.jboss.logging.Logger;
import org.jboss.virtual.VirtualFile;
import org.jboss.ws.core.utils.DOMUtils;
-import org.jboss.ws.integration.Endpoint;
-import org.jboss.ws.integration.ObjectNameFactory;
import org.jboss.ws.integration.deployment.Deployment;
import org.jboss.ws.integration.deployment.WSDeploymentException;
import org.jboss.ws.integration.deployment.Deployment.DeploymentType;
@@ -62,9 +58,6 @@
*/
public abstract class ArchiveDeployerHook extends AbstractDeployerHook
{
- // provide logging
- protected final Logger log = Logger.getLogger(getClass());
-
/** Get the deployemnt type this deployer can handle
*/
public abstract DeploymentType getDeploymentType();
@@ -93,6 +86,7 @@
if (isWebServiceDeployment(unit))
{
+ log.debug("deploy: " + unit.getName());
Deployment dep = getDeployment(unit);
if (dep == null)
{
@@ -100,7 +94,7 @@
dep.getContext().addAttachment(DeploymentUnit.class, unit);
}
- deploymentManager.deploy(dep);
+ deployerManager.deploy(dep);
unit.addAttachment(Deployment.class, dep);
}
}
@@ -113,7 +107,8 @@
Deployment dep = getDeployment(unit);
if (dep != null)
{
- deploymentManager.undeploy(dep);
+ log.debug("undeploy: " + unit.getName());
+ deployerManager.undeploy(dep);
unit.removeAttachment(Deployment.class);
}
}
Deleted:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/BasicDeployerHook.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/BasicDeployerHook.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/BasicDeployerHook.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,61 +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.ws.integration.jboss50.jbossws;
-
-//$Id$
-
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
-import org.jboss.ws.integration.deployment.Deployment;
-
-/**
- * A basic hook that delegates a deployment manger.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 25-Apr-2007
- */
-public class BasicDeployerHook extends AbstractDeployerHook
-{
- public void deploy(DeploymentUnit unit) throws DeploymentException
- {
- if (ignoreDeployment(unit))
- return;
-
- Deployment dep = unit.getAttachment(Deployment.class);
- if (dep != null)
- {
- deploymentManager.deploy(dep);
- }
- }
-
- public void undeploy(DeploymentUnit unit)
- {
- if (ignoreDeployment(unit))
- return;
-
- Deployment dep = unit.getAttachment(Deployment.class);
- if (dep != null)
- {
- deploymentManager.undeploy(dep);
- }
- }
-}
Copied:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/DeploymentInfoAdaptor.java
(from rev 2936,
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/DeploymentInfoAdaptor.java)
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/DeploymentInfoAdaptor.java
(rev 0)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/DeploymentInfoAdaptor.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -0,0 +1,99 @@
+/*
+ * 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.ws.integration.jboss50.jbossws;
+
+import java.net.URL;
+import java.net.URLClassLoader;
+
+import org.jboss.deployers.spi.deployer.DeploymentUnit;
+import org.jboss.ejb3.Ejb3Deployment;
+import org.jboss.logging.Logger;
+import org.jboss.metadata.ApplicationMetaData;
+import org.jboss.metadata.WebMetaData;
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+
+// $Id$
+
+/**
+ * Build container independent deployment info.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 05-May-2006
+ */
+public class DeploymentInfoAdaptor
+{
+ // logging support
+ private static Logger log = Logger.getLogger(DeploymentInfoAdaptor.class);
+
+ public static void buildDeploymentInfo(UnifiedDeploymentInfo udi, DeploymentUnit
unit)
+ {
+ try
+ {
+ if (unit.getDeploymentContext().getParent() != null)
+ {
+ udi.parent = new UnifiedDeploymentInfo(null);
+ buildDeploymentInfo(udi.parent,
unit.getDeploymentContext().getParent().getDeploymentUnit());
+ }
+
+ udi.vfRoot = new VirtualFileAdaptor(unit.getDeploymentContext().getRoot());
+
+ udi.name = unit.getName();
+ udi.simpleName = unit.getSimpleName();
+ udi.url = udi.vfRoot.toURL();
+
+ buildMetaData(udi, unit);
+
+ // Since we create temporary classes, we need to create a delegate loader
+ // This prevents CCE problems where the parent loader is available at deploy
time,
+ // and a child loader is available at start time.
+ udi.classLoader = new URLClassLoader(new URL[] {}, unit.getClassLoader());
+
+ log.debug("UnifiedDeploymentInfo:\n" + udi);
+ }
+ catch (Exception ex)
+ {
+ WSException.rethrow(ex.getMessage(), ex);
+ }
+ }
+
+ private static void buildMetaData(UnifiedDeploymentInfo udi, DeploymentUnit unit)
throws Exception
+ {
+ if (unit.getAttachment(Ejb3Deployment.class) != null)
+ {
+ udi.metaData =
ApplicationMetaDataAdaptorEJB3.buildUnifiedApplicationMetaData(udi, unit);
+ }
+ else if (unit.getAttachment(ApplicationMetaData.class) != null)
+ {
+ udi.metaData = ApplicationMetaDataAdaptor.buildUnifiedApplicationMetaData(udi,
unit);
+ }
+ else if (unit.getAttachment(WebMetaData.class) != null)
+ {
+ udi.metaData = WebMetaDataAdaptor.buildUnifiedWebMetaData(udi, unit);
+ udi.webappURL = udi.vfRoot.toURL();
+ }
+ else
+ {
+ throw new IllegalStateException("Cannot build meta data");
+ }
+ }
+}
Modified:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/EndpointNameDeployer.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/EndpointNameDeployer.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/EndpointNameDeployer.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -23,8 +23,9 @@
//$Id$
+import javax.management.ObjectName;
+
import org.jboss.ws.integration.Endpoint;
-import org.jboss.ws.integration.ObjectNameFactory;
import org.jboss.ws.integration.deployment.AbstractDeployer;
import org.jboss.ws.integration.deployment.Deployment;
import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
@@ -46,21 +47,8 @@
if (sepMetaData == null)
throw new IllegalStateException("Cannot obtain endpoint meta
data");
- String linkName = sepMetaData.getLinkName();
- if (linkName == null)
- throw new IllegalStateException("Link name cannot be null");
-
- String contextRoot = sepMetaData.getContextRoot();
- if (contextRoot == null)
- throw new IllegalStateException("Context root cannot be null");
-
- if (contextRoot.startsWith("/"))
- contextRoot = contextRoot.substring(1);
-
- StringBuilder nameStr = new StringBuilder(Endpoint.SEPID_DOMAIN);
- nameStr.append(":" + Endpoint.SEPID_PROPERTY_CONTEXT + "=" +
contextRoot);
- nameStr.append("," + Endpoint.SEPID_PROPERTY_ENDPOINT + "="
+ linkName);
- ep.setName(ObjectNameFactory.create(nameStr.toString()));
+ ObjectName sepID = sepMetaData.getServiceEndpointID();
+ ep.setName(sepID);
}
}
}
\ No newline at end of file
Modified:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/InvocationHandlerEJB21.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/InvocationHandlerEJB21.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/InvocationHandlerEJB21.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -36,8 +36,12 @@
import org.jboss.invocation.InvocationKey;
import org.jboss.invocation.InvocationType;
import org.jboss.invocation.PayloadKey;
+import org.jboss.logging.Logger;
import org.jboss.mx.util.MBeanServerLocator;
import org.jboss.security.SecurityAssociation;
+import org.jboss.security.SecurityContext;
+import org.jboss.security.plugins.SecurityContextAssociation;
+import org.jboss.security.plugins.SecurityContextFactory;
import org.jboss.ws.WSException;
import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.core.EndpointInvocation;
@@ -48,7 +52,7 @@
import org.jboss.ws.integration.Endpoint;
import org.jboss.ws.integration.ObjectNameFactory;
import org.jboss.ws.integration.invocation.InvocationContext;
-import org.jboss.ws.integration.jboss50.ServiceEndpointInterceptor;
+import org.jboss.ws.integration.jboss50.AbstractWebServiceDeployer;
import org.jboss.ws.metadata.j2ee.UnifiedApplicationMetaData;
import org.jboss.ws.metadata.j2ee.UnifiedBeanMetaData;
import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
@@ -63,6 +67,9 @@
*/
public class InvocationHandlerEJB21 extends AbstractInvocationHandler
{
+ // provide logging
+ private static final Logger log = Logger.getLogger(InvocationHandlerEJB21.class);
+
private String jndiName;
private MBeanServer server;
private ObjectName objectName;
@@ -172,6 +179,18 @@
Object[] args = epInv.getRequestPayload();
Invocation inv = new Invocation(null, method, args, null, principal,
credential);
+ // Copy the SecurityContext
+ if (principal != null)
+ {
+ SecurityContext sc = SecurityContextAssociation.getSecurityContext();
+ if (sc == null)
+ {
+ log.error("Cannot obtain SecurityContext from container that hosts
the endpoint");
+ sc = SecurityContextFactory.createSecurityContext(principal, credential,
null, null);
+ }
+ inv.setSecurityContext(sc);
+ }
+
// EJB2.1 endpoints will only get an JAXRPC context
if ((msgContext instanceof javax.xml.rpc.handler.MessageContext) == false)
msgContext = new SOAPMessageContextJAXRPC(msgContext);
Modified:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/InvocationHandlerEJB3.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/InvocationHandlerEJB3.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/InvocationHandlerEJB3.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -36,6 +36,7 @@
import org.jboss.ejb3.stateless.StatelessBeanContext;
import org.jboss.ejb3.stateless.StatelessContainer;
import org.jboss.injection.lang.reflect.BeanProperty;
+import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.core.EndpointInvocation;
@@ -57,6 +58,9 @@
*/
public class InvocationHandlerEJB3 extends AbstractInvocationHandler
{
+ // provide logging
+ private static final Logger log = Logger.getLogger(InvocationHandlerEJB3.class);
+
private ObjectName objectName;
/** Initialize the service endpoint */
Modified:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/InvocationHandlerJSE.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/InvocationHandlerJSE.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/InvocationHandlerJSE.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -31,6 +31,7 @@
import javax.xml.rpc.soap.SOAPFaultException;
import javax.xml.ws.WebServiceContext;
+import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.core.EndpointInvocation;
@@ -51,6 +52,9 @@
*/
public class InvocationHandlerJSE extends AbstractInvocationHandler
{
+ // provide logging
+ private static final Logger log = Logger.getLogger(InvocationHandlerJSE.class);
+
/** Load the SEI implementation bean if necessary */
public Class loadServiceEndpoint() throws ClassNotFoundException
{
Modified:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/JAXRPCDeployerHookEJB21.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/JAXRPCDeployerHookEJB21.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/JAXRPCDeployerHookEJB21.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -24,13 +24,14 @@
//$Id$
import org.jboss.deployers.spi.deployer.DeploymentUnit;
+import org.jboss.logging.Logger;
import org.jboss.metadata.ApplicationMetaData;
import org.jboss.metadata.BeanMetaData;
-import org.jboss.ws.integration.BasicEndpoint;
+import org.jboss.ws.integration.EndpointImpl;
import org.jboss.ws.integration.Endpoint;
import org.jboss.ws.integration.ObjectNameFactory;
import org.jboss.ws.integration.Service;
-import org.jboss.ws.integration.deployment.BasicDeployment;
+import org.jboss.ws.integration.deployment.DeploymentImpl;
import org.jboss.ws.integration.deployment.Deployment;
import org.jboss.ws.integration.deployment.Deployment.DeploymentType;
import org.jboss.ws.metadata.webservices.PortComponentMetaData;
@@ -55,7 +56,7 @@
@Override
public Deployment createDeployment(DeploymentUnit unit)
{
- Deployment deployment = new BasicDeployment();
+ Deployment deployment = new DeploymentImpl();
deployment.setType(getDeploymentType());
deployment.setClassLoader(unit.getClassLoader());
@@ -92,7 +93,7 @@
Class<?> epBean = loader.loadClass(ejbClass.trim());
// Create the endpoint
- Endpoint endpoint = new BasicEndpoint(service, epBean);
+ Endpoint endpoint = new EndpointImpl(service, epBean);
String nameStr = Endpoint.SEPID_DOMAIN + ":" +
Endpoint.SEPID_PROPERTY_ENDPOINT + "=" + ejbLink;
endpoint.setName(ObjectNameFactory.create(nameStr));
Modified:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/JAXRPCDeployerHookJSE.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/JAXRPCDeployerHookJSE.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/JAXRPCDeployerHookJSE.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -26,11 +26,11 @@
import org.jboss.deployers.spi.deployer.DeploymentUnit;
import org.jboss.metadata.WebMetaData;
import org.jboss.metadata.web.Servlet;
-import org.jboss.ws.integration.BasicEndpoint;
+import org.jboss.ws.integration.EndpointImpl;
import org.jboss.ws.integration.Endpoint;
import org.jboss.ws.integration.ObjectNameFactory;
import org.jboss.ws.integration.Service;
-import org.jboss.ws.integration.deployment.BasicDeployment;
+import org.jboss.ws.integration.deployment.DeploymentImpl;
import org.jboss.ws.integration.deployment.Deployment;
import org.jboss.ws.integration.deployment.Deployment.DeploymentType;
import org.jboss.ws.metadata.webservices.PortComponentMetaData;
@@ -58,7 +58,7 @@
@Override
public Deployment createDeployment(DeploymentUnit unit)
{
- Deployment deployment = new BasicDeployment();
+ Deployment deployment = new DeploymentImpl();
deployment.setType(getDeploymentType());
deployment.setClassLoader(unit.getClassLoader());
@@ -102,7 +102,7 @@
Class<?> epBean = loader.loadClass(servletClass.trim());
// Create the endpoint
- Endpoint endpoint = new BasicEndpoint(service, epBean);
+ Endpoint endpoint = new EndpointImpl(service, epBean);
String nameStr = Endpoint.SEPID_DOMAIN + ":" +
Endpoint.SEPID_PROPERTY_ENDPOINT + "=" + servletLink;
endpoint.setName(ObjectNameFactory.create(nameStr));
Modified:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/JAXWSDeployerHookEJB3.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/JAXWSDeployerHookEJB3.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/JAXWSDeployerHookEJB3.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -32,11 +32,11 @@
import org.jboss.ejb3.EJBContainer;
import org.jboss.ejb3.Ejb3Deployment;
import org.jboss.ejb3.stateless.StatelessContainer;
-import org.jboss.ws.integration.BasicEndpoint;
+import org.jboss.ws.integration.EndpointImpl;
import org.jboss.ws.integration.Endpoint;
import org.jboss.ws.integration.ObjectNameFactory;
import org.jboss.ws.integration.Service;
-import org.jboss.ws.integration.deployment.BasicDeployment;
+import org.jboss.ws.integration.deployment.DeploymentImpl;
import org.jboss.ws.integration.deployment.Deployment;
import org.jboss.ws.integration.deployment.Deployment.DeploymentType;
@@ -58,7 +58,7 @@
@Override
public Deployment createDeployment(DeploymentUnit unit)
{
- Deployment deployment = new BasicDeployment();
+ Deployment deployment = new DeploymentImpl();
deployment.setType(getDeploymentType());
deployment.setClassLoader(unit.getClassLoader());
@@ -81,7 +81,7 @@
Class epBean = container.getBeanClass();
// Create the endpoint
- Endpoint endpoint = new BasicEndpoint(service, epBean);
+ Endpoint endpoint = new EndpointImpl(service, epBean);
String nameStr = Endpoint.SEPID_DOMAIN + ":" +
Endpoint.SEPID_PROPERTY_ENDPOINT + "=" + ejbName;
endpoint.setName(ObjectNameFactory.create(nameStr));
Modified:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/JAXWSDeployerHookJSE.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/JAXWSDeployerHookJSE.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/JAXWSDeployerHookJSE.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -32,11 +32,11 @@
import org.jboss.deployers.spi.deployer.DeploymentUnit;
import org.jboss.metadata.WebMetaData;
import org.jboss.metadata.web.Servlet;
-import org.jboss.ws.integration.BasicEndpoint;
+import org.jboss.ws.integration.EndpointImpl;
import org.jboss.ws.integration.Endpoint;
import org.jboss.ws.integration.ObjectNameFactory;
import org.jboss.ws.integration.Service;
-import org.jboss.ws.integration.deployment.BasicDeployment;
+import org.jboss.ws.integration.deployment.DeploymentImpl;
import org.jboss.ws.integration.deployment.Deployment;
import org.jboss.ws.integration.deployment.Deployment.DeploymentType;
@@ -58,7 +58,7 @@
@Override
public Deployment createDeployment(DeploymentUnit unit)
{
- Deployment deployment = new BasicDeployment();
+ Deployment deployment = new DeploymentImpl();
deployment.setType(getDeploymentType());
deployment.setClassLoader(unit.getClassLoader());
@@ -83,7 +83,7 @@
Class<?> epBean = loader.loadClass(servletClass.trim());
// Create the endpoint
- Endpoint endpoint = new BasicEndpoint(service, epBean);
+ Endpoint endpoint = new EndpointImpl(service, epBean);
String nameStr = Endpoint.SEPID_DOMAIN + ":" +
Endpoint.SEPID_PROPERTY_ENDPOINT + "=" + servletName;
endpoint.setName(ObjectNameFactory.create(nameStr));
Copied:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/JBossContextServlet.java
(from rev 2936,
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/JBossContextServlet.java)
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/JBossContextServlet.java
(rev 0)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/JBossContextServlet.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -0,0 +1,46 @@
+/*
+ * 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.ws.integration.jboss50.jbossws;
+
+// $Id$
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.core.server.legacy.CommonContextServlet;
+import org.jboss.ws.core.server.legacy.ServiceEndpointManagerFactory;
+
+/**
+ * The servlet that that is associated with context /jbossws
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 21-Mar-2005
+ */
+public class JBossContextServlet extends CommonContextServlet
+{
+ // provide logging
+ protected final Logger log = Logger.getLogger(JBossContextServlet.class);
+
+ protected void initServiceEndpointManager()
+ {
+ ServiceEndpointManagerFactory factory =
ServiceEndpointManagerFactory.getInstance();
+ epManager = factory.getServiceEndpointManager();
+ }
+}
Deleted:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/LifecycleHandlerImpl.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/LifecycleHandlerImpl.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/LifecycleHandlerImpl.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -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.ws.integration.jboss50.jbossws;
-
-//$Id$
-
-import org.jboss.ws.integration.BasicLifecycleHandler;
-import org.jboss.ws.integration.Endpoint;
-import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
-
-/**
- * A lifecycle handler
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 25-Apr-2007
- */
-public class LifecycleHandlerImpl extends BasicLifecycleHandler
-{
- public void start(Endpoint endpoint)
- {
- super.start(endpoint);
- log.info("WebService started: " + getEndpointAddress(endpoint));
- }
-
- public void stop(Endpoint endpoint)
- {
- super.stop(endpoint);
- log.info("WebService stoped: " + getEndpointAddress(endpoint));
- }
-
- private String getEndpointAddress(Endpoint ep)
- {
- ServerEndpointMetaData sepMetaData = ep.getMetaData(ServerEndpointMetaData.class);
- if (sepMetaData == null)
- throw new IllegalStateException("Cannot obtain endpoint meta data");
-
- return sepMetaData.getEndpointAddress();
- }
-}
Added:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/LifecycleHandlerImpl.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/LifecycleHandlerImpl.java
(rev 0)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/LifecycleHandlerImpl.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -0,0 +1,57 @@
+/*
+ * 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.ws.integration.jboss50.jbossws;
+
+//$Id$
+
+import org.jboss.ws.integration.Endpoint;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
+
+/**
+ * A lifecycle handler
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 25-Apr-2007
+ */
+public class LifecycleHandlerImpl extends org.jboss.ws.integration.LifecycleHandlerImpl
+{
+ public void start(Endpoint endpoint)
+ {
+ super.start(endpoint);
+ log.info("WebService started: " + getEndpointAddress(endpoint));
+ }
+
+ public void stop(Endpoint endpoint)
+ {
+ super.stop(endpoint);
+ log.info("WebService stoped: " + getEndpointAddress(endpoint));
+ }
+
+ private String getEndpointAddress(Endpoint ep)
+ {
+ ServerEndpointMetaData sepMetaData = ep.getMetaData(ServerEndpointMetaData.class);
+ if (sepMetaData == null)
+ throw new IllegalStateException("Cannot obtain endpoint meta data");
+
+ return sepMetaData.getEndpointAddress();
+ }
+}
Copied:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/MainDeployerHook.java
(from rev 2936,
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/BasicDeployerHook.java)
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/MainDeployerHook.java
(rev 0)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/MainDeployerHook.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -0,0 +1,61 @@
+/*
+ * 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.ws.integration.jboss50.jbossws;
+
+//$Id$
+
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.DeploymentUnit;
+import org.jboss.ws.integration.deployment.Deployment;
+
+/**
+ * A basic hook that delegates a deployment manger.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 25-Apr-2007
+ */
+public class MainDeployerHook extends AbstractDeployerHook
+{
+ public void deploy(DeploymentUnit unit) throws DeploymentException
+ {
+ if (ignoreDeployment(unit))
+ return;
+
+ Deployment dep = unit.getAttachment(Deployment.class);
+ if (dep != null)
+ {
+ deployerManager.deploy(dep);
+ }
+ }
+
+ public void undeploy(DeploymentUnit unit)
+ {
+ if (ignoreDeployment(unit))
+ return;
+
+ Deployment dep = unit.getAttachment(Deployment.class);
+ if (dep != null)
+ {
+ deployerManager.undeploy(dep);
+ }
+ }
+}
Copied:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/PortComponentLinkServlet.java
(from rev 2936,
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/PortComponentLinkServlet.java)
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/PortComponentLinkServlet.java
(rev 0)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/PortComponentLinkServlet.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -0,0 +1,93 @@
+/*
+ * 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.ws.integration.jboss50.jbossws;
+
+// $Id$
+
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.server.legacy.ServiceEndpoint;
+import org.jboss.ws.core.server.legacy.ServiceEndpointManager;
+import org.jboss.ws.core.server.legacy.ServiceEndpointManagerFactory;
+
+/**
+ * A servlet that reports the serviceURL for a given service ID.
+ * <p/>
+ * When the web service client ENC is setup, it may contain port-component-link
+ * entries that point to service endpoints in the same top level deployment.
+ * The final serviceURL of those endpoints will become available after the
+ * reference to the javax.xml.rpc.Service is bound to JNDI.
+ * <p/>
+ * When the client does a lookup of the javax.xml.rpc.Service from JNDI the
ObjectFactory
+ * will contact this servlet for the final serviceURL. It is acceptable that the client
+ * wsdl does not contain the correct serviceURL if the client is using the
port-component-link element.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 29-May-2004
+ */
+public class PortComponentLinkServlet extends HttpServlet
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(PortComponentLinkServlet.class);
+
+ protected ServiceEndpointManager epManager;
+
+ public void init(ServletConfig config) throws ServletException
+ {
+ super.init(config);
+ ServiceEndpointManagerFactory factory =
ServiceEndpointManagerFactory.getInstance();
+ epManager = factory.getServiceEndpointManager();
+ }
+
+ /**
+ * Get the serviceURL as string for a given serviceID.
+ */
+ public void doGet(HttpServletRequest req, HttpServletResponse res) throws
ServletException, IOException
+ {
+ String pcLink = req.getParameter("pcLink");
+ if (pcLink == null)
+ throw new IllegalArgumentException("Cannot obtain request parameter
'pcLink'");
+
+ ServiceEndpoint serviceEndpoint = epManager.resolvePortComponentLink(pcLink);
+ ;
+ if (serviceEndpoint == null)
+ throw new WSException("Cannot resolve port-component-link: " +
pcLink);
+
+ res.setContentType("text/plain");
+ PrintWriter out = res.getWriter();
+
+ String endpointAddress =
serviceEndpoint.getServiceEndpointInfo().getServerEndpointMetaData().getEndpointAddress();
+ out.println(endpointAddress);
+
+ log.debug("Resolved " + pcLink + " to: " + endpointAddress);
+ out.close();
+ }
+}
Modified:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/RequestHandlerImpl.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/RequestHandlerImpl.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/RequestHandlerImpl.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -62,8 +62,6 @@
import org.jboss.ws.core.jaxws.handler.MessageContextJAXWS;
import org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS;
import org.jboss.ws.core.server.MimeHeaderSource;
-import org.jboss.ws.core.server.ServiceEndpointManager;
-import org.jboss.ws.core.server.ServiceEndpointManagerFactory;
import org.jboss.ws.core.server.ServletHeaderSource;
import org.jboss.ws.core.server.ServletRequestContext;
import org.jboss.ws.core.server.WSDLRequestHandler;
@@ -80,6 +78,8 @@
import org.jboss.ws.integration.Endpoint.EndpointState;
import org.jboss.ws.integration.invocation.InvocationContext;
import org.jboss.ws.integration.invocation.InvocationHandler;
+import org.jboss.ws.integration.management.ServerConfig;
+import org.jboss.ws.integration.management.ServerConfigFactory;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
import org.jboss.ws.metadata.umdm.EndpointMetaData.Type;
@@ -94,7 +94,7 @@
public class RequestHandlerImpl implements RequestHandler
{
// provide logging
- protected final Logger log = Logger.getLogger(getClass());
+ private static final Logger log = Logger.getLogger(RequestHandlerImpl.class);
public void handleRequest(Endpoint endpoint, InputStream inputStream, OutputStream
outputStream, InvocationContext context)
{
@@ -387,11 +387,11 @@
String wsdlHost = reqURL.getProtocol() + "://" + reqURL.getHost() +
":" + reqURL.getPort();
- ServiceEndpointManagerFactory factory =
ServiceEndpointManagerFactory.getInstance();
- ServiceEndpointManager epManager = factory.getServiceEndpointManager();
- if
(epManager.getWebServiceHost().equals(ServiceEndpointManager.UNDEFINED_HOSTNAME) ==
false)
+ ServerConfigFactory factory = ServerConfigFactory.getInstance();
+ ServerConfig config = factory.getServerConfig();
+ if (config.getWebServiceHost().equals(ServerConfig.UNDEFINED_HOSTNAME) ==
false)
{
- wsdlHost = epManager.getWebServiceHost();
+ wsdlHost = config.getWebServiceHost();
}
log.debug("WSDL request, using host: " + wsdlHost);
Copied:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/SecurityAssociationAdaptorFactoryImpl.java
(from rev 2936,
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/SecurityAssociationAdaptorFactoryImpl.java)
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/SecurityAssociationAdaptorFactoryImpl.java
(rev 0)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/SecurityAssociationAdaptorFactoryImpl.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -0,0 +1,57 @@
+/*
+ * 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.ws.integration.jboss50.jbossws;
+
+// $Id$
+
+import java.security.Principal;
+
+import org.jboss.security.SecurityAssociation;
+import org.jboss.ws.extensions.security.SecurityAssociationAdaptor;
+import org.jboss.ws.extensions.security.SecurityAssociationAdaptorFactory;
+
+/**
+ * A JBoss specific SecurityAdaptorFactory
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 05-May-2006
+ */
+public class SecurityAssociationAdaptorFactoryImpl implements
SecurityAssociationAdaptorFactory
+{
+ public SecurityAssociationAdaptor getSecurityAssociationAdaptor()
+ {
+ return new SecurityAccociationAdaptorImpl();
+ }
+
+ public class SecurityAccociationAdaptorImpl implements SecurityAssociationAdaptor
+ {
+ public void setPrincipal(Principal pricipal)
+ {
+ SecurityAssociation.setPrincipal(pricipal);
+ }
+
+ public void setCredential(Object credential)
+ {
+ SecurityAssociation.setCredential(credential);
+ }
+ }
+}
Copied:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/ServiceEndpointGeneratorEJB21.java
(from rev 2936,
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceEndpointGeneratorEJB21.java)
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/ServiceEndpointGeneratorEJB21.java
(rev 0)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/ServiceEndpointGeneratorEJB21.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -0,0 +1,70 @@
+/*
+ * 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.ws.integration.jboss50.jbossws;
+
+//$Id$
+
+import java.util.Iterator;
+import java.util.Map;
+
+import org.jboss.logging.Logger;
+import org.jboss.metadata.ApplicationMetaData;
+import org.jboss.metadata.AssemblyDescriptorMetaData;
+import org.jboss.ws.core.server.ServiceEndpointGeneratorEJB;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.w3c.dom.Element;
+
+/**
+ * Generate a service endpoint deployment for EJB endpoints
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 12-May-2006
+ */
+public class ServiceEndpointGeneratorEJB21 extends ServiceEndpointGeneratorEJB
+{
+ // logging support
+ protected Logger log = Logger.getLogger(ServiceEndpointGeneratorEJB21.class);
+
+ /** Add the roles from ejb-jar.xml to the security roles
+ */
+ protected void addEJBSecurityRoles(Element webApp, UnifiedDeploymentInfo udi)
+ {
+ // Fix:
http://jira.jboss.org/jira/browse/JBWS-309
+ ApplicationMetaData applMetaData =
(ApplicationMetaData)udi.getAttachment(ApplicationMetaData.class);
+ AssemblyDescriptorMetaData assemblyDescriptor =
applMetaData.getAssemblyDescriptor();
+ if (assemblyDescriptor != null)
+ {
+ Map securityRoles = assemblyDescriptor.getSecurityRoles();
+ if (securityRoles != null)
+ {
+ Iterator it = securityRoles.keySet().iterator();
+ while (it.hasNext())
+ {
+ Element securityRole =
(Element)webApp.appendChild(DOMUtils.createElement("security-role"));
+ Element roleName =
(Element)securityRole.appendChild(DOMUtils.createElement("role-name"));
+ roleName.appendChild(DOMUtils.createTextNode((String)it.next()));
+ }
+ }
+ }
+ }
+}
Copied:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/ServiceEndpointGeneratorEJB3.java
(from rev 2936,
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceEndpointGeneratorEJB3.java)
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/ServiceEndpointGeneratorEJB3.java
(rev 0)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/ServiceEndpointGeneratorEJB3.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -0,0 +1,73 @@
+/*
+ * 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.ws.integration.jboss50.jbossws;
+
+//$Id$
+
+import java.util.Iterator;
+
+import javax.annotation.security.RolesAllowed;
+
+import org.jboss.ejb3.EJBContainer;
+import org.jboss.ejb3.Ejb3Deployment;
+import org.jboss.logging.Logger;
+import org.jboss.ws.core.server.ServiceEndpointGeneratorEJB;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.w3c.dom.Element;
+
+/**
+ * Generate a service endpoint deployment for EJB endpoints
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 12-May-2006
+ */
+public class ServiceEndpointGeneratorEJB3 extends ServiceEndpointGeneratorEJB
+{
+ // logging support
+ protected Logger log = Logger.getLogger(ServiceEndpointGeneratorEJB3.class);
+
+ /** Add the roles from ejb-jar.xml to the security roles
+ */
+ protected void addEJBSecurityRoles(Element webApp, UnifiedDeploymentInfo udi)
+ {
+ Ejb3Deployment ejb3Deployment = udi.getAttachment(Ejb3Deployment.class);
+ if (ejb3Deployment != null)
+ {
+ Iterator it = ejb3Deployment.getEjbContainers().values().iterator();
+ while (it.hasNext())
+ {
+ EJBContainer container = (EJBContainer)it.next();
+ RolesAllowed anRolesAllowed =
(RolesAllowed)container.resolveAnnotation(RolesAllowed.class);
+ if (anRolesAllowed != null)
+ {
+ for (String role : anRolesAllowed.value())
+ {
+ Element securityRole =
(Element)webApp.appendChild(DOMUtils.createElement("security-role"));
+ Element roleName =
(Element)securityRole.appendChild(DOMUtils.createElement("role-name"));
+ roleName.appendChild(DOMUtils.createTextNode(role));
+ }
+ }
+ }
+ }
+ }
+}
Copied:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/ServiceEndpointInterceptor.java
(from rev 2936,
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceEndpointInterceptor.java)
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/ServiceEndpointInterceptor.java
(rev 0)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/ServiceEndpointInterceptor.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -0,0 +1,145 @@
+/*
+ * 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.ws.integration.jboss50.jbossws;
+
+// $Id$
+
+import javax.xml.soap.SOAPMessage;
+
+import org.jboss.ejb.plugins.AbstractInterceptor;
+import org.jboss.invocation.Invocation;
+import org.jboss.invocation.InvocationKey;
+import org.jboss.logging.Logger;
+import org.jboss.ws.core.CommonBinding;
+import org.jboss.ws.core.CommonBindingProvider;
+import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.core.EndpointInvocation;
+import org.jboss.ws.core.jaxrpc.SOAPFaultHelperJAXRPC;
+import org.jboss.ws.core.jaxrpc.handler.HandlerCallback;
+import org.jboss.ws.core.soap.MessageContextAssociation;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
+
+/**
+ * This Interceptor does the ws4ee handler processing.
+ *
+ * According to the ws4ee spec the handler logic must be invoked after the container
+ * applied method level security to the invocation.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 21-Sep-2005
+ */
+public class ServiceEndpointInterceptor extends AbstractInterceptor
+{
+ // provide logging
+ private static Logger log = Logger.getLogger(ServiceEndpointInterceptor.class);
+
+ // Interceptor implementation --------------------------------------
+
+ /** Before and after we call the service endpoint bean, we process the handler
chains.
+ */
+ public Object invoke(final Invocation mi) throws Exception
+ {
+ // If no msgContext, it's not for us
+ CommonMessageContext msgContext =
(CommonMessageContext)mi.getPayloadValue(InvocationKey.SOAP_MESSAGE_CONTEXT);
+ if (msgContext == null)
+ {
+ return getNext().invoke(mi);
+ }
+
+ // Get the endpoint invocation
+ EndpointInvocation epInv =
(EndpointInvocation)mi.getValue(EndpointInvocation.class.getName());
+ OperationMetaData opMetaData = epInv.getOperationMetaData();
+
+ // Get the handler callback
+ HandlerCallback callback =
(HandlerCallback)mi.getValue(HandlerCallback.class.getName());
+
+ // Handlers need to be Tx. Therefore we must invoke the handler chain after the
TransactionInterceptor.
+ if (callback != null && epInv != null)
+ {
+ try
+ {
+ // call the request handlers
+ boolean handlersPass =
callback.callRequestHandlerChain(HandlerType.ENDPOINT);
+ handlersPass = handlersPass &&
callback.callRequestHandlerChain(HandlerType.POST);
+
+ // Call the next interceptor in the chain
+ if (handlersPass)
+ {
+ CommonBindingProvider bindingProvider = new
CommonBindingProvider(opMetaData.getEndpointMetaData());
+ CommonBinding binding = bindingProvider.getCommonBinding();
+
+ // Verify that the the message has not been mofified
+ CommonMessageContext messageContext =
MessageContextAssociation.peekMessageContext();
+ if (messageContext.isModified())
+ {
+ log.debug("Handler modified payload, unbind message and update
invocation args");
+ epInv =
bindingProvider.getCommonBinding().unbindRequestMessage(opMetaData,
messageContext.getMessageAbstraction());
+ }
+
+ // The SOAPContentElements stored in the EndpointInvocation might have
changed after
+ // handler processing. Get the updated request payload. This should be a
noop if request
+ // handlers did not modify the incomming SOAP message.
+ Object[] reqParams = epInv.getRequestPayload();
+ mi.setArguments(reqParams);
+ Object resObj = getNext().invoke(mi);
+ epInv.setReturnValue(resObj);
+
+ // Bind the response message
+ SOAPMessage resMessage =
(SOAPMessage)binding.bindResponseMessage(opMetaData, epInv);
+ msgContext.setSOAPMessage(resMessage);
+ }
+
+ // call the response handlers
+ handlersPass = callback.callResponseHandlerChain(HandlerType.POST);
+ handlersPass = handlersPass &&
callback.callResponseHandlerChain(HandlerType.ENDPOINT);
+
+ // update the return value after response handler processing
+ Object resObj = epInv.getReturnValue();
+
+ return resObj;
+ }
+ catch (Exception ex)
+ {
+ try
+ {
+ SOAPMessage faultMessage =
SOAPFaultHelperJAXRPC.exceptionToFaultMessage(ex);
+ msgContext.setSOAPMessage(faultMessage);
+
+ // call the fault handlers
+ boolean handlersPass = callback.callFaultHandlerChain(HandlerType.POST,
ex);
+ handlersPass = handlersPass &&
callback.callFaultHandlerChain(HandlerType.ENDPOINT, ex);
+ }
+ catch (Exception subEx)
+ {
+ log.warn("Cannot process handlerChain.handleFault, ignoring: ",
subEx);
+ }
+ throw ex;
+ }
+ }
+ else
+ {
+ log.warn("Handler callback not available");
+ return getNext().invoke(mi);
+ }
+ }
+}
Modified:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/UnifiedDeploymentInfoDeployer.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/UnifiedDeploymentInfoDeployer.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/UnifiedDeploymentInfoDeployer.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -29,7 +29,6 @@
import org.jboss.ws.integration.deployment.AbstractDeployer;
import org.jboss.ws.integration.deployment.Deployment;
import org.jboss.ws.integration.deployment.Deployment.DeploymentType;
-import org.jboss.ws.integration.jboss50.DeploymentInfoAdaptor;
import org.jboss.ws.metadata.builder.jaxrpc.JAXRPCDeployment;
import org.jboss.ws.metadata.webservices.WebservicesMetaData;
Copied:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/VirtualFileAdaptor.java
(from rev 2936,
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/VirtualFileAdaptor.java)
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/VirtualFileAdaptor.java
(rev 0)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/VirtualFileAdaptor.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -0,0 +1,66 @@
+/*
+ * 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.ws.integration.jboss50.jbossws;
+
+import java.io.IOException;
+import java.net.URL;
+
+import org.jboss.virtual.VirtualFile;
+import org.jboss.ws.integration.UnifiedVirtualFile;
+
+// $Id$
+
+/**
+ * A JBoss50 VirtualFile adaptor
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 05-May-2006
+ */
+public class VirtualFileAdaptor implements UnifiedVirtualFile
+{
+ private static final long serialVersionUID = 6547394037548338042L;
+
+ private VirtualFile root;
+
+ public VirtualFileAdaptor(VirtualFile root)
+ {
+ this.root = root;
+ }
+
+ public UnifiedVirtualFile findChild(String child) throws IOException
+ {
+ VirtualFile vf = root.findChild(child);
+ return new VirtualFileAdaptor(vf);
+ }
+
+ public URL toURL()
+ {
+ try
+ {
+ return root.toURL();
+ }
+ catch (Exception e)
+ {
+ return null;
+ }
+ }
+}
Modified:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/WebAppGeneratorDeployer.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/WebAppGeneratorDeployer.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/WebAppGeneratorDeployer.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -26,8 +26,6 @@
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
import org.jboss.ws.integration.deployment.AbstractDeployer;
import org.jboss.ws.integration.deployment.Deployment;
-import org.jboss.ws.integration.jboss50.ServiceEndpointGeneratorEJB21;
-import org.jboss.ws.integration.jboss50.ServiceEndpointGeneratorEJB3;
import org.jboss.ws.metadata.umdm.UnifiedMetaData;
/**
Copied:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/WebMetaDataAdaptor.java
(from rev 2936,
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/WebMetaDataAdaptor.java)
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/WebMetaDataAdaptor.java
(rev 0)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/WebMetaDataAdaptor.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -0,0 +1,136 @@
+/*
+ * 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.ws.integration.jboss50.jbossws;
+
+// $Id$
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.jboss.deployers.spi.deployer.DeploymentUnit;
+import org.jboss.metadata.WebMetaData;
+import org.jboss.metadata.WebSecurityMetaData;
+import org.jboss.metadata.WebSecurityMetaData.WebResourceCollection;
+import org.jboss.metadata.web.Servlet;
+import org.jboss.metadata.web.ServletMapping;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+import org.jboss.ws.metadata.j2ee.UnifiedWebMetaData;
+import org.jboss.ws.metadata.j2ee.UnifiedWebSecurityMetaData;
+import org.jboss.ws.metadata.j2ee.UnifiedWebMetaData.PublishLocationAdapter;
+import
org.jboss.ws.metadata.j2ee.UnifiedWebSecurityMetaData.UnifiedWebResourceCollection;
+
+/**
+ * Build container independent web meta data
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 05-May-2006
+ */
+public class WebMetaDataAdaptor
+{
+ public static UnifiedWebMetaData buildUnifiedWebMetaData(UnifiedDeploymentInfo udi,
DeploymentUnit unit)
+ {
+ WebMetaData wmd = unit.getAttachment(WebMetaData.class);
+ udi.addAttachment(WebMetaData.class, wmd);
+
+ UnifiedWebMetaData umd = new UnifiedWebMetaData();
+ umd.setContextRoot(wmd.getContextRoot());
+ umd.setServletMappings(getServletMappings(wmd));
+ umd.setServletClassNames(getServletClassMap(wmd));
+ umd.setConfigName(wmd.getConfigName());
+ umd.setConfigFile(wmd.getConfigFile());
+ umd.setSecurityDomain(wmd.getSecurityDomain());
+ umd.setPublishLocationAdapter(getPublishLocationAdpater(wmd));
+ umd.setSecurityMetaData(getSecurityMetaData(wmd.getSecurityContraints()));
+
+ return umd;
+ }
+
+ private static PublishLocationAdapter getPublishLocationAdpater(final WebMetaData
wmd)
+ {
+ return new PublishLocationAdapter()
+ {
+ public String getWsdlPublishLocationByName(String name)
+ {
+ return wmd.getWsdlPublishLocationByName(name);
+ }
+ };
+ }
+
+ protected static List<UnifiedWebSecurityMetaData> getSecurityMetaData(final
Iterator securityConstraints)
+ {
+ ArrayList<UnifiedWebSecurityMetaData> unifiedsecurityMetaData = new
ArrayList<UnifiedWebSecurityMetaData>();
+
+ while (securityConstraints.hasNext())
+ {
+ WebSecurityMetaData securityMetaData =
(WebSecurityMetaData)securityConstraints.next();
+
+ UnifiedWebSecurityMetaData current = new UnifiedWebSecurityMetaData();
+ unifiedsecurityMetaData.add(current);
+
+ current.setTransportGuarantee(securityMetaData.getTransportGuarantee());
+
+ Map<String, WebResourceCollection> resources =
securityMetaData.getWebResources();
+ for (WebResourceCollection webResource : resources.values())
+ {
+ UnifiedWebResourceCollection currentResource =
current.addWebResource(webResource.getName());
+ for (String currentPattern : webResource.getUrlPatterns())
+ {
+ currentResource.addPattern(currentPattern);
+ }
+ }
+ }
+
+ return unifiedsecurityMetaData;
+ }
+
+ private static Map<String, String> getServletMappings(WebMetaData wmd)
+ {
+ Map<String, String> mappings = new HashMap<String, String>();
+ Iterator it = wmd.getServletMappings().iterator();
+ while (it.hasNext())
+ {
+ ServletMapping sm = (ServletMapping)it.next();
+ // FIXME - Add support for multiple mappings
+ mappings.put(sm.getName(), sm.getUrlPatterns().get(0));
+ }
+ return mappings;
+ }
+
+ private static Map<String, String> getServletClassMap(WebMetaData wmd)
+ {
+ Map<String, String> mappings = new HashMap<String, String>();
+ Iterator it = wmd.getServlets().iterator();
+ while (it.hasNext())
+ {
+ Servlet servlet = (Servlet)it.next();
+ // Skip JSPs
+ if (servlet.getServletClass() == null || servlet.getServletClass().length() ==
0)
+ continue;
+
+ mappings.put(servlet.getName(), servlet.getServletClass());
+ }
+ return mappings;
+ }
+}
Modified:
trunk/integration-jboss50/src/resources/jbossws.deployer/META-INF/jbossws-deployer-beans.xml
===================================================================
---
trunk/integration-jboss50/src/resources/jbossws.deployer/META-INF/jbossws-deployer-beans.xml 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss50/src/resources/jbossws.deployer/META-INF/jbossws-deployer-beans.xml 2007-04-27
18:55:01 UTC (rev 2947)
@@ -3,9 +3,11 @@
<deployment xmlns="urn:jboss:bean-deployer:2.0">
<!--
- A web service deployer that hooks in after the EJB deployer
+ A web service deployer that hooks in after the EJB deployers
-->
<bean name="WebServiceDeployerEJB"
class="org.jboss.ws.integration.jboss50.WebServiceDeployerEJB">
+ <property name="relOrderEJB2x"><inject
bean="EJB2xDeployer" property="relativeOrder"/></property>
+ <property name="relOrderEJB3"><inject
bean="EJBRegistrationDeployer"
property="relativeOrder"/></property>
<install bean="MainDeployer" method="addDeployer">
<parameter>
<this/>
@@ -16,6 +18,7 @@
<this/>
</parameter>
</uninstall>
+ <depends>EJB2xDeployer</depends>
<depends>EJBRegistrationDeployer</depends>
</bean>
@@ -23,11 +26,7 @@
A web service deployer that hooks in before the WAR deployer
-->
<bean name="WebServiceDeployerJSE"
class="org.jboss.ws.integration.jboss50.WebServiceDeployerJSE">
- <!--
- The AbstractWarDeployer sets this explicitly to 7001. We need to hook in before
- Should this not be done with bean dependencies (i.e. the WarDeployer should depend
on this guy)?
- -->
- <property name="relativeOrder">7000</property>
+ <property name="relOrderWar"><inject bean="WarDeployer"
property="relativeOrder"/></property>
<install bean="MainDeployer" method="addDeployer">
<parameter>
<this/>
@@ -42,9 +41,11 @@
</bean>
<!--
- A web service deployer that hooks in after the WAR/EJB deployer
+ A web service deployer that hooks in after the web service WAR/EJB deployers
-->
- <bean name="WebServiceLifecycleDeployer"
class="org.jboss.ws.integration.jboss50.WebServiceLifecycleDeployer">
+ <bean name="WebServiceMainDeployer"
class="org.jboss.ws.integration.jboss50.WebServiceMainDeployer">
+ <property name="relOrderJSE"><inject
bean="WebServiceDeployerJSE"
property="relativeOrder"/></property>
+ <property name="relOrderEJB"><inject
bean="WebServiceDeployerEJB"
property="relativeOrder"/></property>
<install bean="MainDeployer" method="addDeployer">
<parameter>
<this/>
Modified: trunk/integration-jboss50/src/resources/jbossws.sar/META-INF/jbossws-beans.xml
===================================================================
---
trunk/integration-jboss50/src/resources/jbossws.sar/META-INF/jbossws-beans.xml 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-jboss50/src/resources/jbossws.sar/META-INF/jbossws-beans.xml 2007-04-27
18:55:01 UTC (rev 2947)
@@ -2,23 +2,44 @@
<deployment xmlns="urn:jboss:bean-deployer:2.0">
- <!-- Locate the single instance of the kernel -->
- <bean name="KernelLocator"
class="org.jboss.ws.integration.KernelLocator">
- <property name="kernel"><inject
bean="jboss.kernel:service=Kernel"/></property>
+ <!-- An abstraction of server configuration aspects. -->
+ <bean name="WSServerConfig"
class="org.jboss.ws.integration.management.ServerConfigImpl">
+ <!--
+ 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.
+
+ If the content of <soap:address> is a valid URL, JBossWS will not rewrite
it unless 'modifySOAPAddress' is true.
+ If the content of <soap:address> is not a valid URL, JBossWS will rewrite
it using the attribute values given below.
+
+ If 'webServiceHost' is not set, JBossWS uses requesters protocol host and
port when rewriting the <soap:address>.
+ -->
+ <property
name="webServiceHost">${jboss.bind.address}</property>
+ <property name="modifySOAPAddress">true</property>
+
+ <!--
+ Set these properties to explicitly define the ports that will be used for rewriting
the SOAP address.
+ Otherwise the ports will be identified by querying the list of installed
connectors.
+ If multiple connectors are found the port of the first connector is used.
+ <property name="webServiceSecurePort">8443</property>
+ <property name="webServicePort">8080</property>
+ -->
</bean>
-
+
<!-- The registry for web service endpoints -->
- <bean name="WSEndpointRegistry"
class="org.jboss.ws.integration.management.BasicEndpointRegistry"/>
+ <bean name="WSEndpointRegistry"
class="org.jboss.ws.integration.management.EndpointRegistryImpl"/>
+ <!-- A subscription manager for WS-Eventing -->
+ <bean name="WSSubscriptionManager"
class="org.jboss.ws.extensions.eventing.mgmt.SubscriptionManager"/>
+
<!-- Bind Service objects in client environment context -->
+ <!-- The bean name is compiled into the server. Changeit with the next release.
-->
<bean name="ServiceRefHandler"
class="org.jboss.ws.core.client.ServiceRefHandlerImpl"/>
-
- <!-- An abstraction of server configuration aspects. -->
- <bean name="ServerConfig"
class="org.jboss.ws.integration.jboss50.ServerConfigImpl"/>
-
- <!-- A subscription manager for WS-Eventing -->
- <bean name="SubscriptionManager"
class="org.jboss.ws.extensions.eventing.mgmt.SubscriptionManager"/>
+ <!-- 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>
+
<!--
*********************************************************************************************************************
Web Service deployment
@@ -28,34 +49,34 @@
1) EJBDeployer < WebServiceDeployerEJB
2) WebServiceDeployerJSE < WarDeployer
- 3) WebServiceLifecycleDeployer
+ 3) WebServiceMainDeployer
Each WebServiceDeployer has a number of DeployerHooks registerd with it
- WebServiceDeployerEJB
- - WSJAXRPCDeployerHookEJB21
- - WSJAXWSDeployerHookEJB3
+ - WSDeployerHook_JAXRPC_EJB21
+ - WSDeployerHook_JAXWS_EJB3
- WebServiceDeployerJSE
- - WSJAXRPCDeployerHookJSE
- - WSJAXWSDeployerHookJSE
+ - WSDeployerHook_JAXRPC_JSE
+ - WSDeployerHook_JAXWS_JSE
- - WebServiceLifecycleDeployer
- - WSLifecycleDeployerHook
+ - WebServiceMainDeployer
+ - WSMainDeployerHook
Conceptually, each of these hooks implements the following pattern:
- Hook.deploy(unit)
+ DployerHook.deploy(unit)
if(isWebServiceDeployment)
Deployment dep = createDeployment(unit)
- DeploymentManager.deploy(dep)
+ DeployerManager.deploy(dep)
- Hook.undeploy(unit)
+ DeployerHook.undeploy(unit)
Deployment dep = getDeployment(unit)
- DeploymentManager.undeploy(dep)
+ DeployerManager.undeploy(dep)
- Each deployer hook has a web service deployment manager injected into it.
- A web service deployment managers maintains a list of Deployers, each of which
+ Each deployer hook has a web service DeployerManager injected into it.
+ A web service DeployerManager maintains a list of Deployers, each of which
handles a single aspect of web service deployment.
Finally, each Endpoint is registered with the EndpointRegistry.
@@ -64,84 +85,10 @@
-->
<!--
- Register DeployerHooks with JBoss deployers
- -->
- <bean name="WSJAXRPCDeployerHookJSE"
class="org.jboss.ws.integration.jboss50.jbossws.JAXRPCDeployerHookJSE">
- <property name="deploymentManager"><inject
bean="WSDeploymentJSE"/></property>
- <install bean="WebServiceDeployerJSE"
method="addDeployerHook">
- <parameter>
- <this/>
- </parameter>
- </install>
- <uninstall bean="WebServiceDeployerJSE"
method="removeDeployerHook">
- <parameter>
- <this/>
- </parameter>
- </uninstall>
- <depends>WebServiceDeployerJSE</depends>
- </bean>
- <bean name="WSJAXRPCDeployerHookEJB21"
class="org.jboss.ws.integration.jboss50.jbossws.JAXRPCDeployerHookEJB21">
- <property name="deploymentManager"><inject
bean="WSDeploymentEJB"/></property>
- <install bean="WebServiceDeployerEJB"
method="addDeployerHook">
- <parameter>
- <this/>
- </parameter>
- </install>
- <uninstall bean="WebServiceDeployerEJB"
method="removeDeployerHook">
- <parameter>
- <this/>
- </parameter>
- </uninstall>
- <depends>WebServiceDeployerEJB</depends>
- </bean>
- <bean name="WSJAXWSDeployerHookJSE"
class="org.jboss.ws.integration.jboss50.jbossws.JAXWSDeployerHookJSE">
- <property name="deploymentManager"><inject
bean="WSDeploymentJSE"/></property>
- <install bean="WebServiceDeployerJSE"
method="addDeployerHook">
- <parameter>
- <this/>
- </parameter>
- </install>
- <uninstall bean="WebServiceDeployerJSE"
method="removeDeployerHook">
- <parameter>
- <this/>
- </parameter>
- </uninstall>
- <depends>WebServiceDeployerJSE</depends>
- </bean>
- <bean name="WSJAXWSDeployerHookEJB3"
class="org.jboss.ws.integration.jboss50.jbossws.JAXWSDeployerHookEJB3">
- <property name="deploymentManager"><inject
bean="WSDeploymentEJB"/></property>
- <install bean="WebServiceDeployerEJB"
method="addDeployerHook">
- <parameter>
- <this/>
- </parameter>
- </install>
- <uninstall bean="WebServiceDeployerEJB"
method="removeDeployerHook">
- <parameter>
- <this/>
- </parameter>
- </uninstall>
- <depends>WebServiceDeployerEJB</depends>
- </bean>
- <bean name="WSLifecycleDeployerHook"
class="org.jboss.ws.integration.jboss50.jbossws.BasicDeployerHook">
- <property name="deploymentManager"><inject
bean="WSLifecycleDeployment"/></property>
- <install bean="WebServiceLifecycleDeployer"
method="addDeployerHook">
- <parameter>
- <this/>
- </parameter>
- </install>
- <uninstall bean="WebServiceLifecycleDeployer"
method="removeDeployerHook">
- <parameter>
- <this/>
- </parameter>
- </uninstall>
- <depends>WebServiceLifecycleDeployer</depends>
- </bean>
-
- <!--
Each DeploymentManger maintains a list of Deployers
Each Deployer handles a single aspect of web service deployment.
-->
- <bean name="WSDeploymentJSE"
class="org.jboss.ws.integration.deployment.BasicDeploymentManager">
+ <bean name="WSDeployerManagerJSE"
class="org.jboss.ws.integration.deployment.DeployerManagerImpl">
<property name="deployers">
<list class="java.util.LinkedList"
elementClass="org.jboss.ws.integration.deployment.Deployer">
<inject bean="WSUnifiedDeploymentInfoDeployer"/>
@@ -151,7 +98,7 @@
</list>
</property>
</bean>
- <bean name="WSDeploymentEJB"
class="org.jboss.ws.integration.deployment.BasicDeploymentManager">
+ <bean name="WSDeployerManagerEJB"
class="org.jboss.ws.integration.deployment.DeployerManagerImpl">
<property name="deployers">
<list class="java.util.LinkedList"
elementClass="org.jboss.ws.integration.deployment.Deployer">
<inject bean="WSUnifiedDeploymentInfoDeployer"/>
@@ -162,7 +109,7 @@
</list>
</property>
</bean>
- <bean name="WSLifecycleDeployment"
class="org.jboss.ws.integration.deployment.BasicDeploymentManager">
+ <bean name="WSMainDeployerManager"
class="org.jboss.ws.integration.deployment.DeployerManagerImpl">
<property name="deployers">
<list class="java.util.LinkedList"
elementClass="org.jboss.ws.integration.deployment.Deployer">
<inject bean="WSEndpointNameDeployer"/>
@@ -212,66 +159,24 @@
</bean>
<!--
-
*****************************************************************************************************************************
- * Start of legacy web service integration
+ Register DeployerHooks with JBoss deployers
-->
-
- <bean name="ServiceEndpointManager"
class="org.jboss.ws.core.server.ServiceEndpointManager">
-
- <!--
- 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.
-
- If the content of <soap:address> is a valid URL, JBossWS will not rewrite
it unless 'alwaysModifySOAPAddress' is true.
- If the content of <soap:address> is not a valid URL, JBossWS will rewrite
it using the attribute values given below.
-
- If next line (webServiceHost) is commented, JBossWS uses requesters protocolo,
host and port when rewriting the <soap:address>.
- -->
- <property
name="webServiceHost">${jboss.bind.address}</property>
- <property name="alwaysModifySOAPAddress">true</property>
-
- <!--
- Set these properties to explicitly define the ports that will be used for rewriting
the SOAP address.
- Otherwise the ports will be identified by querying the list of installed
connectors.
- If multiple connectors are found the port of the first connector is used.
- <property name="webServiceSecurePort">8443</property>
- <property name="webServicePort">8080</property>
- -->
-
- <property
name="serviceEndpointInvokerJSE">org.jboss.ws.core.server.ServiceEndpointInvokerJSE</property>
- <property
name="serviceEndpointInvokerEJB3">org.jboss.ws.integration.jboss50.ServiceEndpointInvokerEJB3</property>
- <property
name="serviceEndpointInvokerEJB21">org.jboss.ws.integration.jboss50.ServiceEndpointInvokerEJB21</property>
- <!-- Not implemented
- <property
name="serviceEndpointInvokerMDB">org.jboss.ws.integration.jboss50.ServiceEndpointInvokerMDB</property>
- -->
- </bean>
-
- <bean name="ServiceEndpointDeployer"
class="org.jboss.ws.core.server.ServiceEndpointDeployer">
- <property name="serviceEndpointManager">
- <inject bean="ServiceEndpointManager"/>
- </property>
- </bean>
-
- <bean name="ServiceEndpointPublisher"
class="org.jboss.ws.integration.jboss50.ServiceEndpointPublisher">
- <property name="mainDeployer"><inject
bean="MainDeployer"/></property>
- <property
name="servletClass">org.jboss.ws.integration.jboss50.JBossServiceEndpointServlet</property>
- </bean>
-
- <!--
- <bean name="JAXWSDeployerEJB3"
class="org.jboss.ws.integration.jboss50.JAXWSDeployerEJB3">
- <install bean="WebServiceDeployerEJB"
method="addDeployerHook">
+ <bean name="WSDeployerHook_JAXRPC_JSE"
class="org.jboss.ws.integration.jboss50.jbossws.JAXRPCDeployerHookJSE">
+ <property name="deployerManager"><inject
bean="WSDeployerManagerJSE"/></property>
+ <install bean="WebServiceDeployerJSE"
method="addDeployerHook">
<parameter>
<this/>
</parameter>
</install>
- <uninstall bean="WebServiceDeployerEJB"
method="removeDeployerHook">
+ <uninstall bean="WebServiceDeployerJSE"
method="removeDeployerHook">
<parameter>
<this/>
</parameter>
</uninstall>
- <depends>WebServiceDeployerEJB</depends>
+ <depends>WebServiceDeployerJSE</depends>
</bean>
- <bean name="JAXRPCDeployerEJB21"
class="org.jboss.ws.integration.jboss50.JAXRPCDeployerEJB21">
+ <bean name="WSDeployerHook_JAXRPC_EJB21"
class="org.jboss.ws.integration.jboss50.jbossws.JAXRPCDeployerHookEJB21">
+ <property name="deployerManager"><inject
bean="WSDeployerManagerEJB"/></property>
<install bean="WebServiceDeployerEJB"
method="addDeployerHook">
<parameter>
<this/>
@@ -284,8 +189,8 @@
</uninstall>
<depends>WebServiceDeployerEJB</depends>
</bean>
-
- <bean name="JAXWSDeployerJSE"
class="org.jboss.ws.integration.jboss50.JAXWSDeployerJSE">
+ <bean name="WSDeployerHook_JAXWS_JSE"
class="org.jboss.ws.integration.jboss50.jbossws.JAXWSDeployerHookJSE">
+ <property name="deployerManager"><inject
bean="WSDeployerManagerJSE"/></property>
<install bean="WebServiceDeployerJSE"
method="addDeployerHook">
<parameter>
<this/>
@@ -298,33 +203,33 @@
</uninstall>
<depends>WebServiceDeployerJSE</depends>
</bean>
- <bean name="JAXRPCDeployerJSE"
class="org.jboss.ws.integration.jboss50.JAXRPCDeployerJSE">
- <install bean="WebServiceDeployerJSE"
method="addDeployerHook">
+ <bean name="WSDeployerHook_JAXWS_EJB3"
class="org.jboss.ws.integration.jboss50.jbossws.JAXWSDeployerHookEJB3">
+ <property name="deployerManager"><inject
bean="WSDeployerManagerEJB"/></property>
+ <install bean="WebServiceDeployerEJB"
method="addDeployerHook">
<parameter>
<this/>
</parameter>
</install>
- <uninstall bean="WebServiceDeployerJSE"
method="removeDeployerHook">
+ <uninstall bean="WebServiceDeployerEJB"
method="removeDeployerHook">
<parameter>
<this/>
</parameter>
</uninstall>
- <depends>WebServiceDeployerJSE</depends>
+ <depends>WebServiceDeployerEJB</depends>
</bean>
-
- <bean name="ServiceEndpointLifecycleDeployer"
class="org.jboss.ws.integration.jboss50.ServiceEndpointLifecycleDeployer">
- <install bean="WebServiceLifecycleDeployer"
method="addDeployerHook">
+ <bean name="WSMainDeployerHook"
class="org.jboss.ws.integration.jboss50.jbossws.MainDeployerHook">
+ <property name="deployerManager"><inject
bean="WSMainDeployerManager"/></property>
+ <install bean="WebServiceMainDeployer"
method="addDeployerHook">
<parameter>
<this/>
</parameter>
</install>
- <uninstall bean="WebServiceLifecycleDeployer"
method="removeDeployerHook">
+ <uninstall bean="WebServiceMainDeployer"
method="removeDeployerHook">
<parameter>
<this/>
</parameter>
</uninstall>
- <depends>WebServiceLifecycleDeployer</depends>
+ <depends>WebServiceMainDeployer</depends>
</bean>
- -->
-
+
</deployment>
Deleted:
trunk/integration-tomcat/src/java/org/jboss/ws/integration/tomcat/ServerConfigImpl.java
===================================================================
---
trunk/integration-tomcat/src/java/org/jboss/ws/integration/tomcat/ServerConfigImpl.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-tomcat/src/java/org/jboss/ws/integration/tomcat/ServerConfigImpl.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,78 +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.ws.integration.tomcat;
-
-//$Id: ServiceEndpointManagerFactoryImpl.java 294 2006-05-08 16:33:42Z
thomas.diesler(a)jboss.com $
-
-import java.io.File;
-import java.io.IOException;
-
-import org.jboss.ws.core.server.ServerConfig;
-
-/**
- * Tomcat specific implementation of a ServerConfig
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 08-May-2006
- */
-public class ServerConfigImpl implements ServerConfig
-{
- public File getServerTempDir()
- {
- try
- {
- File tmpFile = File.createTempFile("jbossws", null);
- File tmpdir = tmpFile.getParentFile();
- tmpFile.delete();
- return tmpdir;
- }
- catch (IOException e)
- {
- return null;
- }
- }
-
- public File getServerDataDir()
- {
- try
- {
- File tmpFile = File.createTempFile("jbossws", null);
- File tmpdir = tmpFile.getParentFile();
- tmpFile.delete();
- return tmpdir;
- }
- catch (IOException e)
- {
- return null;
- }
- }
-
- public int getWebServicePort()
- {
- return 8080;
- }
-
- public int getWebServiceSecurePort()
- {
- return 8443;
- }
-}
Modified:
trunk/integration-tomcat/src/java/org/jboss/ws/integration/tomcat/TomcatContextServlet.java
===================================================================
---
trunk/integration-tomcat/src/java/org/jboss/ws/integration/tomcat/TomcatContextServlet.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-tomcat/src/java/org/jboss/ws/integration/tomcat/TomcatContextServlet.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -28,8 +28,8 @@
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
-import org.jboss.ws.core.CommonContextServlet;
-import org.jboss.ws.core.server.ServiceEndpointManagerFactory;
+import org.jboss.ws.core.server.legacy.CommonContextServlet;
+import org.jboss.ws.core.server.legacy.ServiceEndpointManagerFactory;
/**
* The servlet that that is associated with context /jbossws
Modified:
trunk/integration-tomcat/src/java/org/jboss/ws/integration/tomcat/TomcatServiceEndpointServlet.java
===================================================================
---
trunk/integration-tomcat/src/java/org/jboss/ws/integration/tomcat/TomcatServiceEndpointServlet.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/integration-tomcat/src/java/org/jboss/ws/integration/tomcat/TomcatServiceEndpointServlet.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -37,10 +37,10 @@
import org.jboss.kernel.spi.registry.KernelRegistryEntry;
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
-import org.jboss.ws.core.server.AbstractServiceEndpointServlet;
import org.jboss.ws.core.server.JAXWSDeployment;
-import org.jboss.ws.core.server.ServiceEndpointDeployer;
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+import org.jboss.ws.core.server.legacy.AbstractServiceEndpointServlet;
+import org.jboss.ws.core.server.legacy.ServiceEndpointDeployer;
import org.jboss.ws.integration.KernelLocator;
import org.jboss.ws.integration.ResourceLoaderAdapter;
import org.jboss.ws.integration.UnifiedVirtualFile;
Deleted: trunk/jbossws-core/src/java/org/jboss/ws/core/CommonContextServlet.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/CommonContextServlet.java 2007-04-27
14:04:25 UTC (rev 2946)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/CommonContextServlet.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,170 +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.ws.core;
-
-// $Id$
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.net.URL;
-import java.util.List;
-
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.server.ServiceEndpointDTO;
-import org.jboss.ws.core.server.ServiceEndpointManager;
-
-/**
- * The servlet that that is associated with context /jbossws
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 21-Mar-2005
- */
-public abstract class CommonContextServlet extends HttpServlet
-{
- // provide logging
- protected final Logger log = Logger.getLogger(CommonContextServlet.class);
-
- protected ServiceEndpointManager epManager;
-
- public void init(ServletConfig config) throws ServletException
- {
- super.init(config);
- initServiceEndpointManager();
- }
-
- protected abstract void initServiceEndpointManager();
-
- /** Process GET requests.
- */
- public void doGet(HttpServletRequest req, HttpServletResponse res) throws
ServletException, IOException
- {
- PrintWriter writer = res.getWriter();
- res.setContentType("text/html");
-
- writer.print("<html>");
- setupHTMLResponseHeader(writer);
-
- URL requestURL = new URL(req.getRequestURL().toString());
-
- writer.print("<body>");
-
- writer.print("<div
class='pageHeader'>JBossWS/Services</div>");
- writer.print("<div class='pageSection'>");
- writer.print("<fieldset>");
- writer.print("<legend><b>Registered Service
Endpoints</b></legend>");
- writer.print("<table>");
-
- // begin iteration
- List<ServiceEndpointDTO> endpoints =
epManager.getRegisteredEndpoints(requestURL);
-
- if(endpoints.isEmpty())
- {
- writer.print("<tr>");
- writer.print(" <td><h3>There are currently no endpoints
deployed</h3></td>");
- writer.print("</tr>");
- }
-
- for(ServiceEndpointDTO ep : endpoints)
- {
- writer.print("<tr>");
- writer.print(" <td>ServiceEndpointID</td>");
- writer.print(" <td>"+ep.getSepID()+"</td>");
- writer.print("</tr>");
- writer.print("<tr>");
- writer.print(" <td>ServiceEndpointAddress</td>");
- writer.print(" <td><a
href='"+ep.getAddress()+"?wsdl'>"+ep.getAddress()+"?wsdl</a></td>");
- writer.print("</tr>");
- writer.print("<tr>");
- writer.print(" <td colspan=2>");
- writer.print(" ");
- writer.print("");
- writer.print("<table class='metrics'>");
- writer.print("<tr>");
- writer.print(" <td>StartTime</td>");
- writer.print(" <td>StopTime</td>");
- writer.print(" <td></td>");
- writer.print("</tr>");
- writer.print("<tr>");
-
writer.print(" <td>"+ep.getSeMetrics().getStartTime()+"</td>");
-
- String stopTime = ep.getSeMetrics().getStopTime() != null ?
ep.getSeMetrics().getStopTime().toString() : "";
- writer.print(" <td>"+stopTime+"</td>");
- writer.print(" <td></td>");
- writer.print("</tr>");
- writer.print("<tr>");
-
- writer.print(" <td>RequestCount</td>");
- writer.print(" <td>ResponseCount</td>");
- writer.print(" <td>FaultCount</td>");
- writer.print("</tr>");
- writer.print("<tr>");
-
writer.print(" <td>"+ep.getSeMetrics().getRequestCount()+"</td>");
-
writer.print(" <td>"+ep.getSeMetrics().getResponseCount()+"</td>");
-
writer.print(" <td>"+ep.getSeMetrics().getFaultCount()+"</td>");
- writer.print("</tr>");
- writer.print("<tr>");
- writer.print(" <td>MinProcessingTime</td>");
- writer.print(" <td>MaxProcessingTime</td>");
- writer.print(" <td>AvgProcessingTime</td>");
- writer.print("</tr>");
- writer.print("<tr>");
-
writer.print(" <td>"+ep.getSeMetrics().getMinProcessingTime()+"</td>");
-
writer.print(" <td>"+ep.getSeMetrics().getMaxProcessingTime()+"</td>");
-
writer.print(" <td>"+ep.getSeMetrics().getAverageProcessingTime()+"</td>");
- writer.print("</tr>");
- writer.print("");
- writer.print("");
- writer.print("</table>");
- writer.print("");
- writer.print(" </td>");
- writer.print("</tr>");
-
- writer.print("<tr><td
colspan='3'> </td></tr>");
- }
- // end iteration
- writer.print("</table>");
- writer.print("");
- writer.print("</fieldset>");
- writer.print("</div>");
-
-
- writer.print("</body>");
- writer.print("</html>");
- writer.close();
- }
-
- private void setupHTMLResponseHeader(PrintWriter writer)
- {
- Package wsPackage = Package.getPackage("org.jboss.ws");
- writer.println("<head>");
- writer.println("<meta http-equiv='Content-Type content='text/html;
charset=iso-8859-1'>");
- writer.println("<title>JBossWS /
"+wsPackage.getImplementationVersion()+"</title>");
- writer.println("<link rel='stylesheet'
href='./styles.css'>");
- writer.println("</head>");
- }
-}
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/client/ServiceObjectFactoryJAXRPC.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/client/ServiceObjectFactoryJAXRPC.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/client/ServiceObjectFactoryJAXRPC.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -52,9 +52,9 @@
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
import org.jboss.ws.core.client.ServiceObjectFactory;
-import org.jboss.ws.core.server.ServiceEndpoint;
-import org.jboss.ws.core.server.ServiceEndpointManager;
-import org.jboss.ws.core.server.ServiceEndpointManagerFactory;
+import org.jboss.ws.core.server.legacy.ServiceEndpoint;
+import org.jboss.ws.core.server.legacy.ServiceEndpointManager;
+import org.jboss.ws.core.server.legacy.ServiceEndpointManagerFactory;
import org.jboss.ws.metadata.j2ee.serviceref.UnifiedCallPropertyMetaData;
import org.jboss.ws.metadata.j2ee.serviceref.UnifiedPortComponentRefMetaData;
import org.jboss.ws.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
@@ -175,8 +175,7 @@
if (pcLinkRef != null)
{
String pcLink = (String)pcLinkRef.getContent();
- if (log.isDebugEnabled())
- log.debug("Resolving port-component-link: " + pcLink);
+ log.debug("Resolving port-component-link: " + pcLink);
// First try to obtain the endpoint address loacally
String endpointAddress = null;
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/client/ServiceReferenceable.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/client/ServiceReferenceable.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/client/ServiceReferenceable.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -36,9 +36,11 @@
import javax.naming.StringRefAddr;
import org.jboss.logging.Logger;
-import org.jboss.ws.core.server.ServiceEndpointManager;
-import org.jboss.ws.core.server.ServiceEndpointManagerFactory;
+import org.jboss.ws.core.server.legacy.ServiceEndpointManager;
+import org.jboss.ws.core.server.legacy.ServiceEndpointManagerFactory;
import org.jboss.ws.integration.UnifiedVirtualFile;
+import org.jboss.ws.integration.management.ServerConfig;
+import org.jboss.ws.integration.management.ServerConfigFactory;
import org.jboss.ws.metadata.j2ee.serviceref.UnifiedPortComponentRefMetaData;
import org.jboss.ws.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
@@ -101,10 +103,10 @@
myRef.add(new StringRefAddr(PORT_COMPONENT_LINK, pcLink));
try
{
- ServiceEndpointManagerFactory factory =
ServiceEndpointManagerFactory.getInstance();
- ServiceEndpointManager epManager = factory.getServiceEndpointManager();
- String host = epManager.getWebServiceHost();
- int port = epManager.getWebServicePort();
+ ServerConfigFactory factory = ServerConfigFactory.getInstance();
+ ServerConfig config = factory.getServerConfig();
+ String host = config.getWebServiceHost();
+ int port = config.getWebServicePort();
String servletURL = "http://" + host + ":" + port +
"/jbossws/pclink";
myRef.add(new StringRefAddr(PORT_COMPONENT_LINK_SERVLET, servletURL));
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java 2007-04-27
14:04:25 UTC (rev 2946)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -43,7 +43,9 @@
import org.jboss.ws.core.jaxws.binding.BindingProviderImpl;
import org.jboss.ws.core.server.HttpContext;
import org.jboss.ws.core.server.HttpServer;
-import org.jboss.ws.core.server.ServiceEndpointManagerFactory;
+import org.jboss.ws.core.server.legacy.ServiceEndpointManagerFactory;
+import org.jboss.ws.integration.management.ServerConfig;
+import org.jboss.ws.integration.management.ServerConfigFactory;
import org.w3c.dom.Element;
/**
@@ -151,8 +153,8 @@
boolean isStandalone;
try
{
- ServiceEndpointManagerFactory factory =
ServiceEndpointManagerFactory.getInstance();
- factory.getServiceEndpointManager();
+ ServerConfigFactory factory = ServerConfigFactory.getInstance();
+ factory.getServerConfig();
isStandalone = false;
}
catch (Exception ex)
Deleted:
trunk/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,427 +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.ws.core.server;
-
-// $Id$
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.lang.reflect.UndeclaredThrowableException;
-import java.util.HashMap;
-
-import javax.activation.DataHandler;
-import javax.management.MBeanException;
-import javax.xml.namespace.QName;
-import javax.xml.rpc.soap.SOAPFaultException;
-import javax.xml.soap.Name;
-import javax.xml.soap.SOAPBody;
-import javax.xml.soap.SOAPBodyElement;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPHeader;
-import javax.xml.ws.http.HTTPBinding;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.Constants;
-import org.jboss.ws.core.CommonBinding;
-import org.jboss.ws.core.CommonBindingProvider;
-import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.CommonSOAPBinding;
-import org.jboss.ws.core.DirectionHolder;
-import org.jboss.ws.core.EndpointInvocation;
-import org.jboss.ws.core.MessageAbstraction;
-import org.jboss.ws.core.DirectionHolder.Direction;
-import org.jboss.ws.core.jaxrpc.handler.HandlerDelegateJAXRPC;
-import org.jboss.ws.core.jaxrpc.handler.MessageContextJAXRPC;
-import org.jboss.ws.core.jaxws.binding.BindingProviderImpl;
-import org.jboss.ws.core.jaxws.handler.HandlerDelegateJAXWS;
-import org.jboss.ws.core.jaxws.handler.MessageContextJAXWS;
-import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.ws.core.soap.SOAPMessageImpl;
-import org.jboss.ws.core.utils.JavaUtils;
-import org.jboss.ws.extensions.xop.XOPContext;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.ws.metadata.umdm.OperationMetaData;
-import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
-import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
-
-/** An implementation handles invocations on the endpoint
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 19-Jan-2005
- */
-public abstract class AbstractServiceEndpointInvoker implements ServiceEndpointInvoker
-{
- // provide logging
- private static Logger log = Logger.getLogger(AbstractServiceEndpointInvoker.class);
-
- protected ServiceEndpointInfo seInfo;
- protected CommonBindingProvider bindingProvider;
- protected ServerHandlerDelegate delegate;
-
- /** Initialize the service endpoint */
- public void init(ServiceEndpointInfo seInfo)
- {
- this.seInfo = seInfo;
- ServerEndpointMetaData sepMetaData = seInfo.getServerEndpointMetaData();
-
- if (sepMetaData.getType() == EndpointMetaData.Type.JAXRPC)
- {
- bindingProvider = new CommonBindingProvider(sepMetaData);
- delegate = new HandlerDelegateJAXRPC(sepMetaData);
- }
- else
- {
- bindingProvider = new BindingProviderImpl(sepMetaData);
- delegate = new HandlerDelegateJAXWS(sepMetaData);
- }
- }
-
- /** Load the SEI implementation bean if necessary */
- protected abstract Class loadServiceEndpoint() throws ClassNotFoundException;
-
- /** Create the instance of the SEI implementation bean if necessary */
- protected abstract Object createServiceEndpointInstance(Object context, Class
seiImplClass) throws Exception;
-
- /** Invoke the instance of the SEI implementation bean */
- protected abstract void invokeServiceEndpointInstance(Object seiImpl,
EndpointInvocation epInv) throws Exception;
-
- /** Destroy the instance of the SEI implementation bean if necessary */
- protected abstract void destroyServiceEndpointInstance(Object seiImpl);
-
- public boolean callRequestHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType
type)
- {
- return delegate.callRequestHandlerChain(sepMetaData, type);
- }
-
- public boolean callResponseHandlerChain(ServerEndpointMetaData sepMetaData,
HandlerType type)
- {
- return delegate.callResponseHandlerChain(sepMetaData, type);
- }
-
- public void closeHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType type)
- {
- delegate.closeHandlerChain(sepMetaData, type);
- }
-
- public boolean callFaultHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType
type, Exception ex)
- {
- return delegate.callFaultHandlerChain(sepMetaData, type, ex);
- }
-
- /** Invoke the the service endpoint */
- public MessageAbstraction invoke(Object context) throws Exception
- {
- CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- ServerEndpointMetaData sepMetaData =
(ServerEndpointMetaData)msgContext.getEndpointMetaData();
- MessageAbstraction reqMessage = msgContext.getMessageAbstraction();
-
- // Load the endpoint implementation bean
- Class seImpl = loadServiceEndpoint();
-
- // Create an instance of the endpoint implementation bean
- Object seInstance = createServiceEndpointInstance(context, seImpl);
-
- // The direction of the message
- DirectionHolder direction = new DirectionHolder(Direction.InBound);
-
- // Get the order of pre/post handlerchains
- HandlerType[] handlerType = delegate.getHandlerTypeOrder();
- HandlerType[] faultType = delegate.getHandlerTypeOrder();
-
- // Set the required inbound context properties
- setInboundContextProperties();
-
- try
- {
- boolean oneway = false;
- EndpointInvocation epInv = null;
- OperationMetaData opMetaData = null;
- CommonBinding binding = bindingProvider.getCommonBinding();
- binding.setHeaderSource(delegate);
-
- // call the request handler chain
- boolean handlersPass = callRequestHandlerChain(sepMetaData, handlerType[0]);
-
- // Unbind the request message
- if (handlersPass)
- {
- // Get the operation meta data from the SOAP message
- opMetaData = getDispatchDestination(sepMetaData, reqMessage);
- msgContext.setOperationMetaData(opMetaData);
- oneway = opMetaData.isOneWay();
-
- /*
- * From JAX-WS 10.2.1 - "7. If the node does not understand how to
process
- * the message, then neither handlers nor the endpoint
- * are invoked and instead the binding generates a SOAP must
- * understand exception"
- *
- * Therefore, this must precede the ENDPOINT chain; however, The PRE
- * chain still must happen first since the message may be encrypted, in
which
- * case the operation is still not known. Without knowing the operation, it
- * is not possible to determine what headers are understood by the endpoint.
- */
- if (binding instanceof CommonSOAPBinding)
- ((CommonSOAPBinding)binding).checkMustUnderstand(opMetaData);
-
- // Unbind the request message
- epInv = binding.unbindRequestMessage(opMetaData, reqMessage);
- }
-
- handlersPass = handlersPass && callRequestHandlerChain(sepMetaData,
handlerType[1]);
- handlersPass = handlersPass && callRequestHandlerChain(sepMetaData,
handlerType[2]);
-
- if (handlersPass)
- {
- msgContext.put(CommonMessageContext.ALLOW_EXPAND_TO_DOM, Boolean.TRUE);
- try
- {
- // Check if protocol handlers modified the payload
- if (msgContext.isModified())
- {
- log.debug("Handler modified payload, unbind message again");
- reqMessage = msgContext.getMessageAbstraction();
- epInv = binding.unbindRequestMessage(opMetaData, reqMessage);
- }
-
- // Invoke the service endpoint
- invokeServiceEndpointInstance(seInstance, epInv);
- }
- finally
- {
- msgContext.remove(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
- }
-
- // Reverse the message direction
- msgContext = processPivotInternal(msgContext, direction);
-
- // Set the required outbound context properties
- setOutboundContextProperties();
-
- if (binding instanceof CommonSOAPBinding)
- XOPContext.setMTOMEnabled(((CommonSOAPBinding)binding).isMTOMEnabled());
-
- // Bind the response message
- MessageAbstraction resMessage = binding.bindResponseMessage(opMetaData,
epInv);
- msgContext.setMessageAbstraction(resMessage);
- }
- else
- {
- // Reverse the message direction without calling the endpoint
- MessageAbstraction resMessage = msgContext.getMessageAbstraction();
- msgContext = processPivotInternal(msgContext, direction);
- msgContext.setMessageAbstraction(resMessage);
- }
-
- if (oneway == false)
- {
- // call the response handler chain, removing the fault type entry will not
call handleFault for that chain
- handlersPass = callResponseHandlerChain(sepMetaData, handlerType[2]);
- faultType[2] = null;
- handlersPass = handlersPass && callResponseHandlerChain(sepMetaData,
handlerType[1]);
- faultType[1] = null;
- handlersPass = handlersPass && callResponseHandlerChain(sepMetaData,
handlerType[0]);
- faultType[0] = null;
- }
-
- MessageAbstraction resMessage = msgContext.getMessageAbstraction();
- return resMessage;
- }
- catch (RuntimeException ex)
- {
- // Reverse the message direction
- processPivotInternal(msgContext, direction);
-
- try
- {
- CommonBinding binding = bindingProvider.getCommonBinding();
- binding.bindFaultMessage(ex);
-
- // call the fault handler chain
- boolean handlersPass = true;
- if (faultType[2] != null)
- handlersPass = handlersPass && callFaultHandlerChain(sepMetaData,
faultType[2], ex);
- if (faultType[1] != null)
- handlersPass = handlersPass && callFaultHandlerChain(sepMetaData,
faultType[1], ex);
- if (faultType[0] != null)
- handlersPass = handlersPass && callFaultHandlerChain(sepMetaData,
faultType[0], ex);
- }
- catch (RuntimeException subEx)
- {
- log.warn("Exception while processing handleFault: ", ex);
- ex = subEx;
- }
- throw ex;
- }
- finally
- {
- closeHandlerChain(sepMetaData, handlerType[2]);
- closeHandlerChain(sepMetaData, handlerType[1]);
- closeHandlerChain(sepMetaData, handlerType[0]);
-
- destroyServiceEndpointInstance(seInstance);
- }
- }
-
- protected void setInboundContextProperties()
- {
- CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- if (msgContext instanceof MessageContextJAXWS)
- {
- // Map of attachments to a message for the outbound message, key is the MIME
Content-ID, value is a DataHandler
- msgContext.put(MessageContextJAXWS.INBOUND_MESSAGE_ATTACHMENTS, new
HashMap<String, DataHandler>());
- }
- }
-
- protected void setOutboundContextProperties()
- {
- CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- if (msgContext instanceof MessageContextJAXWS)
- {
- // Map of attachments to a message for the outbound message, key is the MIME
Content-ID, value is a DataHandler
- msgContext.put(MessageContextJAXWS.OUTBOUND_MESSAGE_ATTACHMENTS, new
HashMap<String, DataHandler>());
- }
- }
-
- private CommonMessageContext processPivotInternal(CommonMessageContext msgContext,
DirectionHolder direction)
- {
- if (direction.getDirection() == Direction.InBound)
- {
- EndpointMetaData epMetaData = msgContext.getEndpointMetaData();
- if (epMetaData.getType() == EndpointMetaData.Type.JAXRPC)
- {
- msgContext = MessageContextJAXRPC.processPivot(msgContext);
- }
- else
- {
- msgContext = MessageContextJAXWS.processPivot(msgContext);
- }
- direction.setDirection(Direction.OutBound);
- }
- return msgContext;
- }
-
- private OperationMetaData getDispatchDestination(EndpointMetaData epMetaData,
MessageAbstraction reqMessage) throws SOAPException
- {
- OperationMetaData opMetaData;
-
- String bindingID = epMetaData.getBindingId();
- if (HTTPBinding.HTTP_BINDING.equals(bindingID))
- {
- if (epMetaData.getOperations().size() != 1)
- throw new IllegalStateException("Multiple operations not supported for
HTTP binding");
-
- opMetaData = epMetaData.getOperations().get(0);
- }
- else
- {
- SOAPMessageImpl soapMessage = (SOAPMessageImpl)reqMessage;
-
- opMetaData = soapMessage.getOperationMetaData(epMetaData);
- SOAPHeader soapHeader = soapMessage.getSOAPHeader();
-
- // Report a MustUnderstand fault
- if (opMetaData == null)
- {
- String faultString;
- SOAPBody soapBody = soapMessage.getSOAPBody();
- if (soapBody.getChildElements().hasNext())
- {
- SOAPBodyElement soapBodyElement =
(SOAPBodyElement)soapBody.getChildElements().next();
- Name soapName = soapBodyElement.getElementName();
- faultString = "Endpoint " + epMetaData.getPortName() + "
does not contain operation meta data for: " + soapName;
- }
- else
- {
- faultString = "Endpoint " + epMetaData.getPortName() + "
does not contain operation meta data for empty soap body";
- }
-
- // R2724 If an INSTANCE receives a message that is inconsistent with its WSDL
description, it SHOULD generate a soap:Fault
- // with a faultcode of "Client", unless a
"MustUnderstand" or "VersionMismatch" fault is generated.
- if (soapHeader != null &&
soapHeader.examineMustUnderstandHeaderElements(Constants.URI_SOAP11_NEXT_ACTOR).hasNext())
- {
- QName faultCode = Constants.SOAP11_FAULT_CODE_MUST_UNDERSTAND;
- throw new SOAPFaultException(faultCode, faultString, null, null);
- }
- else
- {
- QName faultCode = Constants.SOAP11_FAULT_CODE_CLIENT;
- throw new SOAPFaultException(faultCode, faultString, null, null);
- }
- }
- }
- return opMetaData;
- }
-
- protected Method getImplMethod(Class implClass, Method seiMethod) throws
ClassNotFoundException, NoSuchMethodException
- {
- String methodName = seiMethod.getName();
- Class[] paramTypes = seiMethod.getParameterTypes();
- for (int i = 0; i < paramTypes.length; i++)
- {
- Class paramType = paramTypes[i];
- if (JavaUtils.isPrimitive(paramType) == false)
- {
- String paramTypeName = paramType.getName();
- paramType = JavaUtils.loadJavaType(paramTypeName);
- paramTypes[i] = paramType;
- }
- }
-
- Method implMethod = implClass.getMethod(methodName, paramTypes);
- return implMethod;
- }
-
- /** handle invocation exceptions */
- public void handleInvocationException(Throwable th) throws Exception
- {
- if (th instanceof InvocationTargetException)
- {
- // unwrap the throwable raised by the service endpoint implementation
- Throwable targetEx = ((InvocationTargetException)th).getTargetException();
- handleInvocationThrowable(targetEx);
- }
-
- if (th instanceof MBeanException)
- {
- throw ((MBeanException)th).getTargetException();
- }
-
- handleInvocationThrowable(th);
- }
-
- private void handleInvocationThrowable(Throwable th) throws Exception
- {
- if (th instanceof Exception)
- {
- throw (Exception)th;
- }
- else if (th instanceof Error)
- {
- throw (Error)th;
- }
- else
- {
- throw new UndeclaredThrowableException(th);
- }
- }
-}
Deleted:
trunk/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointServlet.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointServlet.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointServlet.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,164 +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.ws.core.server;
-
-// $Id: AbstractServiceEndpointServlet.java 396 2006-05-23 09:48:45Z
thomas.diesler(a)jboss.com $
-
-import java.io.IOException;
-import java.io.Writer;
-import java.net.URL;
-
-import javax.management.ObjectName;
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.xml.rpc.JAXRPCException;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.integration.ObjectNameFactory;
-import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
-
-/**
- * A servlet that is installed for every web service endpoint.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 15-Jan-2005
- */
-public abstract class AbstractServiceEndpointServlet extends HttpServlet
-{
- // provide logging
- private static final Logger log =
Logger.getLogger(AbstractServiceEndpointServlet.class);
-
- protected ObjectName sepId;
- protected ServiceEndpointManager epManager;
-
- public void init(ServletConfig config) throws ServletException
- {
- super.init(config);
- initServiceEndpointManager();
- }
-
- public void destroy()
- {
- super.destroy();
- }
-
- public void service(HttpServletRequest req, HttpServletResponse res) throws
ServletException, IOException
- {
- if (sepId == null)
- {
- String contextPath = req.getContextPath();
- initServiceEndpoint(contextPath);
- }
- super.service(req, res);
- }
-
- public void doGet(HttpServletRequest req, HttpServletResponse res) throws
ServletException, IOException
- {
- // Process a WSDL request
- if (req.getParameter("wsdl") != null ||
req.getParameter("WSDL") != null)
- {
- res.setContentType("text/xml");
- try
- {
- // For the base document the resourcePath should be null
- String resourcePath = (String)req.getParameter("resource");
- URL requestURL = new URL(req.getRequestURL().toString());
- epManager.processWSDLRequest(sepId, res.getOutputStream(), requestURL,
resourcePath);
- }
- catch (Exception ex)
- {
- handleException(ex);
- }
- }
- else
- {
- res.setStatus(405);
- res.setContentType("text/plain");
- Writer out = res.getWriter();
- out.write("HTTP GET not supported");
- out.flush();
- out.close();
- }
- }
-
- public void doPost(HttpServletRequest req, HttpServletResponse res) throws
ServletException, IOException
- {
- log.debug("doPost: " + req.getRequestURI());
-
- try
- {
- ServletRequestContext context = new ServletRequestContext(getServletContext(),
req, res);
- epManager.processRequest(sepId, req.getInputStream(), res.getOutputStream(),
context);
- }
- catch (Exception ex)
- {
- handleException(ex);
- }
- }
-
- private void handleException(Exception ex) throws ServletException
- {
- log.error("Error processing web service request", ex);
-
- if (ex instanceof JAXRPCException)
- throw (JAXRPCException)ex;
-
- throw new ServletException(ex);
- }
-
- protected void initServiceEndpointManager()
- {
- ServiceEndpointManagerFactory factory =
ServiceEndpointManagerFactory.getInstance();
- epManager = factory.getServiceEndpointManager();
- }
-
- /** Initialize the service endpoint
- */
- protected void initServiceEndpoint(String contextPath)
- {
- String servletName = getServletName();
- if (contextPath.startsWith("/"))
- contextPath = contextPath.substring(1);
-
- for (ObjectName sepId : epManager.getServiceEndpoints())
- {
- String context =
sepId.getKeyProperty(ServerEndpointMetaData.SEPID_PROPERTY_CONTEXT);
- String endpoint =
sepId.getKeyProperty(ServerEndpointMetaData.SEPID_PROPERTY_ENDPOINT);
- if (servletName.equals(endpoint) && contextPath.equals(context))
- {
- this.sepId = sepId;
- break;
- }
- }
-
- if (sepId == null)
- {
- ObjectName oname = ObjectNameFactory.create(ServerEndpointMetaData.SEPID_DOMAIN
+ ":" + ServerEndpointMetaData.SEPID_PROPERTY_CONTEXT + "=" +
contextPath
- + "," + ServerEndpointMetaData.SEPID_PROPERTY_ENDPOINT +
"=" + servletName);
- throw new WSException("Cannot obtain endpoint for: " + oname);
- }
- }
-}
Deleted: trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServerConfig.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServerConfig.java 2007-04-27
14:04:25 UTC (rev 2946)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServerConfig.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,45 +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.ws.core.server;
-
-// $Id: ServiceEndpointManagerFactory.java 293 2006-05-08 16:31:50Z
thomas.diesler(a)jboss.com $
-
-import java.io.File;
-
-/**
- * Interface to container independent config
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 08-May-2006
- */
-public interface ServerConfig
-{
- static final String BEAN_NAME = "ServerConfig";
-
- File getServerTempDir();
-
- File getServerDataDir();
-
- int getWebServicePort();
-
- int getWebServiceSecurePort();
-}
Deleted: trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServerConfigFactory.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServerConfigFactory.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServerConfigFactory.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -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.ws.core.server;
-
-import org.jboss.ws.integration.KernelLocator;
-import org.jboss.kernel.spi.registry.KernelRegistry;
-import org.jboss.logging.Logger;
-
-// $Id: ServiceEndpointManagerFactory.java 293 2006-05-08 16:31:50Z
thomas.diesler(a)jboss.com $
-
-/**
- * Factory to container independent config
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 08-May-2006
- */
-public class ServerConfigFactory
-{
- // provide logging
- private static final Logger log = Logger.getLogger(ServerConfigFactory.class);
-
- private static ServerConfigFactory instance = new ServerConfigFactory();
-
- // Hide ctor
- protected ServerConfigFactory()
- {
- }
-
- public static ServerConfigFactory getInstance()
- {
- return instance;
- }
-
- public ServerConfig getServerConfig()
- {
- KernelRegistry registry = KernelLocator.getKernel().getRegistry();
- return (ServerConfig)registry.getEntry(ServerConfig.BEAN_NAME).getTarget();
- }
-}
Deleted: trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpoint.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpoint.java 2007-04-27
14:04:25 UTC (rev 2946)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpoint.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,303 +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.ws.core.server;
-
-// $Id$
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.net.URL;
-
-import javax.xml.namespace.QName;
-import javax.xml.rpc.soap.SOAPFaultException;
-import javax.xml.soap.MimeHeaders;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.ws.http.HTTPBinding;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.Constants;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.CommonBinding;
-import org.jboss.ws.core.CommonBindingProvider;
-import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.HTTPMessageImpl;
-import org.jboss.ws.core.MessageAbstraction;
-import org.jboss.ws.core.MessageTrace;
-import org.jboss.ws.core.jaxrpc.binding.BindingException;
-import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.ws.core.soap.MessageFactoryImpl;
-import org.jboss.ws.core.soap.SOAPMessageImpl;
-import org.jboss.ws.core.utils.DOMWriter;
-import org.jboss.ws.extensions.xop.XOPContext;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
-import org.jboss.ws.metadata.umdm.UnifiedMetaData;
-import org.w3c.dom.Document;
-
-/**
- * This object registered with the ServiceEndpointManager service.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 16-Jan-2005
- */
-public class ServiceEndpoint
-{
- // provide logging
- private static Logger log = Logger.getLogger(ServiceEndpoint.class);
-
- /** Endpoint type enum */
- public enum State
- {
- CREATED, STARTED, STOPED, DESTROYED
- }
-
- // The deployment info for this endpoint
- protected ServiceEndpointInfo seInfo;
- // Some metrics for this endpoint
- protected ServiceEndpointMetrics seMetrics;
-
- public ServiceEndpoint(ServiceEndpointInfo seInfo)
- {
- this.seInfo = seInfo;
- this.seInfo.setState(State.CREATED);
- this.seMetrics = new ServiceEndpointMetrics(seInfo.getServiceEndpointID());
- }
-
- public State getState()
- {
- return seInfo.getState();
- }
-
- public ServiceEndpointInfo getServiceEndpointInfo()
- {
- return seInfo;
- }
-
- public ServiceEndpointMetrics getServiceEndpointMetrics()
- {
- return seMetrics;
- }
-
- public void create() throws Exception
- {
- seInfo.setState(State.CREATED);
- }
-
- public void start() throws Exception
- {
- // eagerly initialize the UMDM
- ServerEndpointMetaData epMetaData = seInfo.getServerEndpointMetaData();
- UnifiedMetaData wsMetaData = epMetaData.getServiceMetaData().getUnifiedMetaData();
- wsMetaData.eagerInitialize();
-
- seMetrics.start();
- seInfo.setState(State.STARTED);
- }
-
- public void stop()
- {
- seMetrics.stop();
- seInfo.setState(State.STOPED);
- if (log.isDebugEnabled())
- log.debug("Stop Endpoint" + seMetrics);
- }
-
- public void destroy()
- {
- seInfo.setState(State.DESTROYED);
- }
-
- /** Handle a WSDL request or a request for an included resource
- */
- public void handleWSDLRequest(OutputStream outStream, URL reqURL, String resPath)
throws IOException
- {
- ServiceEndpointInfo sepInfo = getServiceEndpointInfo();
- EndpointMetaData epMetaData = sepInfo.getServerEndpointMetaData();
-
- //String wsdlHost = reqURL.getHost();
- String wsdlHost = reqURL.getProtocol() + "://" + reqURL.getHost() +
":" + reqURL.getPort();
-
- ServiceEndpointManagerFactory factory =
ServiceEndpointManagerFactory.getInstance();
- ServiceEndpointManager epManager = factory.getServiceEndpointManager();
- if (epManager.getWebServiceHost().equals(ServiceEndpointManager.UNDEFINED_HOSTNAME)
== false)
- {
- wsdlHost = epManager.getWebServiceHost();
- }
- if (log.isDebugEnabled())
- log.debug("WSDL request, using host: " + wsdlHost);
-
- WSDLRequestHandler wsdlRequestHandler = new WSDLRequestHandler(epMetaData);
- Document document = wsdlRequestHandler.getDocumentForPath(reqURL, wsdlHost,
resPath);
-
- OutputStreamWriter writer = new OutputStreamWriter(outStream);
- new DOMWriter(writer).setPrettyprint(true).print(document.getDocumentElement());
- outStream.flush();
- outStream.close();
- }
-
- /**
- * Handle a request to this web service endpoint
- */
- public MessageAbstraction processRequest(MimeHeaderSource headerSource,
ServletRequestContext context, InputStream inputStream) throws BindingException
- {
- CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- ServerEndpointMetaData sepMetaData = seInfo.getServerEndpointMetaData();
-
- long beginProcessing = 0;
- ClassLoader ctxClassLoader = Thread.currentThread().getContextClassLoader();
- try
- {
- State state = seInfo.getState();
- if (state != State.STARTED)
- {
- QName faultCode = Constants.SOAP11_FAULT_CODE_SERVER;
- String faultString = "Endpoint cannot handle requests in state: " +
state;
- throw new SOAPFaultException(faultCode, faultString, null, null);
- }
-
- log.debug("BEGIN handleRequest: " + seInfo.getServiceEndpointID());
- beginProcessing = seMetrics.processRequestMessage();
-
- MimeHeaders headers = (headerSource != null ? headerSource.getMimeHeaders() :
null);
-
- MessageAbstraction reqMessage;
-
- String bindingID = sepMetaData.getBindingId();
- if (HTTPBinding.HTTP_BINDING.equals(bindingID))
- {
- reqMessage = new HTTPMessageImpl(headers, inputStream);
- }
- else
- {
- MessageFactoryImpl msgFactory = new MessageFactoryImpl();
- msgFactory.setServiceMode(sepMetaData.getServiceMode());
- msgFactory.setStyle(sepMetaData.getStyle());
-
- reqMessage = (SOAPMessageImpl)msgFactory.createMessage(headers,
inputStream);
- }
-
- // Associate current message with message context
- msgContext.setMessageAbstraction(reqMessage);
-
- // debug the incomming message
- MessageTrace.traceMessage("Incoming Request Message", reqMessage);
-
- // Set the thread context class loader
- ClassLoader classLoader = sepMetaData.getClassLoader();
- Thread.currentThread().setContextClassLoader(classLoader);
-
- // Invoke the service endpoint
- ServiceEndpointInvoker seInvoker = seInfo.getInvoker();
- MessageAbstraction resMessage = seInvoker.invoke(context);
-
- if (resMessage != null)
- postProcessResponse(headerSource, resMessage);
-
- return resMessage;
- }
- catch (Exception ex)
- {
- MessageAbstraction resMessage = msgContext.getMessageAbstraction();
-
- // In case we have an exception before the invoker is called
- // we create the fault message here.
- if (resMessage == null || resMessage.isFaultMessage() == false)
- {
- CommonBindingProvider bindingProvider = getCommonBindingProvider();
- CommonBinding binding = bindingProvider.getCommonBinding();
- resMessage = binding.bindFaultMessage(ex);
- }
-
- if (resMessage != null)
- postProcessResponse(headerSource, resMessage);
-
- return resMessage;
- }
- finally
- {
- try
- {
- MessageAbstraction resMessage = msgContext.getMessageAbstraction();
- if (resMessage != null)
- {
- if (resMessage.isFaultMessage())
- {
- seMetrics.processFaultMessage(beginProcessing);
- }
- else
- {
- seMetrics.processResponseMessage(beginProcessing);
- }
- }
- }
- catch (Exception ex)
- {
- log.error("Cannot process metrics", ex);
- }
-
- // Reset the thread context class loader
- Thread.currentThread().setContextClassLoader(ctxClassLoader);
- if (log.isDebugEnabled())
- log.debug("END handleRequest: " + seInfo.getServiceEndpointID());
- }
- }
-
- /** Set response mime headers
- */
- private void postProcessResponse(MimeHeaderSource headerSource, MessageAbstraction
resMessage)
- {
- try
- {
- // Set the outbound headers
- if (headerSource != null && resMessage instanceof SOAPMessage)
- {
- XOPContext.eagerlyCreateAttachments();
- ((SOAPMessage)resMessage).saveChanges();
- headerSource.setMimeHeaders(resMessage.getMimeHeaders());
- }
-
- // debug the outgoing message
- MessageTrace.traceMessage("Outgoing Response Message", resMessage);
- }
- catch (Exception ex)
- {
- WSException.rethrow("Faild to post process response message", ex);
- }
- }
-
- private CommonBindingProvider getCommonBindingProvider()
- {
- return new CommonBindingProvider(seInfo.getServerEndpointMetaData());
- }
-
- /**
- * Returns a string representation of the object.
- */
- public String toString()
- {
- StringBuilder buffer = new StringBuilder(seInfo.toString());
- buffer.append("\n state=" + seInfo.getState());
- return buffer.toString();
- }
-}
Deleted: trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointDTO.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointDTO.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointDTO.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,70 +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.ws.core.server;
-
-import javax.management.ObjectName;
-
-/**
- * @author Heiko.Braun(a)jboss.org
- * @version $Id$
- * @since 02.02.2007
- */
-public class ServiceEndpointDTO {
-
- private ServiceEndpointMetrics seMetrics;
- private ServiceEndpoint.State state;
- private ObjectName sepID;
- private String address;
-
- public ServiceEndpointMetrics getSeMetrics() {
- return seMetrics;
- }
-
- public void setSeMetrics(ServiceEndpointMetrics seMetrics) {
- this.seMetrics = seMetrics;
- }
-
- public ServiceEndpoint.State getState() {
- return state;
- }
-
- public void setState(ServiceEndpoint.State state) {
- this.state = state;
- }
-
- public ObjectName getSepID() {
- return sepID;
- }
-
- public void setSepID(ObjectName sepID) {
- this.sepID = sepID;
- }
-
- public String getAddress() {
- return address;
- }
-
- public void setAddress(String address) {
- this.address = address;
- }
-
-}
Deleted:
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointDeployer.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointDeployer.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointDeployer.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,229 +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.ws.core.server;
-
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-import javax.management.ObjectName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.integration.deployment.Deployment.DeploymentType;
-import org.jboss.ws.metadata.builder.jaxrpc.JAXRPCDeployment;
-import org.jboss.ws.metadata.builder.jaxrpc.JAXRPCServerMetaDataBuilder;
-import org.jboss.ws.metadata.builder.jaxws.JAXWSMetaDataBuilderEJB3;
-import org.jboss.ws.metadata.builder.jaxws.JAXWSMetaDataBuilderJSE;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
-import org.jboss.ws.metadata.umdm.ServiceMetaData;
-import org.jboss.ws.metadata.umdm.UnifiedMetaData;
-
-/**
- * The POJO deployer for web service endpoints. This Deployer is already decoupled from
the target
- * container (i.e. JBoss, Tomcat). The containers deployer architecture should be used to
populate
- * the UnifiedDeploymentInfo object.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 12-May-2006
- */
-public class ServiceEndpointDeployer
-{
- // logging support
- private static Logger log = Logger.getLogger(ServiceEndpointDeployer.class);
-
- // default bean name
- public static final String BEAN_NAME = "ServiceEndpointDeployer";
-
- // The ServiceEndpointManger injected by the kernel
- private ServiceEndpointManager epManager;
-
- // Maps the deployment url to UMDM
- private Map<String, UnifiedMetaData> metaDataMap = new
ConcurrentHashMap<String, UnifiedMetaData>();
-
- // Injected by the Microkernel
- public void setServiceEndpointManager(ServiceEndpointManager epManager)
- {
- this.epManager = epManager;
- }
-
- public void create(UnifiedDeploymentInfo udi)
- {
- if(log.isDebugEnabled()) log.debug("create: " + udi.name);
- try
- {
- UnifiedMetaData wsMetaData;
- if (udi.type == DeploymentType.JAXRPC_JSE)
- {
- JAXRPCServerMetaDataBuilder builder = new JAXRPCServerMetaDataBuilder();
- wsMetaData = builder.buildMetaData((JAXRPCDeployment)udi);
- }
- else if (udi.type == DeploymentType.JAXRPC_EJB21)
- {
- JAXRPCServerMetaDataBuilder builder = new JAXRPCServerMetaDataBuilder();
- wsMetaData = builder.buildMetaData((JAXRPCDeployment)udi);
- }
- else if (udi.type == DeploymentType.JAXWS_JSE)
- {
- JAXWSMetaDataBuilderJSE builder = new JAXWSMetaDataBuilderJSE();
- wsMetaData = builder.buildMetaData(udi);
- }
- else if (udi.type == DeploymentType.JAXWS_EJB3)
- {
- JAXWSMetaDataBuilderEJB3 builder = new JAXWSMetaDataBuilderEJB3();
- wsMetaData = builder.buildMetaData(udi);
- }
- else
- {
- throw new IllegalStateException("Invalid type: " + udi.type);
- }
-
- metaDataMap.put(udi.name, wsMetaData);
-
- for (ServiceMetaData serviceMetaData : wsMetaData.getServices())
- {
- for (EndpointMetaData epMetaData : serviceMetaData.getEndpoints())
- {
- ServiceEndpointInfo seInfo = new ServiceEndpointInfo(udi,
(ServerEndpointMetaData)epMetaData);
- epManager.createServiceEndpoint(seInfo);
- }
- }
- }
- catch (Exception ex)
- {
- log.error("Cannot create service endpoint", ex);
- if (ex instanceof RuntimeException)
- throw (RuntimeException)ex;
-
- throw new WSException(ex);
- }
- }
-
- public void start(UnifiedDeploymentInfo udi)
- {
- if(log.isDebugEnabled()) log.debug("start: " + udi.name);
- try
- {
- UnifiedMetaData wsMetaData = getUnifiedMetaData(udi);
- if (wsMetaData != null)
- {
- // late initialization of the web context loader
- if (wsMetaData.getClassLoader() != udi.classLoader)
- wsMetaData.setClassLoader(udi.classLoader);
-
- // Publish the WSDL file
- WSDLFilePublisher wsdlfp = new WSDLFilePublisher(udi);
- wsdlfp.publishWsdlFiles(wsMetaData);
- for (ServiceMetaData serviceMetaData : wsMetaData.getServices())
- {
- for (EndpointMetaData epMetaData : serviceMetaData.getEndpoints())
- {
- ObjectName sepID =
((ServerEndpointMetaData)epMetaData).getServiceEndpointID();
- epManager.startServiceEndpoint(sepID);
- }
- }
- }
- }
- catch (Exception ex)
- {
- log.error("Cannot start service endpoint", ex);
- if (ex instanceof RuntimeException)
- throw (RuntimeException)ex;
-
- throw new WSException(ex);
- }
- }
-
- public void stop(UnifiedDeploymentInfo udi)
- {
- if(log.isDebugEnabled()) log.debug("stop: " + udi.name);
- try
- {
- UnifiedMetaData wsMetaData = getUnifiedMetaData(udi);
- if (wsMetaData != null)
- {
- // Stop the service endpoints
- for (ServiceMetaData serviceMetaData : wsMetaData.getServices())
- {
- for (EndpointMetaData epMetaData : serviceMetaData.getEndpoints())
- {
- ObjectName sepID =
((ServerEndpointMetaData)epMetaData).getServiceEndpointID();
- epManager.stopServiceEndpoint(sepID);
- }
- }
-
- // Unpublish the WSDL file
- WSDLFilePublisher wsdlfp = new WSDLFilePublisher(udi);
- wsdlfp.unpublishWsdlFiles();
- }
- }
- catch (Exception ex)
- {
- log.error("Cannot stop service endpoint", ex);
- if (ex instanceof RuntimeException)
- throw (RuntimeException)ex;
-
- throw new WSException(ex);
- }
- }
-
- public void destroy(UnifiedDeploymentInfo udi)
- {
- if(log.isDebugEnabled()) log.debug("destroy: " + udi.name);
- try
- {
- UnifiedMetaData wsMetaData = getUnifiedMetaData(udi);
- if (wsMetaData != null)
- {
- // Destroy the service endpoints
- for (ServiceMetaData serviceMetaData : wsMetaData.getServices())
- {
- for (EndpointMetaData epMetaData : serviceMetaData.getEndpoints())
- {
- ObjectName sepID =
((ServerEndpointMetaData)epMetaData).getServiceEndpointID();
- epManager.destroyServiceEndpoint(sepID);
- }
- }
- removeUnifiedMetaData(udi);
- }
- }
- catch (Exception ex)
- {
- log.error("Cannot destroy service endpoint", ex);
- if (ex instanceof RuntimeException)
- throw (RuntimeException)ex;
-
- throw new WSException(ex);
- }
- }
-
- public UnifiedMetaData getUnifiedMetaData(UnifiedDeploymentInfo udi)
- {
- UnifiedMetaData wsMetaData = metaDataMap.get(udi.name);
- return wsMetaData;
- }
-
- public void removeUnifiedMetaData(UnifiedDeploymentInfo udi)
- {
- metaDataMap.remove(udi.name);
- }
-}
\ No newline at end of file
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointGeneratorEJB.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointGeneratorEJB.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointGeneratorEJB.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -33,11 +33,11 @@
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
-import org.jboss.ws.core.server.ServerConfig;
-import org.jboss.ws.core.server.ServerConfigFactory;
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.core.utils.DOMWriter;
+import org.jboss.ws.integration.management.ServerConfig;
+import org.jboss.ws.integration.management.ServerConfigFactory;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
import org.jboss.ws.metadata.umdm.ServiceMetaData;
Deleted: trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointInfo.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointInfo.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointInfo.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,148 +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.ws.core.server;
-
-// $Id$
-
-import javax.management.ObjectName;
-
-import org.jboss.ws.WSException;
-import org.jboss.ws.integration.deployment.Deployment.DeploymentType;
-import org.jboss.ws.metadata.j2ee.UnifiedApplicationMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedBeanMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedMessageDrivenMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedSessionMetaData;
-import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
-
-/**
- * This object registered with the EndpointManager service.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 16-Jan-2005
- */
-public class ServiceEndpointInfo
-{
- /** Endpoint type enum */
- public enum EndpointType
- {
- JSE, SLSB21, SLSB30, MDB21
- }
-
- // The deployment info for this endpoint
- private UnifiedDeploymentInfo udi;
- // The endpoint type
- private EndpointType type;
- // The endpoint meta data
- private ServerEndpointMetaData sepMetaData;
- // The service endpoint invoker
- private ServiceEndpointInvoker seInvoker;
- // The current state of the endpoint
- private ServiceEndpoint.State state;
-
- public ServiceEndpointInfo(UnifiedDeploymentInfo udi, ServerEndpointMetaData
sepMetaData)
- {
- this.udi = udi;
- this.sepMetaData = sepMetaData;
-
- // Set the endpoint type
- if (udi.type == DeploymentType.JAXRPC_JSE || udi.type == DeploymentType.JAXWS_JSE)
- {
- this.type = EndpointType.JSE;
- }
- else if (udi.type == DeploymentType.JAXRPC_EJB21)
- {
- String ejbName = sepMetaData.getLinkName();
- if (ejbName == null)
- throw new WSException("Cannot obtain ejb-link from port
component");
-
- UnifiedApplicationMetaData applMetaData =
(UnifiedApplicationMetaData)udi.metaData;
- UnifiedBeanMetaData beanMetaData =
(UnifiedBeanMetaData)applMetaData.getBeanByEjbName(ejbName);
- if (beanMetaData == null)
- throw new WSException("Cannot obtain ejb meta data for: " +
ejbName);
-
- if (beanMetaData instanceof UnifiedSessionMetaData)
- {
- this.type = EndpointType.SLSB21;
- }
- else if (beanMetaData instanceof UnifiedMessageDrivenMetaData)
- {
- this.type = EndpointType.MDB21;
- }
- }
- else if (udi.type == DeploymentType.JAXRPC_EJB3 || udi.type ==
DeploymentType.JAXWS_EJB3)
- {
- this.type = EndpointType.SLSB30;
- }
-
- if (type == null)
- throw new WSException("Unsupported endpoint type: " + type);
- }
-
- public ServerEndpointMetaData getServerEndpointMetaData()
- {
- return sepMetaData;
- }
-
- public ObjectName getServiceEndpointID()
- {
- return sepMetaData.getServiceEndpointID();
- }
-
- public UnifiedDeploymentInfo getUnifiedDeploymentInfo()
- {
- return udi;
- }
-
- public EndpointType getType()
- {
- return type;
- }
-
- public ServiceEndpointInvoker getInvoker()
- {
- return seInvoker;
- }
-
- public void setInvoker(ServiceEndpointInvoker seInvoker)
- {
- this.seInvoker = seInvoker;
- }
-
- public ServiceEndpoint.State getState()
- {
- return state;
- }
-
- public void setState(ServiceEndpoint.State state)
- {
- this.state = state;
- }
-
- /**
- * Returns a string representation of the object.
- */
- public String toString()
- {
- StringBuilder buffer = new StringBuilder("[id=" + getServiceEndpointID()
+ "state=" + state + "]");
- return buffer.toString();
- }
-}
Deleted: trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,40 +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.ws.core.server;
-
-// $Id$
-
-import org.jboss.ws.core.MessageAbstraction;
-
-/** An implementation handles invocations on the endpoint
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 19-Jan-2005
- */
-public interface ServiceEndpointInvoker
-{
- /** Initialize the invoker */
- void init(ServiceEndpointInfo seInfo);
-
- /** Invoke the the service endpoint */
- MessageAbstraction invoke(Object endpointContext) throws Exception;
-}
Deleted:
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointInvokerJSE.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointInvokerJSE.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointInvokerJSE.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,121 +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.ws.core.server;
-
-// $Id: $
-
-import java.lang.reflect.Method;
-
-import javax.xml.rpc.ServiceException;
-import javax.xml.rpc.server.ServiceLifecycle;
-import javax.xml.rpc.server.ServletEndpointContext;
-import javax.xml.rpc.soap.SOAPFaultException;
-import javax.xml.ws.WebServiceContext;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.EndpointInvocation;
-import org.jboss.ws.core.jaxrpc.ServletEndpointContextImpl;
-import org.jboss.ws.core.jaxws.WebServiceContextInjector;
-import org.jboss.ws.core.jaxws.WebServiceContextJSE;
-import org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS;
-import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
-
-/**
- * Handles invocations on JSE endpoints.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 19-Jan-2005
- */
-public class ServiceEndpointInvokerJSE extends AbstractServiceEndpointInvoker implements
ServiceEndpointInvoker
-{
- // provide logging
- private Logger log = Logger.getLogger(ServiceEndpointInvokerJSE.class);
-
- /** Load the SEI implementation bean if necessary */
- public Class loadServiceEndpoint() throws ClassNotFoundException
- {
- ServerEndpointMetaData epMetaData = seInfo.getServerEndpointMetaData();
- ClassLoader cl = epMetaData.getClassLoader();
- String seiImplName = epMetaData.getServiceEndpointImplName();
- Class seiImplClass = cl.loadClass(seiImplName);
- return seiImplClass;
- }
-
- /** Create an instance of the SEI implementation bean if necessary */
- public Object createServiceEndpointInstance(Object context, Class seiImplClass) throws
IllegalAccessException, InstantiationException
- {
- Object seiImpl = seiImplClass.newInstance();
- if (seiImpl instanceof ServiceLifecycle && context != null)
- {
- try
- {
- ServiceLifecycle serviceLifecycle = ((ServiceLifecycle)seiImpl);
- ServletEndpointContext servletEndpointContext = new
ServletEndpointContextImpl((ServletRequestContext)context);
- serviceLifecycle.init(servletEndpointContext);
- }
- catch (ServiceException ex)
- {
- throw new WSException(ex);
- }
- }
- return seiImpl;
- }
-
- /** Invoke an instance of the SEI implementation bean */
- public void invokeServiceEndpointInstance(Object seiImpl, EndpointInvocation epInv)
throws SOAPFaultException, Exception
- {
- log.debug("invokeServiceEndpoint: " + epInv.getJavaMethod().getName());
- try
- {
- CommonMessageContext msgContext =
MessageContextAssociation.peekMessageContext();
- if (msgContext instanceof SOAPMessageContextJAXWS)
- {
- WebServiceContext wsContext = new
WebServiceContextJSE((SOAPMessageContextJAXWS)msgContext);
- new WebServiceContextInjector().injectContext(seiImpl, wsContext);
- }
-
- Class implClass = seiImpl.getClass();
- Method seiMethod = epInv.getJavaMethod();
- Method implMethod = getImplMethod(implClass, seiMethod);
-
- Object[] args = epInv.getRequestPayload();
- Object retObj = implMethod.invoke(seiImpl, args);
- epInv.setReturnValue(retObj);
- }
- catch (Exception e)
- {
- handleInvocationException(e);
- }
- }
-
- /** Destroy an instance of the SEI implementation bean if necessary */
- public void destroyServiceEndpointInstance(Object seiImpl)
- {
- if (seiImpl instanceof ServiceLifecycle)
- {
- ((ServiceLifecycle)seiImpl).destroy();
- }
- }
-}
Deleted: trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManager.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManager.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManager.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,714 +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.ws.core.server;
-
-// $Id$
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.lang.reflect.Constructor;
-import java.net.InetAddress;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.UnknownHostException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-import javax.activation.DataHandler;
-import javax.management.MBeanServer;
-import javax.management.MBeanServerFactory;
-import javax.management.ObjectName;
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.xml.soap.SOAPEnvelope;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.soap.SOAPPart;
-import javax.xml.ws.addressing.AddressingProperties;
-import javax.xml.ws.addressing.JAXWSAConstants;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.MessageAbstraction;
-import org.jboss.ws.core.jaxrpc.handler.MessageContextJAXRPC;
-import org.jboss.ws.core.jaxrpc.handler.SOAPMessageContextJAXRPC;
-import org.jboss.ws.core.jaxws.handler.MessageContextJAXWS;
-import org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS;
-import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.ws.core.soap.SOAPConnectionImpl;
-import org.jboss.ws.core.utils.ThreadLocalAssociation;
-import org.jboss.ws.extensions.addressing.AddressingConstantsImpl;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.ws.metadata.umdm.HandlerMetaData;
-import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
-import org.jboss.ws.metadata.umdm.UnifiedMetaData;
-import org.jboss.ws.metadata.umdm.EndpointMetaData.Type;
-import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
-
-/**
- * A service that manages JBossWS endpoints.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 15-Jan-2005
- */
-public class ServiceEndpointManager implements ServiceEndpointManagerMBean
-{
- // provide logging
- private static final Logger log = Logger.getLogger(ServiceEndpointManager.class);
-
- // Default bean name
- public static final String BEAN_NAME = "ServiceEndpointManager";
- // The host name that is returned if there is no other defined
- public static String UNDEFINED_HOSTNAME = "jbossws.undefined.host";
-
- // maps serviceID to EndpointInfo
- private Map<ObjectName, ServiceEndpoint> registry = new
ConcurrentHashMap<ObjectName, ServiceEndpoint>();
-
- // 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
- private int webServicePort;
- // The webservice port that will be used when updating the wsdl
- private int webServiceSecurePort;
- // Whether we should always modify the soap address to the deployed endpoing location
- private boolean alwaysModifySOAPAddress;
- // The name of the invoker that handles invocations on JSE endpoints
- private String serviceEndpointInvokerJSE;
- // The name of the invoker that handles invocations on EJB2.1 endpoints
- private String serviceEndpointInvokerEJB21;
- // The name of the invoker that handles invocations on EJB3 endpoints
- private String serviceEndpointInvokerEJB3;
- // The name of the invoker that handles invocations on MDB endpoints
- private String serviceEndpointInvokerMDB;
-
- public String getWebServiceHost()
- {
- return webServiceHost;
- }
-
- public int getWebServicePort()
- {
- if (webServicePort == 0)
- {
- ServerConfigFactory factory = ServerConfigFactory.getInstance();
- ServerConfig config = factory.getServerConfig();
- webServicePort = config.getWebServicePort();
- log.debug("Using WebServicePort: " + webServicePort);
- }
- return webServicePort;
- }
-
- public int getWebServiceSecurePort()
- {
- if (webServiceSecurePort == 0)
- {
- ServerConfigFactory factory = ServerConfigFactory.getInstance();
- ServerConfig config = factory.getServerConfig();
- webServiceSecurePort = config.getWebServiceSecurePort();
- log.debug("Using WebServiceSecurePort: " + webServiceSecurePort);
- }
- return webServiceSecurePort;
- }
-
- public boolean isAlwaysModifySOAPAddress()
- {
- return alwaysModifySOAPAddress;
- }
-
- public void setWebServiceHost(String host) throws UnknownHostException
- {
- if (host == null || host.trim().length() == 0)
- {
- log.debug("Using undefined host: " + UNDEFINED_HOSTNAME);
- host = UNDEFINED_HOSTNAME;
- }
- if ("0.0.0.0".equals(host))
- {
- InetAddress localHost = InetAddress.getLocalHost();
- log.debug("Using local host: " + localHost.getHostName());
- host = localHost.getHostName();
- }
- this.webServiceHost = host;
- }
-
- public void setWebServicePort(int port)
- {
- this.webServicePort = port;
- }
-
- public void setWebServiceSecurePort(int port)
- {
- this.webServiceSecurePort = port;
- }
-
- public void setAlwaysModifySOAPAddress(boolean modify)
- {
- this.alwaysModifySOAPAddress = modify;
- }
-
- public String getServiceEndpointInvokerEJB21()
- {
- return serviceEndpointInvokerEJB21;
- }
-
- public void setServiceEndpointInvokerEJB21(String invoker)
- {
- this.serviceEndpointInvokerEJB21 = invoker;
- }
-
- public String getServiceEndpointInvokerEJB3()
- {
- return serviceEndpointInvokerEJB3;
- }
-
- public void setServiceEndpointInvokerEJB3(String invoker)
- {
- this.serviceEndpointInvokerEJB3 = invoker;
- }
-
- public String getServiceEndpointInvokerMDB()
- {
- return serviceEndpointInvokerMDB;
- }
-
- public void setServiceEndpointInvokerMDB(String invoker)
- {
- this.serviceEndpointInvokerMDB = invoker;
- }
-
- public String getServiceEndpointInvokerJSE()
- {
- return serviceEndpointInvokerJSE;
- }
-
- public void setServiceEndpointInvokerJSE(String invoker)
- {
- this.serviceEndpointInvokerJSE = invoker;
- }
-
- public String getImplementationVersion()
- {
- return UnifiedMetaData.getImplementationVersion();
- }
-
- public List<ObjectName> getServiceEndpoints()
- {
- ArrayList<ObjectName> list = new ArrayList<ObjectName>();
- list.addAll(registry.keySet());
- return list;
- }
-
- /** Get service endpoint for a given serviceID
- *
- * The keys into the registry are:
- *
- * [deploment.ear]/[deployment.war]#WsdlService/PortName
- * [deploment.ear]/[deployment.jar]#ServiceName/PortName
- *
- */
- public ServiceEndpoint getServiceEndpointByID(ObjectName sepID)
- {
- ServiceEndpoint wsEndpoint = (ServiceEndpoint)registry.get(sepID);
- if (wsEndpoint == null)
- log.warn("No ServiceEndpoint found for serviceID: " + sepID);
-
- return wsEndpoint;
- }
-
- /** Resolve a port-component-link, like:
- *
- * [deployment.war]#PortComponentName
- * [deployment.jar]#PortComponentName
- *
- */
- public ServiceEndpoint resolvePortComponentLink(String pcLink)
- {
- String pcName = pcLink;
- int hashIndex = pcLink.indexOf("#");
- if (hashIndex > 0)
- {
- pcName = pcLink.substring(hashIndex + 1);
- }
-
- ServiceEndpoint serviceEndpoint = null;
- for (ObjectName sepID : registry.keySet())
- {
- ServiceEndpoint auxEndpoint = registry.get(sepID);
- ServiceEndpointInfo sepInfo = auxEndpoint.getServiceEndpointInfo();
- if (pcName.equals(sepInfo.getServerEndpointMetaData().getPortComponentName()))
- {
- if (serviceEndpoint != null)
- {
- log.warn("Multiple service endoints found for: " + pcLink);
- serviceEndpoint = null;
- break;
- }
- serviceEndpoint = auxEndpoint;
- }
- }
-
- if (serviceEndpoint == null)
- log.warn("No ServiceEndpoint found for pcLink: " + pcLink);
-
- return serviceEndpoint;
- }
-
- /** Show the registered webservices
- */
- public String showServiceEndpointTable(URL requestURL) throws
java.net.MalformedURLException
- {
- StringWriter sw = new StringWriter();
- PrintWriter pw = new PrintWriter(sw);
-
- pw.println("<h3>Registered Service Endpoints</h3>");
-
- pw.println("<table>");
-
pw.println("<tr><td>ServiceEndpointID</td><td>ServiceEndpointAddress</td><td> </td></tr>");
- Iterator it = registry.entrySet().iterator();
- while (it.hasNext())
- {
- Map.Entry entry = (Map.Entry)it.next();
- ObjectName sepID = (ObjectName)entry.getKey();
- ServiceEndpoint wsEndpoint = (ServiceEndpoint)entry.getValue();
- ServiceEndpointInfo seInfo = wsEndpoint.getServiceEndpointInfo();
- String displayAddress = getDisplayAddress(seInfo, requestURL);
- pw.println("<tr><td>" + sepID.getCanonicalName() +
"</td><td><a href='" + displayAddress +
"?wsdl'>" + displayAddress +
"?wsdl</a></td></tr>");
- }
- pw.println("</table>");
- pw.close();
-
- return sw.toString();
- }
-
- public List<ServiceEndpointDTO> getRegisteredEndpoints(URL requestURL) throws
java.net.MalformedURLException
- {
- List<ServiceEndpointDTO> registered = new
ArrayList<ServiceEndpointDTO>();
- Iterator it = registry.entrySet().iterator();
- while (it.hasNext())
- {
- Map.Entry entry = (Map.Entry)it.next();
- ObjectName sepID = (ObjectName)entry.getKey();
- ServiceEndpoint wsEndpoint = (ServiceEndpoint)entry.getValue();
- ServiceEndpointInfo seInfo = wsEndpoint.getServiceEndpointInfo();
- String displayAddress = getDisplayAddress(seInfo, requestURL);
-
- try
- {
- ServiceEndpointDTO dto = new ServiceEndpointDTO();
- dto.setSepID(sepID);
- dto.setAddress(displayAddress);
-
dto.setSeMetrics((ServiceEndpointMetrics)wsEndpoint.getServiceEndpointMetrics().clone());
- dto.setState(wsEndpoint.getState());
- registered.add(dto);
- }
- catch (CloneNotSupportedException e)
- {
- }
- }
-
- return registered;
- }
-
- private String getDisplayAddress(ServiceEndpointInfo seInfo, URL requestURL) throws
MalformedURLException
- {
- String endpointAddress = seInfo.getServerEndpointMetaData().getEndpointAddress();
- URL displayURL = new URL(endpointAddress);
- String endPointPath = displayURL.getPath();
- if (this.getWebServiceHost().equals(ServiceEndpointManager.UNDEFINED_HOSTNAME) ==
true)
- {
- displayURL = requestURL;
- }
- String displayAddress = displayURL.getProtocol() + "://" +
displayURL.getHost() + ":" + displayURL.getPort() + endPointPath;
- return displayAddress;
- }
-
- /** Get the endpoint metrics
- */
- public ServiceEndpointMetrics getServiceEndpointMetrics(ObjectName sepID)
- {
- ServiceEndpoint wsEndpoint = getServiceEndpointByID(sepID);
- return (wsEndpoint != null ? wsEndpoint.getServiceEndpointMetrics() : null);
- }
-
- /** Show endpoint metrics
- */
- public String showServiceEndpointMetrics(ObjectName sepID)
- {
- StringWriter sw = new StringWriter();
- PrintWriter pw = new PrintWriter(sw);
-
- ServiceEndpointMetrics seMetrics = getServiceEndpointMetrics(sepID);
- if (seMetrics != null)
- {
- pw.println("<h3>Service Endpoint Metrics</h3>");
-
- pw.println("<table>");
- pw.println("<tr><td>EndpointID</td><td>" +
seMetrics.getEndpointID() + "</td></tr>");
- pw.println("<tr><td>Start Time</td><td>" +
seMetrics.getStartTime() + "</td></tr>");
- pw.println("<tr><td>Stop Time</td><td>" +
seMetrics.getStopTime() + "</td></tr>");
- pw.println("<tr><td>Request Count</td><td>" +
seMetrics.getRequestCount() + "</td></tr>");
- pw.println("<tr><td>Response Count</td><td>" +
seMetrics.getRequestCount() + "</td></tr>");
- pw.println("<tr><td>Fault Count</td><td>" +
seMetrics.getResponseCount() + "</td></tr>");
- pw.println("<tr><td>Max Processing
Time</td><td>" + seMetrics.getMaxProcessingTime() +
"</td></tr>");
- pw.println("<tr><td>Min Processing
Time</td><td>" + seMetrics.getMinProcessingTime() +
"</td></tr>");
- pw.println("<tr><td>Avg Processing
Time</td><td>" + seMetrics.getAverageProcessingTime() +
"</td></tr>");
- pw.println("<tr><td>Total Processing
Time</td><td>" + seMetrics.getTotalProcessingTime() +
"</td></tr>");
- pw.println("</table>");
- pw.close();
- }
- return sw.toString();
- }
-
- public void processWSDLRequest(ObjectName sepID, OutputStream outStream, URL
requestURL, String resourcePath) throws Exception
- {
- ServiceEndpoint wsEndpoint = getServiceEndpointByID(sepID);
- if (wsEndpoint == null)
- throw new WSException("Cannot obtain endpoint for: " + sepID);
-
- wsEndpoint.handleWSDLRequest(outStream, requestURL, resourcePath);
- }
-
- public void processRequest(ObjectName sepID, InputStream inStream, OutputStream
outStream, ServletRequestContext context) throws Exception
- {
- ServiceEndpoint wsEndpoint = getServiceEndpointByID(sepID);
- if (wsEndpoint == null)
- throw new WSException("Cannot obtain endpoint for: " + sepID);
-
- // Get the type of the endpoint
- ServerEndpointMetaData sepMetaData =
wsEndpoint.getServiceEndpointInfo().getServerEndpointMetaData();
- Type type = sepMetaData.getType();
-
- ServletContext servletContext = context.getServletContext();
- HttpServletRequest httpRequest = context.getHttpServletRequest();
- HttpServletResponse httpResponse = context.getHttpServletResponse();
- ServletHeaderSource headerSource = new ServletHeaderSource(httpRequest,
httpResponse);
-
- // Associate a message context with the current thread
- CommonMessageContext msgContext;
- if (type == EndpointMetaData.Type.JAXRPC)
- {
- msgContext = new SOAPMessageContextJAXRPC();
- msgContext.put(MessageContextJAXRPC.SERVLET_CONTEXT, servletContext);
- msgContext.put(MessageContextJAXRPC.SERVLET_REQUEST, httpRequest);
- msgContext.put(MessageContextJAXRPC.SERVLET_RESPONSE, httpResponse);
- }
- else
- {
- msgContext = new SOAPMessageContextJAXWS();
- msgContext.put(MessageContextJAXWS.MESSAGE_OUTBOUND_PROPERTY, new
Boolean(false));
- msgContext.put(MessageContextJAXWS.INBOUND_MESSAGE_ATTACHMENTS, new
HashMap<String, DataHandler>());
- msgContext.put(MessageContextJAXWS.HTTP_REQUEST_HEADERS,
headerSource.getHeaderMap());
- msgContext.put(MessageContextJAXWS.HTTP_REQUEST_METHOD,
httpRequest.getMethod());
- msgContext.put(MessageContextJAXWS.QUERY_STRING, httpRequest.getQueryString());
- msgContext.put(MessageContextJAXWS.PATH_INFO, httpRequest.getPathInfo());
- msgContext.put(MessageContextJAXWS.SERVLET_CONTEXT, servletContext);
- msgContext.put(MessageContextJAXWS.SERVLET_REQUEST, httpRequest);
- msgContext.put(MessageContextJAXWS.SERVLET_RESPONSE, httpResponse);
- }
- msgContext.setEndpointMetaData(sepMetaData);
-
- MessageContextAssociation.pushMessageContext(msgContext);
- try
- {
- MessageAbstraction resMessage = wsEndpoint.processRequest(headerSource, context,
inStream);
-
- // Replace the message context with the response context
- msgContext = MessageContextAssociation.peekMessageContext();
-
- Map<String, List<String>> headers = (Map<String,
List<String>>)msgContext.get(MessageContextJAXWS.HTTP_RESPONSE_HEADERS);
- if (headers != null)
- headerSource.setHeaderMap(headers);
-
- Integer code = (Integer)msgContext.get(MessageContextJAXWS.HTTP_RESPONSE_CODE);
- if (code != null)
- httpResponse.setStatus(code.intValue());
-
- boolean isFault = false;
- if (resMessage instanceof SOAPMessage)
- {
- SOAPPart part = ((SOAPMessage)resMessage).getSOAPPart();
- if (part == null)
- throw new SOAPException("Cannot obtain SOAPPart from response
message");
-
- // R1126 An INSTANCE MUST return a "500 Internal Server Error" HTTP
status code
- // if the response envelope is a Fault.
- //
- // Also, a one-way operation must show up as empty content, and can be
detected
- // by a null envelope.
- SOAPEnvelope soapEnv = part.getEnvelope();
- isFault = soapEnv != null && soapEnv.getBody().hasFault();
- if (isFault && httpResponse != null)
- {
- httpResponse.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
- }
- }
-
- sendResponse(outStream, msgContext, isFault);
- }
- finally
- {
- outStream.flush();
- outStream.close();
-
- // Reset the message context association
- MessageContextAssociation.popMessageContext();
-
- // clear thread local storage
- ThreadLocalAssociation.clear();
- }
- }
-
- private void sendResponse(OutputStream outputStream, CommonMessageContext msgContext,
boolean isFault) throws SOAPException, IOException
- {
- MessageAbstraction resMessage = msgContext.getMessageAbstraction();
- String wsaTo = null;
-
- // Get the destination from the AddressingProperties
- AddressingProperties outProps =
(AddressingProperties)msgContext.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND);
- if (outProps != null && outProps.getTo() != null)
- {
- AddressingConstantsImpl ADDR = new AddressingConstantsImpl();
- wsaTo = outProps.getTo().getURI().toString();
- if (wsaTo.equals(ADDR.getAnonymousURI()))
- wsaTo = null;
- }
- if (wsaTo != null)
- {
- log.debug("Sending response to addressing destination: " + wsaTo);
- new SOAPConnectionImpl().callOneWay((SOAPMessage)resMessage, wsaTo);
- }
- else
- {
- resMessage.writeTo(outputStream);
- }
- }
-
- /** Process the given SOAPRequest and return the corresponding SOAPResponse
- */
- public String processRequest(ObjectName sepID, String inMessage) throws Exception
- {
- log.debug("processSOAPRequest: " + sepID);
-
- ByteArrayInputStream inputStream = new
ByteArrayInputStream(inMessage.getBytes("UTF-8"));
- ByteArrayOutputStream outputStream = new ByteArrayOutputStream(512);
-
- processRequest(sepID, inputStream, outputStream, null);
-
- String outMsg = new String(outputStream.toByteArray());
- return outMsg;
- }
-
- /** Get the ServiceEndpointInvoker for this type of service endpoint
- */
- private ServiceEndpointInvoker getServiceEndpointInvoker(ServiceEndpointInfo seInfo)
throws ClassNotFoundException, InstantiationException, IllegalAccessException
- {
- ServiceEndpointInvoker seInvoker = null;
-
- ClassLoader cl = Thread.currentThread().getContextClassLoader();
- if (seInfo.getType() == ServiceEndpointInfo.EndpointType.JSE)
- {
- Class seInvokerClass = cl.loadClass(serviceEndpointInvokerJSE);
- seInvoker = (ServiceEndpointInvoker)seInvokerClass.newInstance();
- }
- else if (seInfo.getType() == ServiceEndpointInfo.EndpointType.SLSB21)
- {
- Class seInvokerClass = cl.loadClass(serviceEndpointInvokerEJB21);
- seInvoker = (ServiceEndpointInvoker)seInvokerClass.newInstance();
- }
- else if (seInfo.getType() == ServiceEndpointInfo.EndpointType.SLSB30)
- {
- Class seInvokerClass = cl.loadClass(serviceEndpointInvokerEJB3);
- seInvoker = (ServiceEndpointInvoker)seInvokerClass.newInstance();
- }
- else if (seInfo.getType() == ServiceEndpointInfo.EndpointType.MDB21)
- {
- Class seInvokerClass = cl.loadClass(serviceEndpointInvokerMDB);
- seInvoker = (ServiceEndpointInvoker)seInvokerClass.newInstance();
- }
-
- if (seInvoker == null)
- throw new WSException("Cannot obtain service endpoint invoker");
-
- return seInvoker;
- }
-
- /** Get the list of HandlerInfos associated with a given service endpoint
- */
- public List<HandlerMetaData> getHandlerMetaData(ObjectName sepID)
- {
- ServiceEndpoint wsEndpoint = getServiceEndpointByID(sepID);
- if (wsEndpoint == null)
- throw new WSException("Cannot find service endpoint: " + sepID);
-
- List<HandlerMetaData> handlers = null;
- if (wsEndpoint != null)
- {
- ServerEndpointMetaData sepMetaData =
wsEndpoint.getServiceEndpointInfo().getServerEndpointMetaData();
- handlers = sepMetaData.getHandlerMetaData(HandlerType.ALL);
- }
- return handlers;
- }
-
- /**
- * Dynamically change the list of handlers associated with a given service endpoint
- * The endpoint is expected to be in STOPED state
- */
- public void setHandlerMetaData(ObjectName sepID, List<HandlerMetaData>
handlers)
- {
- ServiceEndpoint wsEndpoint = getServiceEndpointByID(sepID);
- if (wsEndpoint == null)
- throw new WSException("Cannot find service endpoint: " + sepID);
-
- ServiceEndpointInfo sepInfo = wsEndpoint.getServiceEndpointInfo();
- if (sepInfo.getState() != ServiceEndpoint.State.STOPED)
- throw new WSException("Endpoint expected to be in STOPED state");
-
- ServerEndpointMetaData sepMetaData =
wsEndpoint.getServiceEndpointInfo().getServerEndpointMetaData();
- sepMetaData.clearHandlers();
-
- for (HandlerMetaData handlerMetaData : handlers)
- {
- handlerMetaData.setEndpointMetaData(sepMetaData);
- sepMetaData.addHandler(handlerMetaData);
- }
- }
-
- /** Create a service endpoint
- */
- public void createServiceEndpoint(ServiceEndpointInfo seInfo) throws Exception
- {
- ObjectName sepID = seInfo.getServiceEndpointID();
- if (registry.get(sepID) != null)
- throw new WSException("Service already registerd: " + sepID);
-
- ServiceEndpointInvoker seInvoker = getServiceEndpointInvoker(seInfo);
- seInvoker.init(seInfo);
- seInfo.setInvoker(seInvoker);
-
- // Load/Create the service endpoint impl
- ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
- ServerEndpointMetaData epMetaData = seInfo.getServerEndpointMetaData();
- String managedEndpointBean = epMetaData.getManagedEndpointBean();
- Class seClass = ctxLoader.loadClass(managedEndpointBean);
- Constructor ctor = seClass.getConstructor(new Class[] { ServiceEndpointInfo.class
});
- ServiceEndpoint wsEndpoint = (ServiceEndpoint)ctor.newInstance(new Object[] {
seInfo });
- wsEndpoint.create();
-
- // Register the endpoint with the MBeanServer
- registry.put(sepID, wsEndpoint);
-
- log.debug("WebService created: " + sepID);
- }
-
- /** Start a service endpoint
- */
- public void startServiceEndpoint(ObjectName sepID) throws Exception
- {
- ServiceEndpoint wsEndpoint = getServiceEndpointByID(sepID);
- if (wsEndpoint == null)
- throw new WSException("Cannot find service endpoint: " + sepID);
-
- wsEndpoint.start();
-
- ServiceEndpointInfo seInfo = wsEndpoint.getServiceEndpointInfo();
- log.info("WebService started: " +
seInfo.getServerEndpointMetaData().getEndpointAddress());
- }
-
- /** Stop a service endpoint
- */
- public void stopServiceEndpoint(ObjectName sepID) throws Exception
- {
- ServiceEndpoint wsEndpoint = getServiceEndpointByID(sepID);
- if (wsEndpoint == null)
- {
- log.error("Cannot find service endpoint: " + sepID);
- return;
- }
-
- wsEndpoint.stop();
-
- ServiceEndpointInfo seInfo = wsEndpoint.getServiceEndpointInfo();
- log.info("WebService stopped: " +
seInfo.getServerEndpointMetaData().getEndpointAddress());
- }
-
- /** Destroy a service endpoint
- */
- public void destroyServiceEndpoint(ObjectName sepID) throws Exception
- {
- ServiceEndpoint wsEndpoint = getServiceEndpointByID(sepID);
- if (wsEndpoint == null)
- {
- log.error("Cannot find service endpoint: " + sepID);
- return;
- }
-
- wsEndpoint.destroy();
-
- // Remove the endpoint from the MBeanServer
- registry.remove(sepID);
-
- ServiceEndpointInfo seInfo = wsEndpoint.getServiceEndpointInfo();
- log.debug("WebService destroyed: " +
seInfo.getServerEndpointMetaData().getEndpointAddress());
- }
-
- public void create() throws Exception
- {
- log.info(getImplementationVersion());
- MBeanServer server = getJMXServer();
- if (server != null)
- {
- server.registerMBean(this, OBJECT_NAME);
- }
- }
-
- public void destroy() throws Exception
- {
- log.debug("Destroy service endpoint manager");
- MBeanServer server = getJMXServer();
- if (server != null)
- {
- server.unregisterMBean(OBJECT_NAME);
- }
- }
-
- private MBeanServer getJMXServer()
- {
- MBeanServer server = null;
- ArrayList servers = MBeanServerFactory.findMBeanServer(null);
- if (servers.size() > 0)
- {
- server = (MBeanServer)servers.get(0);
- }
- return server;
- }
-}
Deleted:
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManagerFactory.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManagerFactory.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManagerFactory.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,56 +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.ws.core.server;
-
-import org.jboss.ws.integration.KernelLocator;
-import org.jboss.kernel.spi.registry.KernelRegistry;
-import org.jboss.kernel.spi.registry.KernelRegistryEntry;
-
-// $Id$
-
-/**
- * Factory to the singleton instance of the ServiceEndpointManager
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 08-May-2006
- */
-public class ServiceEndpointManagerFactory
-{
- private static ServiceEndpointManagerFactory instance = new
ServiceEndpointManagerFactory();
-
- // Hide ctor
- private ServiceEndpointManagerFactory()
- {
- }
-
- public static ServiceEndpointManagerFactory getInstance()
- {
- return instance;
- }
-
- public ServiceEndpointManager getServiceEndpointManager()
- {
- KernelRegistry registry = KernelLocator.getKernel().getRegistry();
- KernelRegistryEntry entry = registry.getEntry(ServiceEndpointManager.BEAN_NAME);
- return (ServiceEndpointManager)entry.getTarget();
- }
-}
Deleted:
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManagerMBean.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManagerMBean.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManagerMBean.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,60 +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.ws.core.server;
-
-import java.net.UnknownHostException;
-import java.util.List;
-
-import javax.management.ObjectName;
-
-import org.jboss.ws.integration.ObjectNameFactory;
-import org.jboss.ws.metadata.umdm.HandlerMetaData;
-
-/**
- * MBean interface.
- * @since 15-April-2004
- */
-public interface ServiceEndpointManagerMBean
-{
- // default object name
- static final ObjectName OBJECT_NAME =
ObjectNameFactory.create("jboss.ws:service=ServiceEndpointManager");
-
- String getImplementationVersion();
-
- String getWebServiceHost();
- void setWebServiceHost(String host) throws UnknownHostException;
-
- int getWebServicePort();
- void setWebServicePort(int port);
-
- int getWebServiceSecurePort();
- void setWebServiceSecurePort(int port);
-
- boolean isAlwaysModifySOAPAddress();
- void setAlwaysModifySOAPAddress(boolean modify);
-
- public List<HandlerMetaData> getHandlerMetaData(ObjectName sepID);
- public void setHandlerMetaData(ObjectName sepID, List<HandlerMetaData>
handlers);
-
- void startServiceEndpoint(ObjectName sepID) throws Exception;
- void stopServiceEndpoint(ObjectName sepID) throws Exception;
-}
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointMetrics.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointMetrics.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointMetrics.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -142,7 +142,7 @@
{
return totalProcessingTime;
}
-
+
public long getRequestCount()
{
return requestCount;
@@ -158,22 +158,8 @@
return responseCount;
}
- public String toString()
+ public Object clone() throws CloneNotSupportedException
{
- StringBuilder buffer = new StringBuilder("\nEndpoint Metrics: " +
endpointID);
- buffer.append("\n startTime=" + startTime);
- buffer.append("\n stopTime=" + stopTime);
- buffer.append("\n requestCount=" + requestCount);
- buffer.append("\n responseCount=" + responseCount);
- buffer.append("\n faultCount=" + faultCount);
- buffer.append("\n maxProcessingTime=" + maxProcessingTime);
- buffer.append("\n minProcessingTime=" + minProcessingTime);
- buffer.append("\n avgProcessingTime=" + avgProcessingTime);
- buffer.append("\n totalProcessingTime=" + totalProcessingTime);
- return buffer.toString();
- }
-
- protected Object clone() throws CloneNotSupportedException {
ServiceEndpointMetrics sem = new ServiceEndpointMetrics(this.endpointID);
sem.avgProcessingTime = this.avgProcessingTime;
@@ -190,4 +176,19 @@
return sem;
}
+
+ public String toString()
+ {
+ StringBuilder buffer = new StringBuilder("\nEndpoint Metrics: " +
endpointID);
+ buffer.append("\n startTime=" + startTime);
+ buffer.append("\n stopTime=" + stopTime);
+ buffer.append("\n requestCount=" + requestCount);
+ buffer.append("\n responseCount=" + responseCount);
+ buffer.append("\n faultCount=" + faultCount);
+ buffer.append("\n maxProcessingTime=" + maxProcessingTime);
+ buffer.append("\n minProcessingTime=" + minProcessingTime);
+ buffer.append("\n avgProcessingTime=" + avgProcessingTime);
+ buffer.append("\n totalProcessingTime=" + totalProcessingTime);
+ return buffer.toString();
+ }
}
Deleted: trunk/jbossws-core/src/java/org/jboss/ws/core/server/UnifiedDeploymentInfo.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/server/UnifiedDeploymentInfo.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/server/UnifiedDeploymentInfo.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,144 +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.ws.core.server;
-
-// $Id$
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.management.ObjectName;
-
-import org.jboss.ws.integration.UnifiedVirtualFile;
-import org.jboss.ws.integration.deployment.Deployment.DeploymentType;
-
-/**
- * The container independent deployment info.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class UnifiedDeploymentInfo
-{
- public UnifiedDeploymentInfo(DeploymentType type)
- {
- this.type = type;
- }
-
- /** The type of this deployment */
- public DeploymentType type;
- /** Sub deployments have a parent */
- public UnifiedDeploymentInfo parent;
- /** The suffix of the deployment url */
- public String simpleName;
- /** The URL for this deployment */
- public URL url;
- /** The virtual file for the deployment root */
- public UnifiedVirtualFile vfRoot;
- /** The string identifing this deployment **/
- public String name;
- /** The URL to the expanded webapp **/
- public URL webappURL;
- /** We can hold "typed" metadata */
- public Object metaData;
- /** The deployment classloader **/
- public ClassLoader classLoader;
- /** An optional ObjectName of the deployed object */
- public ObjectName deployedObject;
-
- /** An arbitrary map of state associated with the deployment */
- private Map<Class, Object> attachments = new HashMap<Class, Object>();
-
- public <T> T getAttachment(Class<T> key)
- {
- return (T)attachments.get(key);
- }
-
- public <T> T addAttachment(Class<T> key, T value)
- {
- return (T)attachments.put(key, value);
- }
-
- /** The sortName concatenated with the canonical names of all parents. */
- public String getCanonicalName()
- {
- String name = simpleName;
- if (parent != null)
- name = parent.getCanonicalName() + "/" + name;
- return name;
- }
-
- public URL getMetaDataFileURL(String resourcePath) throws IOException
- {
- URL resourceURL = null;
- if (resourcePath != null && resourcePath.length() > 0)
- {
- if (resourcePath.startsWith("/"))
- resourcePath = resourcePath.substring(1);
-
- try
- {
- // assign an absolute URL
- resourceURL = new URL(resourcePath);
- }
- catch (MalformedURLException ex)
- {
- // ignore
- }
-
- if (resourceURL == null && vfRoot != null)
- {
- UnifiedVirtualFile vfResource = vfRoot.findChild(resourcePath);
- resourceURL = vfResource.toURL();
- }
-
- if (resourceURL == null)
- {
- String deploymentPath = url.toExternalForm();
-
- if (deploymentPath.startsWith("jar:") &&
deploymentPath.endsWith("!/") == false)
- deploymentPath += "!/";
-
- if (deploymentPath.endsWith("/") == false)
- deploymentPath += "/";
-
- // assign a relative URL
- resourceURL = new URL(deploymentPath + resourcePath);
- }
- }
- return resourceURL;
- }
-
- public String toString()
- {
- StringBuilder builder = new StringBuilder();
- builder.append("[");
- builder.append("type=" + type);
- builder.append(",simpleName=" + simpleName);
- builder.append(",url=" + url);
- builder.append("]");
- return builder.toString();
- }
-}
Added: trunk/jbossws-core/src/java/org/jboss/ws/core/server/UnifiedDeploymentInfo.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/server/UnifiedDeploymentInfo.java
(rev 0)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/server/UnifiedDeploymentInfo.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -0,0 +1,144 @@
+/*
+ * 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.ws.core.server;
+
+// $Id$
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.management.ObjectName;
+
+import org.jboss.ws.integration.UnifiedVirtualFile;
+import org.jboss.ws.integration.deployment.Deployment.DeploymentType;
+
+/**
+ * The container independent deployment info.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 05-May-2006
+ */
+public class UnifiedDeploymentInfo
+{
+ public UnifiedDeploymentInfo(DeploymentType type)
+ {
+ this.type = type;
+ }
+
+ /** The type of this deployment */
+ public DeploymentType type;
+ /** Sub deployments have a parent */
+ public UnifiedDeploymentInfo parent;
+ /** The suffix of the deployment url */
+ public String simpleName;
+ /** The URL for this deployment */
+ public URL url;
+ /** The virtual file for the deployment root */
+ public UnifiedVirtualFile vfRoot;
+ /** The string identifing this deployment **/
+ public String name;
+ /** The URL to the expanded webapp **/
+ public URL webappURL;
+ /** We can hold "typed" metadata */
+ public Object metaData;
+ /** The deployment classloader **/
+ public ClassLoader classLoader;
+ /** An optional ObjectName of the deployed object */
+ public ObjectName deployedObject;
+
+ /** An arbitrary map of state associated with the deployment */
+ private Map<Class, Object> attachments = new HashMap<Class, Object>();
+
+ public <T> T getAttachment(Class<T> key)
+ {
+ return (T)attachments.get(key);
+ }
+
+ public <T> T addAttachment(Class<T> key, T value)
+ {
+ return (T)attachments.put(key, value);
+ }
+
+ /** The sortName concatenated with the canonical names of all parents. */
+ public String getCanonicalName()
+ {
+ String name = simpleName;
+ if (parent != null)
+ name = parent.getCanonicalName() + "/" + name;
+ return name;
+ }
+
+ public URL getMetaDataFileURL(String resourcePath) throws IOException
+ {
+ URL resourceURL = null;
+ if (resourcePath != null && resourcePath.length() > 0)
+ {
+ if (resourcePath.startsWith("/"))
+ resourcePath = resourcePath.substring(1);
+
+ try
+ {
+ // assign an absolute URL
+ resourceURL = new URL(resourcePath);
+ }
+ catch (MalformedURLException ex)
+ {
+ // ignore
+ }
+
+ if (resourceURL == null && vfRoot != null)
+ {
+ UnifiedVirtualFile vfResource = vfRoot.findChild(resourcePath);
+ resourceURL = vfResource.toURL();
+ }
+
+ if (resourceURL == null)
+ {
+ String deploymentPath = url.toExternalForm();
+
+ if (deploymentPath.startsWith("jar:") &&
deploymentPath.endsWith("!/") == false)
+ deploymentPath += "!/";
+
+ if (deploymentPath.endsWith("/") == false)
+ deploymentPath += "/";
+
+ // assign a relative URL
+ resourceURL = new URL(deploymentPath + resourcePath);
+ }
+ }
+ return resourceURL;
+ }
+
+ public String toString()
+ {
+ StringBuilder builder = new StringBuilder();
+ builder.append("[");
+ builder.append("type=" + type);
+ builder.append(",simpleName=" + simpleName);
+ builder.append(",url=" + url);
+ builder.append("]");
+ return builder.toString();
+ }
+}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/server/WSDLFilePublisher.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/server/WSDLFilePublisher.java 2007-04-27
14:04:25 UTC (rev 2946)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/server/WSDLFilePublisher.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -45,6 +45,8 @@
import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.core.utils.IOUtils;
import org.jboss.ws.core.utils.ResourceURL;
+import org.jboss.ws.integration.management.ServerConfig;
+import org.jboss.ws.integration.management.ServerConfigFactory;
import org.jboss.ws.metadata.umdm.ServiceMetaData;
import org.jboss.ws.metadata.umdm.UnifiedMetaData;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
Copied:
trunk/jbossws-core/src/java/org/jboss/ws/core/server/legacy/AbstractServiceEndpointInvoker.java
(from rev 2936,
trunk/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java)
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/server/legacy/AbstractServiceEndpointInvoker.java
(rev 0)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/server/legacy/AbstractServiceEndpointInvoker.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -0,0 +1,428 @@
+/*
+ * 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.ws.core.server.legacy;
+
+// $Id$
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.UndeclaredThrowableException;
+import java.util.HashMap;
+
+import javax.activation.DataHandler;
+import javax.management.MBeanException;
+import javax.xml.namespace.QName;
+import javax.xml.rpc.soap.SOAPFaultException;
+import javax.xml.soap.Name;
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPBodyElement;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPHeader;
+import javax.xml.ws.http.HTTPBinding;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.Constants;
+import org.jboss.ws.core.CommonBinding;
+import org.jboss.ws.core.CommonBindingProvider;
+import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.core.CommonSOAPBinding;
+import org.jboss.ws.core.DirectionHolder;
+import org.jboss.ws.core.EndpointInvocation;
+import org.jboss.ws.core.MessageAbstraction;
+import org.jboss.ws.core.DirectionHolder.Direction;
+import org.jboss.ws.core.jaxrpc.handler.HandlerDelegateJAXRPC;
+import org.jboss.ws.core.jaxrpc.handler.MessageContextJAXRPC;
+import org.jboss.ws.core.jaxws.binding.BindingProviderImpl;
+import org.jboss.ws.core.jaxws.handler.HandlerDelegateJAXWS;
+import org.jboss.ws.core.jaxws.handler.MessageContextJAXWS;
+import org.jboss.ws.core.server.ServerHandlerDelegate;
+import org.jboss.ws.core.soap.MessageContextAssociation;
+import org.jboss.ws.core.soap.SOAPMessageImpl;
+import org.jboss.ws.core.utils.JavaUtils;
+import org.jboss.ws.extensions.xop.XOPContext;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
+
+/** An implementation handles invocations on the endpoint
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 19-Jan-2005
+ */
+public abstract class AbstractServiceEndpointInvoker implements ServiceEndpointInvoker
+{
+ // provide logging
+ private static Logger log = Logger.getLogger(AbstractServiceEndpointInvoker.class);
+
+ protected ServiceEndpointInfo seInfo;
+ protected CommonBindingProvider bindingProvider;
+ protected ServerHandlerDelegate delegate;
+
+ /** Initialize the service endpoint */
+ public void init(ServiceEndpointInfo seInfo)
+ {
+ this.seInfo = seInfo;
+ ServerEndpointMetaData sepMetaData = seInfo.getServerEndpointMetaData();
+
+ if (sepMetaData.getType() == EndpointMetaData.Type.JAXRPC)
+ {
+ bindingProvider = new CommonBindingProvider(sepMetaData);
+ delegate = new HandlerDelegateJAXRPC(sepMetaData);
+ }
+ else
+ {
+ bindingProvider = new BindingProviderImpl(sepMetaData);
+ delegate = new HandlerDelegateJAXWS(sepMetaData);
+ }
+ }
+
+ /** Load the SEI implementation bean if necessary */
+ protected abstract Class loadServiceEndpoint() throws ClassNotFoundException;
+
+ /** Create the instance of the SEI implementation bean if necessary */
+ protected abstract Object createServiceEndpointInstance(Object context, Class
seiImplClass) throws Exception;
+
+ /** Invoke the instance of the SEI implementation bean */
+ protected abstract void invokeServiceEndpointInstance(Object seiImpl,
EndpointInvocation epInv) throws Exception;
+
+ /** Destroy the instance of the SEI implementation bean if necessary */
+ protected abstract void destroyServiceEndpointInstance(Object seiImpl);
+
+ public boolean callRequestHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType
type)
+ {
+ return delegate.callRequestHandlerChain(sepMetaData, type);
+ }
+
+ public boolean callResponseHandlerChain(ServerEndpointMetaData sepMetaData,
HandlerType type)
+ {
+ return delegate.callResponseHandlerChain(sepMetaData, type);
+ }
+
+ public void closeHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType type)
+ {
+ delegate.closeHandlerChain(sepMetaData, type);
+ }
+
+ public boolean callFaultHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType
type, Exception ex)
+ {
+ return delegate.callFaultHandlerChain(sepMetaData, type, ex);
+ }
+
+ /** Invoke the the service endpoint */
+ public MessageAbstraction invoke(Object context) throws Exception
+ {
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+ ServerEndpointMetaData sepMetaData =
(ServerEndpointMetaData)msgContext.getEndpointMetaData();
+ MessageAbstraction reqMessage = msgContext.getMessageAbstraction();
+
+ // Load the endpoint implementation bean
+ Class seImpl = loadServiceEndpoint();
+
+ // Create an instance of the endpoint implementation bean
+ Object seInstance = createServiceEndpointInstance(context, seImpl);
+
+ // The direction of the message
+ DirectionHolder direction = new DirectionHolder(Direction.InBound);
+
+ // Get the order of pre/post handlerchains
+ HandlerType[] handlerType = delegate.getHandlerTypeOrder();
+ HandlerType[] faultType = delegate.getHandlerTypeOrder();
+
+ // Set the required inbound context properties
+ setInboundContextProperties();
+
+ try
+ {
+ boolean oneway = false;
+ EndpointInvocation epInv = null;
+ OperationMetaData opMetaData = null;
+ CommonBinding binding = bindingProvider.getCommonBinding();
+ binding.setHeaderSource(delegate);
+
+ // call the request handler chain
+ boolean handlersPass = callRequestHandlerChain(sepMetaData, handlerType[0]);
+
+ // Unbind the request message
+ if (handlersPass)
+ {
+ // Get the operation meta data from the SOAP message
+ opMetaData = getDispatchDestination(sepMetaData, reqMessage);
+ msgContext.setOperationMetaData(opMetaData);
+ oneway = opMetaData.isOneWay();
+
+ /*
+ * From JAX-WS 10.2.1 - "7. If the node does not understand how to
process
+ * the message, then neither handlers nor the endpoint
+ * are invoked and instead the binding generates a SOAP must
+ * understand exception"
+ *
+ * Therefore, this must precede the ENDPOINT chain; however, The PRE
+ * chain still must happen first since the message may be encrypted, in
which
+ * case the operation is still not known. Without knowing the operation, it
+ * is not possible to determine what headers are understood by the endpoint.
+ */
+ if (binding instanceof CommonSOAPBinding)
+ ((CommonSOAPBinding)binding).checkMustUnderstand(opMetaData);
+
+ // Unbind the request message
+ epInv = binding.unbindRequestMessage(opMetaData, reqMessage);
+ }
+
+ handlersPass = handlersPass && callRequestHandlerChain(sepMetaData,
handlerType[1]);
+ handlersPass = handlersPass && callRequestHandlerChain(sepMetaData,
handlerType[2]);
+
+ if (handlersPass)
+ {
+ msgContext.put(CommonMessageContext.ALLOW_EXPAND_TO_DOM, Boolean.TRUE);
+ try
+ {
+ // Check if protocol handlers modified the payload
+ if (msgContext.isModified())
+ {
+ log.debug("Handler modified payload, unbind message again");
+ reqMessage = msgContext.getMessageAbstraction();
+ epInv = binding.unbindRequestMessage(opMetaData, reqMessage);
+ }
+
+ // Invoke the service endpoint
+ invokeServiceEndpointInstance(seInstance, epInv);
+ }
+ finally
+ {
+ msgContext.remove(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
+ }
+
+ // Reverse the message direction
+ msgContext = processPivotInternal(msgContext, direction);
+
+ // Set the required outbound context properties
+ setOutboundContextProperties();
+
+ if (binding instanceof CommonSOAPBinding)
+ XOPContext.setMTOMEnabled(((CommonSOAPBinding)binding).isMTOMEnabled());
+
+ // Bind the response message
+ MessageAbstraction resMessage = binding.bindResponseMessage(opMetaData,
epInv);
+ msgContext.setMessageAbstraction(resMessage);
+ }
+ else
+ {
+ // Reverse the message direction without calling the endpoint
+ MessageAbstraction resMessage = msgContext.getMessageAbstraction();
+ msgContext = processPivotInternal(msgContext, direction);
+ msgContext.setMessageAbstraction(resMessage);
+ }
+
+ if (oneway == false)
+ {
+ // call the response handler chain, removing the fault type entry will not
call handleFault for that chain
+ handlersPass = callResponseHandlerChain(sepMetaData, handlerType[2]);
+ faultType[2] = null;
+ handlersPass = handlersPass && callResponseHandlerChain(sepMetaData,
handlerType[1]);
+ faultType[1] = null;
+ handlersPass = handlersPass && callResponseHandlerChain(sepMetaData,
handlerType[0]);
+ faultType[0] = null;
+ }
+
+ MessageAbstraction resMessage = msgContext.getMessageAbstraction();
+ return resMessage;
+ }
+ catch (RuntimeException ex)
+ {
+ // Reverse the message direction
+ processPivotInternal(msgContext, direction);
+
+ try
+ {
+ CommonBinding binding = bindingProvider.getCommonBinding();
+ binding.bindFaultMessage(ex);
+
+ // call the fault handler chain
+ boolean handlersPass = true;
+ if (faultType[2] != null)
+ handlersPass = handlersPass && callFaultHandlerChain(sepMetaData,
faultType[2], ex);
+ if (faultType[1] != null)
+ handlersPass = handlersPass && callFaultHandlerChain(sepMetaData,
faultType[1], ex);
+ if (faultType[0] != null)
+ handlersPass = handlersPass && callFaultHandlerChain(sepMetaData,
faultType[0], ex);
+ }
+ catch (RuntimeException subEx)
+ {
+ log.warn("Exception while processing handleFault: ", ex);
+ ex = subEx;
+ }
+ throw ex;
+ }
+ finally
+ {
+ closeHandlerChain(sepMetaData, handlerType[2]);
+ closeHandlerChain(sepMetaData, handlerType[1]);
+ closeHandlerChain(sepMetaData, handlerType[0]);
+
+ destroyServiceEndpointInstance(seInstance);
+ }
+ }
+
+ protected void setInboundContextProperties()
+ {
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+ if (msgContext instanceof MessageContextJAXWS)
+ {
+ // Map of attachments to a message for the outbound message, key is the MIME
Content-ID, value is a DataHandler
+ msgContext.put(MessageContextJAXWS.INBOUND_MESSAGE_ATTACHMENTS, new
HashMap<String, DataHandler>());
+ }
+ }
+
+ protected void setOutboundContextProperties()
+ {
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+ if (msgContext instanceof MessageContextJAXWS)
+ {
+ // Map of attachments to a message for the outbound message, key is the MIME
Content-ID, value is a DataHandler
+ msgContext.put(MessageContextJAXWS.OUTBOUND_MESSAGE_ATTACHMENTS, new
HashMap<String, DataHandler>());
+ }
+ }
+
+ private CommonMessageContext processPivotInternal(CommonMessageContext msgContext,
DirectionHolder direction)
+ {
+ if (direction.getDirection() == Direction.InBound)
+ {
+ EndpointMetaData epMetaData = msgContext.getEndpointMetaData();
+ if (epMetaData.getType() == EndpointMetaData.Type.JAXRPC)
+ {
+ msgContext = MessageContextJAXRPC.processPivot(msgContext);
+ }
+ else
+ {
+ msgContext = MessageContextJAXWS.processPivot(msgContext);
+ }
+ direction.setDirection(Direction.OutBound);
+ }
+ return msgContext;
+ }
+
+ private OperationMetaData getDispatchDestination(EndpointMetaData epMetaData,
MessageAbstraction reqMessage) throws SOAPException
+ {
+ OperationMetaData opMetaData;
+
+ String bindingID = epMetaData.getBindingId();
+ if (HTTPBinding.HTTP_BINDING.equals(bindingID))
+ {
+ if (epMetaData.getOperations().size() != 1)
+ throw new IllegalStateException("Multiple operations not supported for
HTTP binding");
+
+ opMetaData = epMetaData.getOperations().get(0);
+ }
+ else
+ {
+ SOAPMessageImpl soapMessage = (SOAPMessageImpl)reqMessage;
+
+ opMetaData = soapMessage.getOperationMetaData(epMetaData);
+ SOAPHeader soapHeader = soapMessage.getSOAPHeader();
+
+ // Report a MustUnderstand fault
+ if (opMetaData == null)
+ {
+ String faultString;
+ SOAPBody soapBody = soapMessage.getSOAPBody();
+ if (soapBody.getChildElements().hasNext())
+ {
+ SOAPBodyElement soapBodyElement =
(SOAPBodyElement)soapBody.getChildElements().next();
+ Name soapName = soapBodyElement.getElementName();
+ faultString = "Endpoint " + epMetaData.getPortName() + "
does not contain operation meta data for: " + soapName;
+ }
+ else
+ {
+ faultString = "Endpoint " + epMetaData.getPortName() + "
does not contain operation meta data for empty soap body";
+ }
+
+ // R2724 If an INSTANCE receives a message that is inconsistent with its WSDL
description, it SHOULD generate a soap:Fault
+ // with a faultcode of "Client", unless a
"MustUnderstand" or "VersionMismatch" fault is generated.
+ if (soapHeader != null &&
soapHeader.examineMustUnderstandHeaderElements(Constants.URI_SOAP11_NEXT_ACTOR).hasNext())
+ {
+ QName faultCode = Constants.SOAP11_FAULT_CODE_MUST_UNDERSTAND;
+ throw new SOAPFaultException(faultCode, faultString, null, null);
+ }
+ else
+ {
+ QName faultCode = Constants.SOAP11_FAULT_CODE_CLIENT;
+ throw new SOAPFaultException(faultCode, faultString, null, null);
+ }
+ }
+ }
+ return opMetaData;
+ }
+
+ protected Method getImplMethod(Class implClass, Method seiMethod) throws
ClassNotFoundException, NoSuchMethodException
+ {
+ String methodName = seiMethod.getName();
+ Class[] paramTypes = seiMethod.getParameterTypes();
+ for (int i = 0; i < paramTypes.length; i++)
+ {
+ Class paramType = paramTypes[i];
+ if (JavaUtils.isPrimitive(paramType) == false)
+ {
+ String paramTypeName = paramType.getName();
+ paramType = JavaUtils.loadJavaType(paramTypeName);
+ paramTypes[i] = paramType;
+ }
+ }
+
+ Method implMethod = implClass.getMethod(methodName, paramTypes);
+ return implMethod;
+ }
+
+ /** handle invocation exceptions */
+ public void handleInvocationException(Throwable th) throws Exception
+ {
+ if (th instanceof InvocationTargetException)
+ {
+ // unwrap the throwable raised by the service endpoint implementation
+ Throwable targetEx = ((InvocationTargetException)th).getTargetException();
+ handleInvocationThrowable(targetEx);
+ }
+
+ if (th instanceof MBeanException)
+ {
+ throw ((MBeanException)th).getTargetException();
+ }
+
+ handleInvocationThrowable(th);
+ }
+
+ private void handleInvocationThrowable(Throwable th) throws Exception
+ {
+ if (th instanceof Exception)
+ {
+ throw (Exception)th;
+ }
+ else if (th instanceof Error)
+ {
+ throw (Error)th;
+ }
+ else
+ {
+ throw new UndeclaredThrowableException(th);
+ }
+ }
+}
Copied:
trunk/jbossws-core/src/java/org/jboss/ws/core/server/legacy/AbstractServiceEndpointServlet.java
(from rev 2936,
trunk/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointServlet.java)
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/server/legacy/AbstractServiceEndpointServlet.java
(rev 0)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/server/legacy/AbstractServiceEndpointServlet.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -0,0 +1,165 @@
+/*
+ * 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.ws.core.server.legacy;
+
+// $Id: AbstractServiceEndpointServlet.java 396 2006-05-23 09:48:45Z
thomas.diesler(a)jboss.com $
+
+import java.io.IOException;
+import java.io.Writer;
+import java.net.URL;
+
+import javax.management.ObjectName;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.xml.rpc.JAXRPCException;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.server.ServletRequestContext;
+import org.jboss.ws.integration.ObjectNameFactory;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
+
+/**
+ * A servlet that is installed for every web service endpoint.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 15-Jan-2005
+ */
+public abstract class AbstractServiceEndpointServlet extends HttpServlet
+{
+ // provide logging
+ private static final Logger log =
Logger.getLogger(AbstractServiceEndpointServlet.class);
+
+ protected ObjectName sepId;
+ protected ServiceEndpointManager epManager;
+
+ public void init(ServletConfig config) throws ServletException
+ {
+ super.init(config);
+ initServiceEndpointManager();
+ }
+
+ public void destroy()
+ {
+ super.destroy();
+ }
+
+ public void service(HttpServletRequest req, HttpServletResponse res) throws
ServletException, IOException
+ {
+ if (sepId == null)
+ {
+ String contextPath = req.getContextPath();
+ initServiceEndpoint(contextPath);
+ }
+ super.service(req, res);
+ }
+
+ public void doGet(HttpServletRequest req, HttpServletResponse res) throws
ServletException, IOException
+ {
+ // Process a WSDL request
+ if (req.getParameter("wsdl") != null ||
req.getParameter("WSDL") != null)
+ {
+ res.setContentType("text/xml");
+ try
+ {
+ // For the base document the resourcePath should be null
+ String resourcePath = (String)req.getParameter("resource");
+ URL requestURL = new URL(req.getRequestURL().toString());
+ epManager.processWSDLRequest(sepId, res.getOutputStream(), requestURL,
resourcePath);
+ }
+ catch (Exception ex)
+ {
+ handleException(ex);
+ }
+ }
+ else
+ {
+ res.setStatus(405);
+ res.setContentType("text/plain");
+ Writer out = res.getWriter();
+ out.write("HTTP GET not supported");
+ out.flush();
+ out.close();
+ }
+ }
+
+ public void doPost(HttpServletRequest req, HttpServletResponse res) throws
ServletException, IOException
+ {
+ log.debug("doPost: " + req.getRequestURI());
+
+ try
+ {
+ ServletRequestContext context = new ServletRequestContext(getServletContext(),
req, res);
+ epManager.processRequest(sepId, req.getInputStream(), res.getOutputStream(),
context);
+ }
+ catch (Exception ex)
+ {
+ handleException(ex);
+ }
+ }
+
+ private void handleException(Exception ex) throws ServletException
+ {
+ log.error("Error processing web service request", ex);
+
+ if (ex instanceof JAXRPCException)
+ throw (JAXRPCException)ex;
+
+ throw new ServletException(ex);
+ }
+
+ protected void initServiceEndpointManager()
+ {
+ ServiceEndpointManagerFactory factory =
ServiceEndpointManagerFactory.getInstance();
+ epManager = factory.getServiceEndpointManager();
+ }
+
+ /** Initialize the service endpoint
+ */
+ protected void initServiceEndpoint(String contextPath)
+ {
+ String servletName = getServletName();
+ if (contextPath.startsWith("/"))
+ contextPath = contextPath.substring(1);
+
+ for (ObjectName sepId : epManager.getServiceEndpoints())
+ {
+ String context =
sepId.getKeyProperty(ServerEndpointMetaData.SEPID_PROPERTY_CONTEXT);
+ String endpoint =
sepId.getKeyProperty(ServerEndpointMetaData.SEPID_PROPERTY_ENDPOINT);
+ if (servletName.equals(endpoint) && contextPath.equals(context))
+ {
+ this.sepId = sepId;
+ break;
+ }
+ }
+
+ if (sepId == null)
+ {
+ ObjectName oname = ObjectNameFactory.create(ServerEndpointMetaData.SEPID_DOMAIN
+ ":" + ServerEndpointMetaData.SEPID_PROPERTY_CONTEXT + "=" +
contextPath
+ + "," + ServerEndpointMetaData.SEPID_PROPERTY_ENDPOINT +
"=" + servletName);
+ throw new WSException("Cannot obtain endpoint for: " + oname);
+ }
+ }
+}
Added:
trunk/jbossws-core/src/java/org/jboss/ws/core/server/legacy/CommonContextServlet.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/server/legacy/CommonContextServlet.java
(rev 0)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/server/legacy/CommonContextServlet.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -0,0 +1,168 @@
+/*
+ * 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.ws.core.server.legacy;
+
+// $Id$
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.net.URL;
+import java.util.List;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.jboss.logging.Logger;
+
+/**
+ * The servlet that that is associated with context /jbossws
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 21-Mar-2005
+ */
+public abstract class CommonContextServlet extends HttpServlet
+{
+ // provide logging
+ protected final Logger log = Logger.getLogger(CommonContextServlet.class);
+
+ protected ServiceEndpointManager epManager;
+
+ public void init(ServletConfig config) throws ServletException
+ {
+ super.init(config);
+ initServiceEndpointManager();
+ }
+
+ protected abstract void initServiceEndpointManager();
+
+ /** Process GET requests.
+ */
+ public void doGet(HttpServletRequest req, HttpServletResponse res) throws
ServletException, IOException
+ {
+ PrintWriter writer = res.getWriter();
+ res.setContentType("text/html");
+
+ writer.print("<html>");
+ setupHTMLResponseHeader(writer);
+
+ URL requestURL = new URL(req.getRequestURL().toString());
+
+ writer.print("<body>");
+
+ writer.print("<div
class='pageHeader'>JBossWS/Services</div>");
+ writer.print("<div class='pageSection'>");
+ writer.print("<fieldset>");
+ writer.print("<legend><b>Registered Service
Endpoints</b></legend>");
+ writer.print("<table>");
+
+ // begin iteration
+ List<ServiceEndpointDTO> endpoints =
epManager.getRegisteredEndpoints(requestURL);
+
+ if(endpoints.isEmpty())
+ {
+ writer.print("<tr>");
+ writer.print(" <td><h3>There are currently no endpoints
deployed</h3></td>");
+ writer.print("</tr>");
+ }
+
+ for(ServiceEndpointDTO ep : endpoints)
+ {
+ writer.print("<tr>");
+ writer.print(" <td>ServiceEndpointID</td>");
+ writer.print(" <td>"+ep.getSepID()+"</td>");
+ writer.print("</tr>");
+ writer.print("<tr>");
+ writer.print(" <td>ServiceEndpointAddress</td>");
+ writer.print(" <td><a
href='"+ep.getAddress()+"?wsdl'>"+ep.getAddress()+"?wsdl</a></td>");
+ writer.print("</tr>");
+ writer.print("<tr>");
+ writer.print(" <td colspan=2>");
+ writer.print(" ");
+ writer.print("");
+ writer.print("<table class='metrics'>");
+ writer.print("<tr>");
+ writer.print(" <td>StartTime</td>");
+ writer.print(" <td>StopTime</td>");
+ writer.print(" <td></td>");
+ writer.print("</tr>");
+ writer.print("<tr>");
+
writer.print(" <td>"+ep.getSeMetrics().getStartTime()+"</td>");
+
+ String stopTime = ep.getSeMetrics().getStopTime() != null ?
ep.getSeMetrics().getStopTime().toString() : "";
+ writer.print(" <td>"+stopTime+"</td>");
+ writer.print(" <td></td>");
+ writer.print("</tr>");
+ writer.print("<tr>");
+
+ writer.print(" <td>RequestCount</td>");
+ writer.print(" <td>ResponseCount</td>");
+ writer.print(" <td>FaultCount</td>");
+ writer.print("</tr>");
+ writer.print("<tr>");
+
writer.print(" <td>"+ep.getSeMetrics().getRequestCount()+"</td>");
+
writer.print(" <td>"+ep.getSeMetrics().getResponseCount()+"</td>");
+
writer.print(" <td>"+ep.getSeMetrics().getFaultCount()+"</td>");
+ writer.print("</tr>");
+ writer.print("<tr>");
+ writer.print(" <td>MinProcessingTime</td>");
+ writer.print(" <td>MaxProcessingTime</td>");
+ writer.print(" <td>AvgProcessingTime</td>");
+ writer.print("</tr>");
+ writer.print("<tr>");
+
writer.print(" <td>"+ep.getSeMetrics().getMinProcessingTime()+"</td>");
+
writer.print(" <td>"+ep.getSeMetrics().getMaxProcessingTime()+"</td>");
+
writer.print(" <td>"+ep.getSeMetrics().getAverageProcessingTime()+"</td>");
+ writer.print("</tr>");
+ writer.print("");
+ writer.print("");
+ writer.print("</table>");
+ writer.print("");
+ writer.print(" </td>");
+ writer.print("</tr>");
+
+ writer.print("<tr><td
colspan='3'> </td></tr>");
+ }
+ // end iteration
+ writer.print("</table>");
+ writer.print("");
+ writer.print("</fieldset>");
+ writer.print("</div>");
+
+
+ writer.print("</body>");
+ writer.print("</html>");
+ writer.close();
+ }
+
+ private void setupHTMLResponseHeader(PrintWriter writer)
+ {
+ Package wsPackage = Package.getPackage("org.jboss.ws");
+ writer.println("<head>");
+ writer.println("<meta http-equiv='Content-Type content='text/html;
charset=iso-8859-1'>");
+ writer.println("<title>JBossWS /
"+wsPackage.getImplementationVersion()+"</title>");
+ writer.println("<link rel='stylesheet'
href='./styles.css'>");
+ writer.println("</head>");
+ }
+}
Property changes on:
trunk/jbossws-core/src/java/org/jboss/ws/core/server/legacy/CommonContextServlet.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: trunk/jbossws-core/src/java/org/jboss/ws/core/server/legacy/ServiceEndpoint.java
(from rev 2936,
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpoint.java)
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/server/legacy/ServiceEndpoint.java
(rev 0)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/server/legacy/ServiceEndpoint.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -0,0 +1,307 @@
+/*
+ * 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.ws.core.server.legacy;
+
+// $Id$
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.rpc.soap.SOAPFaultException;
+import javax.xml.soap.MimeHeaders;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.http.HTTPBinding;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.Constants;
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.CommonBinding;
+import org.jboss.ws.core.CommonBindingProvider;
+import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.core.HTTPMessageImpl;
+import org.jboss.ws.core.MessageAbstraction;
+import org.jboss.ws.core.MessageTrace;
+import org.jboss.ws.core.jaxrpc.binding.BindingException;
+import org.jboss.ws.core.server.MimeHeaderSource;
+import org.jboss.ws.core.server.ServiceEndpointMetrics;
+import org.jboss.ws.core.server.ServletRequestContext;
+import org.jboss.ws.core.server.WSDLRequestHandler;
+import org.jboss.ws.core.soap.MessageContextAssociation;
+import org.jboss.ws.core.soap.MessageFactoryImpl;
+import org.jboss.ws.core.soap.SOAPMessageImpl;
+import org.jboss.ws.core.utils.DOMWriter;
+import org.jboss.ws.extensions.xop.XOPContext;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
+import org.w3c.dom.Document;
+
+/**
+ * This object registered with the ServiceEndpointManager service.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 16-Jan-2005
+ */
+public class ServiceEndpoint
+{
+ // provide logging
+ private static Logger log = Logger.getLogger(ServiceEndpoint.class);
+
+ /** Endpoint type enum */
+ public enum State
+ {
+ CREATED, STARTED, STOPED, DESTROYED
+ }
+
+ // The deployment info for this endpoint
+ protected ServiceEndpointInfo seInfo;
+ // Some metrics for this endpoint
+ protected ServiceEndpointMetrics seMetrics;
+
+ public ServiceEndpoint(ServiceEndpointInfo seInfo)
+ {
+ this.seInfo = seInfo;
+ this.seInfo.setState(State.CREATED);
+ this.seMetrics = new ServiceEndpointMetrics(seInfo.getServiceEndpointID());
+ }
+
+ public State getState()
+ {
+ return seInfo.getState();
+ }
+
+ public ServiceEndpointInfo getServiceEndpointInfo()
+ {
+ return seInfo;
+ }
+
+ public ServiceEndpointMetrics getServiceEndpointMetrics()
+ {
+ return seMetrics;
+ }
+
+ public void create() throws Exception
+ {
+ seInfo.setState(State.CREATED);
+ }
+
+ public void start() throws Exception
+ {
+ // eagerly initialize the UMDM
+ ServerEndpointMetaData epMetaData = seInfo.getServerEndpointMetaData();
+ UnifiedMetaData wsMetaData = epMetaData.getServiceMetaData().getUnifiedMetaData();
+ wsMetaData.eagerInitialize();
+
+ seMetrics.start();
+ seInfo.setState(State.STARTED);
+ }
+
+ public void stop()
+ {
+ seMetrics.stop();
+ seInfo.setState(State.STOPED);
+ if (log.isDebugEnabled())
+ log.debug("Stop Endpoint" + seMetrics);
+ }
+
+ public void destroy()
+ {
+ seInfo.setState(State.DESTROYED);
+ }
+
+ /** Handle a WSDL request or a request for an included resource
+ */
+ public void handleWSDLRequest(OutputStream outStream, URL reqURL, String resPath)
throws IOException
+ {
+ ServiceEndpointInfo sepInfo = getServiceEndpointInfo();
+ EndpointMetaData epMetaData = sepInfo.getServerEndpointMetaData();
+
+ //String wsdlHost = reqURL.getHost();
+ String wsdlHost = reqURL.getProtocol() + "://" + reqURL.getHost() +
":" + reqURL.getPort();
+
+ ServiceEndpointManagerFactory factory =
ServiceEndpointManagerFactory.getInstance();
+ ServiceEndpointManager epManager = factory.getServiceEndpointManager();
+ if (epManager.getWebServiceHost().equals(ServiceEndpointManager.UNDEFINED_HOSTNAME)
== false)
+ {
+ wsdlHost = epManager.getWebServiceHost();
+ }
+ if (log.isDebugEnabled())
+ log.debug("WSDL request, using host: " + wsdlHost);
+
+ WSDLRequestHandler wsdlRequestHandler = new WSDLRequestHandler(epMetaData);
+ Document document = wsdlRequestHandler.getDocumentForPath(reqURL, wsdlHost,
resPath);
+
+ OutputStreamWriter writer = new OutputStreamWriter(outStream);
+ new DOMWriter(writer).setPrettyprint(true).print(document.getDocumentElement());
+ outStream.flush();
+ outStream.close();
+ }
+
+ /**
+ * Handle a request to this web service endpoint
+ */
+ public MessageAbstraction processRequest(MimeHeaderSource headerSource,
ServletRequestContext context, InputStream inputStream) throws BindingException
+ {
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+ ServerEndpointMetaData sepMetaData = seInfo.getServerEndpointMetaData();
+
+ long beginProcessing = 0;
+ ClassLoader ctxClassLoader = Thread.currentThread().getContextClassLoader();
+ try
+ {
+ State state = seInfo.getState();
+ if (state != State.STARTED)
+ {
+ QName faultCode = Constants.SOAP11_FAULT_CODE_SERVER;
+ String faultString = "Endpoint cannot handle requests in state: " +
state;
+ throw new SOAPFaultException(faultCode, faultString, null, null);
+ }
+
+ log.debug("BEGIN handleRequest: " + seInfo.getServiceEndpointID());
+ beginProcessing = seMetrics.processRequestMessage();
+
+ MimeHeaders headers = (headerSource != null ? headerSource.getMimeHeaders() :
null);
+
+ MessageAbstraction reqMessage;
+
+ String bindingID = sepMetaData.getBindingId();
+ if (HTTPBinding.HTTP_BINDING.equals(bindingID))
+ {
+ reqMessage = new HTTPMessageImpl(headers, inputStream);
+ }
+ else
+ {
+ MessageFactoryImpl msgFactory = new MessageFactoryImpl();
+ msgFactory.setServiceMode(sepMetaData.getServiceMode());
+ msgFactory.setStyle(sepMetaData.getStyle());
+
+ reqMessage = (SOAPMessageImpl)msgFactory.createMessage(headers,
inputStream);
+ }
+
+ // Associate current message with message context
+ msgContext.setMessageAbstraction(reqMessage);
+
+ // debug the incomming message
+ MessageTrace.traceMessage("Incoming Request Message", reqMessage);
+
+ // Set the thread context class loader
+ ClassLoader classLoader = sepMetaData.getClassLoader();
+ Thread.currentThread().setContextClassLoader(classLoader);
+
+ // Invoke the service endpoint
+ ServiceEndpointInvoker seInvoker = seInfo.getInvoker();
+ MessageAbstraction resMessage = seInvoker.invoke(context);
+
+ if (resMessage != null)
+ postProcessResponse(headerSource, resMessage);
+
+ return resMessage;
+ }
+ catch (Exception ex)
+ {
+ MessageAbstraction resMessage = msgContext.getMessageAbstraction();
+
+ // In case we have an exception before the invoker is called
+ // we create the fault message here.
+ if (resMessage == null || resMessage.isFaultMessage() == false)
+ {
+ CommonBindingProvider bindingProvider = getCommonBindingProvider();
+ CommonBinding binding = bindingProvider.getCommonBinding();
+ resMessage = binding.bindFaultMessage(ex);
+ }
+
+ if (resMessage != null)
+ postProcessResponse(headerSource, resMessage);
+
+ return resMessage;
+ }
+ finally
+ {
+ try
+ {
+ MessageAbstraction resMessage = msgContext.getMessageAbstraction();
+ if (resMessage != null)
+ {
+ if (resMessage.isFaultMessage())
+ {
+ seMetrics.processFaultMessage(beginProcessing);
+ }
+ else
+ {
+ seMetrics.processResponseMessage(beginProcessing);
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ log.error("Cannot process metrics", ex);
+ }
+
+ // Reset the thread context class loader
+ Thread.currentThread().setContextClassLoader(ctxClassLoader);
+ if (log.isDebugEnabled())
+ log.debug("END handleRequest: " + seInfo.getServiceEndpointID());
+ }
+ }
+
+ /** Set response mime headers
+ */
+ private void postProcessResponse(MimeHeaderSource headerSource, MessageAbstraction
resMessage)
+ {
+ try
+ {
+ // Set the outbound headers
+ if (headerSource != null && resMessage instanceof SOAPMessage)
+ {
+ XOPContext.eagerlyCreateAttachments();
+ ((SOAPMessage)resMessage).saveChanges();
+ headerSource.setMimeHeaders(resMessage.getMimeHeaders());
+ }
+
+ // debug the outgoing message
+ MessageTrace.traceMessage("Outgoing Response Message", resMessage);
+ }
+ catch (Exception ex)
+ {
+ WSException.rethrow("Faild to post process response message", ex);
+ }
+ }
+
+ private CommonBindingProvider getCommonBindingProvider()
+ {
+ return new CommonBindingProvider(seInfo.getServerEndpointMetaData());
+ }
+
+ /**
+ * Returns a string representation of the object.
+ */
+ public String toString()
+ {
+ StringBuilder buffer = new StringBuilder(seInfo.toString());
+ buffer.append("\n state=" + seInfo.getState());
+ return buffer.toString();
+ }
+}
Copied:
trunk/jbossws-core/src/java/org/jboss/ws/core/server/legacy/ServiceEndpointDTO.java (from
rev 2936, trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointDTO.java)
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/server/legacy/ServiceEndpointDTO.java
(rev 0)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/server/legacy/ServiceEndpointDTO.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -0,0 +1,72 @@
+/*
+ * 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.ws.core.server.legacy;
+
+import javax.management.ObjectName;
+
+import org.jboss.ws.core.server.ServiceEndpointMetrics;
+
+/**
+ * @author Heiko.Braun(a)jboss.org
+ * @version $Id$
+ * @since 02.02.2007
+ */
+public class ServiceEndpointDTO {
+
+ private ServiceEndpointMetrics seMetrics;
+ private ServiceEndpoint.State state;
+ private ObjectName sepID;
+ private String address;
+
+ public ServiceEndpointMetrics getSeMetrics() {
+ return seMetrics;
+ }
+
+ public void setSeMetrics(ServiceEndpointMetrics seMetrics) {
+ this.seMetrics = seMetrics;
+ }
+
+ public ServiceEndpoint.State getState() {
+ return state;
+ }
+
+ public void setState(ServiceEndpoint.State state) {
+ this.state = state;
+ }
+
+ public ObjectName getSepID() {
+ return sepID;
+ }
+
+ public void setSepID(ObjectName sepID) {
+ this.sepID = sepID;
+ }
+
+ public String getAddress() {
+ return address;
+ }
+
+ public void setAddress(String address) {
+ this.address = address;
+ }
+
+}
Copied:
trunk/jbossws-core/src/java/org/jboss/ws/core/server/legacy/ServiceEndpointDeployer.java
(from rev 2936,
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointDeployer.java)
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/server/legacy/ServiceEndpointDeployer.java
(rev 0)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/server/legacy/ServiceEndpointDeployer.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -0,0 +1,231 @@
+/*
+ * 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.ws.core.server.legacy;
+
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import javax.management.ObjectName;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+import org.jboss.ws.core.server.WSDLFilePublisher;
+import org.jboss.ws.integration.deployment.Deployment.DeploymentType;
+import org.jboss.ws.metadata.builder.jaxrpc.JAXRPCDeployment;
+import org.jboss.ws.metadata.builder.jaxrpc.JAXRPCServerMetaDataBuilder;
+import org.jboss.ws.metadata.builder.jaxws.JAXWSMetaDataBuilderEJB3;
+import org.jboss.ws.metadata.builder.jaxws.JAXWSMetaDataBuilderJSE;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
+import org.jboss.ws.metadata.umdm.ServiceMetaData;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
+
+/**
+ * The POJO deployer for web service endpoints. This Deployer is already decoupled from
the target
+ * container (i.e. JBoss, Tomcat). The containers deployer architecture should be used to
populate
+ * the UnifiedDeploymentInfo object.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 12-May-2006
+ */
+public class ServiceEndpointDeployer
+{
+ // logging support
+ private static Logger log = Logger.getLogger(ServiceEndpointDeployer.class);
+
+ // default bean name
+ public static final String BEAN_NAME = "ServiceEndpointDeployer";
+
+ // The ServiceEndpointManger injected by the kernel
+ private ServiceEndpointManager epManager;
+
+ // Maps the deployment url to UMDM
+ private Map<String, UnifiedMetaData> metaDataMap = new
ConcurrentHashMap<String, UnifiedMetaData>();
+
+ // Injected by the Microkernel
+ public void setServiceEndpointManager(ServiceEndpointManager epManager)
+ {
+ this.epManager = epManager;
+ }
+
+ public void create(UnifiedDeploymentInfo udi)
+ {
+ if(log.isDebugEnabled()) log.debug("create: " + udi.name);
+ try
+ {
+ UnifiedMetaData wsMetaData;
+ if (udi.type == DeploymentType.JAXRPC_JSE)
+ {
+ JAXRPCServerMetaDataBuilder builder = new JAXRPCServerMetaDataBuilder();
+ wsMetaData = builder.buildMetaData((JAXRPCDeployment)udi);
+ }
+ else if (udi.type == DeploymentType.JAXRPC_EJB21)
+ {
+ JAXRPCServerMetaDataBuilder builder = new JAXRPCServerMetaDataBuilder();
+ wsMetaData = builder.buildMetaData((JAXRPCDeployment)udi);
+ }
+ else if (udi.type == DeploymentType.JAXWS_JSE)
+ {
+ JAXWSMetaDataBuilderJSE builder = new JAXWSMetaDataBuilderJSE();
+ wsMetaData = builder.buildMetaData(udi);
+ }
+ else if (udi.type == DeploymentType.JAXWS_EJB3)
+ {
+ JAXWSMetaDataBuilderEJB3 builder = new JAXWSMetaDataBuilderEJB3();
+ wsMetaData = builder.buildMetaData(udi);
+ }
+ else
+ {
+ throw new IllegalStateException("Invalid type: " + udi.type);
+ }
+
+ metaDataMap.put(udi.name, wsMetaData);
+
+ for (ServiceMetaData serviceMetaData : wsMetaData.getServices())
+ {
+ for (EndpointMetaData epMetaData : serviceMetaData.getEndpoints())
+ {
+ ServiceEndpointInfo seInfo = new ServiceEndpointInfo(udi,
(ServerEndpointMetaData)epMetaData);
+ epManager.createServiceEndpoint(seInfo);
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ log.error("Cannot create service endpoint", ex);
+ if (ex instanceof RuntimeException)
+ throw (RuntimeException)ex;
+
+ throw new WSException(ex);
+ }
+ }
+
+ public void start(UnifiedDeploymentInfo udi)
+ {
+ if(log.isDebugEnabled()) log.debug("start: " + udi.name);
+ try
+ {
+ UnifiedMetaData wsMetaData = getUnifiedMetaData(udi);
+ if (wsMetaData != null)
+ {
+ // late initialization of the web context loader
+ if (wsMetaData.getClassLoader() != udi.classLoader)
+ wsMetaData.setClassLoader(udi.classLoader);
+
+ // Publish the WSDL file
+ WSDLFilePublisher wsdlfp = new WSDLFilePublisher(udi);
+ wsdlfp.publishWsdlFiles(wsMetaData);
+ for (ServiceMetaData serviceMetaData : wsMetaData.getServices())
+ {
+ for (EndpointMetaData epMetaData : serviceMetaData.getEndpoints())
+ {
+ ObjectName sepID =
((ServerEndpointMetaData)epMetaData).getServiceEndpointID();
+ epManager.startServiceEndpoint(sepID);
+ }
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ log.error("Cannot start service endpoint", ex);
+ if (ex instanceof RuntimeException)
+ throw (RuntimeException)ex;
+
+ throw new WSException(ex);
+ }
+ }
+
+ public void stop(UnifiedDeploymentInfo udi)
+ {
+ if(log.isDebugEnabled()) log.debug("stop: " + udi.name);
+ try
+ {
+ UnifiedMetaData wsMetaData = getUnifiedMetaData(udi);
+ if (wsMetaData != null)
+ {
+ // Stop the service endpoints
+ for (ServiceMetaData serviceMetaData : wsMetaData.getServices())
+ {
+ for (EndpointMetaData epMetaData : serviceMetaData.getEndpoints())
+ {
+ ObjectName sepID =
((ServerEndpointMetaData)epMetaData).getServiceEndpointID();
+ epManager.stopServiceEndpoint(sepID);
+ }
+ }
+
+ // Unpublish the WSDL file
+ WSDLFilePublisher wsdlfp = new WSDLFilePublisher(udi);
+ wsdlfp.unpublishWsdlFiles();
+ }
+ }
+ catch (Exception ex)
+ {
+ log.error("Cannot stop service endpoint", ex);
+ if (ex instanceof RuntimeException)
+ throw (RuntimeException)ex;
+
+ throw new WSException(ex);
+ }
+ }
+
+ public void destroy(UnifiedDeploymentInfo udi)
+ {
+ if(log.isDebugEnabled()) log.debug("destroy: " + udi.name);
+ try
+ {
+ UnifiedMetaData wsMetaData = getUnifiedMetaData(udi);
+ if (wsMetaData != null)
+ {
+ // Destroy the service endpoints
+ for (ServiceMetaData serviceMetaData : wsMetaData.getServices())
+ {
+ for (EndpointMetaData epMetaData : serviceMetaData.getEndpoints())
+ {
+ ObjectName sepID =
((ServerEndpointMetaData)epMetaData).getServiceEndpointID();
+ epManager.destroyServiceEndpoint(sepID);
+ }
+ }
+ removeUnifiedMetaData(udi);
+ }
+ }
+ catch (Exception ex)
+ {
+ log.error("Cannot destroy service endpoint", ex);
+ if (ex instanceof RuntimeException)
+ throw (RuntimeException)ex;
+
+ throw new WSException(ex);
+ }
+ }
+
+ public UnifiedMetaData getUnifiedMetaData(UnifiedDeploymentInfo udi)
+ {
+ UnifiedMetaData wsMetaData = metaDataMap.get(udi.name);
+ return wsMetaData;
+ }
+
+ public void removeUnifiedMetaData(UnifiedDeploymentInfo udi)
+ {
+ metaDataMap.remove(udi.name);
+ }
+}
\ No newline at end of file
Copied:
trunk/jbossws-core/src/java/org/jboss/ws/core/server/legacy/ServiceEndpointInfo.java (from
rev 2936, trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointInfo.java)
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/server/legacy/ServiceEndpointInfo.java
(rev 0)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/server/legacy/ServiceEndpointInfo.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -0,0 +1,149 @@
+/*
+ * 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.ws.core.server.legacy;
+
+// $Id$
+
+import javax.management.ObjectName;
+
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+import org.jboss.ws.integration.deployment.Deployment.DeploymentType;
+import org.jboss.ws.metadata.j2ee.UnifiedApplicationMetaData;
+import org.jboss.ws.metadata.j2ee.UnifiedBeanMetaData;
+import org.jboss.ws.metadata.j2ee.UnifiedMessageDrivenMetaData;
+import org.jboss.ws.metadata.j2ee.UnifiedSessionMetaData;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
+
+/**
+ * This object registered with the EndpointManager service.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 16-Jan-2005
+ */
+public class ServiceEndpointInfo
+{
+ /** Endpoint type enum */
+ public enum EndpointType
+ {
+ JSE, SLSB21, SLSB30, MDB21
+ }
+
+ // The deployment info for this endpoint
+ private UnifiedDeploymentInfo udi;
+ // The endpoint type
+ private EndpointType type;
+ // The endpoint meta data
+ private ServerEndpointMetaData sepMetaData;
+ // The service endpoint invoker
+ private ServiceEndpointInvoker seInvoker;
+ // The current state of the endpoint
+ private ServiceEndpoint.State state;
+
+ public ServiceEndpointInfo(UnifiedDeploymentInfo udi, ServerEndpointMetaData
sepMetaData)
+ {
+ this.udi = udi;
+ this.sepMetaData = sepMetaData;
+
+ // Set the endpoint type
+ if (udi.type == DeploymentType.JAXRPC_JSE || udi.type == DeploymentType.JAXWS_JSE)
+ {
+ this.type = EndpointType.JSE;
+ }
+ else if (udi.type == DeploymentType.JAXRPC_EJB21)
+ {
+ String ejbName = sepMetaData.getLinkName();
+ if (ejbName == null)
+ throw new WSException("Cannot obtain ejb-link from port
component");
+
+ UnifiedApplicationMetaData applMetaData =
(UnifiedApplicationMetaData)udi.metaData;
+ UnifiedBeanMetaData beanMetaData =
(UnifiedBeanMetaData)applMetaData.getBeanByEjbName(ejbName);
+ if (beanMetaData == null)
+ throw new WSException("Cannot obtain ejb meta data for: " +
ejbName);
+
+ if (beanMetaData instanceof UnifiedSessionMetaData)
+ {
+ this.type = EndpointType.SLSB21;
+ }
+ else if (beanMetaData instanceof UnifiedMessageDrivenMetaData)
+ {
+ this.type = EndpointType.MDB21;
+ }
+ }
+ else if (udi.type == DeploymentType.JAXRPC_EJB3 || udi.type ==
DeploymentType.JAXWS_EJB3)
+ {
+ this.type = EndpointType.SLSB30;
+ }
+
+ if (type == null)
+ throw new WSException("Unsupported endpoint type: " + type);
+ }
+
+ public ServerEndpointMetaData getServerEndpointMetaData()
+ {
+ return sepMetaData;
+ }
+
+ public ObjectName getServiceEndpointID()
+ {
+ return sepMetaData.getServiceEndpointID();
+ }
+
+ public UnifiedDeploymentInfo getUnifiedDeploymentInfo()
+ {
+ return udi;
+ }
+
+ public EndpointType getType()
+ {
+ return type;
+ }
+
+ public ServiceEndpointInvoker getInvoker()
+ {
+ return seInvoker;
+ }
+
+ public void setInvoker(ServiceEndpointInvoker seInvoker)
+ {
+ this.seInvoker = seInvoker;
+ }
+
+ public ServiceEndpoint.State getState()
+ {
+ return state;
+ }
+
+ public void setState(ServiceEndpoint.State state)
+ {
+ this.state = state;
+ }
+
+ /**
+ * Returns a string representation of the object.
+ */
+ public String toString()
+ {
+ StringBuilder buffer = new StringBuilder("[id=" + getServiceEndpointID()
+ "state=" + state + "]");
+ return buffer.toString();
+ }
+}
Copied:
trunk/jbossws-core/src/java/org/jboss/ws/core/server/legacy/ServiceEndpointInvoker.java
(from rev 2936,
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java)
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/server/legacy/ServiceEndpointInvoker.java
(rev 0)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/server/legacy/ServiceEndpointInvoker.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -0,0 +1,40 @@
+/*
+ * 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.ws.core.server.legacy;
+
+// $Id$
+
+import org.jboss.ws.core.MessageAbstraction;
+
+/** An implementation handles invocations on the endpoint
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 19-Jan-2005
+ */
+public interface ServiceEndpointInvoker
+{
+ /** Initialize the invoker */
+ void init(ServiceEndpointInfo seInfo);
+
+ /** Invoke the the service endpoint */
+ MessageAbstraction invoke(Object endpointContext) throws Exception;
+}
Copied:
trunk/jbossws-core/src/java/org/jboss/ws/core/server/legacy/ServiceEndpointInvokerJSE.java
(from rev 2936,
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointInvokerJSE.java)
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/server/legacy/ServiceEndpointInvokerJSE.java
(rev 0)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/server/legacy/ServiceEndpointInvokerJSE.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -0,0 +1,122 @@
+/*
+ * 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.ws.core.server.legacy;
+
+// $Id: $
+
+import java.lang.reflect.Method;
+
+import javax.xml.rpc.ServiceException;
+import javax.xml.rpc.server.ServiceLifecycle;
+import javax.xml.rpc.server.ServletEndpointContext;
+import javax.xml.rpc.soap.SOAPFaultException;
+import javax.xml.ws.WebServiceContext;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.core.EndpointInvocation;
+import org.jboss.ws.core.jaxrpc.ServletEndpointContextImpl;
+import org.jboss.ws.core.jaxws.WebServiceContextInjector;
+import org.jboss.ws.core.jaxws.WebServiceContextJSE;
+import org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS;
+import org.jboss.ws.core.server.ServletRequestContext;
+import org.jboss.ws.core.soap.MessageContextAssociation;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
+
+/**
+ * Handles invocations on JSE endpoints.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 19-Jan-2005
+ */
+public class ServiceEndpointInvokerJSE extends AbstractServiceEndpointInvoker implements
ServiceEndpointInvoker
+{
+ // provide logging
+ private Logger log = Logger.getLogger(ServiceEndpointInvokerJSE.class);
+
+ /** Load the SEI implementation bean if necessary */
+ public Class loadServiceEndpoint() throws ClassNotFoundException
+ {
+ ServerEndpointMetaData epMetaData = seInfo.getServerEndpointMetaData();
+ ClassLoader cl = epMetaData.getClassLoader();
+ String seiImplName = epMetaData.getServiceEndpointImplName();
+ Class seiImplClass = cl.loadClass(seiImplName);
+ return seiImplClass;
+ }
+
+ /** Create an instance of the SEI implementation bean if necessary */
+ public Object createServiceEndpointInstance(Object context, Class seiImplClass) throws
IllegalAccessException, InstantiationException
+ {
+ Object seiImpl = seiImplClass.newInstance();
+ if (seiImpl instanceof ServiceLifecycle && context != null)
+ {
+ try
+ {
+ ServiceLifecycle serviceLifecycle = ((ServiceLifecycle)seiImpl);
+ ServletEndpointContext servletEndpointContext = new
ServletEndpointContextImpl((ServletRequestContext)context);
+ serviceLifecycle.init(servletEndpointContext);
+ }
+ catch (ServiceException ex)
+ {
+ throw new WSException(ex);
+ }
+ }
+ return seiImpl;
+ }
+
+ /** Invoke an instance of the SEI implementation bean */
+ public void invokeServiceEndpointInstance(Object seiImpl, EndpointInvocation epInv)
throws SOAPFaultException, Exception
+ {
+ log.debug("invokeServiceEndpoint: " + epInv.getJavaMethod().getName());
+ try
+ {
+ CommonMessageContext msgContext =
MessageContextAssociation.peekMessageContext();
+ if (msgContext instanceof SOAPMessageContextJAXWS)
+ {
+ WebServiceContext wsContext = new
WebServiceContextJSE((SOAPMessageContextJAXWS)msgContext);
+ new WebServiceContextInjector().injectContext(seiImpl, wsContext);
+ }
+
+ Class implClass = seiImpl.getClass();
+ Method seiMethod = epInv.getJavaMethod();
+ Method implMethod = getImplMethod(implClass, seiMethod);
+
+ Object[] args = epInv.getRequestPayload();
+ Object retObj = implMethod.invoke(seiImpl, args);
+ epInv.setReturnValue(retObj);
+ }
+ catch (Exception e)
+ {
+ handleInvocationException(e);
+ }
+ }
+
+ /** Destroy an instance of the SEI implementation bean if necessary */
+ public void destroyServiceEndpointInstance(Object seiImpl)
+ {
+ if (seiImpl instanceof ServiceLifecycle)
+ {
+ ((ServiceLifecycle)seiImpl).destroy();
+ }
+ }
+}
Copied:
trunk/jbossws-core/src/java/org/jboss/ws/core/server/legacy/ServiceEndpointManager.java
(from rev 2936,
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManager.java)
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/server/legacy/ServiceEndpointManager.java
(rev 0)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/server/legacy/ServiceEndpointManager.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -0,0 +1,721 @@
+/*
+ * 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.ws.core.server.legacy;
+
+// $Id$
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.lang.reflect.Constructor;
+import java.net.InetAddress;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.UnknownHostException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import javax.activation.DataHandler;
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
+import javax.management.ObjectName;
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.soap.SOAPPart;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.JAXWSAConstants;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.core.MessageAbstraction;
+import org.jboss.ws.core.jaxrpc.handler.MessageContextJAXRPC;
+import org.jboss.ws.core.jaxrpc.handler.SOAPMessageContextJAXRPC;
+import org.jboss.ws.core.jaxws.handler.MessageContextJAXWS;
+import org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS;
+import org.jboss.ws.core.server.ServiceEndpointMetrics;
+import org.jboss.ws.core.server.ServletHeaderSource;
+import org.jboss.ws.core.server.ServletRequestContext;
+import org.jboss.ws.core.server.legacy.ServiceEndpoint.State;
+import org.jboss.ws.core.server.legacy.ServiceEndpointInfo.EndpointType;
+import org.jboss.ws.core.soap.MessageContextAssociation;
+import org.jboss.ws.core.soap.SOAPConnectionImpl;
+import org.jboss.ws.core.utils.ThreadLocalAssociation;
+import org.jboss.ws.extensions.addressing.AddressingConstantsImpl;
+import org.jboss.ws.integration.management.ServerConfig;
+import org.jboss.ws.integration.management.ServerConfigFactory;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
+import org.jboss.ws.metadata.umdm.EndpointMetaData.Type;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
+
+/**
+ * A service that manages JBossWS endpoints.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 15-Jan-2005
+ */
+public class ServiceEndpointManager implements ServiceEndpointManagerMBean
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(ServiceEndpointManager.class);
+
+ // Default bean name
+ public static final String BEAN_NAME = "ServiceEndpointManager";
+ // The host name that is returned if there is no other defined
+ public static String UNDEFINED_HOSTNAME = "jbossws.undefined.host";
+
+ // maps serviceID to EndpointInfo
+ private Map<ObjectName, ServiceEndpoint> registry = new
ConcurrentHashMap<ObjectName, ServiceEndpoint>();
+
+ // 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
+ private int webServicePort;
+ // The webservice port that will be used when updating the wsdl
+ private int webServiceSecurePort;
+ // Whether we should always modify the soap address to the deployed endpoing location
+ private boolean alwaysModifySOAPAddress;
+ // The name of the invoker that handles invocations on JSE endpoints
+ private String serviceEndpointInvokerJSE;
+ // The name of the invoker that handles invocations on EJB2.1 endpoints
+ private String serviceEndpointInvokerEJB21;
+ // The name of the invoker that handles invocations on EJB3 endpoints
+ private String serviceEndpointInvokerEJB3;
+ // The name of the invoker that handles invocations on MDB endpoints
+ private String serviceEndpointInvokerMDB;
+
+ public String getWebServiceHost()
+ {
+ return webServiceHost;
+ }
+
+ public int getWebServicePort()
+ {
+ if (webServicePort == 0)
+ {
+ ServerConfigFactory factory = ServerConfigFactory.getInstance();
+ ServerConfig config = factory.getServerConfig();
+ webServicePort = config.getWebServicePort();
+ log.debug("Using WebServicePort: " + webServicePort);
+ }
+ return webServicePort;
+ }
+
+ public int getWebServiceSecurePort()
+ {
+ if (webServiceSecurePort == 0)
+ {
+ ServerConfigFactory factory = ServerConfigFactory.getInstance();
+ ServerConfig config = factory.getServerConfig();
+ webServiceSecurePort = config.getWebServiceSecurePort();
+ log.debug("Using WebServiceSecurePort: " + webServiceSecurePort);
+ }
+ return webServiceSecurePort;
+ }
+
+ public boolean isAlwaysModifySOAPAddress()
+ {
+ return alwaysModifySOAPAddress;
+ }
+
+ public void setWebServiceHost(String host) throws UnknownHostException
+ {
+ if (host == null || host.trim().length() == 0)
+ {
+ log.debug("Using undefined host: " + UNDEFINED_HOSTNAME);
+ host = UNDEFINED_HOSTNAME;
+ }
+ if ("0.0.0.0".equals(host))
+ {
+ InetAddress localHost = InetAddress.getLocalHost();
+ log.debug("Using local host: " + localHost.getHostName());
+ host = localHost.getHostName();
+ }
+ this.webServiceHost = host;
+ }
+
+ public void setWebServicePort(int port)
+ {
+ this.webServicePort = port;
+ }
+
+ public void setWebServiceSecurePort(int port)
+ {
+ this.webServiceSecurePort = port;
+ }
+
+ public void setAlwaysModifySOAPAddress(boolean modify)
+ {
+ this.alwaysModifySOAPAddress = modify;
+ }
+
+ public String getServiceEndpointInvokerEJB21()
+ {
+ return serviceEndpointInvokerEJB21;
+ }
+
+ public void setServiceEndpointInvokerEJB21(String invoker)
+ {
+ this.serviceEndpointInvokerEJB21 = invoker;
+ }
+
+ public String getServiceEndpointInvokerEJB3()
+ {
+ return serviceEndpointInvokerEJB3;
+ }
+
+ public void setServiceEndpointInvokerEJB3(String invoker)
+ {
+ this.serviceEndpointInvokerEJB3 = invoker;
+ }
+
+ public String getServiceEndpointInvokerMDB()
+ {
+ return serviceEndpointInvokerMDB;
+ }
+
+ public void setServiceEndpointInvokerMDB(String invoker)
+ {
+ this.serviceEndpointInvokerMDB = invoker;
+ }
+
+ public String getServiceEndpointInvokerJSE()
+ {
+ return serviceEndpointInvokerJSE;
+ }
+
+ public void setServiceEndpointInvokerJSE(String invoker)
+ {
+ this.serviceEndpointInvokerJSE = invoker;
+ }
+
+ public String getImplementationVersion()
+ {
+ return UnifiedMetaData.getImplementationVersion();
+ }
+
+ public List<ObjectName> getServiceEndpoints()
+ {
+ ArrayList<ObjectName> list = new ArrayList<ObjectName>();
+ list.addAll(registry.keySet());
+ return list;
+ }
+
+ /** Get service endpoint for a given serviceID
+ *
+ * The keys into the registry are:
+ *
+ * [deploment.ear]/[deployment.war]#WsdlService/PortName
+ * [deploment.ear]/[deployment.jar]#ServiceName/PortName
+ *
+ */
+ public ServiceEndpoint getServiceEndpointByID(ObjectName sepID)
+ {
+ ServiceEndpoint wsEndpoint = (ServiceEndpoint)registry.get(sepID);
+ if (wsEndpoint == null)
+ log.warn("No ServiceEndpoint found for serviceID: " + sepID);
+
+ return wsEndpoint;
+ }
+
+ /** Resolve a port-component-link, like:
+ *
+ * [deployment.war]#PortComponentName
+ * [deployment.jar]#PortComponentName
+ *
+ */
+ public ServiceEndpoint resolvePortComponentLink(String pcLink)
+ {
+ String pcName = pcLink;
+ int hashIndex = pcLink.indexOf("#");
+ if (hashIndex > 0)
+ {
+ pcName = pcLink.substring(hashIndex + 1);
+ }
+
+ ServiceEndpoint serviceEndpoint = null;
+ for (ObjectName sepID : registry.keySet())
+ {
+ ServiceEndpoint auxEndpoint = registry.get(sepID);
+ ServiceEndpointInfo sepInfo = auxEndpoint.getServiceEndpointInfo();
+ if (pcName.equals(sepInfo.getServerEndpointMetaData().getPortComponentName()))
+ {
+ if (serviceEndpoint != null)
+ {
+ log.warn("Multiple service endoints found for: " + pcLink);
+ serviceEndpoint = null;
+ break;
+ }
+ serviceEndpoint = auxEndpoint;
+ }
+ }
+
+ if (serviceEndpoint == null)
+ log.warn("No ServiceEndpoint found for pcLink: " + pcLink);
+
+ return serviceEndpoint;
+ }
+
+ /** Show the registered webservices
+ */
+ public String showServiceEndpointTable(URL requestURL) throws
java.net.MalformedURLException
+ {
+ StringWriter sw = new StringWriter();
+ PrintWriter pw = new PrintWriter(sw);
+
+ pw.println("<h3>Registered Service Endpoints</h3>");
+
+ pw.println("<table>");
+
pw.println("<tr><td>ServiceEndpointID</td><td>ServiceEndpointAddress</td><td> </td></tr>");
+ Iterator it = registry.entrySet().iterator();
+ while (it.hasNext())
+ {
+ Map.Entry entry = (Map.Entry)it.next();
+ ObjectName sepID = (ObjectName)entry.getKey();
+ ServiceEndpoint wsEndpoint = (ServiceEndpoint)entry.getValue();
+ ServiceEndpointInfo seInfo = wsEndpoint.getServiceEndpointInfo();
+ String displayAddress = getDisplayAddress(seInfo, requestURL);
+ pw.println("<tr><td>" + sepID.getCanonicalName() +
"</td><td><a href='" + displayAddress +
"?wsdl'>" + displayAddress +
"?wsdl</a></td></tr>");
+ }
+ pw.println("</table>");
+ pw.close();
+
+ return sw.toString();
+ }
+
+ public List<ServiceEndpointDTO> getRegisteredEndpoints(URL requestURL) throws
java.net.MalformedURLException
+ {
+ List<ServiceEndpointDTO> registered = new
ArrayList<ServiceEndpointDTO>();
+ Iterator it = registry.entrySet().iterator();
+ while (it.hasNext())
+ {
+ Map.Entry entry = (Map.Entry)it.next();
+ ObjectName sepID = (ObjectName)entry.getKey();
+ ServiceEndpoint wsEndpoint = (ServiceEndpoint)entry.getValue();
+ ServiceEndpointInfo seInfo = wsEndpoint.getServiceEndpointInfo();
+ String displayAddress = getDisplayAddress(seInfo, requestURL);
+
+ try
+ {
+ ServiceEndpointDTO dto = new ServiceEndpointDTO();
+ dto.setSepID(sepID);
+ dto.setAddress(displayAddress);
+
dto.setSeMetrics((ServiceEndpointMetrics)wsEndpoint.getServiceEndpointMetrics().clone());
+ dto.setState(wsEndpoint.getState());
+ registered.add(dto);
+ }
+ catch (CloneNotSupportedException e)
+ {
+ }
+ }
+
+ return registered;
+ }
+
+ private String getDisplayAddress(ServiceEndpointInfo seInfo, URL requestURL) throws
MalformedURLException
+ {
+ String endpointAddress = seInfo.getServerEndpointMetaData().getEndpointAddress();
+ URL displayURL = new URL(endpointAddress);
+ String endPointPath = displayURL.getPath();
+ if (this.getWebServiceHost().equals(ServiceEndpointManager.UNDEFINED_HOSTNAME) ==
true)
+ {
+ displayURL = requestURL;
+ }
+ String displayAddress = displayURL.getProtocol() + "://" +
displayURL.getHost() + ":" + displayURL.getPort() + endPointPath;
+ return displayAddress;
+ }
+
+ /** Get the endpoint metrics
+ */
+ public ServiceEndpointMetrics getServiceEndpointMetrics(ObjectName sepID)
+ {
+ ServiceEndpoint wsEndpoint = getServiceEndpointByID(sepID);
+ return (wsEndpoint != null ? wsEndpoint.getServiceEndpointMetrics() : null);
+ }
+
+ /** Show endpoint metrics
+ */
+ public String showServiceEndpointMetrics(ObjectName sepID)
+ {
+ StringWriter sw = new StringWriter();
+ PrintWriter pw = new PrintWriter(sw);
+
+ ServiceEndpointMetrics seMetrics = getServiceEndpointMetrics(sepID);
+ if (seMetrics != null)
+ {
+ pw.println("<h3>Service Endpoint Metrics</h3>");
+
+ pw.println("<table>");
+ pw.println("<tr><td>EndpointID</td><td>" +
seMetrics.getEndpointID() + "</td></tr>");
+ pw.println("<tr><td>Start Time</td><td>" +
seMetrics.getStartTime() + "</td></tr>");
+ pw.println("<tr><td>Stop Time</td><td>" +
seMetrics.getStopTime() + "</td></tr>");
+ pw.println("<tr><td>Request Count</td><td>" +
seMetrics.getRequestCount() + "</td></tr>");
+ pw.println("<tr><td>Response Count</td><td>" +
seMetrics.getRequestCount() + "</td></tr>");
+ pw.println("<tr><td>Fault Count</td><td>" +
seMetrics.getResponseCount() + "</td></tr>");
+ pw.println("<tr><td>Max Processing
Time</td><td>" + seMetrics.getMaxProcessingTime() +
"</td></tr>");
+ pw.println("<tr><td>Min Processing
Time</td><td>" + seMetrics.getMinProcessingTime() +
"</td></tr>");
+ pw.println("<tr><td>Avg Processing
Time</td><td>" + seMetrics.getAverageProcessingTime() +
"</td></tr>");
+ pw.println("<tr><td>Total Processing
Time</td><td>" + seMetrics.getTotalProcessingTime() +
"</td></tr>");
+ pw.println("</table>");
+ pw.close();
+ }
+ return sw.toString();
+ }
+
+ public void processWSDLRequest(ObjectName sepID, OutputStream outStream, URL
requestURL, String resourcePath) throws Exception
+ {
+ ServiceEndpoint wsEndpoint = getServiceEndpointByID(sepID);
+ if (wsEndpoint == null)
+ throw new WSException("Cannot obtain endpoint for: " + sepID);
+
+ wsEndpoint.handleWSDLRequest(outStream, requestURL, resourcePath);
+ }
+
+ public void processRequest(ObjectName sepID, InputStream inStream, OutputStream
outStream, ServletRequestContext context) throws Exception
+ {
+ ServiceEndpoint wsEndpoint = getServiceEndpointByID(sepID);
+ if (wsEndpoint == null)
+ throw new WSException("Cannot obtain endpoint for: " + sepID);
+
+ // Get the type of the endpoint
+ ServerEndpointMetaData sepMetaData =
wsEndpoint.getServiceEndpointInfo().getServerEndpointMetaData();
+ Type type = sepMetaData.getType();
+
+ ServletContext servletContext = context.getServletContext();
+ HttpServletRequest httpRequest = context.getHttpServletRequest();
+ HttpServletResponse httpResponse = context.getHttpServletResponse();
+ ServletHeaderSource headerSource = new ServletHeaderSource(httpRequest,
httpResponse);
+
+ // Associate a message context with the current thread
+ CommonMessageContext msgContext;
+ if (type == EndpointMetaData.Type.JAXRPC)
+ {
+ msgContext = new SOAPMessageContextJAXRPC();
+ msgContext.put(MessageContextJAXRPC.SERVLET_CONTEXT, servletContext);
+ msgContext.put(MessageContextJAXRPC.SERVLET_REQUEST, httpRequest);
+ msgContext.put(MessageContextJAXRPC.SERVLET_RESPONSE, httpResponse);
+ }
+ else
+ {
+ msgContext = new SOAPMessageContextJAXWS();
+ msgContext.put(MessageContextJAXWS.MESSAGE_OUTBOUND_PROPERTY, new
Boolean(false));
+ msgContext.put(MessageContextJAXWS.INBOUND_MESSAGE_ATTACHMENTS, new
HashMap<String, DataHandler>());
+ msgContext.put(MessageContextJAXWS.HTTP_REQUEST_HEADERS,
headerSource.getHeaderMap());
+ msgContext.put(MessageContextJAXWS.HTTP_REQUEST_METHOD,
httpRequest.getMethod());
+ msgContext.put(MessageContextJAXWS.QUERY_STRING, httpRequest.getQueryString());
+ msgContext.put(MessageContextJAXWS.PATH_INFO, httpRequest.getPathInfo());
+ msgContext.put(MessageContextJAXWS.SERVLET_CONTEXT, servletContext);
+ msgContext.put(MessageContextJAXWS.SERVLET_REQUEST, httpRequest);
+ msgContext.put(MessageContextJAXWS.SERVLET_RESPONSE, httpResponse);
+ }
+ msgContext.setEndpointMetaData(sepMetaData);
+
+ MessageContextAssociation.pushMessageContext(msgContext);
+ try
+ {
+ MessageAbstraction resMessage = wsEndpoint.processRequest(headerSource, context,
inStream);
+
+ // Replace the message context with the response context
+ msgContext = MessageContextAssociation.peekMessageContext();
+
+ Map<String, List<String>> headers = (Map<String,
List<String>>)msgContext.get(MessageContextJAXWS.HTTP_RESPONSE_HEADERS);
+ if (headers != null)
+ headerSource.setHeaderMap(headers);
+
+ Integer code = (Integer)msgContext.get(MessageContextJAXWS.HTTP_RESPONSE_CODE);
+ if (code != null)
+ httpResponse.setStatus(code.intValue());
+
+ boolean isFault = false;
+ if (resMessage instanceof SOAPMessage)
+ {
+ SOAPPart part = ((SOAPMessage)resMessage).getSOAPPart();
+ if (part == null)
+ throw new SOAPException("Cannot obtain SOAPPart from response
message");
+
+ // R1126 An INSTANCE MUST return a "500 Internal Server Error" HTTP
status code
+ // if the response envelope is a Fault.
+ //
+ // Also, a one-way operation must show up as empty content, and can be
detected
+ // by a null envelope.
+ SOAPEnvelope soapEnv = part.getEnvelope();
+ isFault = soapEnv != null && soapEnv.getBody().hasFault();
+ if (isFault && httpResponse != null)
+ {
+ httpResponse.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+ }
+ }
+
+ sendResponse(outStream, msgContext, isFault);
+ }
+ finally
+ {
+ outStream.flush();
+ outStream.close();
+
+ // Reset the message context association
+ MessageContextAssociation.popMessageContext();
+
+ // clear thread local storage
+ ThreadLocalAssociation.clear();
+ }
+ }
+
+ private void sendResponse(OutputStream outputStream, CommonMessageContext msgContext,
boolean isFault) throws SOAPException, IOException
+ {
+ MessageAbstraction resMessage = msgContext.getMessageAbstraction();
+ String wsaTo = null;
+
+ // Get the destination from the AddressingProperties
+ AddressingProperties outProps =
(AddressingProperties)msgContext.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND);
+ if (outProps != null && outProps.getTo() != null)
+ {
+ AddressingConstantsImpl ADDR = new AddressingConstantsImpl();
+ wsaTo = outProps.getTo().getURI().toString();
+ if (wsaTo.equals(ADDR.getAnonymousURI()))
+ wsaTo = null;
+ }
+ if (wsaTo != null)
+ {
+ log.debug("Sending response to addressing destination: " + wsaTo);
+ new SOAPConnectionImpl().callOneWay((SOAPMessage)resMessage, wsaTo);
+ }
+ else
+ {
+ resMessage.writeTo(outputStream);
+ }
+ }
+
+ /** Process the given SOAPRequest and return the corresponding SOAPResponse
+ */
+ public String processRequest(ObjectName sepID, String inMessage) throws Exception
+ {
+ log.debug("processSOAPRequest: " + sepID);
+
+ ByteArrayInputStream inputStream = new
ByteArrayInputStream(inMessage.getBytes("UTF-8"));
+ ByteArrayOutputStream outputStream = new ByteArrayOutputStream(512);
+
+ processRequest(sepID, inputStream, outputStream, null);
+
+ String outMsg = new String(outputStream.toByteArray());
+ return outMsg;
+ }
+
+ /** Get the ServiceEndpointInvoker for this type of service endpoint
+ */
+ private ServiceEndpointInvoker getServiceEndpointInvoker(ServiceEndpointInfo seInfo)
throws ClassNotFoundException, InstantiationException, IllegalAccessException
+ {
+ ServiceEndpointInvoker seInvoker = null;
+
+ ClassLoader cl = Thread.currentThread().getContextClassLoader();
+ if (seInfo.getType() == ServiceEndpointInfo.EndpointType.JSE)
+ {
+ Class seInvokerClass = cl.loadClass(serviceEndpointInvokerJSE);
+ seInvoker = (ServiceEndpointInvoker)seInvokerClass.newInstance();
+ }
+ else if (seInfo.getType() == ServiceEndpointInfo.EndpointType.SLSB21)
+ {
+ Class seInvokerClass = cl.loadClass(serviceEndpointInvokerEJB21);
+ seInvoker = (ServiceEndpointInvoker)seInvokerClass.newInstance();
+ }
+ else if (seInfo.getType() == ServiceEndpointInfo.EndpointType.SLSB30)
+ {
+ Class seInvokerClass = cl.loadClass(serviceEndpointInvokerEJB3);
+ seInvoker = (ServiceEndpointInvoker)seInvokerClass.newInstance();
+ }
+ else if (seInfo.getType() == ServiceEndpointInfo.EndpointType.MDB21)
+ {
+ Class seInvokerClass = cl.loadClass(serviceEndpointInvokerMDB);
+ seInvoker = (ServiceEndpointInvoker)seInvokerClass.newInstance();
+ }
+
+ if (seInvoker == null)
+ throw new WSException("Cannot obtain service endpoint invoker");
+
+ return seInvoker;
+ }
+
+ /** Get the list of HandlerInfos associated with a given service endpoint
+ */
+ public List<HandlerMetaData> getHandlerMetaData(ObjectName sepID)
+ {
+ ServiceEndpoint wsEndpoint = getServiceEndpointByID(sepID);
+ if (wsEndpoint == null)
+ throw new WSException("Cannot find service endpoint: " + sepID);
+
+ List<HandlerMetaData> handlers = null;
+ if (wsEndpoint != null)
+ {
+ ServerEndpointMetaData sepMetaData =
wsEndpoint.getServiceEndpointInfo().getServerEndpointMetaData();
+ handlers = sepMetaData.getHandlerMetaData(HandlerType.ALL);
+ }
+ return handlers;
+ }
+
+ /**
+ * Dynamically change the list of handlers associated with a given service endpoint
+ * The endpoint is expected to be in STOPED state
+ */
+ public void setHandlerMetaData(ObjectName sepID, List<HandlerMetaData>
handlers)
+ {
+ ServiceEndpoint wsEndpoint = getServiceEndpointByID(sepID);
+ if (wsEndpoint == null)
+ throw new WSException("Cannot find service endpoint: " + sepID);
+
+ ServiceEndpointInfo sepInfo = wsEndpoint.getServiceEndpointInfo();
+ if (sepInfo.getState() != ServiceEndpoint.State.STOPED)
+ throw new WSException("Endpoint expected to be in STOPED state");
+
+ ServerEndpointMetaData sepMetaData =
wsEndpoint.getServiceEndpointInfo().getServerEndpointMetaData();
+ sepMetaData.clearHandlers();
+
+ for (HandlerMetaData handlerMetaData : handlers)
+ {
+ handlerMetaData.setEndpointMetaData(sepMetaData);
+ sepMetaData.addHandler(handlerMetaData);
+ }
+ }
+
+ /** Create a service endpoint
+ */
+ public void createServiceEndpoint(ServiceEndpointInfo seInfo) throws Exception
+ {
+ ObjectName sepID = seInfo.getServiceEndpointID();
+ if (registry.get(sepID) != null)
+ throw new WSException("Service already registerd: " + sepID);
+
+ ServiceEndpointInvoker seInvoker = getServiceEndpointInvoker(seInfo);
+ seInvoker.init(seInfo);
+ seInfo.setInvoker(seInvoker);
+
+ // Load/Create the service endpoint impl
+ ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
+ ServerEndpointMetaData epMetaData = seInfo.getServerEndpointMetaData();
+ String managedEndpointBean = epMetaData.getManagedEndpointBean();
+ Class seClass = ctxLoader.loadClass(managedEndpointBean);
+ Constructor ctor = seClass.getConstructor(new Class[] { ServiceEndpointInfo.class
});
+ ServiceEndpoint wsEndpoint = (ServiceEndpoint)ctor.newInstance(new Object[] {
seInfo });
+ wsEndpoint.create();
+
+ // Register the endpoint with the MBeanServer
+ registry.put(sepID, wsEndpoint);
+
+ log.debug("WebService created: " + sepID);
+ }
+
+ /** Start a service endpoint
+ */
+ public void startServiceEndpoint(ObjectName sepID) throws Exception
+ {
+ ServiceEndpoint wsEndpoint = getServiceEndpointByID(sepID);
+ if (wsEndpoint == null)
+ throw new WSException("Cannot find service endpoint: " + sepID);
+
+ wsEndpoint.start();
+
+ ServiceEndpointInfo seInfo = wsEndpoint.getServiceEndpointInfo();
+ log.info("WebService started: " +
seInfo.getServerEndpointMetaData().getEndpointAddress());
+ }
+
+ /** Stop a service endpoint
+ */
+ public void stopServiceEndpoint(ObjectName sepID) throws Exception
+ {
+ ServiceEndpoint wsEndpoint = getServiceEndpointByID(sepID);
+ if (wsEndpoint == null)
+ {
+ log.error("Cannot find service endpoint: " + sepID);
+ return;
+ }
+
+ wsEndpoint.stop();
+
+ ServiceEndpointInfo seInfo = wsEndpoint.getServiceEndpointInfo();
+ log.info("WebService stopped: " +
seInfo.getServerEndpointMetaData().getEndpointAddress());
+ }
+
+ /** Destroy a service endpoint
+ */
+ public void destroyServiceEndpoint(ObjectName sepID) throws Exception
+ {
+ ServiceEndpoint wsEndpoint = getServiceEndpointByID(sepID);
+ if (wsEndpoint == null)
+ {
+ log.error("Cannot find service endpoint: " + sepID);
+ return;
+ }
+
+ wsEndpoint.destroy();
+
+ // Remove the endpoint from the MBeanServer
+ registry.remove(sepID);
+
+ ServiceEndpointInfo seInfo = wsEndpoint.getServiceEndpointInfo();
+ log.debug("WebService destroyed: " +
seInfo.getServerEndpointMetaData().getEndpointAddress());
+ }
+
+ public void create() throws Exception
+ {
+ log.info(getImplementationVersion());
+ MBeanServer server = getJMXServer();
+ if (server != null)
+ {
+ server.registerMBean(this, OBJECT_NAME);
+ }
+ }
+
+ public void destroy() throws Exception
+ {
+ log.debug("Destroy service endpoint manager");
+ MBeanServer server = getJMXServer();
+ if (server != null)
+ {
+ server.unregisterMBean(OBJECT_NAME);
+ }
+ }
+
+ private MBeanServer getJMXServer()
+ {
+ MBeanServer server = null;
+ ArrayList servers = MBeanServerFactory.findMBeanServer(null);
+ if (servers.size() > 0)
+ {
+ server = (MBeanServer)servers.get(0);
+ }
+ return server;
+ }
+}
Copied:
trunk/jbossws-core/src/java/org/jboss/ws/core/server/legacy/ServiceEndpointManagerFactory.java
(from rev 2936,
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManagerFactory.java)
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/server/legacy/ServiceEndpointManagerFactory.java
(rev 0)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/server/legacy/ServiceEndpointManagerFactory.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -0,0 +1,56 @@
+/*
+ * 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.ws.core.server.legacy;
+
+import org.jboss.ws.integration.KernelLocator;
+import org.jboss.kernel.spi.registry.KernelRegistry;
+import org.jboss.kernel.spi.registry.KernelRegistryEntry;
+
+// $Id$
+
+/**
+ * Factory to the singleton instance of the ServiceEndpointManager
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 08-May-2006
+ */
+public class ServiceEndpointManagerFactory
+{
+ private static ServiceEndpointManagerFactory instance = new
ServiceEndpointManagerFactory();
+
+ // Hide ctor
+ private ServiceEndpointManagerFactory()
+ {
+ }
+
+ public static ServiceEndpointManagerFactory getInstance()
+ {
+ return instance;
+ }
+
+ public ServiceEndpointManager getServiceEndpointManager()
+ {
+ KernelRegistry registry = KernelLocator.getKernel().getRegistry();
+ KernelRegistryEntry entry = registry.getEntry(ServiceEndpointManager.BEAN_NAME);
+ return (ServiceEndpointManager)entry.getTarget();
+ }
+}
Copied:
trunk/jbossws-core/src/java/org/jboss/ws/core/server/legacy/ServiceEndpointManagerMBean.java
(from rev 2936,
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManagerMBean.java)
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/server/legacy/ServiceEndpointManagerMBean.java
(rev 0)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/server/legacy/ServiceEndpointManagerMBean.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -0,0 +1,60 @@
+/*
+ * 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.ws.core.server.legacy;
+
+import java.net.UnknownHostException;
+import java.util.List;
+
+import javax.management.ObjectName;
+
+import org.jboss.ws.integration.ObjectNameFactory;
+import org.jboss.ws.metadata.umdm.HandlerMetaData;
+
+/**
+ * MBean interface.
+ * @since 15-April-2004
+ */
+public interface ServiceEndpointManagerMBean
+{
+ // default object name
+ static final ObjectName OBJECT_NAME =
ObjectNameFactory.create("jboss.ws:service=ServiceEndpointManager");
+
+ String getImplementationVersion();
+
+ String getWebServiceHost();
+ void setWebServiceHost(String host) throws UnknownHostException;
+
+ int getWebServicePort();
+ void setWebServicePort(int port);
+
+ int getWebServiceSecurePort();
+ void setWebServiceSecurePort(int port);
+
+ boolean isAlwaysModifySOAPAddress();
+ void setAlwaysModifySOAPAddress(boolean modify);
+
+ public List<HandlerMetaData> getHandlerMetaData(ObjectName sepID);
+ public void setHandlerMetaData(ObjectName sepID, List<HandlerMetaData>
handlers);
+
+ void startServiceEndpoint(ObjectName sepID) throws Exception;
+ void stopServiceEndpoint(ObjectName sepID) throws Exception;
+}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/utils/IOUtils.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/utils/IOUtils.java 2007-04-27 14:04:25
UTC (rev 2946)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/utils/IOUtils.java 2007-04-27 18:55:01
UTC (rev 2947)
@@ -38,8 +38,8 @@
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
-import org.jboss.ws.core.server.ServerConfig;
-import org.jboss.ws.core.server.ServerConfigFactory;
+import org.jboss.ws.integration.management.ServerConfig;
+import org.jboss.ws.integration.management.ServerConfigFactory;
/**
* IO utilites
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/extensions/eventing/deployment/EventingEndpoint.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/extensions/eventing/deployment/EventingEndpoint.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/jbossws-core/src/java/org/jboss/ws/extensions/eventing/deployment/EventingEndpoint.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -1,8 +1,8 @@
package org.jboss.ws.extensions.eventing.deployment;
import org.jboss.ws.WSException;
-import org.jboss.ws.core.server.ServiceEndpoint;
-import org.jboss.ws.core.server.ServiceEndpointInfo;
+import org.jboss.ws.core.server.legacy.ServiceEndpoint;
+import org.jboss.ws.core.server.legacy.ServiceEndpointInfo;
import org.jboss.ws.extensions.eventing.EventingConstants;
import org.jboss.ws.extensions.eventing.metadata.EventingEpMetaExt;
import org.jboss.ws.extensions.eventing.mgmt.SubscriptionManagerFactory;
Modified: trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -47,10 +47,12 @@
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
import org.jboss.ws.core.jaxrpc.Use;
-import org.jboss.ws.core.server.ServiceEndpointManager;
-import org.jboss.ws.core.server.ServiceEndpointManagerFactory;
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+import org.jboss.ws.core.server.legacy.ServiceEndpointManager;
+import org.jboss.ws.core.server.legacy.ServiceEndpointManagerFactory;
import org.jboss.ws.integration.ObjectNameFactory;
+import org.jboss.ws.integration.management.ServerConfig;
+import org.jboss.ws.integration.management.ServerConfigFactory;
import org.jboss.ws.extensions.addressing.AddressingPropertiesImpl;
import org.jboss.ws.extensions.addressing.metadata.AddressingOpMetaExt;
import org.jboss.ws.extensions.eventing.EventingConstants;
@@ -261,12 +263,12 @@
if (uriScheme == null)
uriScheme = "http";
- ServiceEndpointManagerFactory factory =
ServiceEndpointManagerFactory.getInstance();
- ServiceEndpointManager epManager = factory.getServiceEndpointManager();
- String host = epManager.getWebServiceHost();
- int port = epManager.getWebServicePort();
+ ServerConfigFactory factory = ServerConfigFactory.getInstance();
+ ServerConfig config = factory.getServerConfig();
+ String host = config.getWebServiceHost();
+ int port = config.getWebServicePort();
if ("https".equals(uriScheme))
- port = epManager.getWebServiceSecurePort();
+ port = config.getWebServiceSecurePort();
String urlStr = uriScheme + "://" + host + ":" + port +
servicePath;
try
@@ -342,9 +344,9 @@
String servicePath = sepMetaData.getContextRoot() +
sepMetaData.getURLPattern();
String serviceEndpointURL = getServiceEndpointAddress(uriScheme,
servicePath);
- ServiceEndpointManagerFactory factory =
ServiceEndpointManagerFactory.getInstance();
- ServiceEndpointManager epManager = factory.getServiceEndpointManager();
- boolean alwaysModify = epManager.isAlwaysModifySOAPAddress();
+ ServerConfigFactory factory = ServerConfigFactory.getInstance();
+ ServerConfig config = factory.getServerConfig();
+ boolean alwaysModify = config.isModifySOAPAddress();
if (alwaysModify || uriScheme == null ||
orgAddress.indexOf("REPLACE_WITH_ACTUAL_URL") >= 0)
{
Modified: trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/UnifiedMetaData.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/UnifiedMetaData.java 2007-04-27
14:04:25 UTC (rev 2946)
+++ trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/UnifiedMetaData.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -30,7 +30,7 @@
import java.util.StringTokenizer;
import org.jboss.logging.Logger;
-import org.jboss.ws.core.server.ServiceEndpointManager;
+import org.jboss.ws.core.server.legacy.ServiceEndpointManager;
import org.jboss.ws.integration.UnifiedVirtualFile;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
Modified: trunk/jbossws-core/src/java/org/jboss/ws/metadata/wsdl/xsd/SchemaUtils.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/metadata/wsdl/xsd/SchemaUtils.java 2007-04-27
14:04:25 UTC (rev 2946)
+++ trunk/jbossws-core/src/java/org/jboss/ws/metadata/wsdl/xsd/SchemaUtils.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -50,8 +50,8 @@
import org.apache.xerces.xs.XSTypeDefinition;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
-import org.jboss.ws.core.server.ServerConfig;
-import org.jboss.ws.core.server.ServerConfigFactory;
+import org.jboss.ws.integration.management.ServerConfig;
+import org.jboss.ws.integration.management.ServerConfigFactory;
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSComplexTypeDefinition;
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSElementDeclaration;
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSErrorHandler;
Modified:
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1190/TestEndpointImpl.java
===================================================================
---
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1190/TestEndpointImpl.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1190/TestEndpointImpl.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -25,8 +25,8 @@
import java.io.FilenameFilter;
import java.net.MalformedURLException;
-import org.jboss.ws.core.server.ServerConfig;
-import org.jboss.ws.core.server.ServerConfigFactory;
+import org.jboss.ws.integration.management.ServerConfig;
+import org.jboss.ws.integration.management.ServerConfigFactory;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.metadata.wsdl.WSDLEndpoint;
import org.jboss.ws.metadata.wsdl.WSDLService;
Modified:
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1205/TestEndpointImpl.java
===================================================================
---
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1205/TestEndpointImpl.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1205/TestEndpointImpl.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -28,8 +28,8 @@
import javax.naming.InitialContext;
import javax.xml.rpc.Service;
-import org.jboss.ws.core.server.ServerConfig;
-import org.jboss.ws.core.server.ServerConfigFactory;
+import org.jboss.ws.integration.management.ServerConfig;
+import org.jboss.ws.integration.management.ServerConfigFactory;
/**
* @author darran.lofthouse(a)jboss.com
Modified:
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpointImpl.java
===================================================================
---
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpointImpl.java 2007-04-27
14:04:25 UTC (rev 2946)
+++
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpointImpl.java 2007-04-27
18:55:01 UTC (rev 2947)
@@ -27,8 +27,8 @@
import javax.jws.WebService;
-import org.jboss.ws.core.server.ServerConfig;
-import org.jboss.ws.core.server.ServerConfigFactory;
+import org.jboss.ws.integration.management.ServerConfig;
+import org.jboss.ws.integration.management.ServerConfigFactory;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.metadata.wsdl.WSDLEndpoint;
import org.jboss.ws.metadata.wsdl.WSDLService;