Author: thomas.diesler(a)jboss.com
Date: 2007-04-25 06:07:39 -0400 (Wed, 25 Apr 2007)
New Revision: 2916
Added:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/DeployerHook.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/WebServiceLifecycleDeployer.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/AbstractDeployerHook.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/AbstractDeployerHookEJB.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/AbstractDeployerHookJSE.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/AbstractServiceEndpointServlet.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/AssignEndpointHandlersDeployer.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/AssignEndpointMetaDataDeployer.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/ClassLoaderInjectionDeployer.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/DeployerHookJAXRPCEJB21.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/DeployerHookJAXRPCJSE.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/DeployerHookJAXWSEJB3.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/DeployerHookJAXWSJSE.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/EagerInitalizeDeployer.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/EndpointLifecycleDeployer.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/LifecycleHandlerImpl.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/ModifyWebMetaDataDeployer.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/ServiceEndpointServlet.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/UnifiedMetaDataDeployer.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/WSDLPublisherDeployer.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/WebXMLRewritingDeployer.java
trunk/integration/src/main/java/org/jboss/ws/integration/BasicLifecycleHandler.java
trunk/integration/src/main/java/org/jboss/ws/integration/EndpointHandler.java
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/BasicDeployment.java
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/Deployment.java
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/WSDeploymentException.java
trunk/integration/src/main/java/org/jboss/ws/integration/invocation/
trunk/integration/src/main/java/org/jboss/ws/integration/invocation/InvocationHandler.java
trunk/integration/src/main/java/org/jboss/ws/integration/message/
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServletRequestContext.java
Removed:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/WebServiceDeployer.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/WebServiceStartStopDeployer.java
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/BasicDeploymentUnit.java
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/DeploymentException.java
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/DeploymentUnit.java
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/EndpointNameDeployer.java
trunk/integration/src/main/java/org/jboss/ws/integration/message/
trunk/jbossws-core/src/java/org/jboss/ws/core/server/EndpointContext.java
trunk/jbossws-core/src/java/org/jboss/ws/core/utils/ObjectNameFactory.java
Modified:
trunk/integration-jboss40/src/java/org/jboss/ws/integration/jboss40/WebServiceClientDeployer.java
trunk/integration-jboss40/src/java/org/jboss/ws/integration/jboss40/WebServiceClientDeployerMBean.java
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/DeployerInterceptor.java
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB21.java
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB21MBean.java
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB3.java
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB3MBean.java
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/DeployerInterceptorJSE.java
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/DeployerInterceptorJSEMBean.java
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/DeployerInterceptorNestedJSE.java
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/DeployerInterceptorNestedJSEMBean.java
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/ServerConfigImpl.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/jms/MessageDispatcher.java
trunk/integration-jboss50/build.xml
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/AbstractDeployer.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/AbstractDeployerJSE.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/ServerConfigImpl.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/WebServiceAbstractDeployer.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/TomcatServiceEndpointServlet.java
trunk/integration/src/main/java/org/jboss/ws/integration/BasicEndpoint.java
trunk/integration/src/main/java/org/jboss/ws/integration/BasicService.java
trunk/integration/src/main/java/org/jboss/ws/integration/Endpoint.java
trunk/integration/src/main/java/org/jboss/ws/integration/LifecycleHandler.java
trunk/integration/src/main/java/org/jboss/ws/integration/RequestHandler.java
trunk/integration/src/main/java/org/jboss/ws/integration/Service.java
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/AbstractDeployer.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/Deployer.java
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/DeploymentContext.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/deployment/RegisteringDeployer.java
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/ValidatingDeployer.java
trunk/integration/src/main/java/org/jboss/ws/integration/management/EndpointRegistryFactory.java
trunk/integration/src/test/java/org/jboss/test/ws/integration/basic/BasicDeploymentTest.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/ServletEndpointContextImpl.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/handler/HandlerDelegateJAXRPC.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointServlet.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/JAXWSDeployment.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServerHandlerDelegate.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpoint.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/ServiceEndpointInvokerJSE.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManager.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
trunk/jbossws-core/src/java/org/jboss/ws/core/server/WSDLFilePublisher.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/WSDLRequestHandler.java
trunk/jbossws-core/src/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionManager.java
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientDeployment.java
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCDeployment.java
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java
trunk/jbossws-core/src/java/org/jboss/ws/metadata/webservices/WebservicesMetaData.java
trunk/jbossws-core/src/java/org/jboss/ws/tools/jaxws/impl/WSContractProviderImpl.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/JBossWSTestHelper.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1115/JBWS1115TestCase.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/samples/dynamichandler/DynamicHandlerTestCase.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/samples/wsbpel/JbpmBpelTestSetup.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/jaxr/scout/JaxrBaseTest.java
Log:
More general purpose WS integration
Modified: trunk/integration/src/main/java/org/jboss/ws/integration/BasicEndpoint.java
===================================================================
--- trunk/integration/src/main/java/org/jboss/ws/integration/BasicEndpoint.java 2007-04-24
12:52:42 UTC (rev 2915)
+++ trunk/integration/src/main/java/org/jboss/ws/integration/BasicEndpoint.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -55,11 +55,13 @@
*/
package org.jboss.ws.integration;
-import java.util.List;
+import java.util.HashMap;
+import java.util.Map;
import javax.management.ObjectName;
-import javax.xml.transform.Source;
+import org.jboss.ws.integration.invocation.InvocationHandler;
+
/**
* A general JAXWS endpoint.
*
@@ -71,14 +73,17 @@
private Service service;
private ObjectName name;
private Class endpointImpl;
- private List<Source> metaData;
+ 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()
@@ -101,26 +106,16 @@
this.endpointImpl = endpointImpl;
}
- public LifecycleHandler getLifecycleHandler()
+ public EndpointState getState()
{
- return lifecycleHandler;
+ return state;
}
- public void setLifecycleHandler(LifecycleHandler lifecycleHandler)
+ public void setState(EndpointState state)
{
- this.lifecycleHandler = lifecycleHandler;
+ this.state = state;
}
- public List<Source> getMetaData()
- {
- return metaData;
- }
-
- public void addMetaData(Source metaData)
- {
- this.metaData.add(metaData);
- }
-
public ObjectName getName()
{
return name;
@@ -136,8 +131,43 @@
return requestHandler;
}
- public void setRequestHandler(RequestHandler requestHandler)
+ public void setRequestHandler(RequestHandler handler)
{
- this.requestHandler = requestHandler;
+ 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);
+ }
}
Added:
trunk/integration/src/main/java/org/jboss/ws/integration/BasicLifecycleHandler.java
===================================================================
--- trunk/integration/src/main/java/org/jboss/ws/integration/BasicLifecycleHandler.java
(rev 0)
+++
trunk/integration/src/main/java/org/jboss/ws/integration/BasicLifecycleHandler.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -0,0 +1,81 @@
+/*
+ * 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.info("Create: " + endpoint.getName());
+
+ // Initialize the invoker
+ InvocationHandler invoker = endpoint.getInvocationHandler();
+ invoker.init(endpoint);
+
+ endpoint.setState(EndpointState.CREATED);
+ }
+
+ public void start(Endpoint endpoint)
+ {
+ log.info("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.info("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.info("Destroy: " + endpoint.getName());
+ endpoint.setState(EndpointState.DESTROYED);
+ }
+}
Property changes on:
trunk/integration/src/main/java/org/jboss/ws/integration/BasicLifecycleHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: trunk/integration/src/main/java/org/jboss/ws/integration/BasicService.java
===================================================================
--- trunk/integration/src/main/java/org/jboss/ws/integration/BasicService.java 2007-04-24
12:52:42 UTC (rev 2915)
+++ trunk/integration/src/main/java/org/jboss/ws/integration/BasicService.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -61,7 +61,7 @@
import java.util.List;
import java.util.Set;
-import org.jboss.ws.integration.deployment.DeploymentUnit;
+import org.jboss.ws.integration.deployment.Deployment;
/**
* A general service.
@@ -73,21 +73,21 @@
*/
public class BasicService implements Service
{
- private DeploymentUnit unit;
+ private Deployment unit;
private List<Endpoint> endpoints = new LinkedList<Endpoint>();
- public BasicService(DeploymentUnit unit)
+ public BasicService(Deployment unit)
{
this.unit = unit;
this.unit.setService(this);
}
- public DeploymentUnit getDeploymentUnit()
+ public Deployment getDeployment()
{
return unit;
}
- public void setDeploymentUnit(DeploymentUnit unit)
+ public void setDeployment(Deployment unit)
{
this.unit = unit;
}
Modified: trunk/integration/src/main/java/org/jboss/ws/integration/Endpoint.java
===================================================================
--- trunk/integration/src/main/java/org/jboss/ws/integration/Endpoint.java 2007-04-24
12:52:42 UTC (rev 2915)
+++ trunk/integration/src/main/java/org/jboss/ws/integration/Endpoint.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -55,11 +55,9 @@
*/
package org.jboss.ws.integration;
-import java.util.List;
-
import javax.management.ObjectName;
-import javax.xml.transform.Source;
+import org.jboss.ws.integration.invocation.InvocationHandler;
/**
* A general JAXWS endpoint.
@@ -69,33 +67,42 @@
*/
public interface Endpoint
{
+ static final String SEPID_DOMAIN = "jboss.ws";
+ static final String SEPID_PROPERTY_CONTEXT = "context";
+ static final String SEPID_PROPERTY_ENDPOINT = "endpoint";
+
+ public enum EndpointState
+ {
+ UNDEFINED, CREATED, STARTED, STOPED, DESTROYED
+ };
+
/** Get the service this endpoint belongs to */
Service getService();
-
+
/** Set the service this endpoint belongs to */
void setService(Service service);
-
+
/** Get the unique identifier for this endpoint */
ObjectName getName();
-
+
/** Set the unique identifier for this endpoint */
void setName(ObjectName epName);
-
+
+ /** Get the current state for this endpoint */
+ EndpointState getState();
+
+ /** Set the current state for this endpoint */
+ void setState(EndpointState state);
+
/** Get the endpoint implementation bean */
Class getEndpointImpl();
-
+
/** Set the endpoint implementation bean */
void setEndpointImpl(Class epImpl);
- /** Add an arbitry source of meta data */
- void addMetaData(Source metaSource);
-
- /** Get the list of meta data */
- List<Source> getMetaData();
-
/** Set the request handler for this endpoint */
void setRequestHandler(RequestHandler handler);
-
+
/** Get the request handler for this endpoint */
RequestHandler getRequestHandler();
@@ -104,4 +111,19 @@
/** Set the lifecycle handler for this endpoint */
void setLifecycleHandler(LifecycleHandler handler);
+
+ /** Get the endpoint bean invoker */
+ InvocationHandler getInvocationHandler();
+
+ /** Set the endpoint bean invoker */
+ void setInvocationHandler(InvocationHandler invoker);
+
+ /** Add arbitrary meta data */
+ <T> T addMetaData(Class<T> key, Object value);
+
+ /** Get arbitrary meta data */
+ <T> T getMetaData(Class<T> key);
+
+ /** Remove arbitrary meta data */
+ <T> T removeMetaData(Class<T> key);
}
Added: trunk/integration/src/main/java/org/jboss/ws/integration/EndpointHandler.java
===================================================================
--- trunk/integration/src/main/java/org/jboss/ws/integration/EndpointHandler.java
(rev 0)
+++
trunk/integration/src/main/java/org/jboss/ws/integration/EndpointHandler.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -0,0 +1,68 @@
+/*
+ * ====================================================================
+ *
+ * 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$
+
+/**
+ * A general endpoint handler.
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 20-Apr-2007
+ */
+public interface EndpointHandler
+{
+}
Property changes on:
trunk/integration/src/main/java/org/jboss/ws/integration/EndpointHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: trunk/integration/src/main/java/org/jboss/ws/integration/LifecycleHandler.java
===================================================================
---
trunk/integration/src/main/java/org/jboss/ws/integration/LifecycleHandler.java 2007-04-24
12:52:42 UTC (rev 2915)
+++
trunk/integration/src/main/java/org/jboss/ws/integration/LifecycleHandler.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -61,7 +61,7 @@
* @author Thomas.Diesler(a)jboss.com
* @since 20-Apr-2007
*/
-public interface LifecycleHandler
+public interface LifecycleHandler extends EndpointHandler
{
/** Handle the create step of an endpoint */
void create(Endpoint endpoint);
Modified: trunk/integration/src/main/java/org/jboss/ws/integration/RequestHandler.java
===================================================================
---
trunk/integration/src/main/java/org/jboss/ws/integration/RequestHandler.java 2007-04-24
12:52:42 UTC (rev 2915)
+++
trunk/integration/src/main/java/org/jboss/ws/integration/RequestHandler.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -55,9 +55,10 @@
*/
package org.jboss.ws.integration;
-import org.jboss.ws.integration.message.RequestMessage;
-import org.jboss.ws.integration.message.ResponseMessage;
+// $Id$
+import java.io.InputStream;
+import java.io.OutputStream;
/**
* A general JAXWS request handler.
@@ -65,11 +66,11 @@
* @author Thomas.Diesler(a)jboss.com
* @since 20-Apr-2007
*/
-public interface RequestHandler
+public interface RequestHandler extends EndpointHandler
{
- /** Get the endpoint this handler belongs to */
- Endpoint getEndpoint();
+ /** Handle a web service request */
+ void handleRequest(Endpoint endpoint, InputStream input, OutputStream output, Object
context);
- /** Handle a web service request */
- ResponseMessage handleRequest(RequestMessage message);
+ /** Handle a wsdl request */
+ void handleWSDLRequest(Endpoint endpoint, OutputStream output, Object context);
}
Modified: trunk/integration/src/main/java/org/jboss/ws/integration/Service.java
===================================================================
--- trunk/integration/src/main/java/org/jboss/ws/integration/Service.java 2007-04-24
12:52:42 UTC (rev 2915)
+++ trunk/integration/src/main/java/org/jboss/ws/integration/Service.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -59,7 +59,7 @@
import java.util.List;
-import org.jboss.ws.integration.deployment.DeploymentUnit;
+import org.jboss.ws.integration.deployment.Deployment;
/**
* A general service deployment.
@@ -71,11 +71,11 @@
*/
public interface Service
{
- /** Get the deployment unit this service belongs to */
- DeploymentUnit getDeploymentUnit();
+ /** Get the deployment this service belongs to */
+ Deployment getDeployment();
- /** Set the deployment unit this service belongs to */
- void setDeploymentUnit(DeploymentUnit unit);
+ /** Set the deployment this service belongs to */
+ void setDeployment(Deployment dep);
/** Add an endpoint to the service */
void addEndpoint(Endpoint endpoint);
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-24
12:52:42 UTC (rev 2915)
+++
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/AbstractDeployer.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -55,8 +55,10 @@
*/
package org.jboss.ws.integration.deployment;
-// $Id$
+//$Id$
+import org.jboss.logging.Logger;
+
/**
* An abstract deployer that does nothing.
* Overwrite the deployer methods appropriately.
@@ -66,19 +68,22 @@
*/
public abstract class AbstractDeployer implements Deployer
{
- public void create(DeploymentUnit unit)
+ // logging support
+ protected final Logger log = Logger.getLogger(getClass());
+
+ public void create(Deployment dep)
{
}
- public void destroy(DeploymentUnit unit)
+ public void destroy(Deployment dep)
{
}
- public void start(DeploymentUnit unit)
+ public void start(Deployment dep)
{
}
- public void stop(DeploymentUnit unit)
+ public void stop(Deployment dep)
{
}
}
\ No newline at end of file
Copied:
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/BasicDeployment.java
(from rev 2913,
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/BasicDeploymentUnit.java)
===================================================================
---
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/BasicDeployment.java
(rev 0)
+++
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/BasicDeployment.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -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.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;
+ }
+}
Modified:
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-24
12:52:42 UTC (rev 2915)
+++
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/BasicDeploymentContext.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -70,13 +70,13 @@
{
private Map<Class, Object> attachments = new HashMap<Class, Object>();
- public Object getAttachment(Class clazz)
+ public <T> T getAttachment(Class<T> clazz)
{
- return attachments.get(clazz);
+ return (T)attachments.get(clazz);
}
- public Object addAttachment(Class clazz, Object obj)
+ public <T> T addAttachment(Class<T> clazz, Object obj)
{
- return attachments.put(clazz, obj);
+ return (T)attachments.put(clazz, obj);
}
}
Modified:
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-24
12:52:42 UTC (rev 2915)
+++
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/BasicDeploymentManager.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -60,6 +60,8 @@
import java.util.LinkedList;
import java.util.List;
+import org.jboss.ws.integration.deployment.Deployment.DeploymentState;
+
/**
* A general service deployment manger.
*
@@ -86,14 +88,16 @@
* If start fails it automaticall calls destroy in the reverse order
* starting with the deployer that failed
*/
- public void deploy(DeploymentUnit unit)
+ public void deploy(Deployment dep)
{
// create the deployment
for (int i = 0; i < deployers.size(); i++)
{
Deployer deployer = deployers.get(i);
- deployer.create(unit);
+ deployer.create(dep);
}
+
+ dep.setState(DeploymentState.CREATED);
// start the deployment
for (int i = 0; i < deployers.size(); i++)
@@ -101,58 +105,64 @@
Deployer deployer = deployers.get(i);
try
{
- deployer.start(unit);
+ deployer.start(dep);
}
catch (RuntimeException rte)
{
while (i-- >= 0)
{
// destroy the deployment
- failsafeDestroy(deployer, unit);
+ failsafeDestroy(deployer, dep);
}
throw rte;
}
}
+
+ dep.setState(DeploymentState.STARTED);
}
- public void undeploy(DeploymentUnit unit)
+ public void undeploy(Deployment dep)
{
// stop the deployment
for (int i = deployers.size(); 0 < i; i--)
{
Deployer deployer = deployers.get(i - 1);
- failsafeStop(deployer, unit);
+ 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, unit);
+ failsafeDestroy(deployer, dep);
}
+
+ dep.setState(DeploymentState.DESTROYED);
}
- private void failsafeStop(Deployer deployer, DeploymentUnit unit)
+ private void failsafeStop(Deployer deployer, Deployment dep)
{
try
{
- deployer.stop(unit);
+ deployer.stop(dep);
}
catch (RuntimeException rte)
{
- DeploymentException.rethrow(rte);
+ WSDeploymentException.rethrow(rte);
}
}
- private void failsafeDestroy(Deployer deployer, DeploymentUnit unit)
+ private void failsafeDestroy(Deployer deployer, Deployment dep)
{
try
{
- deployer.destroy(unit);
+ deployer.destroy(dep);
}
catch (RuntimeException rte)
{
- DeploymentException.rethrow(rte);
+ WSDeploymentException.rethrow(rte);
}
}
}
Deleted:
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/BasicDeploymentUnit.java
===================================================================
---
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/BasicDeploymentUnit.java 2007-04-24
12:52:42 UTC (rev 2915)
+++
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/BasicDeploymentUnit.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -1,96 +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.Service;
-
-/**
- * A general web service deployment unit.
- *
- * It has no notion of J2EE deployment packages.
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 20-Apr-2007
- */
-public class BasicDeploymentUnit implements DeploymentUnit
-{
- // The context for this deployment unit
- private DeploymentContext context;
- // A deployment has one service
- private Service service;
-
- public BasicDeploymentUnit()
- {
- context = new BasicDeploymentContext();
- }
-
- public DeploymentContext getContext()
- {
- return context;
- }
-
- public Service getService()
- {
- return service;
- }
-
- public void setService(Service service)
- {
- this.service = service;
- }
-}
Modified:
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/Deployer.java
===================================================================
---
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/Deployer.java 2007-04-24
12:52:42 UTC (rev 2915)
+++
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/Deployer.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -65,12 +65,12 @@
*/
public interface Deployer
{
- void create (DeploymentUnit unit);
+ void create (Deployment dep);
- void start (DeploymentUnit unit);
+ void start (Deployment dep);
- void stop (DeploymentUnit unit);
+ void stop (Deployment dep);
- void destroy (DeploymentUnit unit);
+ void destroy (Deployment dep);
}
Copied:
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/Deployment.java (from
rev 2913,
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/DeploymentUnit.java)
===================================================================
--- trunk/integration/src/main/java/org/jboss/ws/integration/deployment/Deployment.java
(rev 0)
+++
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/Deployment.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -0,0 +1,101 @@
+/*
+ * ====================================================================
+ *
+ * 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.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 interface Deployment
+{
+ public enum DeploymentType
+ {
+ JAXRPC_CLIENT, JAXRPC_JSE, JAXRPC_EJB21, JAXRPC_EJB3, JAXWS_JSE, JAXWS_EJB3
+ };
+
+ public enum DeploymentState
+ {
+ UNDEFINED, CREATED, STARTED, STOPED, DESTROYED
+ };
+
+ ClassLoader getClassLoader();
+
+ void setClassLoader(ClassLoader loader);
+
+ DeploymentContext getContext();
+
+ void setContext(DeploymentContext context);
+
+ DeploymentType getType();
+
+ void setType(DeploymentType type);
+
+ DeploymentState getState();
+
+ void setState(DeploymentState type);
+
+ Service getService();
+
+ void setService(Service service);
+}
\ No newline at end of file
Modified:
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/DeploymentContext.java
===================================================================
---
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/DeploymentContext.java 2007-04-24
12:52:42 UTC (rev 2915)
+++
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/DeploymentContext.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -2,9 +2,7 @@
public interface DeploymentContext
{
+ <T> T getAttachment(Class<T> clazz);
- Object getAttachment(Class clazz);
-
- Object addAttachment(Class clazz, Object obj);
-
+ <T> T addAttachment(Class<T> clazz, Object obj);
}
\ No newline at end of file
Deleted:
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/DeploymentException.java
===================================================================
---
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/DeploymentException.java 2007-04-24
12:52:42 UTC (rev 2915)
+++
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/DeploymentException.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -1,90 +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$
-
-/**
- * A general deployment exception
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 20-Apr-2007
- */
-public class DeploymentException extends RuntimeException
-{
- public DeploymentException(String message, Throwable cause)
- {
- super(message, cause);
- }
-
- public DeploymentException(String message)
- {
- super(message);
- }
-
- public DeploymentException(Throwable cause)
- {
- super(cause);
- }
-
- public static void rethrow(Throwable cause)
- {
- if (cause instanceof DeploymentException)
- throw (DeploymentException)cause;
-
- throw new DeploymentException(cause);
- }
-}
Modified:
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-24
12:52:42 UTC (rev 2915)
+++
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/DeploymentManager.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -77,8 +77,8 @@
void setDeployers(List<Deployer> deployers);
/** Deploy a web service */
- void deploy(DeploymentUnit unit);
+ void deploy(Deployment dep);
/** Undeploy a web service */
- void undeploy(DeploymentUnit unit);
+ void undeploy(Deployment dep);
}
Modified:
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-24
12:52:42 UTC (rev 2915)
+++
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/DeploymentManagerFactory.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -58,9 +58,9 @@
//$Id$
import org.jboss.kernel.Kernel;
-import org.jboss.kernel.plugins.util.KernelLocator;
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
Deleted:
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/DeploymentUnit.java
===================================================================
---
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/DeploymentUnit.java 2007-04-24
12:52:42 UTC (rev 2915)
+++
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/DeploymentUnit.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -1,78 +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;
-
-import org.jboss.ws.integration.Service;
-
-/**
- * A general web service deployment unit.
- *
- * It has no notion of J2EE deployment packages.
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 20-Apr-2007
- */
-public interface DeploymentUnit
-{
- /** Get the context for this deployment unit */
- DeploymentContext getContext();
-
- /** Get the service that is being deployed */
- Service getService();
-
- /** Set the service that is being deployed */
- void setService(Service service);
-}
\ No newline at end of file
Deleted:
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/EndpointNameDeployer.java
===================================================================
---
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/EndpointNameDeployer.java 2007-04-24
12:52:42 UTC (rev 2915)
+++
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/EndpointNameDeployer.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -1,90 +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 javax.management.ObjectName;
-
-import org.jboss.ws.integration.Endpoint;
-import org.jboss.ws.integration.ObjectNameFactory;
-
-/**
- * A deployer that gives the endpoint its name
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 20-Apr-2007
- */
-public class EndpointNameDeployer extends AbstractDeployer
-{
- public void create(DeploymentUnit unit)
- {
- for (Endpoint ep : unit.getService().getEndpoints())
- {
- ObjectName name = ep.getName();
- if (name == null)
- {
- Class epImpl = ep.getEndpointImpl();
- if (epImpl == null)
- throw new IllegalStateException("Endpoint implementation bean cannot
be null: " + ep);
-
- String className = epImpl.getName();
- className = className.substring(className.lastIndexOf(".") + 1);
- ep.setName(ObjectNameFactory.create("jboss.ws:endpoint=" +
className));
- }
- }
- }
-}
\ No newline at end of file
Modified:
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/RegisteringDeployer.java
===================================================================
---
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/RegisteringDeployer.java 2007-04-24
12:52:42 UTC (rev 2915)
+++
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/RegisteringDeployer.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -59,7 +59,6 @@
import org.jboss.ws.integration.management.EndpointRegistry;
import org.jboss.ws.integration.management.EndpointRegistryFactory;
-
/**
* A deployer that registers the endpoints
*
@@ -68,19 +67,19 @@
*/
public class RegisteringDeployer extends AbstractDeployer
{
- public void create(DeploymentUnit unit)
+ public void create(Deployment dep)
{
EndpointRegistry registry = EndpointRegistryFactory.getEndpointRegistry();
- for (Endpoint ep : unit.getService().getEndpoints())
+ for (Endpoint ep : dep.getService().getEndpoints())
{
registry.register(ep);
}
}
-
- public void destroy(DeploymentUnit unit)
+
+ public void destroy(Deployment dep)
{
EndpointRegistry registry = EndpointRegistryFactory.getEndpointRegistry();
- for (Endpoint ep : unit.getService().getEndpoints())
+ for (Endpoint ep : dep.getService().getEndpoints())
{
registry.unregister(ep);
}
Modified:
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/ValidatingDeployer.java
===================================================================
---
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/ValidatingDeployer.java 2007-04-24
12:52:42 UTC (rev 2915)
+++
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/ValidatingDeployer.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -59,6 +59,7 @@
import javax.xml.ws.Provider;
import org.jboss.ws.integration.Endpoint;
+import org.jboss.ws.integration.deployment.Deployment.DeploymentType;
/**
@@ -69,16 +70,23 @@
*/
public class ValidatingDeployer extends AbstractDeployer
{
- public void create(DeploymentUnit unit)
+ public void create(Deployment dep)
{
- for (Endpoint ep : unit.getService().getEndpoints())
+ DeploymentType type = dep.getType();
+ if (type == null)
+ throw new IllegalStateException("Cannot obtain deployment type: " +
dep);
+
+ if (type == DeploymentType.JAXWS_EJB3 || type == DeploymentType.JAXWS_JSE)
{
- Class epImpl = ep.getEndpointImpl();
- if (epImpl == null)
- throw new IllegalStateException("Endpoint implementation bean cannot be
null: " + ep);
-
- if (!epImpl.isAnnotationPresent(WebService.class) &&
!epImpl.isAnnotationPresent(Provider.class))
- throw new IllegalStateException("Not a valid JAXWS endpoint: " +
epImpl.getName());
+ for (Endpoint ep : dep.getService().getEndpoints())
+ {
+ Class epImpl = ep.getEndpointImpl();
+ if (epImpl == null)
+ throw new IllegalStateException("Endpoint implementation bean cannot
be null: " + ep);
+
+ if (!epImpl.isAnnotationPresent(WebService.class) &&
!epImpl.isAnnotationPresent(Provider.class))
+ throw new IllegalStateException("Not a valid JAXWS endpoint: " +
epImpl.getName());
+ }
}
}
}
\ No newline at end of file
Added:
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/WSDeploymentException.java
===================================================================
---
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/WSDeploymentException.java
(rev 0)
+++
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/WSDeploymentException.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -0,0 +1,90 @@
+/*
+ * ====================================================================
+ *
+ * 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$
+
+/**
+ * A general deployment exception
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 20-Apr-2007
+ */
+public class WSDeploymentException extends RuntimeException
+{
+ public WSDeploymentException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ public WSDeploymentException(String message)
+ {
+ super(message);
+ }
+
+ public WSDeploymentException(Throwable cause)
+ {
+ super(cause);
+ }
+
+ public static void rethrow(Throwable cause)
+ {
+ if (cause instanceof WSDeploymentException)
+ throw (WSDeploymentException)cause;
+
+ throw new WSDeploymentException(cause);
+ }
+}
Property changes on:
trunk/integration/src/main/java/org/jboss/ws/integration/deployment/WSDeploymentException.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
trunk/integration/src/main/java/org/jboss/ws/integration/invocation/InvocationHandler.java
===================================================================
---
trunk/integration/src/main/java/org/jboss/ws/integration/invocation/InvocationHandler.java
(rev 0)
+++
trunk/integration/src/main/java/org/jboss/ws/integration/invocation/InvocationHandler.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -0,0 +1,75 @@
+/*
+ * ====================================================================
+ *
+ * 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.invocation;
+
+//$Id$
+
+import org.jboss.ws.integration.Endpoint;
+
+/**
+ * A general endpoint invoker.
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 20-Apr-2007
+ */
+public interface InvocationHandler
+{
+ /** Initialize the invocation handler */
+ void init(Endpoint endpoint);
+
+ /** Invoke the the service endpoint */
+ void invoke(Object reqContext) throws Exception;
+}
Property changes on:
trunk/integration/src/main/java/org/jboss/ws/integration/invocation/InvocationHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified:
trunk/integration/src/main/java/org/jboss/ws/integration/management/EndpointRegistryFactory.java
===================================================================
---
trunk/integration/src/main/java/org/jboss/ws/integration/management/EndpointRegistryFactory.java 2007-04-24
12:52:42 UTC (rev 2915)
+++
trunk/integration/src/main/java/org/jboss/ws/integration/management/EndpointRegistryFactory.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -58,9 +58,9 @@
//$Id$
import org.jboss.kernel.Kernel;
-import org.jboss.kernel.plugins.util.KernelLocator;
import org.jboss.kernel.spi.registry.KernelRegistry;
import org.jboss.kernel.spi.registry.KernelRegistryEntry;
+import org.jboss.ws.integration.KernelLocator;
/**
* Get the endpoint registry from the kernel
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-24
12:52:42 UTC (rev 2915)
+++
trunk/integration/src/test/java/org/jboss/test/ws/integration/basic/BasicDeploymentTest.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -65,7 +65,7 @@
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.BasicDeploymentUnit;
+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.management.EndpointRegistry;
@@ -92,7 +92,7 @@
EndpointRegistry epRegistry = EndpointRegistryFactory.getEndpointRegistry();
// create the deployment unit
- BasicDeploymentUnit unit = new BasicDeploymentUnit();
+ BasicDeployment unit = new BasicDeployment();
BasicService service = new BasicService(unit);
service.addEndpoint(new BasicEndpoint(service, BasicEndpointImp.class));
Modified:
trunk/integration-jboss40/src/java/org/jboss/ws/integration/jboss40/WebServiceClientDeployer.java
===================================================================
---
trunk/integration-jboss40/src/java/org/jboss/ws/integration/jboss40/WebServiceClientDeployer.java 2007-04-24
12:52:42 UTC (rev 2915)
+++
trunk/integration-jboss40/src/java/org/jboss/ws/integration/jboss40/WebServiceClientDeployer.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -35,6 +35,7 @@
import org.jboss.ws.core.jaxrpc.client.ServiceReferenceable;
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
import org.jboss.ws.integration.URLLoaderAdapter;
+import org.jboss.ws.integration.deployment.Deployment.DeploymentType;
import org.jboss.ws.integration.jboss42.DeploymentInfoAdapterFactory;
import org.jboss.ws.metadata.builder.jaxrpc.JAXRPCClientDeployment;
import org.jboss.ws.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
@@ -66,7 +67,7 @@
String serviceRefName = serviceRef.getServiceRefName();
// Build the container independent deployment info
- UnifiedDeploymentInfo udi = new
JAXRPCClientDeployment(UnifiedDeploymentInfo.DeploymentType.JAXRPC_Client);
+ UnifiedDeploymentInfo udi = new
JAXRPCClientDeployment(DeploymentType.JAXRPC_CLIENT);
DeploymentInfoAdapterFactory.newInstance().buildDeploymentInfo(udi, di);
UnifiedServiceRefMetaData usr =
ServiceRefMetaDataAdapterFactory.newInstance().buildServiceRefMetaData(udi, serviceRef);
Modified:
trunk/integration-jboss40/src/java/org/jboss/ws/integration/jboss40/WebServiceClientDeployerMBean.java
===================================================================
---
trunk/integration-jboss40/src/java/org/jboss/ws/integration/jboss40/WebServiceClientDeployerMBean.java 2007-04-24
12:52:42 UTC (rev 2915)
+++
trunk/integration-jboss40/src/java/org/jboss/ws/integration/jboss40/WebServiceClientDeployerMBean.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -25,7 +25,7 @@
import org.jboss.system.ServiceMBean;
import org.jboss.webservice.WebServiceClientDeployment;
-import org.jboss.ws.core.utils.ObjectNameFactory;
+import org.jboss.ws.integration.ObjectNameFactory;
/**
* MBean interface.
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-24
12:52:42 UTC (rev 2915)
+++
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/DeployerInterceptor.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -36,6 +36,7 @@
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.WSDeploymentException;
/**
* A deployer service that manages WS4EE compliant Web Services
Modified:
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB21.java
===================================================================
---
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB21.java 2007-04-24
12:52:42 UTC (rev 2915)
+++
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB21.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -34,6 +34,7 @@
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
import org.jboss.ws.integration.ResourceLoaderAdapter;
import org.jboss.ws.integration.UnifiedVirtualFile;
+import org.jboss.ws.integration.deployment.Deployment.DeploymentType;
import org.jboss.ws.metadata.builder.jaxrpc.JAXRPCDeployment;
import org.jboss.ws.metadata.umdm.UnifiedMetaData;
@@ -48,7 +49,7 @@
protected UnifiedDeploymentInfo createUnifiedDeploymentInfo(DeploymentInfo di) throws
Exception
{
UnifiedVirtualFile vfsWebservices = getWebservicesFile(di);
- UnifiedDeploymentInfo udi = new
JAXRPCDeployment(UnifiedDeploymentInfo.DeploymentType.JAXRPC_EJB21, vfsWebservices);
+ UnifiedDeploymentInfo udi = new JAXRPCDeployment(DeploymentType.JAXRPC_EJB21,
vfsWebservices);
DeploymentInfoAdapterFactory.newInstance().buildDeploymentInfo(udi, di);
return udi;
}
Modified:
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB21MBean.java
===================================================================
---
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB21MBean.java 2007-04-24
12:52:42 UTC (rev 2915)
+++
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB21MBean.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -24,7 +24,7 @@
import javax.management.ObjectName;
import org.jboss.deployment.SubDeployerInterceptorMBean;
-import org.jboss.ws.core.utils.ObjectNameFactory;
+import org.jboss.ws.integration.ObjectNameFactory;
/**
* MBean interface.
Modified:
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB3.java
===================================================================
---
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB3.java 2007-04-24
12:52:42 UTC (rev 2915)
+++
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB3.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -40,6 +40,7 @@
import org.jboss.ws.WSException;
import org.jboss.ws.core.server.JAXWSDeployment;
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.umdm.UnifiedMetaData;
@@ -54,7 +55,7 @@
{
protected UnifiedDeploymentInfo createUnifiedDeploymentInfo(DeploymentInfo di) throws
Exception
{
- UnifiedDeploymentInfo udi = new
JAXWSDeployment(UnifiedDeploymentInfo.DeploymentType.JAXWS_EJB3);
+ UnifiedDeploymentInfo udi = new JAXWSDeployment(DeploymentType.JAXWS_EJB3);
DeploymentInfoAdapterFactory.newInstance().buildDeploymentInfo(udi, di);
Ejb3ModuleMBean ejb3Module = getEJB3Module(udi.deployedObject);
Modified:
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB3MBean.java
===================================================================
---
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB3MBean.java 2007-04-24
12:52:42 UTC (rev 2915)
+++
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB3MBean.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -24,7 +24,7 @@
import javax.management.ObjectName;
import org.jboss.deployment.SubDeployerInterceptorMBean;
-import org.jboss.ws.core.utils.ObjectNameFactory;
+import org.jboss.ws.integration.ObjectNameFactory;
/**
* MBean interface.
Modified:
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/DeployerInterceptorJSE.java
===================================================================
---
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/DeployerInterceptorJSE.java 2007-04-24
12:52:42 UTC (rev 2915)
+++
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/DeployerInterceptorJSE.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -37,9 +37,9 @@
import org.jboss.ws.core.server.JAXWSDeployment;
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
import org.jboss.ws.core.server.AbstractServiceEndpointPublisher.RewriteResults;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo.DeploymentType;
import org.jboss.ws.integration.ResourceLoaderAdapter;
import org.jboss.ws.integration.UnifiedVirtualFile;
+import org.jboss.ws.integration.deployment.Deployment.DeploymentType;
import org.jboss.ws.metadata.builder.jaxrpc.JAXRPCDeployment;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
@@ -66,7 +66,7 @@
{
if (getWebservicesFile(di) != null)
{
- di.context.put("UnifiedDeploymentInfo.Type",
UnifiedDeploymentInfo.DeploymentType.JAXRPC_JSE);
+ di.context.put("UnifiedDeploymentInfo.Type",
DeploymentType.JAXRPC_JSE);
isWebserviceDeployment = true;
}
}
@@ -84,7 +84,7 @@
Class servletClass = di.annotationsCl.loadClass(servletClassName);
if (servletClass.isAnnotationPresent(WebService.class) ||
servletClass.isAnnotationPresent(WebServiceProvider.class))
{
- di.context.put("UnifiedDeploymentInfo.Type",
UnifiedDeploymentInfo.DeploymentType.JAXWS_JSE);
+ di.context.put("UnifiedDeploymentInfo.Type",
DeploymentType.JAXWS_JSE);
isWebserviceDeployment = true;
}
}
@@ -104,15 +104,15 @@
UnifiedDeploymentInfo udi;
DeploymentType type =
(DeploymentType)di.context.get("UnifiedDeploymentInfo.Type");
- if (type == UnifiedDeploymentInfo.DeploymentType.JAXRPC_JSE)
+ if (type == DeploymentType.JAXRPC_JSE)
{
UnifiedVirtualFile vfsWebservices = getWebservicesFile(di);
- udi = new JAXRPCDeployment(UnifiedDeploymentInfo.DeploymentType.JAXRPC_JSE,
vfsWebservices);
+ udi = new JAXRPCDeployment(DeploymentType.JAXRPC_JSE, vfsWebservices);
DeploymentInfoAdapterFactory.newInstance().buildDeploymentInfo(udi, di);
}
- else if (type == UnifiedDeploymentInfo.DeploymentType.JAXWS_JSE)
+ else if (type == DeploymentType.JAXWS_JSE)
{
- udi = new JAXWSDeployment(UnifiedDeploymentInfo.DeploymentType.JAXWS_JSE);
+ udi = new JAXWSDeployment(DeploymentType.JAXWS_JSE);
DeploymentInfoAdapterFactory.newInstance().buildDeploymentInfo(udi, di);
}
else
Modified:
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/DeployerInterceptorJSEMBean.java
===================================================================
---
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/DeployerInterceptorJSEMBean.java 2007-04-24
12:52:42 UTC (rev 2915)
+++
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/DeployerInterceptorJSEMBean.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -24,7 +24,7 @@
import javax.management.ObjectName;
import org.jboss.deployment.SubDeployerInterceptorMBean;
-import org.jboss.ws.core.utils.ObjectNameFactory;
+import org.jboss.ws.integration.ObjectNameFactory;
/**
* MBean interface.
Modified:
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/DeployerInterceptorNestedJSE.java
===================================================================
---
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/DeployerInterceptorNestedJSE.java 2007-04-24
12:52:42 UTC (rev 2915)
+++
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/DeployerInterceptorNestedJSE.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -35,6 +35,7 @@
import org.jboss.system.server.ServerConfig;
import org.jboss.system.server.ServerConfigLocator;
import org.jboss.ws.core.utils.IOUtils;
+import org.jboss.ws.integration.deployment.WSDeploymentException;
/**
* A deployer service that manages WS4EE compliant Web Services for
@@ -126,7 +127,7 @@
}
catch (IOException ex)
{
- throw new DeploymentException("Failed to destroy: " + di.url, ex);
+ throw new WSDeploymentException("Failed to destroy: " + di.url, ex);
}
}
}
Modified:
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/DeployerInterceptorNestedJSEMBean.java
===================================================================
---
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/DeployerInterceptorNestedJSEMBean.java 2007-04-24
12:52:42 UTC (rev 2915)
+++
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/DeployerInterceptorNestedJSEMBean.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -27,7 +27,7 @@
import org.jboss.deployment.MainDeployerMBean;
import org.jboss.deployment.SubDeployerMBean;
-import org.jboss.ws.core.utils.ObjectNameFactory;
+import org.jboss.ws.integration.ObjectNameFactory;
/**
* @author Thomas.Diesler(a)jboss.org
Modified:
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-24
12:52:42 UTC (rev 2915)
+++
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/ServerConfigImpl.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -34,7 +34,7 @@
import org.jboss.logging.Logger;
import org.jboss.mx.util.MBeanServerLocator;
import org.jboss.ws.core.server.ServerConfig;
-import org.jboss.ws.core.utils.ObjectNameFactory;
+import org.jboss.ws.integration.ObjectNameFactory;
/**
* JBoss specific implementation of a ServerConfig
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-24
12:52:42 UTC (rev 2915)
+++
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/ServiceEndpointInvokerEJB21.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -47,7 +47,7 @@
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.core.utils.ObjectNameFactory;
+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;
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-24
12:52:42 UTC (rev 2915)
+++
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/ServiceEndpointInvokerEJB3.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -38,7 +38,7 @@
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.utils.ObjectNameFactory;
+import org.jboss.ws.integration.ObjectNameFactory;
/**
* Handles invocations on EJB3 endpoints.
Modified:
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/jms/MessageDispatcher.java
===================================================================
---
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/jms/MessageDispatcher.java 2007-04-24
12:52:42 UTC (rev 2915)
+++
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/jms/MessageDispatcher.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -29,7 +29,7 @@
import javax.management.ObjectName;
import javax.xml.soap.SOAPMessage;
-import org.jboss.ws.core.utils.ObjectNameFactory;
+import org.jboss.ws.integration.ObjectNameFactory;
/**
* A dispatcher for SOAPMessages
Modified: trunk/integration-jboss50/build.xml
===================================================================
--- trunk/integration-jboss50/build.xml 2007-04-24 12:52:42 UTC (rev 2915)
+++ trunk/integration-jboss50/build.xml 2007-04-25 10:07:39 UTC (rev 2916)
@@ -122,6 +122,9 @@
<!-- 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>
Modified:
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-24
12:52:42 UTC (rev 2915)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/AbstractDeployer.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -31,8 +31,8 @@
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.UnifiedDeploymentInfo.DeploymentType;
import org.jboss.ws.integration.KernelLocator;
+import org.jboss.ws.integration.deployment.Deployment.DeploymentType;
/**
* An abstract web service deployer.
@@ -50,10 +50,10 @@
* @author Thomas.Diesler(a)jboss.org
* @since 31-Oct-2006
*/
-public abstract class AbstractDeployer implements WebServiceDeployer
+public abstract class AbstractDeployer implements DeployerHook
{
// provide logging
- private static final Logger log = Logger.getLogger(AbstractDeployer.class);
+ 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.
Modified:
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-24
12:52:42 UTC (rev 2915)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/AbstractDeployerJSE.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -43,9 +43,6 @@
*/
public abstract class AbstractDeployerJSE extends AbstractDeployer
{
- // provide logging
- protected static final Logger log = Logger.getLogger(AbstractDeployerJSE.class);
-
public AbstractDeployerJSE()
{
super();
Copied:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/DeployerHook.java
(from rev 2914,
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/WebServiceDeployer.java)
===================================================================
--- trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/DeployerHook.java
(rev 0)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/DeployerHook.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -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.integration.jboss50;
+
+//$Id$
+
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.DeploymentUnit;
+
+/**
+ * An interface for all web service deployers
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 24-Apr-2007
+ */
+public interface DeployerHook
+{
+ void deploy(DeploymentUnit unit) throws DeploymentException;
+
+ public void undeploy(DeploymentUnit unit);
+}
Modified:
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-24
12:52:42 UTC (rev 2915)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/DeploymentInfoAdaptor.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -24,17 +24,16 @@
import java.net.URL;
import java.net.URLClassLoader;
-import org.jboss.deployers.spi.DeploymentException;
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.
*
@@ -46,7 +45,7 @@
// logging support
private static Logger log = Logger.getLogger(DeploymentInfoAdaptor.class);
- public static void buildDeploymentInfo(UnifiedDeploymentInfo udi, DeploymentUnit unit)
throws DeploymentException
+ public static void buildDeploymentInfo(UnifiedDeploymentInfo udi, DeploymentUnit
unit)
{
try
{
@@ -55,25 +54,25 @@
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());
-
+ udi.classLoader = new URLClassLoader(new URL[] {}, unit.getClassLoader());
+
log.debug("UnifiedDeploymentInfo:\n" + udi);
}
catch (Exception ex)
{
- DeploymentException.rethrowAsDeploymentException(ex.getMessage(), ex);
+ WSException.rethrow(ex.getMessage(), ex);
}
}
Modified:
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-24
12:52:42 UTC (rev 2915)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerEJB21.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -23,18 +23,18 @@
//$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.server.UnifiedDeploymentInfo.DeploymentType;
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;
-import java.io.IOException;
-
/**
* A deployer JAXRPC EJB21 Endpoints
*
Modified:
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-24
12:52:42 UTC (rev 2915)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerJSE.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -23,19 +23,19 @@
//$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.server.UnifiedDeploymentInfo.DeploymentType;
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;
-import java.io.IOException;
-
/**
* A deployer JAXRPC JSE Endpoints
*
Modified:
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-24
12:52:42 UTC (rev 2915)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/JAXWSDeployerEJB3.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -35,7 +35,7 @@
import org.jboss.ejb3.stateless.StatelessContainer;
import org.jboss.ws.core.server.JAXWSDeployment;
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo.DeploymentType;
+import org.jboss.ws.integration.deployment.Deployment.DeploymentType;
/**
* A deployer JAXWS EJB3 Endpoints
Modified:
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-24
12:52:42 UTC (rev 2915)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/JAXWSDeployerJSE.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -35,7 +35,7 @@
import org.jboss.metadata.web.Servlet;
import org.jboss.ws.core.server.JAXWSDeployment;
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo.DeploymentType;
+import org.jboss.ws.integration.deployment.Deployment.DeploymentType;
/**
* A deployer JAXWS JSE Endpoints
Modified:
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-24
12:52:42 UTC (rev 2915)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServerConfigImpl.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -34,7 +34,7 @@
import org.jboss.logging.Logger;
import org.jboss.mx.util.MBeanServerLocator;
import org.jboss.ws.core.server.ServerConfig;
-import org.jboss.ws.core.utils.ObjectNameFactory;
+import org.jboss.ws.integration.ObjectNameFactory;
/**
* JBoss specific implementation of a ServerConfig
Modified:
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-24
12:52:42 UTC (rev 2915)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceEndpointInvokerEJB21.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -47,7 +47,7 @@
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.core.utils.ObjectNameFactory;
+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;
Modified:
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-24
12:52:42 UTC (rev 2915)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceEndpointInvokerEJB3.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -49,7 +49,7 @@
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.core.utils.ObjectNameFactory;
+import org.jboss.ws.integration.ObjectNameFactory;
/**
* Handles invocations on EJB3 endpoints.
Modified:
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-24
12:52:42 UTC (rev 2915)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceEndpointLifecycleDeployer.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -41,7 +41,7 @@
* @author Thomas.Diesler(a)jboss.org
* @since 31-Oct-2006
*/
-public class ServiceEndpointLifecycleDeployer implements WebServiceDeployer
+public class ServiceEndpointLifecycleDeployer implements DeployerHook
{
// provide logging
private static final Logger log =
Logger.getLogger(ServiceEndpointLifecycleDeployer.class);
Modified:
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-24
12:52:42 UTC (rev 2915)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/WebServiceAbstractDeployer.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -40,19 +40,19 @@
public abstract class WebServiceAbstractDeployer extends AbstractSimpleDeployer
{
// provide logging
- private static final Logger log = Logger.getLogger(WebServiceAbstractDeployer.class);
+ protected final Logger log = Logger.getLogger(getClass());
- private List<WebServiceDeployer> deployers = new
LinkedList<WebServiceDeployer>();
+ private List<DeployerHook> deployers = new LinkedList<DeployerHook>();
- public void addDeployer(WebServiceDeployer deployer)
+ public void addDeployerHook(DeployerHook deployer)
{
- log.debug("Add deployer: " + deployer);
+ log.debug("Add deployer hook: " + deployer);
deployers.add(deployer);
}
- public void removeDeployer(WebServiceDeployer deployer)
+ public void removeDeployerHook(DeployerHook deployer)
{
- log.debug("Remove deployer: " + deployer);
+ log.debug("Remove deployer hook: " + deployer);
deployers.remove(deployer);
}
@@ -60,7 +60,7 @@
public void deploy(DeploymentUnit unit) throws DeploymentException
{
log.debug("Deploy: " + unit.getName());
- for (WebServiceDeployer deployer : deployers)
+ for (DeployerHook deployer : deployers)
deployer.deploy(unit);
}
@@ -68,7 +68,7 @@
public void undeploy(DeploymentUnit unit)
{
log.debug("Undeploy: " + unit.getName());
- for (WebServiceDeployer deployer : deployers)
+ for (DeployerHook deployer : deployers)
deployer.undeploy(unit);
}
}
Deleted:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/WebServiceDeployer.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/WebServiceDeployer.java 2007-04-24
12:52:42 UTC (rev 2915)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/WebServiceDeployer.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -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.integration.jboss50;
-
-//$Id$
-
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
-
-/**
- * An interface for all web service deployers
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 24-Apr-2007
- */
-public interface WebServiceDeployer
-{
- void deploy(DeploymentUnit unit) throws DeploymentException;
-
- public void undeploy(DeploymentUnit unit);
-}
Added:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/WebServiceLifecycleDeployer.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/WebServiceLifecycleDeployer.java
(rev 0)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/WebServiceLifecycleDeployer.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -0,0 +1,34 @@
+/*
+ * 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
+{
+}
Property changes on:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/WebServiceLifecycleDeployer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/WebServiceStartStopDeployer.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/WebServiceStartStopDeployer.java 2007-04-24
12:52:42 UTC (rev 2915)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/WebServiceStartStopDeployer.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -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 WebServiceStartStopDeployer extends WebServiceAbstractDeployer
-{
-}
Added:
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
(rev 0)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/AbstractDeployerHook.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -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.deployer.DeploymentUnit;
+import org.jboss.logging.Logger;
+import org.jboss.ws.integration.deployment.DeploymentManager;
+import org.jboss.ws.integration.jboss50.DeployerHook;
+
+/**
+ * An abstract web service deployer.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 31-Oct-2006
+ */
+public abstract class AbstractDeployerHook implements DeployerHook
+{
+ // provide logging
+ protected final Logger log = Logger.getLogger(getClass());
+
+ protected DeploymentManager deploymentManager;
+
+ public DeploymentManager getDeploymentManager()
+ {
+ return deploymentManager;
+ }
+
+ public void setDeploymentManager(DeploymentManager deploymentManager)
+ {
+ this.deploymentManager = deploymentManager;
+ }
+
+ /** Return true if this deployment should be ignored
+ */
+ public boolean ignoreDeployment(DeploymentUnit unit)
+ {
+ String name = unit.getName();
+ return (name.startsWith("jboss:id=") &&
name.indexOf("service=jacc") > 0);
+ }
+}
Property changes on:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/AbstractDeployerHook.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/AbstractDeployerHookEJB.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/AbstractDeployerHookEJB.java
(rev 0)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/AbstractDeployerHookEJB.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -0,0 +1,34 @@
+/*
+ * 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$
+
+/**
+ * An abstract deployer for EJB Endpoints
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 31-Oct-2006
+ */
+public abstract class AbstractDeployerHookEJB extends ArchiveDeployerHook
+{
+}
Property changes on:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/AbstractDeployerHookEJB.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/AbstractDeployerHookJSE.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/AbstractDeployerHookJSE.java
(rev 0)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/AbstractDeployerHookJSE.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -0,0 +1,44 @@
+/*
+ * 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 org.jboss.deployers.spi.deployer.DeploymentUnit;
+import org.jboss.metadata.WebMetaData;
+
+//$Id$
+
+/**
+ * An abstract deployer for JSE Endpoints
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 31-Oct-2006
+ */
+public abstract class AbstractDeployerHookJSE extends ArchiveDeployerHook
+{
+ public boolean isWebServiceDeployment(DeploymentUnit unit)
+ {
+ if (unit.getAttachment(WebMetaData.class) == null)
+ return false;
+
+ return true;
+ }
+}
Property changes on:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/AbstractDeployerHookJSE.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
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
(rev 0)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/AbstractInvocationHandler.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -0,0 +1,430 @@
+/*
+ * 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.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.integration.Endpoint;
+import org.jboss.ws.integration.invocation.InvocationHandler;
+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 AbstractInvocationHandler implements InvocationHandler
+{
+ // provide logging
+ private static Logger log = Logger.getLogger(AbstractInvocationHandler.class);
+
+ protected Endpoint endpoint;
+ protected CommonBindingProvider bindingProvider;
+ protected ServerHandlerDelegate delegate;
+
+ /** Initialize the service endpoint */
+ public void init(Endpoint endpoint)
+ {
+ this.endpoint = endpoint;
+
+ ServerEndpointMetaData sepMetaData =
endpoint.getMetaData(ServerEndpointMetaData.class);
+ if (sepMetaData == null)
+ throw new IllegalStateException("Cannot obtain endpoint meta data");
+
+ 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 void invoke(Object reqContext) 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(reqContext, 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;
+ }
+ }
+ 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);
+ }
+ }
+}
Property changes on:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/AbstractInvocationHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/AbstractServiceEndpointServlet.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/AbstractServiceEndpointServlet.java
(rev 0)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/AbstractServiceEndpointServlet.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -0,0 +1,161 @@
+/*
+ * 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.Writer;
+
+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.Endpoint;
+import org.jboss.ws.integration.ObjectNameFactory;
+import org.jboss.ws.integration.RequestHandler;
+import org.jboss.ws.integration.management.EndpointRegistry;
+import org.jboss.ws.integration.management.EndpointRegistryFactory;
+
+/**
+ * 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 Endpoint endpoint;
+ protected EndpointRegistry epManager;
+
+ public void init(ServletConfig config) throws ServletException
+ {
+ super.init(config);
+ epManager = EndpointRegistryFactory.getEndpointRegistry();
+ }
+
+ public void destroy()
+ {
+ super.destroy();
+ }
+
+ public void service(HttpServletRequest req, HttpServletResponse res) throws
ServletException, IOException
+ {
+ if (endpoint == 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
+ {
+ RequestHandler requestHandler = endpoint.getRequestHandler();
+ ServletRequestContext context = new
ServletRequestContext(getServletContext(), req, res);
+ requestHandler.handleWSDLRequest(endpoint, res.getOutputStream(), context);
+ }
+ 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
+ {
+ RequestHandler requestHandler = endpoint.getRequestHandler();
+ ServletRequestContext context = new ServletRequestContext(getServletContext(),
req, res);
+ requestHandler.handleRequest(endpoint, 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);
+ }
+
+ /** Initialize the service endpoint
+ */
+ protected void initServiceEndpoint(String contextPath)
+ {
+ String servletName = getServletName();
+ if (contextPath.startsWith("/"))
+ contextPath = contextPath.substring(1);
+
+ for (ObjectName sepId : epManager.getEndpoints())
+ {
+ String propContext = sepId.getKeyProperty(Endpoint.SEPID_PROPERTY_CONTEXT);
+ String propEndpoint = sepId.getKeyProperty(Endpoint.SEPID_PROPERTY_ENDPOINT);
+ if (servletName.equals(propEndpoint) &&
contextPath.equals(propContext))
+ {
+ endpoint = epManager.getEndpoint(sepId);
+ break;
+ }
+ }
+
+ if (endpoint == null)
+ {
+ ObjectName oname = ObjectNameFactory.create(Endpoint.SEPID_DOMAIN +
":" + Endpoint.SEPID_PROPERTY_CONTEXT + "=" + contextPath +
","
+ + Endpoint.SEPID_PROPERTY_ENDPOINT + "=" + servletName);
+ throw new WSException("Cannot obtain endpoint for: " + oname);
+ }
+ }
+}
Property changes on:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/AbstractServiceEndpointServlet.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
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
(rev 0)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/ArchiveDeployerHook.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -0,0 +1,169 @@
+/*
+ * 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.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;
+import org.jboss.ws.metadata.webservices.WebservicesFactory;
+import org.jboss.ws.metadata.webservices.WebservicesMetaData;
+import org.jboss.xb.binding.ObjectModelFactory;
+import org.jboss.xb.binding.Unmarshaller;
+import org.jboss.xb.binding.UnmarshallerFactory;
+import org.w3c.dom.Element;
+
+/**
+ * An abstract web service deployer.
+ *
+ * deploy(unit)
+ * if(isWebServiceDeployment)
+ * dep = createDeployment(unit)
+ * deploy(dep)
+ *
+ * undeploy(unit)
+ * dep = getDeployment(unit)
+ * undeploy(dep)
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 31-Oct-2006
+ */
+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();
+
+ /** Depending on the type of deployment, this method should return true
+ * if the deployment contains web service endpoints.
+ */
+ public abstract boolean isWebServiceDeployment(DeploymentUnit unit);
+
+ /** Create the Deployment for a given DeploymentUnit
+ */
+ public abstract Deployment createDeployment(DeploymentUnit unit);
+
+ /** Get the Deployment for a given DeploymentUnit
+ */
+ public Deployment getDeployment(DeploymentUnit unit)
+ {
+ Deployment dep = unit.getAttachment(Deployment.class);
+ return (dep != null && dep.getType() == getDeploymentType() ? dep : null);
+ }
+
+ public void deploy(DeploymentUnit unit) throws DeploymentException
+ {
+ if (ignoreDeployment(unit))
+ return;
+
+ if (isWebServiceDeployment(unit))
+ {
+ Deployment dep = getDeployment(unit);
+ if (dep == null)
+ {
+ dep = createDeployment(unit);
+ dep.getContext().addAttachment(DeploymentUnit.class, unit);
+ }
+
+ deploymentManager.deploy(dep);
+ unit.addAttachment(Deployment.class, dep);
+ }
+ }
+
+ public void undeploy(DeploymentUnit unit)
+ {
+ if (ignoreDeployment(unit))
+ return;
+
+ Deployment dep = getDeployment(unit);
+ if (dep != null)
+ {
+ deploymentManager.undeploy(dep);
+ unit.removeAttachment(Deployment.class);
+ }
+ }
+
+ /** Unmrashall the webservices.xml if there is one
+ */
+ protected WebservicesMetaData getWebservicesMetaData(DeploymentUnit unit)
+ {
+ WebservicesMetaData wsMetaData = unit.getAttachment(WebservicesMetaData.class);
+ VirtualFile vfWebservices = unit.getMetaDataFile("webservices.xml");
+ if (wsMetaData == null && vfWebservices != null)
+ {
+ try
+ {
+ URL webservicesURL = vfWebservices.toURL();
+ InputStream is = webservicesURL.openStream();
+ try
+ {
+ Element root = DOMUtils.parse(vfWebservices.openStream());
+ String namespaceURI = root.getNamespaceURI();
+ if (
namespaceURI.equals("http://java.sun.com/xml/ns/j2ee"))
+ {
+ Unmarshaller unmarshaller =
UnmarshallerFactory.newInstance().newUnmarshaller();
+ ObjectModelFactory factory = new WebservicesFactory(webservicesURL);
+ wsMetaData = (WebservicesMetaData)unmarshaller.unmarshal(is, factory,
null);
+ unit.addAttachment(WebservicesMetaData.class, wsMetaData);
+ }
+ }
+ finally
+ {
+ is.close();
+ }
+ }
+ catch (Exception ex)
+ {
+ throw new WSDeploymentException(ex);
+ }
+ }
+ return wsMetaData;
+ }
+
+ protected ObjectName createEndpointName(String contextRoot, String linkName)
+ {
+ if (contextRoot.startsWith("/"))
+ contextRoot = contextRoot.substring(1);
+
+ StringBuilder idstr = new StringBuilder(Endpoint.SEPID_DOMAIN + ":");
+ idstr.append(Endpoint.SEPID_PROPERTY_CONTEXT + "=" + contextRoot);
+ idstr.append("," + Endpoint.SEPID_PROPERTY_ENDPOINT + "=" +
linkName);
+
+ return ObjectNameFactory.create(idstr.toString());
+ }
+}
Property changes on:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/ArchiveDeployerHook.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/AssignEndpointHandlersDeployer.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/AssignEndpointHandlersDeployer.java
(rev 0)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/AssignEndpointHandlersDeployer.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -0,0 +1,115 @@
+/*
+ * 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.Map;
+
+import org.jboss.ws.integration.Endpoint;
+import org.jboss.ws.integration.LifecycleHandler;
+import org.jboss.ws.integration.RequestHandler;
+import org.jboss.ws.integration.deployment.AbstractDeployer;
+import org.jboss.ws.integration.deployment.Deployment;
+import org.jboss.ws.integration.invocation.InvocationHandler;
+
+/**
+ * A deployer that assigns the handlers to the Endpoint
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 31-Oct-2005
+ */
+public class AssignEndpointHandlersDeployer extends AbstractDeployer
+{
+ private String requestHandler;
+ private String lifecycleHandler;
+ private Map<String,String> invocationHandlers;
+
+ public void setLifecycleHandler(String handler)
+ {
+ this.lifecycleHandler = handler;
+ }
+
+ public void setRequestHandler(String handler)
+ {
+ this.requestHandler = handler;
+ }
+
+ public void setInvocationHandlers(Map<String,String> handlers)
+ {
+ this.invocationHandlers = handlers;
+ }
+
+ @Override
+ public void create(Deployment dep)
+ {
+ for (Endpoint ep : dep.getService().getEndpoints())
+ {
+ ep.setRequestHandler(getRequestHandler(dep));
+ ep.setLifecycleHandler(getLifecycleHandler(dep));
+ ep.setInvocationHandler(getInvocationHandler(dep));
+ }
+ }
+
+ private RequestHandler getRequestHandler(Deployment dep)
+ {
+ try
+ {
+ Class<?> handlerClass = dep.getClassLoader().loadClass(requestHandler);
+ return (RequestHandler)handlerClass.newInstance();
+ }
+ catch (Exception e)
+ {
+ throw new IllegalStateException("Cannot load request handler: " +
requestHandler);
+ }
+ }
+
+ private LifecycleHandler getLifecycleHandler(Deployment dep)
+ {
+ try
+ {
+ Class<?> handlerClass = dep.getClassLoader().loadClass(lifecycleHandler);
+ return (LifecycleHandler)handlerClass.newInstance();
+ }
+ catch (Exception e)
+ {
+ throw new IllegalStateException("Cannot load lifecycle handler: " +
lifecycleHandler);
+ }
+ }
+
+ private InvocationHandler getInvocationHandler(Deployment dep)
+ {
+ String className = invocationHandlers.get(dep.getType().toString());
+ if (className == null)
+ throw new IllegalStateException("Cannot obtain invocation handler for:
" + dep.getType());
+
+ try
+ {
+ Class<?> handlerClass = dep.getClassLoader().loadClass(className);
+ return (InvocationHandler)handlerClass.newInstance();
+ }
+ catch (Exception e)
+ {
+ throw new IllegalStateException("Cannot load invocation handler: " +
className);
+ }
+ }
+}
\ No newline at end of file
Property changes on:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/AssignEndpointHandlersDeployer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/AssignEndpointMetaDataDeployer.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/AssignEndpointMetaDataDeployer.java
(rev 0)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/AssignEndpointMetaDataDeployer.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -0,0 +1,85 @@
+/*
+ * 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.management.ObjectName;
+
+import org.jboss.ws.integration.Endpoint;
+import org.jboss.ws.integration.deployment.AbstractDeployer;
+import org.jboss.ws.integration.deployment.Deployment;
+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;
+
+/**
+ * A deployer that assigns the EndpointMetaData to the Endpoint
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 31-Oct-2005
+ */
+public class AssignEndpointMetaDataDeployer extends AbstractDeployer
+{
+ @Override
+ public void create(Deployment dep)
+ {
+ UnifiedMetaData umd = dep.getContext().getAttachment(UnifiedMetaData.class);
+ if (umd == null)
+ throw new IllegalStateException("Cannot obtain unified meta data");
+
+ for (Endpoint ep : dep.getService().getEndpoints())
+ {
+ ServerEndpointMetaData sepMetaData =
ep.getMetaData(ServerEndpointMetaData.class);
+ if (sepMetaData == null)
+ {
+ sepMetaData = getEndpointMetaData(umd, ep.getName());
+ ep.addMetaData(ServerEndpointMetaData.class, sepMetaData);
+ }
+ }
+ }
+
+ private ServerEndpointMetaData getEndpointMetaData(UnifiedMetaData umd, ObjectName
epName)
+ {
+ String propEndpoint = epName.getKeyProperty(Endpoint.SEPID_PROPERTY_ENDPOINT);
+
+ ServerEndpointMetaData epMetaData = null;
+ for (ServiceMetaData serviceMetaData : umd.getServices())
+ {
+ for (EndpointMetaData aux : serviceMetaData.getEndpoints())
+ {
+ String linkName = ((ServerEndpointMetaData)aux).getLinkName();
+ if (propEndpoint.equals(linkName))
+ {
+ epMetaData = (ServerEndpointMetaData)aux;
+ break;
+ }
+ }
+ }
+
+ if (epMetaData == null)
+ throw new IllegalStateException("Cannot find endpoint meta data for: "
+ epName);
+
+ return epMetaData;
+ }
+}
\ No newline at end of file
Property changes on:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/AssignEndpointMetaDataDeployer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
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
(rev 0)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/BasicDeployerHook.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -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 31-Oct-2006
+ */
+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);
+ }
+ }
+}
Property changes on:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/BasicDeployerHook.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/ClassLoaderInjectionDeployer.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/ClassLoaderInjectionDeployer.java
(rev 0)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/ClassLoaderInjectionDeployer.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -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.jbossws;
+
+//$Id$
+
+import org.jboss.deployers.spi.deployer.DeploymentUnit;
+import org.jboss.ws.integration.deployment.AbstractDeployer;
+import org.jboss.ws.integration.deployment.Deployment;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
+
+/**
+ * A deployer that injects the correct classloader into the UMDM
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 31-Oct-2005
+ */
+public class ClassLoaderInjectionDeployer extends AbstractDeployer
+{
+ @Override
+ public void create(Deployment dep)
+ {
+ DeploymentUnit unit = dep.getContext().getAttachment(DeploymentUnit.class);
+ if (unit == null)
+ throw new IllegalStateException("Cannot obtain deployement unit");
+
+ UnifiedMetaData umd = dep.getContext().getAttachment(UnifiedMetaData.class);
+ if (umd == null)
+ throw new IllegalStateException("Cannot obtain unified meta data");
+
+ ClassLoader classLoader = unit.getClassLoader();
+ umd.setClassLoader(classLoader);
+ }
+}
\ No newline at end of file
Property changes on:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/ClassLoaderInjectionDeployer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/DeployerHookJAXRPCEJB21.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/DeployerHookJAXRPCEJB21.java
(rev 0)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/DeployerHookJAXRPCEJB21.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -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.integration.jboss50.jbossws;
+
+//$Id$
+
+import org.jboss.deployers.spi.deployer.DeploymentUnit;
+import org.jboss.metadata.ApplicationMetaData;
+import org.jboss.ws.integration.deployment.Deployment;
+import org.jboss.ws.integration.deployment.Deployment.DeploymentType;
+import org.jboss.ws.metadata.webservices.WebservicesMetaData;
+
+/**
+ * A deployer JAXRPC EJB21 Endpoints
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 06-Jan-2007
+ */
+public class DeployerHookJAXRPCEJB21 extends AbstractDeployerHookEJB
+{
+ /** Get the deployemnt type this deployer can handle
+ */
+ public DeploymentType getDeploymentType()
+ {
+ return DeploymentType.JAXRPC_EJB21;
+ }
+
+ @Override
+ public Deployment createDeployment(DeploymentUnit unit)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public boolean isWebServiceDeployment(DeploymentUnit unit)
+ {
+ WebservicesMetaData wsMetaData = getWebservicesMetaData(unit);
+ return wsMetaData != null &&
unit.getAllMetaData(ApplicationMetaData.class).size() > 0;
+ }
+}
\ No newline at end of file
Property changes on:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/DeployerHookJAXRPCEJB21.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/DeployerHookJAXRPCJSE.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/DeployerHookJAXRPCJSE.java
(rev 0)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/DeployerHookJAXRPCJSE.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -0,0 +1,139 @@
+/*
+ * 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.deployer.DeploymentUnit;
+import org.jboss.metadata.WebMetaData;
+import org.jboss.metadata.web.Servlet;
+import org.jboss.ws.integration.BasicEndpoint;
+import org.jboss.ws.integration.Endpoint;
+import org.jboss.ws.integration.Service;
+import org.jboss.ws.integration.deployment.BasicDeployment;
+import org.jboss.ws.integration.deployment.Deployment;
+import org.jboss.ws.integration.deployment.Deployment.DeploymentType;
+import org.jboss.ws.metadata.webservices.PortComponentMetaData;
+import org.jboss.ws.metadata.webservices.WebserviceDescriptionMetaData;
+import org.jboss.ws.metadata.webservices.WebservicesMetaData;
+
+/**
+ * A deployer JAXRPC JSE Endpoints
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 31-Oct-2005
+ */
+public class DeployerHookJAXRPCJSE extends AbstractDeployerHookJSE
+{
+ /** Get the deployemnt type this deployer can handle
+ */
+ public DeploymentType getDeploymentType()
+ {
+ return DeploymentType.JAXRPC_JSE;
+ }
+
+ /**
+ * Create an endpoint for every servlet-link in webservices.xml
+ */
+ @Override
+ public Deployment createDeployment(DeploymentUnit unit)
+ {
+ Deployment deployment = new BasicDeployment();
+ deployment.setType(getDeploymentType());
+ deployment.setClassLoader(unit.getClassLoader());
+
+ Service service = deployment.getService();
+
+ WebMetaData wmd = unit.getAttachment(WebMetaData.class);
+ if (wmd == null)
+ throw new IllegalStateException("Deployment unit does not contain web meta
data");
+
+ WebservicesMetaData wsMetaData = getWebservicesMetaData(unit);
+ if (wsMetaData == null)
+ throw new IllegalStateException("Deployment unit does not contain
webservices meta data");
+
+ // Copy the attachments
+ deployment.getContext().addAttachment(WebservicesMetaData.class, wsMetaData);
+ deployment.getContext().addAttachment(WebMetaData.class, wmd);
+
+ // Get the context root
+ String contextRoot = wmd.getContextRoot();
+ if (contextRoot == null)
+ {
+ contextRoot = unit.getSimpleName();
+ if (contextRoot.endsWith(".war"))
+ contextRoot = contextRoot.substring(0, contextRoot.length() - 4);
+ }
+
+ for (WebserviceDescriptionMetaData wsd : wsMetaData.getWebserviceDescriptions())
+ {
+ for (PortComponentMetaData pcmd : wsd.getPortComponents())
+ {
+ String servletLink = pcmd.getServletLink();
+ Servlet servlet = getServlet(wmd, servletLink);
+ String servletClassName = servlet.getServletClass();
+
+ Class<?> servletClass = null;
+ try
+ {
+ ClassLoader loader = unit.getClassLoader();
+ servletClass = loader.loadClass(servletClassName.trim());
+ }
+ catch (ClassNotFoundException ex)
+ {
+ log.warn("Cannot load servlet class: " + servletClassName);
+ continue;
+ }
+
+ // Create the endpoint
+ Endpoint endpoint = new BasicEndpoint(service, servletClass);
+ endpoint.setName(createEndpointName(contextRoot, servletLink));
+
+ service.addEndpoint(endpoint);
+ }
+ }
+
+ return deployment;
+ }
+
+ private Servlet getServlet(WebMetaData wmd, String servletLink)
+ {
+ for (Servlet servlet : wmd.getServlets())
+ {
+ if (servletLink.equals(servlet.getName()))
+ {
+ return servlet;
+ }
+ }
+ throw new IllegalStateException("Cannot find servlet for link: " +
servletLink);
+ }
+
+ @Override
+ public boolean isWebServiceDeployment(DeploymentUnit unit)
+ {
+ if (super.isWebServiceDeployment(unit) == false)
+ return false;
+
+ WebservicesMetaData wsMetaData = getWebservicesMetaData(unit);
+ return wsMetaData != null;
+ }
+}
Property changes on:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/DeployerHookJAXRPCJSE.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/DeployerHookJAXWSEJB3.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/DeployerHookJAXWSEJB3.java
(rev 0)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/DeployerHookJAXWSEJB3.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -0,0 +1,85 @@
+/*
+ * 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.jws.WebService;
+import javax.xml.ws.WebServiceProvider;
+
+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.integration.deployment.Deployment;
+import org.jboss.ws.integration.deployment.Deployment.DeploymentType;
+
+import sun.reflect.generics.reflectiveObjects.NotImplementedException;
+
+/**
+ * A deployer JAXWS EJB3 Endpoints
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 31-Oct-2005
+ */
+public class DeployerHookJAXWSEJB3 extends AbstractDeployerHookEJB
+{
+ /** Get the deployemnt type this deployer can handle
+ */
+ public DeploymentType getDeploymentType()
+ {
+ return DeploymentType.JAXWS_EJB3;
+ }
+
+ @Override
+ public Deployment createDeployment(DeploymentUnit unit)
+ {
+ throw new NotImplementedException();
+ }
+
+ @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();
+ boolean isWebService = container.resolveAnnotation(WebService.class) !=
null;
+ boolean isWebServiceProvider =
container.resolveAnnotation(WebServiceProvider.class) != null;
+ if (container instanceof StatelessContainer && (isWebService ||
isWebServiceProvider))
+ {
+ isWebServiceDeployment = true;
+ break;
+ }
+ }
+ }
+
+ return isWebServiceDeployment;
+ }
+}
\ No newline at end of file
Property changes on:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/DeployerHookJAXWSEJB3.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/DeployerHookJAXWSJSE.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/DeployerHookJAXWSJSE.java
(rev 0)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/DeployerHookJAXWSJSE.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -0,0 +1,112 @@
+/*
+ * 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.jws.WebService;
+import javax.xml.ws.WebServiceProvider;
+
+import org.jboss.deployers.spi.deployer.DeploymentUnit;
+import org.jboss.metadata.WebMetaData;
+import org.jboss.metadata.web.Servlet;
+import org.jboss.ws.integration.deployment.Deployment;
+import org.jboss.ws.integration.deployment.Deployment.DeploymentType;
+
+import sun.reflect.generics.reflectiveObjects.NotImplementedException;
+
+/**
+ * A deployer JAXWS JSE Endpoints
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 31-Oct-2005
+ */
+public class DeployerHookJAXWSJSE extends AbstractDeployerHookJSE
+{
+ /** Get the deployemnt type this deployer can handle
+ */
+ public DeploymentType getDeploymentType()
+ {
+ return DeploymentType.JAXWS_JSE;
+ }
+
+ @Override
+ public Deployment createDeployment(DeploymentUnit unit)
+ {
+ throw new NotImplementedException();
+ }
+
+ @Override
+ public boolean isWebServiceDeployment(DeploymentUnit unit)
+ {
+ WebMetaData webMetaData = unit.getAttachment(WebMetaData.class);
+ if (webMetaData == null)
+ return false;
+
+ String name = unit.getName();
+ if (name.startsWith("jboss:id=") &&
name.indexOf("service=jacc") > 0)
+ return false;
+
+ boolean isWebServiceDeployment = false;
+ try
+ {
+ Iterator it = webMetaData.getServlets().iterator();
+ while (it.hasNext())
+ {
+ Servlet servlet = (Servlet)it.next();
+ String servletClassName = servlet.getServletClass();
+
+ // Skip JSPs
+ if (servletClassName == null)
+ continue;
+
+ Class<?> servletClass = null;
+ try
+ {
+ ClassLoader loader = unit.getClassLoader();
+ servletClass = loader.loadClass(servletClassName.trim());
+ }
+ catch (ClassNotFoundException ex)
+ {
+ log.warn("Cannot load servlet class: " + servletClassName);
+ continue;
+ }
+
+ boolean isWebService = servletClass.isAnnotationPresent(WebService.class);
+ boolean isWebServiceProvider =
servletClass.isAnnotationPresent(WebServiceProvider.class);
+ if (isWebService || isWebServiceProvider)
+ {
+ isWebServiceDeployment = true;
+ break;
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ log.error("Cannot process web deployment", ex);
+ }
+
+ return isWebServiceDeployment;
+ }
+}
\ No newline at end of file
Property changes on:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/DeployerHookJAXWSJSE.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/EagerInitalizeDeployer.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/EagerInitalizeDeployer.java
(rev 0)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/EagerInitalizeDeployer.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -0,0 +1,47 @@
+/*
+ * 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.deployment.AbstractDeployer;
+import org.jboss.ws.integration.deployment.Deployment;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
+
+/**
+ * A deployer that initializes the UMDM
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 31-Oct-2005
+ */
+public class EagerInitalizeDeployer extends AbstractDeployer
+{
+ @Override
+ public void create(Deployment dep)
+ {
+ UnifiedMetaData umd = dep.getContext().getAttachment(UnifiedMetaData.class);
+ if (umd == null)
+ throw new IllegalStateException("Cannot obtain unified meta data");
+
+ umd.eagerInitialize();
+ }
+}
\ No newline at end of file
Property changes on:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/EagerInitalizeDeployer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/EndpointLifecycleDeployer.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/EndpointLifecycleDeployer.java
(rev 0)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/EndpointLifecycleDeployer.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -0,0 +1,69 @@
+/*
+ * 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.integration.deployment.AbstractDeployer;
+import org.jboss.ws.integration.deployment.Deployment;
+
+/**
+ * A deployer that that calls the endpoint lifecycle handler
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 31-Oct-2005
+ */
+public class EndpointLifecycleDeployer extends AbstractDeployer
+{
+ @Override
+ public void create(Deployment dep)
+ {
+ for (Endpoint ep : dep.getService().getEndpoints())
+ ep.getLifecycleHandler().create(ep);
+ }
+
+ @Override
+ public void start(Deployment dep)
+ {
+ for (Endpoint ep : dep.getService().getEndpoints())
+ {
+ ep.getLifecycleHandler().start(ep);
+ }
+ }
+
+ @Override
+ public void stop(Deployment dep)
+ {
+ for (Endpoint ep : dep.getService().getEndpoints())
+ {
+ ep.getLifecycleHandler().stop(ep);
+ }
+ }
+
+ @Override
+ public void destroy(Deployment dep)
+ {
+ for (Endpoint ep : dep.getService().getEndpoints())
+ ep.getLifecycleHandler().destroy(ep);
+ }
+}
Property changes on:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/EndpointLifecycleDeployer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
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
(rev 0)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/InvocationHandlerJSE.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -0,0 +1,125 @@
+/*
+ * 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.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 InvocationHandlerJSE extends AbstractInvocationHandler
+{
+ // provide logging
+ private Logger log = Logger.getLogger(InvocationHandlerJSE.class);
+
+ /** Load the SEI implementation bean if necessary */
+ public Class loadServiceEndpoint() throws ClassNotFoundException
+ {
+ ServerEndpointMetaData sepMetaData =
endpoint.getMetaData(ServerEndpointMetaData.class);
+ if (sepMetaData == null)
+ throw new IllegalStateException("Cannot obtain endpoint meta data");
+
+ ClassLoader cl = sepMetaData.getClassLoader();
+ String seiImplName = sepMetaData.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();
+ }
+ }
+}
Property changes on:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/InvocationHandlerJSE.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
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-25
10:07:39 UTC (rev 2916)
@@ -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.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 31-Oct-2006
+ */
+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();
+ }
+}
Property changes on:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/LifecycleHandlerImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/ModifyWebMetaDataDeployer.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/ModifyWebMetaDataDeployer.java
(rev 0)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/ModifyWebMetaDataDeployer.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -0,0 +1,118 @@
+/*
+ * 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 org.jboss.kernel.Kernel;
+import org.jboss.kernel.spi.registry.KernelRegistry;
+import org.jboss.kernel.spi.registry.KernelRegistryEntry;
+import org.jboss.metadata.NameValuePair;
+import org.jboss.metadata.WebMetaData;
+import org.jboss.metadata.web.Servlet;
+import org.jboss.ws.core.utils.JavaUtils;
+import org.jboss.ws.integration.KernelLocator;
+import org.jboss.ws.integration.deployment.AbstractDeployer;
+import org.jboss.ws.integration.deployment.Deployment;
+import org.jboss.ws.integration.deployment.DeploymentManager;
+
+/**
+ * A deployer that modifies the web.xml meta data
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 31-Oct-2005
+ */
+public class ModifyWebMetaDataDeployer extends AbstractDeployer
+{
+ // The servlet init param in web.xml that is the service endpoint class
+ public static final String INIT_PARAM_WEBSERVICE_ENDPOINT_BEAN =
WebXMLRewritingDeployer.INIT_PARAM_WEBSERVICE_ENDPOINT_BEAN;
+
+ public String getServiceEndpointServlet()
+ {
+ Kernel kernel = KernelLocator.getKernel();
+ KernelRegistry registry = kernel.getRegistry();
+ KernelRegistryEntry entry = registry.getEntry(WebXMLRewritingDeployer.BEAN_NAME);
+ WebXMLRewritingDeployer delegate = (WebXMLRewritingDeployer)entry.getTarget();
+ return delegate.getServiceEndpointServlet();
+ }
+
+ @Override
+ public void create(Deployment dep)
+ {
+ WebMetaData webMetaData = dep.getContext().getAttachment(WebMetaData.class);
+ if (webMetaData != null)
+ {
+ for (Servlet servlet : webMetaData.getServlets())
+ {
+ String servletClassName = servlet.getServletClass();
+
+ // JSP
+ if (servletClassName != null && servletClassName.length() > 0)
+ {
+ // Nothing to do if we have an <init-param>
+ if (!isAlreadyModified(servlet) &&
!isJavaxServlet(servletClassName, dep.getClassLoader()))
+ {
+ servlet.setServletClass(getServiceEndpointServlet());
+ NameValuePair initParam = new
NameValuePair(INIT_PARAM_WEBSERVICE_ENDPOINT_BEAN, servletClassName);
+ servlet.addInitParam(initParam);
+ }
+ }
+ }
+ }
+ }
+
+ private boolean isJavaxServlet(String servletClassName, ClassLoader loader)
+ {
+ boolean isServlet = false;
+ if (loader != null)
+ {
+ try
+ {
+ Class servletClass = loader.loadClass(servletClassName);
+ isServlet = JavaUtils.isAssignableFrom(javax.servlet.Servlet.class,
servletClass);
+ if (isServlet == true)
+ {
+ log.info("Ignore servlet: " + servletClassName);
+ }
+ }
+ catch (ClassNotFoundException e)
+ {
+ log.warn("Cannot load servlet class: " + servletClassName);
+ }
+ }
+ return isServlet;
+ }
+
+ private boolean isAlreadyModified(Servlet servlet)
+ {
+ Iterator itParams = servlet.getInitParams().iterator();
+ while (itParams.hasNext())
+ {
+ NameValuePair pair = (NameValuePair)itParams.next();
+ if (INIT_PARAM_WEBSERVICE_ENDPOINT_BEAN.equals(pair.getName()))
+ return true;
+ }
+ return false;
+ }
+}
\ No newline at end of file
Property changes on:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/ModifyWebMetaDataDeployer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
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
(rev 0)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/RequestHandlerImpl.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -0,0 +1,421 @@
+/*
+ * 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.InputStream;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.activation.DataHandler;
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+import javax.xml.namespace.QName;
+import javax.xml.rpc.soap.SOAPFaultException;
+import javax.xml.soap.MimeHeaders;
+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 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.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.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;
+import org.jboss.ws.core.soap.MessageContextAssociation;
+import org.jboss.ws.core.soap.MessageFactoryImpl;
+import org.jboss.ws.core.soap.SOAPConnectionImpl;
+import org.jboss.ws.core.soap.SOAPMessageImpl;
+import org.jboss.ws.core.utils.DOMWriter;
+import org.jboss.ws.core.utils.ThreadLocalAssociation;
+import org.jboss.ws.extensions.addressing.AddressingConstantsImpl;
+import org.jboss.ws.extensions.xop.XOPContext;
+import org.jboss.ws.integration.Endpoint;
+import org.jboss.ws.integration.RequestHandler;
+import org.jboss.ws.integration.Endpoint.EndpointState;
+import org.jboss.ws.integration.invocation.InvocationHandler;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
+import org.jboss.ws.metadata.umdm.EndpointMetaData.Type;
+import org.w3c.dom.Document;
+
+/**
+ * A request handler
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 31-Oct-2006
+ */
+public class RequestHandlerImpl implements RequestHandler
+{
+ // provide logging
+ protected final Logger log = Logger.getLogger(getClass());
+
+ public void handleRequest(Endpoint endpoint, InputStream input, OutputStream output,
Object ctx)
+ {
+ log.debug("handleRequest: " + endpoint.getName());
+
+ ServerEndpointMetaData sepMetaData =
endpoint.getMetaData(ServerEndpointMetaData.class);
+ if (sepMetaData == null)
+ throw new IllegalStateException("Cannot obtain endpoint meta data");
+
+ ServletRequestContext context = (ServletRequestContext)ctx;
+
+ Type type = sepMetaData.getType();
+
+ ServletContext servletContext = context.getServletContext();
+ HttpServletRequest httpRequest = context.getHttpServletRequest();
+ HttpServletResponse httpResponse = context.getHttpServletResponse();
+ ServletHeaderSource headerSource = new ServletHeaderSource(httpRequest,
httpResponse);
+ HttpSession httpSession = context.getHttpSession();
+
+ // 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);
+ msgContext.put(MessageContextJAXRPC.SERVLET_SESSION, httpSession);
+ }
+ 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 = processRequest(endpoint, headerSource, context,
input);
+
+ // 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(output, msgContext, isFault);
+ }
+ catch (Exception ex)
+ {
+ WSException.rethrow(ex);
+ }
+ finally
+ {
+ try
+ {
+ output.flush();
+ output.close();
+ }
+ catch (IOException ioex)
+ {
+ log.error("Cannot flush output stream");
+ }
+
+ // Reset the message context association
+ MessageContextAssociation.popMessageContext();
+
+ // clear thread local storage
+ ThreadLocalAssociation.clear();
+ }
+ }
+
+ private void sendResponse(OutputStream output, 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(output);
+ }
+ }
+
+ /**
+ * Handle a request to this web service endpoint
+ */
+ private MessageAbstraction processRequest(Endpoint endpoint, MimeHeaderSource
headerSource, ServletRequestContext context, InputStream input)
+ throws BindingException
+ {
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+
+ ServerEndpointMetaData sepMetaData =
endpoint.getMetaData(ServerEndpointMetaData.class);
+ if (sepMetaData == null)
+ throw new IllegalStateException("Cannot obtain endpoint meta data");
+
+ long beginProcessing = 0;
+ ClassLoader ctxClassLoader = Thread.currentThread().getContextClassLoader();
+ try
+ {
+ EndpointState state = endpoint.getState();
+ if (state != EndpointState.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: " + endpoint.getName());
+ beginProcessing = processRequestMessage(endpoint);
+
+ MimeHeaders headers = (headerSource != null ? headerSource.getMimeHeaders() :
null);
+
+ MessageAbstraction reqMessage;
+
+ String bindingID = sepMetaData.getBindingId();
+ if (HTTPBinding.HTTP_BINDING.equals(bindingID))
+ {
+ reqMessage = new HTTPMessageImpl(headers, input);
+ }
+ else
+ {
+ MessageFactoryImpl msgFactory = new MessageFactoryImpl();
+ msgFactory.setServiceMode(sepMetaData.getServiceMode());
+ msgFactory.setStyle(sepMetaData.getStyle());
+
+ reqMessage = (SOAPMessageImpl)msgFactory.createMessage(headers, input);
+ }
+
+ // 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
+ InvocationHandler invoker = endpoint.getInvocationHandler();
+ invoker.invoke(endpoint);
+
+ MessageAbstraction resMessage = msgContext.getMessageAbstraction();
+ 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 = new
CommonBindingProvider(sepMetaData);
+ 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())
+ {
+ processFaultMessage(endpoint, beginProcessing);
+ }
+ else
+ {
+ processResponseMessage(endpoint, beginProcessing);
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ log.error("Cannot process metrics", ex);
+ }
+
+ // Reset the thread context class loader
+ Thread.currentThread().setContextClassLoader(ctxClassLoader);
+ log.debug("END handleRequest: " + endpoint.getName());
+ }
+ }
+
+ private long processRequestMessage(Endpoint endpoint)
+ {
+ return 0;
+ }
+
+ private void processResponseMessage(Endpoint endpoint, long beginProcessing)
+ {
+ }
+
+ private void processFaultMessage(Endpoint endpoint, long beginProcessing)
+ {
+ }
+
+ /** 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);
+ }
+ }
+
+ public void handleWSDLRequest(Endpoint endpoint, OutputStream output, Object context)
+ {
+ log.debug("handleWSDLRequest: " + endpoint.getName());
+
+ ServerEndpointMetaData epMetaData =
endpoint.getMetaData(ServerEndpointMetaData.class);
+ if (epMetaData == null)
+ throw new IllegalStateException("Cannot obtain endpoint meta data");
+
+ ServletRequestContext reqContext = (ServletRequestContext)context;
+ HttpServletRequest req = reqContext.getHttpServletRequest();
+
+ try
+ {
+ // For the base document the resourcePath should be null
+ String resPath = (String)req.getParameter("resource");
+ URL reqURL = new URL(req.getRequestURL().toString());
+
+ 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();
+ }
+ log.debug("WSDL request, using host: " + wsdlHost);
+
+ WSDLRequestHandler wsdlRequestHandler = new WSDLRequestHandler(epMetaData);
+ Document document = wsdlRequestHandler.getDocumentForPath(reqURL, wsdlHost,
resPath);
+
+ OutputStreamWriter writer = new OutputStreamWriter(output);
+ new
DOMWriter(writer).setPrettyprint(true).print(document.getDocumentElement());
+ output.flush();
+ output.close();
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (IOException ex)
+ {
+ throw new WSException(ex);
+ }
+ }
+}
Property changes on:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/RequestHandlerImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/ServiceEndpointServlet.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/ServiceEndpointServlet.java
(rev 0)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/ServiceEndpointServlet.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -0,0 +1,62 @@
+/*
+ * 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.servlet.ServletContext;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+
+/**
+ * A servlet that is installed for every web service endpoint.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 16-May-2006
+ */
+public class ServiceEndpointServlet extends AbstractServiceEndpointServlet
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(ServiceEndpointServlet.class);
+
+ /** Initialize the service endpoint
+ */
+ protected void initServiceEndpoint(String contextPath)
+ {
+ super.initServiceEndpoint(contextPath);
+
+ // 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)
+ {
+ EndpointMetaData epMetaData = endpoint.getMetaData(EndpointMetaData.class);
+ if (epMetaData == null)
+ throw new IllegalStateException("Cannot obtain endpoint meta
data");
+
+ log.debug("Updating service endpoint config\n config-name: " +
configName + "\n config-file: " + configFile);
+ epMetaData.setConfigName(configName, configFile);
+ }
+ }
+}
Property changes on:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/ServiceEndpointServlet.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
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
(rev 0)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/UnifiedDeploymentInfoDeployer.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -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 org.jboss.deployers.spi.deployer.DeploymentUnit;
+import org.jboss.ws.core.server.JAXWSDeployment;
+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.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;
+
+/**
+ * A deployer that builds the UnifiedDeploymentInfo
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 31-Oct-2005
+ */
+public class UnifiedDeploymentInfoDeployer extends AbstractDeployer
+{
+ @Override
+ public void create(Deployment dep)
+ {
+ UnifiedDeploymentInfo udi =
dep.getContext().getAttachment(UnifiedDeploymentInfo.class);
+ if (udi == null)
+ {
+ DeploymentUnit unit = dep.getContext().getAttachment(DeploymentUnit.class);
+ if (unit == null)
+ throw new IllegalStateException("Cannot obtain deployment unit");
+
+ DeploymentType type = dep.getType();
+ if (type == DeploymentType.JAXWS_JSE || type == DeploymentType.JAXWS_EJB3)
+ {
+ udi = new JAXWSDeployment(type);
+ DeploymentInfoAdaptor.buildDeploymentInfo(udi, unit);
+ }
+ else
+ {
+ WebservicesMetaData wsMetaData =
dep.getContext().getAttachment(WebservicesMetaData.class);
+ udi = new JAXRPCDeployment(type, wsMetaData);
+ DeploymentInfoAdaptor.buildDeploymentInfo(udi, unit);
+ }
+
+ dep.getContext().addAttachment(UnifiedDeploymentInfo.class, udi);
+ }
+ }
+}
\ No newline at end of file
Property changes on:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/UnifiedDeploymentInfoDeployer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/UnifiedMetaDataDeployer.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/UnifiedMetaDataDeployer.java
(rev 0)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/UnifiedMetaDataDeployer.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -0,0 +1,82 @@
+/*
+ * 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.core.server.UnifiedDeploymentInfo;
+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.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.UnifiedMetaData;
+
+/**
+ * A deployer that builds the UnifiedDeploymentInfo
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 31-Oct-2005
+ */
+public class UnifiedMetaDataDeployer extends AbstractDeployer
+{
+ @Override
+ public void create(Deployment dep)
+ {
+ UnifiedMetaData umd = dep.getContext().getAttachment(UnifiedMetaData.class);
+ if (umd == null)
+ {
+ UnifiedDeploymentInfo udi =
dep.getContext().getAttachment(UnifiedDeploymentInfo.class);
+ if (udi == null)
+ throw new IllegalStateException("Cannot obtain unified deployement
info");
+
+ if (udi.type == DeploymentType.JAXRPC_JSE)
+ {
+ JAXRPCServerMetaDataBuilder builder = new JAXRPCServerMetaDataBuilder();
+ umd = builder.buildMetaData((JAXRPCDeployment)udi);
+ }
+ else if (udi.type == DeploymentType.JAXRPC_EJB21)
+ {
+ JAXRPCServerMetaDataBuilder builder = new JAXRPCServerMetaDataBuilder();
+ umd = builder.buildMetaData((JAXRPCDeployment)udi);
+ }
+ else if (udi.type == DeploymentType.JAXWS_JSE)
+ {
+ JAXWSMetaDataBuilderJSE builder = new JAXWSMetaDataBuilderJSE();
+ umd = builder.buildMetaData(udi);
+ }
+ else if (udi.type == DeploymentType.JAXWS_EJB3)
+ {
+ JAXWSMetaDataBuilderEJB3 builder = new JAXWSMetaDataBuilderEJB3();
+ umd = builder.buildMetaData(udi);
+ }
+ else
+ {
+ throw new IllegalStateException("Invalid type: " + udi.type);
+ }
+
+ dep.getContext().addAttachment(UnifiedMetaData.class, umd);
+ }
+ }
+}
\ No newline at end of file
Property changes on:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/UnifiedMetaDataDeployer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/WSDLPublisherDeployer.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/WSDLPublisherDeployer.java
(rev 0)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/WSDLPublisherDeployer.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -0,0 +1,64 @@
+/*
+ * 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 org.jboss.ws.core.server.UnifiedDeploymentInfo;
+import org.jboss.ws.core.server.WSDLFilePublisher;
+import org.jboss.ws.integration.deployment.AbstractDeployer;
+import org.jboss.ws.integration.deployment.Deployment;
+import org.jboss.ws.integration.deployment.WSDeploymentException;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
+
+/**
+ * A deployer that publishes the wsdl
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 31-Oct-2005
+ */
+public class WSDLPublisherDeployer extends AbstractDeployer
+{
+ @Override
+ public void create(Deployment dep)
+ {
+ UnifiedDeploymentInfo udi =
dep.getContext().getAttachment(UnifiedDeploymentInfo.class);
+ if (udi == null)
+ throw new IllegalStateException("Cannot obtain unified deployement
info");
+
+ UnifiedMetaData umd = dep.getContext().getAttachment(UnifiedMetaData.class);
+ if (umd == null)
+ throw new IllegalStateException("Cannot obtain unified meta data");
+
+ try
+ {
+ WSDLFilePublisher publisher = new WSDLFilePublisher(udi);
+ publisher.publishWsdlFiles(umd);
+ }
+ catch (IOException ex)
+ {
+ throw new WSDeploymentException(ex);
+ }
+ }
+}
\ No newline at end of file
Property changes on:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/WSDLPublisherDeployer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/WebXMLRewritingDeployer.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/WebXMLRewritingDeployer.java
(rev 0)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/WebXMLRewritingDeployer.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -0,0 +1,257 @@
+/*
+ * 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.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.servlet.Servlet;
+
+import org.jboss.ws.WSException;
+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.core.utils.IOUtils;
+import org.jboss.ws.core.utils.JavaUtils;
+import org.jboss.ws.integration.deployment.AbstractDeployer;
+import org.jboss.ws.integration.deployment.Deployment;
+import org.w3c.dom.Element;
+
+/**
+ * A deployer that rewrites the web.xml
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 31-Oct-2005
+ */
+public class WebXMLRewritingDeployer extends AbstractDeployer
+{
+ // The default bean name
+ public static final Object BEAN_NAME = "WSWebXMLRewritingDeployer";
+ // The servlet init param in web.xml that is the service endpoint class
+ public static final String INIT_PARAM_WEBSERVICE_ENDPOINT_BEAN =
"webservice-endpoint-bean";
+
+ // The service endpoint servlet that is specific for the deployed stack
+ private String serviceEndpointServlet;
+
+ public String getServiceEndpointServlet()
+ {
+ return serviceEndpointServlet;
+ }
+
+ public void setServiceEndpointServlet(String servletName)
+ {
+ this.serviceEndpointServlet = servletName;
+ }
+
+ @Override
+ public void create(Deployment dep)
+ {
+ UnifiedDeploymentInfo udi =
dep.getContext().getAttachment(UnifiedDeploymentInfo.class);
+ if (udi == null)
+ throw new IllegalStateException("Cannot obtain unified deployement
info");
+
+ URL warURL = udi.webappURL;
+ if (warURL == null)
+ throw new IllegalStateException("Cannot obtain webapp URL");
+
+ File warFile = new File(warURL.getFile());
+ if (warFile.isDirectory() == false)
+ throw new WSException("Expected a war directory: " + warURL);
+
+ File webXML = new File(warURL.getFile() + "/WEB-INF/web.xml");
+ if (webXML.isFile() == false)
+ throw new WSException("Cannot find web.xml: " + webXML);
+
+ try
+ {
+ // After redeployment there might be a stale copy of the original
web.xml.org,
we delete it
+ File orgWebXML = new File(webXML.getCanonicalPath() + ".org");
+ orgWebXML.delete();
+
+ // Rename the web.xml
+ if (webXML.renameTo(orgWebXML) == false)
+ throw new WSException("Cannot rename web.xml: " + orgWebXML);
+
+ FileInputStream stream = new FileInputStream(orgWebXML);
+ rewriteWebXml(stream, webXML, udi.classLoader);
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception e)
+ {
+ throw new WSException(e);
+ }
+ }
+
+ public void rewriteWebXml(InputStream source, File dest, ClassLoader loader) throws
Exception
+ {
+ if (dest == null)
+ {
+ dest = File.createTempFile("jbossws-alt-web", "xml",
IOUtils.createTempDirectory());
+ dest.deleteOnExit();
+ }
+
+ Element root = DOMUtils.parse(source);
+ modifyServletConfig(root, loader);
+
+ FileOutputStream fos = new FileOutputStream(dest);
+ new DOMWriter(fos).setPrettyprint(true).print(root);
+ fos.flush();
+ fos.close();
+ }
+
+ private void modifyServletConfig(Element root, ClassLoader loader) throws
ClassNotFoundException
+ {
+ Iterator itServlets = DOMUtils.getChildElements(root, "servlet");
+ while (itServlets.hasNext())
+ {
+ Element servletElement = (Element)itServlets.next();
+ String linkName =
DOMUtils.getTextContent(DOMUtils.getFirstChildElement(servletElement,
"servlet-name"));
+
+ // find the servlet-class
+ Element classElement = DOMUtils.getFirstChildElement(servletElement,
"servlet-class");
+
+ // JSP
+ if (classElement == null)
+ continue;
+
+ String servletClassName = DOMUtils.getTextContent(classElement).trim();
+
+ // Get the servlet class
+ Class servletClass = null;
+ if (loader != null)
+ {
+ try
+ {
+ servletClass = loader.loadClass(servletClassName);
+ }
+ catch (ClassNotFoundException ex)
+ {
+ log.warn("Cannot load servlet class: " + servletClassName);
+ }
+ }
+
+ String targetBeanName = null;
+
+ // Nothing to do if we have an <init-param>
+ if (isAlreadyModified(servletElement))
+ {
+ Iterator itParams = DOMUtils.getChildElements(servletElement,
"init-param");
+ while (itParams.hasNext())
+ {
+ Element elParam = (Element)itParams.next();
+ Element elParamName = DOMUtils.getFirstChildElement(elParam,
"param-name");
+ Element elParamValue = DOMUtils.getFirstChildElement(elParam,
"param-value");
+ if
(INIT_PARAM_WEBSERVICE_ENDPOINT_BEAN.equals(DOMUtils.getTextContent(elParamName)))
+ {
+ targetBeanName = DOMUtils.getTextContent(elParamValue);
+ }
+ }
+ }
+ else
+ {
+ // Check if it is a real servlet that we can ignore
+ if (servletClass != null && JavaUtils.isAssignableFrom(Servlet.class,
servletClass))
+ {
+ log.info("Ignore servlet: " + servletClassName);
+ continue;
+ }
+ else if (servletClassName.endsWith("Servlet"))
+ {
+ log.info("Ignore <servlet-class> that ends with
'Servlet': " + servletClassName);
+ continue;
+ }
+
+ // build a list of detached elements that come after <servlet-class>
+ boolean startDetach = false;
+ List<Element> detachedElements = new ArrayList<Element>();
+ Iterator itDetached = DOMUtils.getChildElements(servletElement);
+ while (itDetached.hasNext())
+ {
+ Element el = (Element)itDetached.next();
+ if (startDetach == true)
+ {
+ detachedElements.add(el);
+ servletElement.removeChild(el);
+ }
+ if (el.equals(classElement))
+ {
+ servletElement.removeChild(el);
+ startDetach = true;
+ }
+ }
+
+ // replace the class name
+ classElement = (Element)DOMUtils.createElement("servlet-class");
+ classElement.appendChild(DOMUtils.createTextNode(serviceEndpointServlet));
+ classElement =
(Element)servletElement.getOwnerDocument().importNode(classElement, true);
+ servletElement.appendChild(classElement);
+
+ // add additional init params
+ if (servletClassName.equals(serviceEndpointServlet) == false)
+ {
+ Element paramElement = DOMUtils.createElement("init-param");
+
paramElement.appendChild(DOMUtils.createElement("param-name")).appendChild(DOMUtils.createTextNode(INIT_PARAM_WEBSERVICE_ENDPOINT_BEAN));
+
paramElement.appendChild(DOMUtils.createElement("param-value")).appendChild(DOMUtils.createTextNode(servletClassName));
+ paramElement =
(Element)servletElement.getOwnerDocument().importNode(paramElement, true);
+ servletElement.appendChild(paramElement);
+ targetBeanName = servletClassName;
+ }
+
+ // reattach the elements
+ itDetached = detachedElements.iterator();
+ while (itDetached.hasNext())
+ {
+ Element el = (Element)itDetached.next();
+ servletElement.appendChild(el);
+ }
+ }
+
+ if (targetBeanName == null)
+ throw new IllegalStateException("Cannot obtain service endpoint bean
for: " + linkName);
+ }
+ }
+
+ // Return true if the web.xml is already modified
+ private boolean isAlreadyModified(Element servletElement)
+ {
+ Iterator itParams = DOMUtils.getChildElements(servletElement,
"init-param");
+ while (itParams.hasNext())
+ {
+ Element elParam = (Element)itParams.next();
+ Element elParamName = DOMUtils.getFirstChildElement(elParam,
"param-name");
+ if
(INIT_PARAM_WEBSERVICE_ENDPOINT_BEAN.equals(DOMUtils.getTextContent(elParamName)))
+ return true;
+ }
+ return false;
+ }
+}
\ No newline at end of file
Property changes on:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/WebXMLRewritingDeployer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
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-24
12:52:42 UTC (rev 2915)
+++
trunk/integration-jboss50/src/resources/jbossws.deployer/META-INF/jbossws-deployer-beans.xml 2007-04-25
10:07:39 UTC (rev 2916)
@@ -44,7 +44,7 @@
<!--
A web service deployer that hooks in after the WAR/EJB deployer
-->
- <bean name="WebServiceStartStopDeployer"
class="org.jboss.ws.integration.jboss50.WebServiceStartStopDeployer">
+ <bean name="WebServiceLifecycleDeployer"
class="org.jboss.ws.integration.jboss50.WebServiceLifecycleDeployer">
<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-24
12:52:42 UTC (rev 2915)
+++
trunk/integration-jboss50/src/resources/jbossws.sar/META-INF/jbossws-beans.xml 2007-04-25
10:07:39 UTC (rev 2916)
@@ -7,6 +7,127 @@
<property name="kernel"><inject
bean="jboss.kernel:service=Kernel"/></property>
</bean>
+ <!--
+
*****************************************************************************************************************************
+ * Start of general purpose web service integration
+ -->
+
+ <!-- The registry for web service endpoints -->
+ <bean name="WSEndpointRegistry"
class="org.jboss.ws.integration.management.BasicEndpointRegistry"/>
+
+ <!-- The deployment manger registers the list of web service deployers -->
+ <bean name="WSDeploymentJSE"
class="org.jboss.ws.integration.deployment.BasicDeploymentManager">
+ <property name="deployers">
+ <list class="java.util.LinkedList"
elementClass="org.jboss.ws.integration.deployment.Deployer">
+ <inject bean="WSUnifiedDeploymentInfoDeployer"/>
+ <inject bean="WSUnifiedMetaDataDeployer"/>
+ <inject bean="WSAssignEndpointMetaDataDeployer"/>
+ <inject bean="WSAssignEndpointHandlersDeployer"/>
+ <inject bean="WSModifyWebMetaDataDeployer"/>
+ <inject bean="WSWSDLPublisherDeployer"/>
+ <inject bean="WSRegisteringDeployer"/>
+ </list>
+ </property>
+ </bean>
+ <bean name="WSDeploymentEJB"
class="org.jboss.ws.integration.deployment.BasicDeploymentManager">
+ <property name="deployers">
+ <list class="java.util.LinkedList"
elementClass="org.jboss.ws.integration.deployment.Deployer">
+ <inject bean="WSUnifiedDeploymentInfoDeployer"/>
+ <inject bean="WSUnifiedMetaDataDeployer"/>
+ <inject bean="WSAssignEndpointMetaDataDeployer"/>
+ <inject bean="WSAssignEndpointHandlersDeployer"/>
+ <inject bean="WSRegisteringDeployer"/>
+ </list>
+ </property>
+ </bean>
+ <bean name="WSLifecycleDeployment"
class="org.jboss.ws.integration.deployment.BasicDeploymentManager">
+ <property name="deployers">
+ <list class="java.util.LinkedList"
elementClass="org.jboss.ws.integration.deployment.Deployer">
+ <inject bean="WSClassLoaderInjectionDeployer"/>
+ <inject bean="WSEagerInitializeDeployer"/>
+ <inject bean="WSEndpointLifecycleDeployer"/>
+ </list>
+ </property>
+ </bean>
+
+ <!-- The deployers, each handles an aspect of web service deployment -->
+ <bean name="WSAssignEndpointHandlersDeployer"
class="org.jboss.ws.integration.jboss50.jbossws.AssignEndpointHandlersDeployer">
+ <property
name="requestHandler">org.jboss.ws.integration.jboss50.jbossws.RequestHandlerImpl</property>
+ <property
name="lifecycleHandler">org.jboss.ws.integration.jboss50.jbossws.LifecycleHandlerImpl</property>
+ <property name="invocationHandlers">
+ <map keyClass="java.lang.String"
valueClass="java.lang.String">
+
<entry><key>JAXRPC_JSE</key><value>org.jboss.ws.integration.jboss50.jbossws.InvocationHandlerJSE</value></entry>
+
<entry><key>JAXWS_JSE</key><value>org.jboss.ws.integration.jboss50.jbossws.InvocationHandlerJSE</value></entry>
+ </map>
+ </property>
+ </bean>
+ <bean name="WSAssignEndpointMetaDataDeployer"
class="org.jboss.ws.integration.jboss50.jbossws.AssignEndpointMetaDataDeployer"/>
+ <bean name="WSClassLoaderInjectionDeployer"
class="org.jboss.ws.integration.jboss50.jbossws.ClassLoaderInjectionDeployer"/>
+ <bean name="WSEagerInitializeDeployer"
class="org.jboss.ws.integration.jboss50.jbossws.EagerInitializeDeployer"/>
+ <bean name="WSEndpointLifecycleDeployer"
class="org.jboss.ws.integration.jboss50.jbossws.EndpointLifecycleDeployer"/>
+ <bean name="WSModifyWebMetaDataDeployer"
class="org.jboss.ws.integration.jboss50.jbossws.ModifyWebMetaDataDeployer"/>
+ <bean name="WSRegisteringDeployer"
class="org.jboss.ws.integration.deployment.RegisteringDeployer"/>
+ <bean name="WSUnifiedDeploymentInfoDeployer"
class="org.jboss.ws.integration.jboss50.jbossws.UnifiedDeploymentInfoDeployer"/>
+ <bean name="WSUnifiedMetaDataDeployer"
class="org.jboss.ws.integration.jboss50.jbossws.UnifiedMetaDataDeployer"/>
+ <bean name="WSValidatingDeployer"
class="org.jboss.ws.integration.deployment.ValidatingDeployer"/>
+ <bean name="WSWebXMLRewritingDeployer"
class="org.jboss.ws.integration.jboss50.jbossws.WebXMLRewritingDeployer">
+ <property
name="serviceEndpointServlet">org.jboss.ws.integration.jboss50.jbossws.ServiceEndpointServlet</property>
+ </bean>
+ <bean name="WSWSDLPublisherDeployer"
class="org.jboss.ws.integration.jboss50.jbossws.WSDLPublisherDeployer"/>
+
+ <!-- Register deployers with the Web Service JSE deployer
+ <bean name="WSDeployerHookJAXWSJSE"
class="org.jboss.ws.integration.jboss50.jbossws.DeployerHookJAXWSJSE">
+ <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="WSDeployerHookJAXRPCJSE"
class="org.jboss.ws.integration.jboss50.jbossws.DeployerHookJAXRPCJSE">
+ <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>
+ -->
+
+ <!-- Register deployers with the Web Service lifecycle deployer
+ <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>
+ -->
+
+ <!--
+
*****************************************************************************************************************************
+ * Start of legacy web service integration
+ -->
+
<bean name="ServiceEndpointManager"
class="org.jboss.ws.core.server.ServiceEndpointManager">
<!--
@@ -56,14 +177,13 @@
<bean name="ServerConfig"
class="org.jboss.ws.integration.jboss50.ServerConfigImpl"/>
- <!-- Register deployers with the Web Service EJB deployer -->
<bean name="JAXWSDeployerEJB3"
class="org.jboss.ws.integration.jboss50.JAXWSDeployerEJB3">
- <install bean="WebServiceDeployerEJB"
method="addDeployer">
+ <install bean="WebServiceDeployerEJB"
method="addDeployerHook">
<parameter>
<this/>
</parameter>
</install>
- <uninstall bean="WebServiceDeployerEJB"
method="removeDeployer">
+ <uninstall bean="WebServiceDeployerEJB"
method="removeDeployerHook">
<parameter>
<this/>
</parameter>
@@ -71,12 +191,12 @@
<depends>WebServiceDeployerEJB</depends>
</bean>
<bean name="JAXRPCDeployerEJB21"
class="org.jboss.ws.integration.jboss50.JAXRPCDeployerEJB21">
- <install bean="WebServiceDeployerEJB"
method="addDeployer">
+ <install bean="WebServiceDeployerEJB"
method="addDeployerHook">
<parameter>
<this/>
</parameter>
</install>
- <uninstall bean="WebServiceDeployerEJB"
method="removeDeployer">
+ <uninstall bean="WebServiceDeployerEJB"
method="removeDeployerHook">
<parameter>
<this/>
</parameter>
@@ -84,14 +204,13 @@
<depends>WebServiceDeployerEJB</depends>
</bean>
- <!-- Register deployers with the Web Service JSE deployer -->
<bean name="JAXWSDeployerJSE"
class="org.jboss.ws.integration.jboss50.JAXWSDeployerJSE">
- <install bean="WebServiceDeployerJSE"
method="addDeployer">
+ <install bean="WebServiceDeployerJSE"
method="addDeployerHook">
<parameter>
<this/>
</parameter>
</install>
- <uninstall bean="WebServiceDeployerJSE"
method="removeDeployer">
+ <uninstall bean="WebServiceDeployerJSE"
method="removeDeployerHook">
<parameter>
<this/>
</parameter>
@@ -99,12 +218,12 @@
<depends>WebServiceDeployerJSE</depends>
</bean>
<bean name="JAXRPCDeployerJSE"
class="org.jboss.ws.integration.jboss50.JAXRPCDeployerJSE">
- <install bean="WebServiceDeployerJSE"
method="addDeployer">
+ <install bean="WebServiceDeployerJSE"
method="addDeployerHook">
<parameter>
<this/>
</parameter>
</install>
- <uninstall bean="WebServiceDeployerJSE"
method="removeDeployer">
+ <uninstall bean="WebServiceDeployerJSE"
method="removeDeployerHook">
<parameter>
<this/>
</parameter>
@@ -112,19 +231,18 @@
<depends>WebServiceDeployerJSE</depends>
</bean>
- <!-- Register deployers with the Web Service Start/Stop deployer -->
<bean name="ServiceEndpointLifecycleDeployer"
class="org.jboss.ws.integration.jboss50.ServiceEndpointLifecycleDeployer">
- <install bean="WebServiceStartStopDeployer"
method="addDeployer">
+ <install bean="WebServiceLifecycleDeployer"
method="addDeployerHook">
<parameter>
<this/>
</parameter>
</install>
- <uninstall bean="WebServiceStartStopDeployer"
method="removeDeployer">
+ <uninstall bean="WebServiceLifecycleDeployer"
method="removeDeployerHook">
<parameter>
<this/>
</parameter>
</uninstall>
- <depends>WebServiceStartStopDeployer</depends>
+ <depends>WebServiceLifecycleDeployer</depends>
</bean>
</deployment>
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-24
12:52:42 UTC (rev 2915)
+++
trunk/integration-tomcat/src/java/org/jboss/ws/integration/tomcat/TomcatServiceEndpointServlet.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -44,6 +44,7 @@
import org.jboss.ws.integration.KernelLocator;
import org.jboss.ws.integration.ResourceLoaderAdapter;
import org.jboss.ws.integration.UnifiedVirtualFile;
+import org.jboss.ws.integration.deployment.Deployment.DeploymentType;
import org.jboss.ws.metadata.builder.jaxrpc.JAXRPCDeployment;
/**
@@ -165,11 +166,11 @@
UnifiedVirtualFile vfsWebservices = getWebservicesFile(ctxLoader);
if (vfsWebservices != null)
{
- udi = new JAXRPCDeployment(UnifiedDeploymentInfo.DeploymentType.JAXRPC_JSE,
vfsWebservices);
+ udi = new JAXRPCDeployment(DeploymentType.JAXRPC_JSE, vfsWebservices);
}
else
{
- udi = new JAXWSDeployment(UnifiedDeploymentInfo.DeploymentType.JAXWS_JSE);
+ udi = new JAXWSDeployment(DeploymentType.JAXWS_JSE);
}
DeploymentInfoAdaptor.buildDeploymentInfo(udi, ctxLoader, servletContext);
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/ServletEndpointContextImpl.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/ServletEndpointContextImpl.java 2007-04-24
12:52:42 UTC (rev 2915)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/ServletEndpointContextImpl.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -32,7 +32,7 @@
import javax.xml.rpc.handler.MessageContext;
import javax.xml.rpc.server.ServletEndpointContext;
-import org.jboss.ws.core.server.EndpointContext;
+import org.jboss.ws.core.server.ServletRequestContext;
import org.jboss.ws.core.soap.MessageContextAssociation;
/**
@@ -46,7 +46,7 @@
private HttpServletRequest request;
private HttpServletResponse response;
- public ServletEndpointContextImpl(EndpointContext context)
+ public ServletEndpointContextImpl(ServletRequestContext context)
{
this.context = context.getServletContext();
this.request = context.getHttpServletRequest();
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/handler/HandlerDelegateJAXRPC.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/handler/HandlerDelegateJAXRPC.java 2007-04-24
12:52:42 UTC (rev 2915)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/handler/HandlerDelegateJAXRPC.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -76,7 +76,7 @@
/**
* For JAXRPC PRE/POST are defined in the context of message origin.
*/
- protected HandlerType[] getHandlerTypeOrder()
+ public HandlerType[] getHandlerTypeOrder()
{
return new HandlerType[] { HandlerType.PRE, HandlerType.ENDPOINT, HandlerType.POST
};
}
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java 2007-04-24
12:52:42 UTC (rev 2915)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -64,7 +64,7 @@
/**
* For JAXWS PRE/POST are defined in the context of an outbound message
*/
- protected HandlerType[] getHandlerTypeOrder()
+ public HandlerType[] getHandlerTypeOrder()
{
return new HandlerType[] { HandlerType.POST, HandlerType.ENDPOINT, HandlerType.PRE
};
}
Modified:
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-24
12:52:42 UTC (rev 2915)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointServlet.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -37,7 +37,7 @@
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
-import org.jboss.ws.core.utils.ObjectNameFactory;
+import org.jboss.ws.integration.ObjectNameFactory;
import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
/**
@@ -110,7 +110,7 @@
try
{
- EndpointContext context = new EndpointContext(getServletContext(), req, res);
+ ServletRequestContext context = new ServletRequestContext(getServletContext(),
req, res);
epManager.processRequest(sepId, req.getInputStream(), res.getOutputStream(),
context);
}
catch (Exception ex)
Deleted: trunk/jbossws-core/src/java/org/jboss/ws/core/server/EndpointContext.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/server/EndpointContext.java 2007-04-24
12:52:42 UTC (rev 2915)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/server/EndpointContext.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -1,76 +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.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-import javax.xml.rpc.handler.MessageContext;
-
-import org.jboss.ws.core.soap.MessageContextAssociation;
-
-/**
- * Implementation of ServletEndpointContext
- *
- * @author Thomas.Diesler(a)jboss.org
- */
-public class EndpointContext
-{
- private ServletContext context;
- private HttpServletRequest request;
- private HttpServletResponse response;
-
- public EndpointContext(ServletContext context, HttpServletRequest request,
HttpServletResponse response)
- {
- this.context = context;
- this.request = request;
- this.response = response;
- }
-
- public HttpSession getHttpSession()
- {
- return request.getSession(true);
- }
-
- public MessageContext getMessageContext()
- {
- return (MessageContext)MessageContextAssociation.peekMessageContext();
- }
-
- public ServletContext getServletContext()
- {
- return context;
- }
-
- public HttpServletRequest getHttpServletRequest()
- {
- return request;
- }
-
- public HttpServletResponse getHttpServletResponse()
- {
- return response;
- }
-}
\ No newline at end of file
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/server/JAXWSDeployment.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/server/JAXWSDeployment.java 2007-04-24
12:52:42 UTC (rev 2915)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/server/JAXWSDeployment.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -21,10 +21,10 @@
*/
package org.jboss.ws.core.server;
+//$Id$
+import org.jboss.ws.integration.deployment.Deployment.DeploymentType;
-// $Id$
-
/**
* The container independent deployment info.
*
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServerHandlerDelegate.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServerHandlerDelegate.java 2007-04-24
12:52:42 UTC (rev 2915)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServerHandlerDelegate.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -42,7 +42,7 @@
}
// Get the order of pre/post handlerchains
- protected abstract HandlerType[] getHandlerTypeOrder();
+ public abstract HandlerType[] getHandlerTypeOrder();
public abstract boolean callRequestHandlerChain(ServerEndpointMetaData sepMetaData,
HandlerType type);
Modified: 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-24
12:52:42 UTC (rev 2915)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpoint.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -159,7 +159,7 @@
/**
* Handle a request to this web service endpoint
*/
- public MessageAbstraction processRequest(MimeHeaderSource headerSource,
EndpointContext context, InputStream inputStream) throws BindingException
+ public MessageAbstraction processRequest(MimeHeaderSource headerSource,
ServletRequestContext context, InputStream inputStream) throws BindingException
{
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
ServerEndpointMetaData sepMetaData = seInfo.getServerEndpointMetaData();
Modified:
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-24
12:52:42 UTC (rev 2915)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointDeployer.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -28,6 +28,7 @@
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;
@@ -71,22 +72,22 @@
try
{
UnifiedMetaData wsMetaData;
- if (udi.type == UnifiedDeploymentInfo.DeploymentType.JAXRPC_JSE)
+ if (udi.type == DeploymentType.JAXRPC_JSE)
{
JAXRPCServerMetaDataBuilder builder = new JAXRPCServerMetaDataBuilder();
wsMetaData = builder.buildMetaData((JAXRPCDeployment)udi);
}
- else if (udi.type == UnifiedDeploymentInfo.DeploymentType.JAXRPC_EJB21)
+ else if (udi.type == DeploymentType.JAXRPC_EJB21)
{
JAXRPCServerMetaDataBuilder builder = new JAXRPCServerMetaDataBuilder();
wsMetaData = builder.buildMetaData((JAXRPCDeployment)udi);
}
- else if (udi.type == UnifiedDeploymentInfo.DeploymentType.JAXWS_JSE)
+ else if (udi.type == DeploymentType.JAXWS_JSE)
{
JAXWSMetaDataBuilderJSE builder = new JAXWSMetaDataBuilderJSE();
wsMetaData = builder.buildMetaData(udi);
}
- else if (udi.type == UnifiedDeploymentInfo.DeploymentType.JAXWS_EJB3)
+ else if (udi.type == DeploymentType.JAXWS_EJB3)
{
JAXWSMetaDataBuilderEJB3 builder = new JAXWSMetaDataBuilderEJB3();
wsMetaData = builder.buildMetaData(udi);
Modified: 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-24
12:52:42 UTC (rev 2915)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointInfo.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -26,7 +26,7 @@
import javax.management.ObjectName;
import org.jboss.ws.WSException;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo.DeploymentType;
+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;
Modified:
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-24
12:52:42 UTC (rev 2915)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointInvokerJSE.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -72,7 +72,7 @@
try
{
ServiceLifecycle serviceLifecycle = ((ServiceLifecycle)seiImpl);
- ServletEndpointContext servletEndpointContext = new
ServletEndpointContextImpl((EndpointContext)context);
+ ServletEndpointContext servletEndpointContext = new
ServletEndpointContextImpl((ServletRequestContext)context);
serviceLifecycle.init(servletEndpointContext);
}
catch (ServiceException ex)
Modified:
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-24
12:52:42 UTC (rev 2915)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManager.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -398,10 +398,8 @@
wsEndpoint.handleWSDLRequest(outStream, requestURL, resourcePath);
}
- public void processRequest(ObjectName sepID, InputStream inStream, OutputStream
outStream, EndpointContext context) throws Exception
+ public void processRequest(ObjectName sepID, InputStream inStream, OutputStream
outStream, ServletRequestContext context) throws Exception
{
- final String SESSION_COOKIES = "org.jboss.ws.cookies";
-
ServiceEndpoint wsEndpoint = getServiceEndpointByID(sepID);
if (wsEndpoint == null)
throw new WSException("Cannot obtain endpoint for: " + sepID);
@@ -719,9 +717,9 @@
public static class HttpSessionPropertyCallback implements PropertyCallback
{
- private EndpointContext context;
+ private ServletRequestContext context;
- public HttpSessionPropertyCallback(final EndpointContext context)
+ public HttpSessionPropertyCallback(final ServletRequestContext context)
{
this.context = context;
}
Modified:
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-24
12:52:42 UTC (rev 2915)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManagerMBean.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -26,7 +26,7 @@
import javax.management.ObjectName;
-import org.jboss.ws.core.utils.ObjectNameFactory;
+import org.jboss.ws.integration.ObjectNameFactory;
import org.jboss.ws.metadata.umdm.HandlerMetaData;
/**
Copied: trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServletRequestContext.java
(from rev 2913,
trunk/jbossws-core/src/java/org/jboss/ws/core/server/EndpointContext.java)
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServletRequestContext.java
(rev 0)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServletRequestContext.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -0,0 +1,76 @@
+/*
+ * 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.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+import javax.xml.rpc.handler.MessageContext;
+
+import org.jboss.ws.core.soap.MessageContextAssociation;
+
+/**
+ * Implementation of ServletEndpointContext
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ */
+public class ServletRequestContext
+{
+ private ServletContext context;
+ private HttpServletRequest request;
+ private HttpServletResponse response;
+
+ public ServletRequestContext(ServletContext context, HttpServletRequest request,
HttpServletResponse response)
+ {
+ this.context = context;
+ this.request = request;
+ this.response = response;
+ }
+
+ public HttpSession getHttpSession()
+ {
+ return request.getSession(true);
+ }
+
+ public MessageContext getMessageContext()
+ {
+ return (MessageContext)MessageContextAssociation.peekMessageContext();
+ }
+
+ public ServletContext getServletContext()
+ {
+ return context;
+ }
+
+ public HttpServletRequest getHttpServletRequest()
+ {
+ return request;
+ }
+
+ public HttpServletResponse getHttpServletResponse()
+ {
+ return response;
+ }
+}
\ No newline at end of file
Modified: 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-24
12:52:42 UTC (rev 2915)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/server/UnifiedDeploymentInfo.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -32,6 +32,7 @@
import javax.management.ObjectName;
import org.jboss.ws.integration.UnifiedVirtualFile;
+import org.jboss.ws.integration.deployment.Deployment.DeploymentType;
/**
* The container independent deployment info.
@@ -41,11 +42,6 @@
*/
public class UnifiedDeploymentInfo
{
- public enum DeploymentType
- {
- JAXRPC_Client, JAXRPC_JSE, JAXRPC_EJB21, JAXRPC_EJB3, JAXWS_JSE, JAXWS_EJB3
- };
-
public UnifiedDeploymentInfo(DeploymentType type)
{
this.type = type;
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-24
12:52:42 UTC (rev 2915)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/server/WSDLFilePublisher.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -42,7 +42,6 @@
import org.jboss.util.NotImplementedException;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo.DeploymentType;
import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.core.utils.IOUtils;
import org.jboss.ws.core.utils.ResourceURL;
@@ -72,9 +71,14 @@
{
this.udi = udi;
- if (udi.type == DeploymentType.JAXRPC_JSE || udi.type == DeploymentType.JAXWS_JSE)
+ if (udi.type.toString().endsWith("_JSE"))
+ {
expLocation = "WEB-INF/wsdl/";
- else expLocation = "META-INF/wsdl/";
+ }
+ else
+ {
+ expLocation = "META-INF/wsdl/";
+ }
}
/** Publish the deployed wsdl file to the data directory
@@ -101,7 +105,7 @@
// udpate the wsdl file location
serviceMetaData.setWsdlLocation(wsdlFile.toURL());
-
+
// Process the wsdl imports
Definition wsdl11Definition = wsdlDefinitions.getWsdlOneOneDefinition();
if (wsdl11Definition != null)
@@ -155,7 +159,8 @@
wsdlWriter.writeWSDL(subdef, fw);
fw.close();
- if(log.isDebugEnabled()) log.debug("WSDL import published to: "
+ targetURL);
+ if (log.isDebugEnabled())
+ log.debug("WSDL import published to: " + targetURL);
// recursivly publish imports
publishWsdlImports(targetURL, subdef);
@@ -209,7 +214,8 @@
fos.close();
is.close();
- if(log.isDebugEnabled()) log.debug("XMLSchema import published to:
" + xsdURL);
+ if (log.isDebugEnabled())
+ log.debug("XMLSchema import published to: " + xsdURL);
// recursivly publish imports
Element subdoc = DOMUtils.parse(xsdURL.openStream());
@@ -274,8 +280,9 @@
if (wsdlLocation == null)
throw new IllegalStateException("Cannot obtain wsdl location for: " +
serviceMetaData.getServiceName());
- if(log.isDebugEnabled()) log.debug("Publish WSDL file: " +
wsdlLocation);
-
+ if (log.isDebugEnabled())
+ log.debug("Publish WSDL file: " + wsdlLocation);
+
// Only file URLs are supported in <wsdl-publish-location>
String publishLocation = serviceMetaData.getWsdlPublishLocation();
boolean predefinedLocation = publishLocation != null &&
publishLocation.startsWith("file:");
@@ -313,7 +320,7 @@
{
throw new WSException("Invalid wsdlFile '" + wsdlLocation +
"', expected in: " + expLocation);
}
-
+
return wsdlFile;
}
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/server/WSDLRequestHandler.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/server/WSDLRequestHandler.java 2007-04-24
12:52:42 UTC (rev 2915)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/server/WSDLRequestHandler.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -74,6 +74,8 @@
// The WSDLFilePublisher should set the location to an URL
URL wsdlLocation = epMetaData.getServiceMetaData().getWsdlLocation();
+ if (wsdlLocation == null)
+ throw new IllegalStateException("Cannot obtain wsdl location");
// get the root wsdl
if (resPath == null)
Deleted: trunk/jbossws-core/src/java/org/jboss/ws/core/utils/ObjectNameFactory.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/utils/ObjectNameFactory.java 2007-04-24
12:52:42 UTC (rev 2915)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/utils/ObjectNameFactory.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -1,72 +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.utils;
-
-import java.util.Hashtable;
-
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
-
-/**
- * A simple factory for creating safe object names.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 08-May-2006
- */
-public class ObjectNameFactory
-{
- public static ObjectName create(String name)
- {
- try
- {
- return new ObjectName(name);
- }
- catch (MalformedObjectNameException e)
- {
- throw new Error("Invalid ObjectName: " + name + "; " + e);
- }
- }
-
- public static ObjectName create(String domain, String key, String value)
- {
- try
- {
- return new ObjectName(domain, key, value);
- }
- catch (MalformedObjectNameException e)
- {
- throw new Error("Invalid ObjectName: " + domain + "," + key
+ "," + value + "; " + e);
- }
- }
-
- public static ObjectName create(String domain, Hashtable table)
- {
- try
- {
- return new ObjectName(domain, table);
- }
- catch (MalformedObjectNameException e)
- {
- throw new Error("Invalid ObjectName: " + domain + "," +
table + "; " + e);
- }
- }
-}
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionManager.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionManager.java 2007-04-24
12:52:42 UTC (rev 2915)
+++
trunk/jbossws-core/src/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionManager.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -55,13 +55,13 @@
import org.jboss.ws.WSException;
import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.core.utils.DOMWriter;
-import org.jboss.ws.core.utils.ObjectNameFactory;
import org.jboss.ws.core.utils.UUIDGenerator;
import org.jboss.ws.extensions.eventing.EventingConstants;
import org.jboss.ws.extensions.eventing.deployment.EventingEndpointDI;
import org.jboss.ws.extensions.eventing.jaxws.AttributedURIType;
import org.jboss.ws.extensions.eventing.jaxws.EndpointReferenceType;
import org.jboss.ws.extensions.eventing.jaxws.ReferenceParametersType;
+import org.jboss.ws.integration.ObjectNameFactory;
import org.w3c.dom.Element;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
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-24
12:52:42 UTC (rev 2915)
+++
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -50,7 +50,7 @@
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.utils.ObjectNameFactory;
+import org.jboss.ws.integration.ObjectNameFactory;
import org.jboss.ws.extensions.addressing.AddressingPropertiesImpl;
import org.jboss.ws.extensions.addressing.metadata.AddressingOpMetaExt;
import org.jboss.ws.extensions.eventing.EventingConstants;
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientDeployment.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientDeployment.java 2007-04-24
12:52:42 UTC (rev 2915)
+++
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientDeployment.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -21,11 +21,11 @@
*/
package org.jboss.ws.metadata.builder.jaxrpc;
+//$Id$
+
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+import org.jboss.ws.integration.deployment.Deployment.DeploymentType;
-
-// $Id$
-
/**
* The container independent deployment info.
*
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCDeployment.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCDeployment.java 2007-04-24
12:52:42 UTC (rev 2915)
+++
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCDeployment.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -27,6 +27,7 @@
import org.jboss.ws.WSException;
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
import org.jboss.ws.integration.UnifiedVirtualFile;
+import org.jboss.ws.integration.deployment.Deployment.DeploymentType;
import org.jboss.ws.metadata.webservices.WebservicesFactory;
import org.jboss.ws.metadata.webservices.WebservicesMetaData;
import org.jboss.xb.binding.ObjectModelFactory;
@@ -43,8 +44,14 @@
*/
public class JAXRPCDeployment extends UnifiedDeploymentInfo
{
- private WebservicesMetaData jsr109MetaData;
+ private WebservicesMetaData wsMetaData;
+ public JAXRPCDeployment(DeploymentType type, WebservicesMetaData wsMetaData)
+ {
+ super(type);
+ this.wsMetaData = wsMetaData;
+ }
+
public JAXRPCDeployment(DeploymentType type, UnifiedVirtualFile vfWebservices)
{
super(type);
@@ -58,7 +65,7 @@
{
Unmarshaller unmarshaller =
UnmarshallerFactory.newInstance().newUnmarshaller();
ObjectModelFactory factory = new WebservicesFactory(webservicesURL);
- jsr109MetaData = (WebservicesMetaData)unmarshaller.unmarshal(is, factory,
null);
+ wsMetaData = (WebservicesMetaData)unmarshaller.unmarshal(is, factory, null);
}
finally
{
@@ -73,6 +80,6 @@
public WebservicesMetaData getWebservicesMetaData()
{
- return jsr109MetaData;
+ return wsMetaData;
}
}
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java 2007-04-24
12:52:42 UTC (rev 2915)
+++
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -29,7 +29,7 @@
import org.jboss.ws.annotation.EndpointConfig;
import org.jboss.ws.annotation.WebContext;
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo.DeploymentType;
+import org.jboss.ws.integration.deployment.Deployment.DeploymentType;
import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
import org.jboss.ws.metadata.umdm.UnifiedMetaData;
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/metadata/webservices/WebservicesMetaData.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/metadata/webservices/WebservicesMetaData.java 2007-04-24
12:52:42 UTC (rev 2915)
+++
trunk/jbossws-core/src/java/org/jboss/ws/metadata/webservices/WebservicesMetaData.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -24,7 +24,6 @@
import java.net.URL;
import java.util.ArrayList;
-import java.util.Map;
import org.jboss.ws.Constants;
@@ -95,24 +94,4 @@
buf.append("
xsi:schemaLocation='http://java.sun.com/xml/ns/j2ee
http://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd'");
buf.append(" version='1.1'>");
}
-
- private String createAlternatePrefix(String prefix, Map<String, String>
namespaces)
- {
- // allocate working buffer
- StringBuilder altPrefixBuilder = new StringBuilder(prefix);
- // remember original length
- int baseLength = prefix.length();
-
- for (int i = 2; i < Integer.MAX_VALUE; i++)
- {
- // append a natural number to the original prefix
- String altPrefix = altPrefixBuilder.append(i).toString();
- // if the alternate prefix does not match an existing one, we're done
- if (!namespaces.containsKey(altPrefix))
- return altPrefix;
- // truncate buffer to original length
- altPrefixBuilder.setLength(baseLength);
- }
- throw new IllegalArgumentException("could not create alternate prefix from:
" + prefix);
- }
}
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/tools/jaxws/impl/WSContractProviderImpl.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/tools/jaxws/impl/WSContractProviderImpl.java 2007-04-24
12:52:42 UTC (rev 2915)
+++
trunk/jbossws-core/src/java/org/jboss/ws/tools/jaxws/impl/WSContractProviderImpl.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -21,9 +21,6 @@
*/
package org.jboss.ws.tools.jaxws.impl;
-import static org.jboss.ws.core.server.UnifiedDeploymentInfo.DeploymentType.JAXWS_EJB3;
-import static org.jboss.ws.core.server.UnifiedDeploymentInfo.DeploymentType.JAXWS_JSE;
-
import java.io.File;
import java.io.IOException;
import java.io.PrintStream;
@@ -34,8 +31,8 @@
import org.jboss.ws.WSException;
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo.DeploymentType;
import org.jboss.ws.integration.ResourceLoaderAdapter;
+import org.jboss.ws.integration.deployment.Deployment.DeploymentType;
import org.jboss.ws.metadata.builder.jaxws.JAXWSWebServiceMetaDataBuilder;
import org.jboss.ws.metadata.umdm.UnifiedMetaData;
import org.jboss.ws.tools.jaxws.api.WSContractProvider;
@@ -72,7 +69,7 @@
private UnifiedDeploymentInfo createUDI(Class<?> endpointClass, ClassLoader
loader)
{
- DeploymentType type = (endpointClass.isAnnotationPresent(Stateless.class)) ?
JAXWS_EJB3 : JAXWS_JSE;
+ DeploymentType type = (endpointClass.isAnnotationPresent(Stateless.class)) ?
DeploymentType.JAXWS_EJB3 : DeploymentType.JAXWS_JSE;
UnifiedDeploymentInfo udi = new UnifiedDeploymentInfo(type)
{
@Override
Modified: trunk/jbossws-tests/src/java/org/jboss/test/ws/JBossWSTestHelper.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/JBossWSTestHelper.java 2007-04-24
12:52:42 UTC (rev 2915)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/JBossWSTestHelper.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -31,7 +31,7 @@
import javax.naming.NamingException;
import org.jboss.logging.Logger;
-import org.jboss.ws.core.utils.ObjectNameFactory;
+import org.jboss.ws.integration.ObjectNameFactory;
/**
* A JBossWS test helper that deals with test deployment/undeployment, etc.
Modified:
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1115/JBWS1115TestCase.java
===================================================================
---
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1115/JBWS1115TestCase.java 2007-04-24
12:52:42 UTC (rev 2915)
+++
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1115/JBWS1115TestCase.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -26,7 +26,7 @@
import javax.management.ObjectName;
import org.jboss.test.ws.JBossWSTest;
-import org.jboss.ws.core.utils.ObjectNameFactory;
+import org.jboss.ws.integration.ObjectNameFactory;
/**
* Auto discover HTTP(S) port configuration from Tomcat
Modified:
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/samples/dynamichandler/DynamicHandlerTestCase.java
===================================================================
---
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/samples/dynamichandler/DynamicHandlerTestCase.java 2007-04-24
12:52:42 UTC (rev 2915)
+++
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/samples/dynamichandler/DynamicHandlerTestCase.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -36,7 +36,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.core.jaxrpc.client.ServiceExt;
-import org.jboss.ws.core.utils.ObjectNameFactory;
+import org.jboss.ws.integration.ObjectNameFactory;
import org.jboss.ws.metadata.umdm.HandlerMetaData;
/**
Modified:
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/samples/wsbpel/JbpmBpelTestSetup.java
===================================================================
---
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/samples/wsbpel/JbpmBpelTestSetup.java 2007-04-24
12:52:42 UTC (rev 2915)
+++
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/samples/wsbpel/JbpmBpelTestSetup.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -28,7 +28,7 @@
import org.jboss.logging.Logger;
import org.jboss.test.ws.JBossWSTestHelper;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.core.utils.ObjectNameFactory;
+import org.jboss.ws.integration.ObjectNameFactory;
/**
* A test setup that deploys process archives.
Modified:
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/jaxr/scout/JaxrBaseTest.java
===================================================================
---
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/jaxr/scout/JaxrBaseTest.java 2007-04-24
12:52:42 UTC (rev 2915)
+++
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/jaxr/scout/JaxrBaseTest.java 2007-04-25
10:07:39 UTC (rev 2916)
@@ -57,7 +57,7 @@
import javax.xml.registry.infomodel.User;
import org.jboss.test.ws.JBossWSTest;
-import org.jboss.ws.core.utils.ObjectNameFactory;
+import org.jboss.ws.integration.ObjectNameFactory;
/**
* Acts as the base class for Jaxr Test Cases