[jbossws-commits] JBossWS SVN: r8419 - in stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276: src/main/java/org/jboss/ws/core/jaxws/client and 10 other directories.

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Thu Oct 9 11:21:20 EDT 2008


Author: darran.lofthouse at jboss.com
Date: 2008-10-09 11:21:19 -0400 (Thu, 09 Oct 2008)
New Revision: 8419

Added:
   stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/main/java/org/jboss/ws/metadata/umdm/EndpointConfigMetaData.java
   stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/java/org/jboss/test/ws/jaxws/jbws2187/
   stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/java/org/jboss/test/ws/jaxws/jbws2187/JBWS2187TestCase.java
   stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/java/org/jboss/test/ws/jaxws/jbws2187/TestEndpoint.java
   stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/java/org/jboss/test/ws/jaxws/jbws2187/TestEndpointImpl.java
   stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/java/org/jboss/test/ws/jaxws/jbws2187/TestHandler.java
   stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/resources/jaxws/jbws2187/
   stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/resources/jaxws/jbws2187/META-INF/
   stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/resources/jaxws/jbws2187/META-INF/jbws2187-client-config.xml
   stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/resources/jaxws/jbws2187/WEB-INF/
   stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/resources/jaxws/jbws2187/WEB-INF/jboss-web.xml
   stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/resources/jaxws/jbws2187/WEB-INF/web.xml
Removed:
   stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/java/org/jboss/test/ws/jaxws/jbws2187/JBWS2187TestCase.java
   stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/java/org/jboss/test/ws/jaxws/jbws2187/TestEndpoint.java
   stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/java/org/jboss/test/ws/jaxws/jbws2187/TestEndpointImpl.java
   stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/java/org/jboss/test/ws/jaxws/jbws2187/TestHandler.java
   stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/resources/jaxws/jbws2187/META-INF/
   stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/resources/jaxws/jbws2187/META-INF/jbws2187-client-config.xml
   stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/resources/jaxws/jbws2187/WEB-INF/
   stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/resources/jaxws/jbws2187/WEB-INF/jboss-web.xml
   stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/resources/jaxws/jbws2187/WEB-INF/web.xml
Modified:
   stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/ant-import-tests/build-jars-jaxws.xml
   stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java
   stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java
   stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerResolverImpl.java
   stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/main/java/org/jboss/ws/extensions/policy/deployer/domainAssertion/WSSecurityAssertionDeployer.java
   stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/main/java/org/jboss/ws/metadata/umdm/ClientEndpointMetaData.java
   stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
   stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java
   stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/main/java/org/jboss/ws/tools/metadata/ToolsEndpointMetaData.java
Log:
[JBPAPP-1276] Handler Chain Management Prevents Service Re-Use.

Modified: stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/ant-import-tests/build-jars-jaxws.xml
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/ant-import-tests/build-jars-jaxws.xml	2008-10-09 15:18:05 UTC (rev 8418)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/ant-import-tests/build-jars-jaxws.xml	2008-10-09 15:21:19 UTC (rev 8419)
@@ -323,7 +323,18 @@
         <include name="org/jboss/test/ws/jaxws/jbws1422/*.*"/>
       </fileset>
     </jar>
-    
+
+    <!-- jaxws-jbws2187 -->
+    <war warfile="${tests.output.dir}/libs/jaxws-jbws2187.war" webxml="${tests.output.dir}/resources/jaxws/jbws2187/WEB-INF/web.xml">
+      <classes dir="${tests.output.dir}/classes">
+        <include name="org/jboss/test/ws/jaxws/jbws2187/TestEndpoint.class"/>
+        <include name="org/jboss/test/ws/jaxws/jbws2187/TestEndpointImpl.class"/>
+      </classes>
+      <webinf dir="${tests.output.dir}/resources/jaxws/jbws2187/WEB-INF">
+        <include name="jboss-web.xml"/>
+      </webinf>
+    </war>
+      	
     <!-- jaxws-jbws1505 -->
     <jar destfile="${tests.output.dir}/libs/jaxws-jbws1505.jar">
       <fileset dir="${tests.output.dir}/classes">

Modified: stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java	2008-10-09 15:18:05 UTC (rev 8418)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java	2008-10-09 15:21:19 UTC (rev 8419)
@@ -28,7 +28,6 @@
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
-import java.util.Observable;
 import java.util.Set;
 
 import javax.activation.DataHandler;
@@ -47,7 +46,6 @@
 import javax.xml.ws.soap.SOAPBinding;
 import javax.xml.ws.soap.SOAPFaultException;
 
-import org.jboss.logging.Logger;
 import org.jboss.remoting.transport.http.HTTPMetadataConstants;
 import org.jboss.util.NotImplementedException;
 import org.jboss.ws.core.CommonBindingProvider;
@@ -61,8 +59,8 @@
 import org.jboss.ws.core.jaxws.handler.PortInfoImpl;
 import org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS;
 import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.ws.metadata.config.Configurable;
-import org.jboss.ws.metadata.config.ConfigurationProvider;
+import org.jboss.ws.metadata.umdm.ClientEndpointMetaData;
+import org.jboss.ws.metadata.umdm.EndpointConfigMetaData;
 import org.jboss.ws.metadata.umdm.EndpointMetaData;
 import org.jboss.ws.metadata.umdm.OperationMetaData;
 import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData.HandlerType;
@@ -73,35 +71,39 @@
  * @author Thomas.Diesler at jboss.org
  * @since 04-Jul-2006
  */
-public class ClientImpl extends CommonClient implements BindingProvider, Configurable
+
+public class ClientImpl extends CommonClient implements BindingProvider
 {
-   // provide logging
-   private static Logger log = Logger.getLogger(ClientImpl.class);
 
-	// the associated endpoint meta data
-	private final EndpointMetaData epMetaData;
+   // the associated endpoint meta data
+   private final EndpointMetaData epMetaData;
+   private EndpointConfigMetaData epConfigMetaData;
 
-	// Keep a handle on the resolver so that updateConfig calls may revisit the associated chains
-	private final HandlerResolver handlerResolver;
-	
-	private Map<HandlerType, HandlerChainExecutor> executorMap = new HashMap<HandlerType, HandlerChainExecutor>();
+   // Keep a handle on the resolver so that updateConfig calls may revisit the associated chains
+   private final HandlerResolver handlerResolver;
 
-	private static HandlerType[] HANDLER_TYPES = new HandlerType[] {HandlerType.PRE, HandlerType.ENDPOINT, HandlerType.POST};
-	
-	public ClientImpl(EndpointMetaData epMetaData, HandlerResolver handlerResolver)
+   private Map<HandlerType, HandlerChainExecutor> executorMap = new HashMap<HandlerType, HandlerChainExecutor>();
+
+   private static HandlerType[] HANDLER_TYPES = new HandlerType[] { HandlerType.PRE, HandlerType.ENDPOINT, HandlerType.POST };
+
+   public ClientImpl(EndpointMetaData epMetaData, HandlerResolver handlerResolver)
    {
       super(epMetaData);
       setTargetEndpointAddress(epMetaData.getEndpointAddress());
 
       this.epMetaData = epMetaData;
-      this.handlerResolver = handlerResolver;
+      this.epConfigMetaData = epMetaData.getEndpointConfigMetaData();
 
+      if (handlerResolver instanceof HandlerResolverImpl)
+      {
+         this.handlerResolver = new HandlerResolverImpl((HandlerResolverImpl)handlerResolver);
+      }
+      else
+      {
+         this.handlerResolver = handlerResolver;
+      }
+
       initBindingHandlerChain(false);
-
-      // The config may change at some later point in time
-      // when applications utilize the ServiceDecorator API
-      // When clients change the config-name, we need reset the handlerchain
-      ((ConfigurationProvider)epMetaData).registerConfigObserver(this);
    }
 
    /**
@@ -111,42 +113,31 @@
    {
       BindingExt binding = (BindingExt)getBindingProvider().getBinding();
 
-		PortInfo portInfo = getPortInfo(epMetaData);
+      PortInfo portInfo = getPortInfo(epMetaData);
 
-		if (handlerResolver != null)
-		{
+      if (handlerResolver != null)
+      {
 
-			boolean jbossHandlerResolver = handlerResolver instanceof HandlerResolverImpl;
-			
-			if (jbossHandlerResolver) // knows about PRE and POST handlers
-			{
-				HandlerResolverImpl impl = (HandlerResolverImpl)handlerResolver;
-				impl.initHandlerChain(epMetaData, HandlerType.PRE, clearExistingHandlers);
-				impl.initHandlerChain(epMetaData, HandlerType.ENDPOINT, clearExistingHandlers);
-				impl.initHandlerChain(epMetaData, HandlerType.POST, clearExistingHandlers);
+         boolean jbossHandlerResolver = handlerResolver instanceof HandlerResolverImpl;
 
-				List<Handler> preChain = impl.getHandlerChain(portInfo, HandlerType.PRE);
-				List<Handler> postChain = impl.getHandlerChain(portInfo, HandlerType.POST);
-				
-				binding.setHandlerChain(postChain, HandlerType.POST);
-				binding.setHandlerChain(preChain, HandlerType.PRE);
-			}
+         if (jbossHandlerResolver) // knows about PRE and POST handlers
+         {
+            HandlerResolverImpl impl = (HandlerResolverImpl)handlerResolver;
+            impl.initHandlerChain(epConfigMetaData, HandlerType.PRE, clearExistingHandlers);
+            impl.initHandlerChain(epConfigMetaData, HandlerType.ENDPOINT, clearExistingHandlers);
+            impl.initHandlerChain(epConfigMetaData, HandlerType.POST, clearExistingHandlers);
 
-			// The regular handler chain
-			List<Handler> endpointChain = handlerResolver.getHandlerChain(portInfo);
-			binding.setHandlerChain(endpointChain);
-		}
-   }
+            List<Handler> preChain = impl.getHandlerChain(portInfo, HandlerType.PRE);
+            List<Handler> postChain = impl.getHandlerChain(portInfo, HandlerType.POST);
 
-   /**
-    * Callback when the config-name or config-file changes.
-    */
-   public void update(Observable observable, Object object)
-   {
-      log.debug("Configuration change event received. Reconfigure handler chain: " + object);
+            binding.setHandlerChain(postChain, HandlerType.POST);
+            binding.setHandlerChain(preChain, HandlerType.PRE);
+         }
 
-      // re-populate the binding handler chain
-      initBindingHandlerChain(true);
+         // The regular handler chain
+         List<Handler> endpointChain = handlerResolver.getHandlerChain(portInfo);
+         binding.setHandlerChain(endpointChain);
+      }
    }
 
    @Override
@@ -382,32 +373,51 @@
       throw new NotImplementedException();
    }
 
+   public EndpointConfigMetaData getEndpointConfigMetaData()
+   {
+      return epConfigMetaData;
+   }
+
    public void setConfigName(String configName, String configFile)
    {
-      ConfigurationProvider configProvider = (ConfigurationProvider)getEndpointMetaData();
-      configProvider.setConfigName(configName, configFile);
+      if (configName == null)
+         throw new IllegalArgumentException("Config name cannot be null");
+
+      String orgConfigName = epConfigMetaData.getConfigName();
+      String orgConfigFile = epConfigMetaData.getConfigFile();
+
+      if (configFile == null)
+      {
+         configFile = orgConfigFile;
+      }
+
+      if (orgConfigName.equals(configName) == false || orgConfigFile.equals(configFile) == false)
+      {
+         epConfigMetaData = ((ClientEndpointMetaData)this.epMetaData).createEndpointConfigMetaData(configName, configFile);
+         initBindingHandlerChain(true);
+      }
    }
 
-	/**
-	 * Retrieve header names that can be processed by this binding
-	 * @return
-	 */
-	public Set<QName> getHeaders()
+   /**
+    * Retrieve header names that can be processed by this binding
+    * @return
+    */
+   public Set<QName> getHeaders()
    {
-		Set<QName> headers = new HashSet<QName>();
+      Set<QName> headers = new HashSet<QName>();
 
-		BindingExt binding = (BindingExt)getBinding();
+      BindingExt binding = (BindingExt)getBinding();
 
-		for(HandlerType type : HANDLER_TYPES)
-		{
-			for(Handler bindingHandler : binding.getHandlerChain(type))
-			{
-				if(bindingHandler instanceof SOAPHandler)
-					headers.addAll( ((SOAPHandler)bindingHandler).getHeaders());
-			}
-		}
-		
-		return headers;
+      for (HandlerType type : HANDLER_TYPES)
+      {
+         for (Handler bindingHandler : binding.getHandlerChain(type))
+         {
+            if (bindingHandler instanceof SOAPHandler)
+               headers.addAll(((SOAPHandler)bindingHandler).getHeaders());
+         }
+      }
+
+      return headers;
    }
 
    @Override
@@ -416,7 +426,7 @@
       Object bool = getRequestContext().get(BindingProvider.SESSION_MAINTAIN_PROPERTY);
       return Boolean.TRUE.equals(bool);
    }
-   
+
    private PortInfo getPortInfo(EndpointMetaData epMetaData)
    {
       QName serviceName = epMetaData.getServiceMetaData().getServiceName();

Modified: stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java	2008-10-09 15:18:05 UTC (rev 8418)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java	2008-10-09 15:21:19 UTC (rev 8419)
@@ -35,6 +35,7 @@
 import org.jboss.logging.Logger;
 import org.jboss.ws.core.server.ServerHandlerDelegate;
 import org.jboss.ws.core.soap.MessageContextAssociation;
+import org.jboss.ws.metadata.umdm.EndpointConfigMetaData;
 import org.jboss.ws.metadata.umdm.EndpointMetaData;
 import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
 import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData.HandlerType;
@@ -50,11 +51,11 @@
    // provide logging
    private static Logger log = Logger.getLogger(HandlerDelegateJAXWS.class);
    private HandlerResolverImpl resolver = new HandlerResolverImpl();
-   
+
    private ThreadLocal<HandlerChainExecutor> preExecutor = new ThreadLocal<HandlerChainExecutor>();
    private ThreadLocal<HandlerChainExecutor> jaxwsExecutor = new ThreadLocal<HandlerChainExecutor>();
    private ThreadLocal<HandlerChainExecutor> postExecutor = new ThreadLocal<HandlerChainExecutor>();
-   
+
    public HandlerDelegateJAXWS(ServerEndpointMetaData sepMetaData)
    {
       super(sepMetaData);
@@ -63,7 +64,7 @@
 
    /**
     * For JAXWS PRE/POST are defined in the context of an outbound message
-    */ 
+    */
    public HandlerType[] getHandlerTypeOrder()
    {
       return new HandlerType[] { HandlerType.POST, HandlerType.ENDPOINT, HandlerType.PRE };
@@ -76,9 +77,10 @@
       // Initialize the handler chain
       if (isInitialized() == false)
       {
-         resolver.initHandlerChain(sepMetaData, HandlerType.PRE, true);
-         resolver.initHandlerChain(sepMetaData, HandlerType.ENDPOINT, true);
-         resolver.initHandlerChain(sepMetaData, HandlerType.POST, true);
+         EndpointConfigMetaData ecmd = sepMetaData.getEndpointConfigMetaData();
+         resolver.initHandlerChain(ecmd, HandlerType.PRE, true);
+         resolver.initHandlerChain(ecmd, HandlerType.ENDPOINT, true);
+         resolver.initHandlerChain(ecmd, HandlerType.POST, true);
          setInitialized(true);
       }
 
@@ -90,7 +92,7 @@
    public boolean callResponseHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType type)
    {
       log.debug("callResponseHandlerChain: " + type);
-      HandlerChainExecutor executor =  getExecutor(type);
+      HandlerChainExecutor executor = getExecutor(type);
       MessageContext msgContext = (MessageContext)MessageContextAssociation.peekMessageContext();
       return (executor != null ? executor.handleMessage(msgContext) : true);
    }
@@ -98,7 +100,7 @@
    public void closeHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType type)
    {
       log.debug("closeHandlerChain");
-      HandlerChainExecutor executor =  getExecutor(type);
+      HandlerChainExecutor executor = getExecutor(type);
       MessageContext msgContext = (MessageContext)MessageContextAssociation.peekMessageContext();
       if (executor != null)
       {
@@ -106,11 +108,11 @@
          removeExecutor(type);
       }
    }
-   
+
    public boolean callFaultHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType type, Exception ex)
    {
       log.debug("callFaultHandlerChain: " + type);
-      HandlerChainExecutor executor =  getExecutor(type);
+      HandlerChainExecutor executor = getExecutor(type);
       MessageContext msgContext = (MessageContext)MessageContextAssociation.peekMessageContext();
       return (executor != null ? executor.handleFault(msgContext, ex) : true);
    }
@@ -139,7 +141,7 @@
    {
       if (type == HandlerType.ALL)
          throw new IllegalArgumentException("Invalid handler type: " + type);
-      
+
       HandlerChainExecutor executor = new HandlerChainExecutor(sepMetaData, getHandlerChain(sepMetaData, type));
       if (type == HandlerType.PRE)
          preExecutor.set(executor);
@@ -147,7 +149,7 @@
          jaxwsExecutor.set(executor);
       else if (type == HandlerType.POST)
          postExecutor.set(executor);
-      
+
       return executor;
    }
 
@@ -155,7 +157,7 @@
    {
       if (type == HandlerType.ALL)
          throw new IllegalArgumentException("Invalid handler type: " + type);
-      
+
       HandlerChainExecutor executor = null;
       if (type == HandlerType.PRE)
          executor = preExecutor.get();
@@ -163,7 +165,7 @@
          executor = jaxwsExecutor.get();
       else if (type == HandlerType.POST)
          executor = postExecutor.get();
-      
+
       return executor;
    }
 
@@ -171,7 +173,7 @@
    {
       if (type == HandlerType.ALL)
          throw new IllegalArgumentException("Invalid handler type: " + type);
-      
+
       if (type == HandlerType.PRE)
          preExecutor.remove();
       else if (type == HandlerType.ENDPOINT)

Modified: stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerResolverImpl.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerResolverImpl.java	2008-10-09 15:18:05 UTC (rev 8418)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerResolverImpl.java	2008-10-09 15:21:19 UTC (rev 8419)
@@ -45,7 +45,7 @@
 import org.jboss.logging.Logger;
 import org.jboss.util.NotImplementedException;
 import org.jboss.ws.WSException;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.EndpointConfigMetaData;
 import org.jboss.ws.metadata.umdm.HandlerMetaData;
 import org.jboss.ws.metadata.umdm.HandlerMetaDataJAXWS;
 import org.jboss.ws.metadata.umdm.ServiceMetaData;
@@ -77,13 +77,29 @@
       protocolMap.put("##XML_HTTP", HTTPBinding.HTTP_BINDING);
    }
 
-   private List<ScopedHandler> preHandlers = new ArrayList<ScopedHandler>();
-   private List<ScopedHandler> jaxwsHandlers = new ArrayList<ScopedHandler>();
-   private List<ScopedHandler> postHandlers = new ArrayList<ScopedHandler>();
+   private final List<ScopedHandler> preHandlers;
+   private final List<ScopedHandler> jaxwsHandlers;
+   private final List<ScopedHandler> postHandlers;
 
    // understood headers
-   Set<QName> headers = new HashSet<QName>();
+   private final Set<QName> headers;
 
+   public HandlerResolverImpl()
+   {
+      preHandlers = new ArrayList<ScopedHandler>();
+      jaxwsHandlers = new ArrayList<ScopedHandler>();
+      postHandlers = new ArrayList<ScopedHandler>();
+      headers = new HashSet<QName>();
+   }
+
+   public HandlerResolverImpl(HandlerResolverImpl parent)
+   {
+      preHandlers = new ArrayList<ScopedHandler>(parent.preHandlers);
+      jaxwsHandlers = new ArrayList<ScopedHandler>(parent.jaxwsHandlers);
+      postHandlers = new ArrayList<ScopedHandler>(parent.postHandlers);
+      headers = new HashSet<QName>(parent.headers);
+   }
+
    public Set<QName> getHeaders()
    {
       return headers;
@@ -120,7 +136,7 @@
          addHandler(classLoader, HandlerType.ENDPOINT, handlerMetaData);
    }
 
-   public void initHandlerChain(EndpointMetaData epMetaData, HandlerType type, boolean clearExistingHandlers)
+   public void initHandlerChain(EndpointConfigMetaData epConfigMetaData, HandlerType type, boolean clearExistingHandlers)
    {
       log.debug("initHandlerChain: " + type);
 
@@ -129,8 +145,8 @@
       if (clearExistingHandlers)
          handlerMap.clear();
 
-      ClassLoader classLoader = epMetaData.getClassLoader();
-      for (HandlerMetaData handlerMetaData : epMetaData.getHandlerMetaData(type))
+      ClassLoader classLoader = epConfigMetaData.getEndpointMetaData().getClassLoader();
+      for (HandlerMetaData handlerMetaData : epConfigMetaData.getHandlerMetaData(type))
          addHandler(classLoader, type, handlerMetaData);
    }
 

Modified: stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/main/java/org/jboss/ws/extensions/policy/deployer/domainAssertion/WSSecurityAssertionDeployer.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/main/java/org/jboss/ws/extensions/policy/deployer/domainAssertion/WSSecurityAssertionDeployer.java	2008-10-09 15:18:05 UTC (rev 8418)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/main/java/org/jboss/ws/extensions/policy/deployer/domainAssertion/WSSecurityAssertionDeployer.java	2008-10-09 15:21:19 UTC (rev 8419)
@@ -67,7 +67,6 @@
             
             //set up handler chain as defined in standard file
             ep.setConfigName("Standard WSSecurity Endpoint");
-            ep.initEndpointConfig();
       
          }
          catch (Exception e)
@@ -96,7 +95,6 @@
                serviceMetaData.setSecurityConfiguration(securityConfiguration);
                
                epMetaData.setConfigName("Standard WSSecurity Client");
-               epMetaData.initEndpointConfig();
             }
             catch (Exception e)
             {

Modified: stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/main/java/org/jboss/ws/metadata/umdm/ClientEndpointMetaData.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/main/java/org/jboss/ws/metadata/umdm/ClientEndpointMetaData.java	2008-10-09 15:18:05 UTC (rev 8418)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/main/java/org/jboss/ws/metadata/umdm/ClientEndpointMetaData.java	2008-10-09 15:21:19 UTC (rev 8419)
@@ -23,11 +23,11 @@
 
 // $Id$
 
+import javax.xml.namespace.QName;
+
 import org.jboss.ws.metadata.config.ConfigurationProvider;
 import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData.HandlerType;
 
-import javax.xml.namespace.QName;
-
 /**
  * Client side endpoint meta data.
  *
@@ -38,16 +38,20 @@
 {
    // The endpoint address
    private String endpointAddress;
-   
+
    public ClientEndpointMetaData(ServiceMetaData service, QName qname, QName portTypeName, Type type)
    {
       super(service, qname, portTypeName, type);
-      configName = ConfigurationProvider.DEFAULT_CLIENT_CONFIG_NAME;
+      String configName = ConfigurationProvider.DEFAULT_CLIENT_CONFIG_NAME;
 
+      String configFile;
       if (type == Type.JAXRPC)
          configFile = ConfigurationProvider.DEFAULT_JAXRPC_CLIENT_CONFIG_FILE;
-      else
-         configFile = ConfigurationProvider.DEFAULT_JAXWS_CLIENT_CONFIG_FILE;
+      else configFile = ConfigurationProvider.DEFAULT_JAXWS_CLIENT_CONFIG_FILE;
+
+      EndpointConfigMetaData ecmd = getEndpointConfigMetaData();
+      ecmd.setConfigName(configName);
+      ecmd.setConfigFile(configFile);
    }
 
    public String getEndpointAddress()
@@ -60,6 +64,11 @@
       this.endpointAddress = endpointAddress;
    }
 
+   public EndpointConfigMetaData createEndpointConfigMetaData(String configName, String configFile)
+   {
+      return super.createEndpointConfigMetaData(configName, configFile);
+   }
+
    public String toString()
    {
       StringBuilder buffer = new StringBuilder("\nClientEndpointMetaData:");

Copied: stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/main/java/org/jboss/ws/metadata/umdm/EndpointConfigMetaData.java (from rev 7871, stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/metadata/umdm/EndpointConfigMetaData.java)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/main/java/org/jboss/ws/metadata/umdm/EndpointConfigMetaData.java	                        (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/main/java/org/jboss/ws/metadata/umdm/EndpointConfigMetaData.java	2008-10-09 15:21:19 UTC (rev 8419)
@@ -0,0 +1,172 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, 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.metadata.umdm;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.metadata.config.CommonConfig;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData.HandlerType;
+
+/**
+ * The configurable EndpointMetaData.
+ * 
+ * This class allows the configurable items to be separated
+ * from the parent EndpointMetaData allowing different clients
+ * to load their configuration independently while sharing a 
+ * common EndpointMetaData.   
+ * 
+ * @author darran.lofthouse at jboss.com
+ * @since 18th July 2008
+ */
+public class EndpointConfigMetaData
+{
+
+   private static Logger log = Logger.getLogger(EndpointConfigMetaData.class);
+
+   private final EndpointMetaData epMetaData;
+   // The REQUIRED config-name
+   protected String configName;
+   // The REQUIRED config-file
+   protected String configFile;
+
+   // The REQUIRED endpoint config
+   private CommonConfig config;
+
+   // The optional handlers
+   private List<HandlerMetaData> handlers = new ArrayList<HandlerMetaData>();
+   // True if the handlers are initialized
+   private boolean handlersInitialized;
+
+   public EndpointConfigMetaData(EndpointMetaData parent)
+   {
+      this.epMetaData = parent;
+   }
+
+   void addHandlers(List<HandlerMetaData> configHandlers)
+   {
+      for (HandlerMetaData handler : configHandlers)
+         handler.setEndpointMetaData(epMetaData);
+      handlers.addAll(configHandlers);
+   }
+
+   void addHandler(HandlerMetaData handler)
+   {
+      handler.setEndpointMetaData(epMetaData);
+      handlers.add(handler);
+   }
+
+   void clearHandlers()
+   {
+      handlers.clear();
+      handlersInitialized = false;
+   }
+
+   public List<HandlerMetaData> getHandlerMetaData(HandlerType type)
+   {
+      List<HandlerMetaData> typeHandlers = new ArrayList<HandlerMetaData>();
+      for (HandlerMetaData hmd : handlers)
+      {
+         if (hmd.getHandlerType() == type || type == HandlerType.ALL)
+            typeHandlers.add(hmd);
+      }
+      return typeHandlers;
+   }
+
+   public boolean isHandlersInitialized()
+   {
+      return handlersInitialized;
+   }
+
+   public void setHandlersInitialized(boolean flag)
+   {
+      this.handlersInitialized = flag;
+   }
+
+   void configHandlerMetaData()
+   {
+      log.debug("Configure EndpointMetaData");
+
+      List<HandlerMetaData> sepHandlers = getHandlerMetaData(HandlerType.ENDPOINT);
+      clearHandlers();
+
+      List<HandlerMetaData> preHandlers = config.getHandlers(epMetaData, HandlerType.PRE);
+      List<HandlerMetaData> postHandlers = config.getHandlers(epMetaData, HandlerType.POST);
+
+      addHandlers(preHandlers);
+      addHandlers(sepHandlers);
+      addHandlers(postHandlers);
+
+      log.debug("Added " + preHandlers.size() + " PRE handlers");
+      log.debug("Added " + sepHandlers.size() + " ENDPOINT handlers");
+      log.debug("Added " + postHandlers.size() + " POST handlers");
+   }
+
+   public EndpointMetaData getEndpointMetaData()
+   {
+      return epMetaData;
+   }
+
+   void validate()
+   {
+      for (HandlerMetaData handler : handlers)
+         handler.validate();
+   }
+
+   void initializeInternal()
+   {
+      // Initialize handlers
+      for (HandlerMetaData handler : handlers)
+         handler.eagerInitialize();
+   }
+
+   public CommonConfig getConfig()
+   {
+      return config;
+   }
+
+   void setConfig(CommonConfig config)
+   {
+      this.config = config;
+   }
+
+   public String getConfigName()
+   {
+      return configName;
+   }
+
+   public void setConfigName(String configName)
+   {
+      this.configName = configName;
+   }
+
+   public String getConfigFile()
+   {
+      return configFile;
+   }
+
+   public void setConfigFile(String configFile)
+   {
+      this.configFile = configFile;
+   }
+}

Modified: stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java	2008-10-09 15:18:05 UTC (rev 8418)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java	2008-10-09 15:21:19 UTC (rev 8419)
@@ -105,19 +105,14 @@
    // The parent meta data.
    private ServiceMetaData serviceMetaData;
 
-   // The REQUIRED endpoint config
-   private CommonConfig config;
-
+   // The REQUIRED configuration meta data.
+   private EndpointConfigMetaData configMetaData;
    // The REQUIRED name
    private QName portName;
    // The REQUIRED binding id
    private String bindingId;
    // The REQUIRED name of the WSDL interface/portType
    private QName portTypeName;
-   // The REQUIRED config-name
-   protected String configName;
-   // The REQUIRED config-file
-   protected String configFile;
    // The endpoint interface name
    private String seiName;
    // The endpoint interface
@@ -138,10 +133,6 @@
    private Type type;
    // The list of service meta data
    private List<OperationMetaData> operations = new ArrayList<OperationMetaData>();
-   // The optional handlers
-   private List<HandlerMetaData> handlers = new ArrayList<HandlerMetaData>();
-   // True if the handlers are initialized
-   private boolean handlersInitialized;
    // Maps the java method to the operation meta data
    private Map<Method, OperationMetaData> opMetaDataCache = new HashMap<Method, OperationMetaData>();
    // All of the registered types
@@ -460,46 +451,37 @@
 
    public void addHandlers(List<HandlerMetaData> configHandlers)
    {
-      handlers.addAll(configHandlers);
+      getEndpointConfigMetaData().addHandlers(configHandlers);
    }
 
    public void addHandler(HandlerMetaData handler)
    {
-      handler.setEndpointMetaData(this);
-      handlers.add(handler);
+      getEndpointConfigMetaData().addHandler(handler);
    }
 
    public void clearHandlers()
    {
-      handlers.clear();
-      handlersInitialized = false;
+      getEndpointConfigMetaData().clearHandlers();
    }
 
    public List<HandlerMetaData> getHandlerMetaData(HandlerType type)
    {
-      List<HandlerMetaData> typeHandlers = new ArrayList<HandlerMetaData>();
-      for (HandlerMetaData hmd : handlers)
-      {
-         if (hmd.getHandlerType() == type || type == HandlerType.ALL)
-            typeHandlers.add(hmd);
-      }
-      return typeHandlers;
+      return getEndpointConfigMetaData().getHandlerMetaData(type);
    }
 
    public boolean isHandlersInitialized()
    {
-      return handlersInitialized;
+      return getEndpointConfigMetaData().isHandlersInitialized();
    }
 
    public void setHandlersInitialized(boolean flag)
    {
-      this.handlersInitialized = flag;
+      getEndpointConfigMetaData().setHandlersInitialized(flag);
    }
 
    public void validate()
    {
-      for (HandlerMetaData handler : handlers)
-         handler.validate();
+      getEndpointConfigMetaData().validate();
 
       for (OperationMetaData opMetaData : operations)
          opMetaData.validate();
@@ -518,9 +500,7 @@
       // reset sei class
       seiClass = null;
 
-      // Initialize handlers
-      for (HandlerMetaData handler : handlers)
-         handler.eagerInitialize();
+      getEndpointConfigMetaData().initializeInternal();
 
       eagerInitializeOperations();
       eagerInitializeTypes();
@@ -623,21 +603,21 @@
             AccessorFactoryCreator factoryCreator = paramMetaData.getAccessorFactoryCreator();
             if (factoryCreator instanceof JAXBAccessorFactoryCreator)
                useJAXBAccessorFactory = true;
-            
+
             types.add(paramMetaData.getJavaType());
          }
-         
+
          ParameterMetaData retParam = opMetaData.getReturnParameter();
          if (retParam != null)
          {
             AccessorFactoryCreator factoryCreator = retParam.getAccessorFactoryCreator();
             if (factoryCreator instanceof JAXBAccessorFactoryCreator)
                useJAXBAccessorFactory = true;
-            
+
             types.add(retParam.getJavaType());
          }
       }
-      
+
       // Create a JAXBContext for those types
       JAXBRIContext jaxbCtx = null;
       if (useJAXBAccessorFactory)
@@ -645,7 +625,7 @@
          Class[] typeArr = new Class[types.size()];
          jaxbCtx = (JAXBRIContext)JAXBContextFactory.newInstance().createContext(types.toArray(typeArr));
       }
-      
+
       // Create the accessors using a shared JAXBContext 
       for (OperationMetaData opMetaData : operations)
       {
@@ -653,7 +633,7 @@
          {
             createAccessor(paramMetaData, jaxbCtx);
          }
-         
+
          ParameterMetaData retParam = opMetaData.getReturnParameter();
          if (retParam != null)
             createAccessor(retParam, jaxbCtx);
@@ -665,7 +645,7 @@
       AccessorFactoryCreator factoryCreator = paramMetaData.getAccessorFactoryCreator();
       if (factoryCreator instanceof JAXBAccessorFactoryCreator)
          ((JAXBAccessorFactoryCreator)factoryCreator).setJAXBContext(jaxbCtx);
-      
+
       if (paramMetaData.getWrappedParameters() != null)
       {
          AccessorFactory factory = factoryCreator.create(paramMetaData);
@@ -673,7 +653,7 @@
             wParam.setAccessor(factory.create(wParam));
       }
    }
-   
+
    // ---------------------------------------------------------------
    // Configuration provider impl
 
@@ -682,9 +662,7 @@
     */
    public void configure(Configurable configurable)
    {
-      // Make sure we have a configuration
-      if (config == null)
-         initEndpointConfig();
+      CommonConfig config = getConfig();
 
       // SOAPBinding configuration
       if (configurable instanceof CommonBindingProvider)
@@ -722,19 +700,34 @@
 
    public String getConfigFile()
    {
-      return configFile;
+      return getEndpointConfigMetaData().getConfigFile();
    }
 
    public String getConfigName()
    {
-      return configName;
+      return getEndpointConfigMetaData().getConfigName();
    }
 
+   public EndpointConfigMetaData getEndpointConfigMetaData()
+   {
+      if (configMetaData == null)
+         configMetaData = new EndpointConfigMetaData(this);
+
+      return this.configMetaData;
+   }
+
    public CommonConfig getConfig()
    {
+      EndpointConfigMetaData ecmd = getEndpointConfigMetaData();
+      CommonConfig config = ecmd.getConfig();
+
       // Make sure we have a configuration
       if (config == null)
-         initEndpointConfig();
+      {
+         // No base configuration. 
+         initEndpointConfigMetaData(ecmd, null);
+         config = ecmd.getConfig();
+      }
 
       return config;
    }
@@ -754,45 +747,66 @@
       if (configName == null)
          throw new IllegalArgumentException("Config name cannot be null");
 
-      if (configFile != null)
-         this.configFile = configFile;
+      if (configFile == null)
+      {
+         configFile = getEndpointConfigMetaData().getConfigFile();
+      }
 
-      if (configName.equals(this.configName) == false)
+      if (configName.equals(getEndpointConfigMetaData().getConfigName()) == false || configFile.equals(getEndpointConfigMetaData().getConfigFile()) == false)
       {
-         this.configName = configName;
+         log.debug("Reconfiguration forced, new config is '" + configName + "' file is '" + configFile + "'");
 
-         log.debug("Reconfiguration forced, new config is '" + configName + "'");
-         initEndpointConfig();
+         this.configMetaData = createEndpointConfigMetaData(configName, configFile);
          configObservable.doNotify(configName);
       }
    }
 
-   public void initEndpointConfig()
+   /**
+    * The factory method to create and initialise a new EndpointConfigMetaData, the current 
+    * EndpointConfigMetaData will be used as the base to backup the RMMD.
+    * 
+    * This method does not set the EndpointConfigMetaData as it can be used by clients to create 
+    * a local configuration not stored in the EndpointMetaData.
+    */
+   protected EndpointConfigMetaData createEndpointConfigMetaData(String configName, String configFile)
    {
-      log.debug("Create new config [name=" + getConfigName() + ",file=" + getConfigFile() + "]");
-      JBossWSConfigFactory factory = JBossWSConfigFactory.newInstance();
-      config = factory.getConfig(getRootFile(), getConfigName(), getConfigFile());
+      EndpointConfigMetaData ecmd = new EndpointConfigMetaData(this);
+      ecmd.setConfigName(configName);
+      ecmd.setConfigFile(configFile);
 
-      reconfigHandlerMetaData();
+      initEndpointConfigMetaData(ecmd, configMetaData);
+
+      return ecmd;
    }
 
-   private void reconfigHandlerMetaData()
+   public void initEndpointConfig()
    {
-      log.debug("Configure EndpointMetaData");
+      EndpointConfigMetaData ecmd = getEndpointConfigMetaData();
+      // At the time this method is called initialisation may have already happened
+      // always take the current ECMD as a base in case there is anything to backup. 
+      initEndpointConfigMetaData(ecmd, ecmd);
+   }
 
-      List<HandlerMetaData> sepHandlers = getHandlerMetaData(HandlerType.ENDPOINT);
-      clearHandlers();
+   /**
+    * Initialise the toInitialise EndpointConfigMeta but first backup the RM Meta Data from
+    * the base EndpointConfigMetaData.
+    * 
+    * @param toInitialise - The EndpointConfigMetaData to initialise.
+    * @param base - The base EndpointConfigMetaData to take the RMMD from.
+    */
+   private void initEndpointConfigMetaData(EndpointConfigMetaData toInitialise, EndpointConfigMetaData base)
+   {
+      String configName = toInitialise.getConfigName();
+      String configFile = toInitialise.getConfigFile();
 
-      List<HandlerMetaData> preHandlers = config.getHandlers(this, HandlerType.PRE);
-      List<HandlerMetaData> postHandlers = config.getHandlers(this, HandlerType.POST);
+      log.debug("Create new config [name=" + configName + ",file=" + configFile + "]");
 
-      addHandlers(preHandlers);
-      addHandlers(sepHandlers);
-      addHandlers(postHandlers);
+      JBossWSConfigFactory factory = JBossWSConfigFactory.newInstance();
 
-      log.debug("Added " + preHandlers.size() + " PRE handlers");
-      log.debug("Added " + sepHandlers.size() + " ENDPOINT handlers");
-      log.debug("Added " + postHandlers.size() + " POST handlers");
+      CommonConfig config = factory.getConfig(getRootFile(), configName, configFile);
+      toInitialise.setConfig(config);
+
+      toInitialise.configHandlerMetaData();
    }
 
    public List<Class> getRegisteredTypes()
@@ -813,15 +827,15 @@
 
       public synchronized void addObserver(Observer o)
       {
-         observer.add( new WeakReference(o));
+         observer.add(new WeakReference(o));
       }
 
       public synchronized void deleteObserver(Observer o)
       {
-         for(WeakReference<Observer> w : observer)
+         for (WeakReference<Observer> w : observer)
          {
             Observer tmp = w.get();
-            if(tmp.equals(o))
+            if (tmp.equals(o))
             {
                observer.remove(o);
                break;
@@ -837,9 +851,9 @@
 
       public void notifyObservers(Object arg)
       {
-         if(hasChanged())
+         if (hasChanged())
          {
-            for(WeakReference<Observer> w : observer)
+            for (WeakReference<Observer> w : observer)
             {
                Observer tmp = w.get();
                tmp.update(this, arg);

Modified: stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java	2008-10-09 15:18:05 UTC (rev 8418)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java	2008-10-09 15:21:19 UTC (rev 8419)
@@ -77,12 +77,17 @@
    {
       super(service, portName, portTypeName, type);
       this.endpoint = endpoint;
-      
-      super.configName = ConfigurationProvider.DEFAULT_ENDPOINT_CONFIG_NAME;
+
+      String configName = ConfigurationProvider.DEFAULT_ENDPOINT_CONFIG_NAME;
+      String configFile;
       if (type == Type.JAXRPC)
          configFile = ConfigurationProvider.DEFAULT_JAXRPC_ENDPOINT_CONFIG_FILE;
       else
          configFile = ConfigurationProvider.DEFAULT_JAXWS_ENDPOINT_CONFIG_FILE;
+
+      EndpointConfigMetaData ecmd = getEndpointConfigMetaData();
+      ecmd.setConfigName(configName);
+      ecmd.setConfigFile(configFile);
    }
 
    public Endpoint getEndpoint()
@@ -202,7 +207,7 @@
    {
       if (endpoint == null)
          throw new IllegalStateException("Endpoint not available");
-      
+
       endpoint.setAddress(endpointAddress);
    }
 

Modified: stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/main/java/org/jboss/ws/tools/metadata/ToolsEndpointMetaData.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/main/java/org/jboss/ws/tools/metadata/ToolsEndpointMetaData.java	2008-10-09 15:18:05 UTC (rev 8418)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/main/java/org/jboss/ws/tools/metadata/ToolsEndpointMetaData.java	2008-10-09 15:21:19 UTC (rev 8419)
@@ -24,6 +24,7 @@
 // $Id$
 
 import org.jboss.ws.metadata.config.ConfigurationProvider;
+import org.jboss.ws.metadata.umdm.EndpointConfigMetaData;
 import org.jboss.ws.metadata.umdm.EndpointMetaData;
 import org.jboss.ws.metadata.umdm.ServiceMetaData;
 
@@ -42,8 +43,10 @@
    public ToolsEndpointMetaData(ServiceMetaData service, QName portName, QName portTypeName)
    {
       super(service, portName, portTypeName, Type.JAXRPC);
-      super.configName = ConfigurationProvider.DEFAULT_CLIENT_CONFIG_NAME;
-      super.configFile = ConfigurationProvider.DEFAULT_JAXRPC_CLIENT_CONFIG_FILE;
+     
+      EndpointConfigMetaData ecmd = getEndpointConfigMetaData();
+      ecmd.setConfigFile(ConfigurationProvider.DEFAULT_JAXRPC_CLIENT_CONFIG_FILE);
+      ecmd.setConfigName(ConfigurationProvider.DEFAULT_CLIENT_CONFIG_NAME);
    }
    
    public String getEndpointAddress()

Copied: stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/java/org/jboss/test/ws/jaxws/jbws2187 (from rev 7871, stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2187)

Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/java/org/jboss/test/ws/jaxws/jbws2187/JBWS2187TestCase.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2187/JBWS2187TestCase.java	2008-07-21 10:50:31 UTC (rev 7871)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/java/org/jboss/test/ws/jaxws/jbws2187/JBWS2187TestCase.java	2008-10-09 15:21:19 UTC (rev 8419)
@@ -1,121 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, 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.test.ws.jaxws.jbws2187;
-
-import java.io.File;
-import java.net.URL;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.Service;
-
-import junit.framework.Test;
-
-import org.jboss.ws.core.StubExt;
-import org.jboss.wsf.test.JBossWSTest;
-import org.jboss.wsf.test.JBossWSTestSetup;
-
-/**
- * [JBWS-2187] Handler Chain Management Prevents Service Re-Use
- * 
- * @author darran.lofthouse at jboss.com
- * @since 18th July 2008
- * @see https://jira.jboss.org/jira/browse/JBWS-2187
- */
-public class JBWS2187TestCase extends JBossWSTest
-{
-
-   public static Test suite() throws Exception
-   {
-      return new JBossWSTestSetup(JBWS2187TestCase.class, "jaxws-jbws2187.war");
-   }
-
-   public void testSetBothPorts() throws Exception
-   {
-      Service service = getService();
-      TestEndpoint original = service.getPort(TestEndpoint.class);
-
-      setConfigName(original);
-      performTest(original, 1);
-
-      TestEndpoint subsequent = service.getPort(TestEndpoint.class);
-
-      setConfigName(subsequent);
-      performTest(subsequent, 1);
-
-      performTest(original, 1);
-   }
-
-   public void testSetFirstPort() throws Exception
-   {
-      Service service = getService();
-      TestEndpoint original = service.getPort(TestEndpoint.class);
-
-      setConfigName(original);
-      performTest(original, 1);
-
-      TestEndpoint subsequent = service.getPort(TestEndpoint.class);
-
-      //setConfigName(subsequent);
-      performTest(subsequent, 0);
-
-      performTest(original, 1);
-   }
-
-   public void testSetSecondPort() throws Exception
-   {
-      Service service = getService();
-      TestEndpoint original = service.getPort(TestEndpoint.class);
-
-      //setConfigName(original);
-      performTest(original, 0);
-
-      TestEndpoint subsequent = service.getPort(TestEndpoint.class);
-
-      setConfigName(subsequent);
-      performTest(subsequent, 1);
-
-      performTest(original, 0);
-   }
-
-   void performTest(TestEndpoint port, int expected) throws Exception
-   {
-      TestHandler.clear();
-      assertEquals("Av it", port.echo("Av it"));
-      assertEquals("Call Count", expected, TestHandler.getCallCount());
-   }
-
-   void setConfigName(TestEndpoint port)
-   {
-      File config = new File("resources/jaxws/jbws2187/META-INF/jbws2187-client-config.xml");
-      ((StubExt)port).setConfigName("JBWS2187 Config", config.getAbsolutePath());
-   }
-
-   Service getService() throws Exception
-   {
-      URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-jbws2187?wsdl");
-      QName serviceName = new QName("http://ws.jboss.org/jbws2187", "TestService");
-
-      Service service = Service.create(wsdlURL, serviceName);
-
-      return service;
-   }
-}

Copied: stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/java/org/jboss/test/ws/jaxws/jbws2187/JBWS2187TestCase.java (from rev 7871, stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2187/JBWS2187TestCase.java)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/java/org/jboss/test/ws/jaxws/jbws2187/JBWS2187TestCase.java	                        (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/java/org/jboss/test/ws/jaxws/jbws2187/JBWS2187TestCase.java	2008-10-09 15:21:19 UTC (rev 8419)
@@ -0,0 +1,121 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, 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.test.ws.jaxws.jbws2187;
+
+import java.io.File;
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.jboss.ws.core.StubExt;
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * [JBWS-2187] Handler Chain Management Prevents Service Re-Use
+ * 
+ * @author darran.lofthouse at jboss.com
+ * @since 18th July 2008
+ * @see https://jira.jboss.org/jira/browse/JBWS-2187
+ */
+public class JBWS2187TestCase extends JBossWSTest
+{
+
+   public static Test suite() throws Exception
+   {
+      return new JBossWSTestSetup(JBWS2187TestCase.class, "jaxws-jbws2187.war");
+   }
+
+   public void testSetBothPorts() throws Exception
+   {
+      Service service = getService();
+      TestEndpoint original = service.getPort(TestEndpoint.class);
+
+      setConfigName(original);
+      performTest(original, 1);
+
+      TestEndpoint subsequent = service.getPort(TestEndpoint.class);
+
+      setConfigName(subsequent);
+      performTest(subsequent, 1);
+
+      performTest(original, 1);
+   }
+
+   public void testSetFirstPort() throws Exception
+   {
+      Service service = getService();
+      TestEndpoint original = service.getPort(TestEndpoint.class);
+
+      setConfigName(original);
+      performTest(original, 1);
+
+      TestEndpoint subsequent = service.getPort(TestEndpoint.class);
+
+      //setConfigName(subsequent);
+      performTest(subsequent, 0);
+
+      performTest(original, 1);
+   }
+
+   public void testSetSecondPort() throws Exception
+   {
+      Service service = getService();
+      TestEndpoint original = service.getPort(TestEndpoint.class);
+
+      //setConfigName(original);
+      performTest(original, 0);
+
+      TestEndpoint subsequent = service.getPort(TestEndpoint.class);
+
+      setConfigName(subsequent);
+      performTest(subsequent, 1);
+
+      performTest(original, 0);
+   }
+
+   void performTest(TestEndpoint port, int expected) throws Exception
+   {
+      TestHandler.clear();
+      assertEquals("Av it", port.echo("Av it"));
+      assertEquals("Call Count", expected, TestHandler.getCallCount());
+   }
+
+   void setConfigName(TestEndpoint port)
+   {
+      File config = new File("resources/jaxws/jbws2187/META-INF/jbws2187-client-config.xml");
+      ((StubExt)port).setConfigName("JBWS2187 Config", config.getAbsolutePath());
+   }
+
+   Service getService() throws Exception
+   {
+      URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-jbws2187?wsdl");
+      QName serviceName = new QName("http://ws.jboss.org/jbws2187", "TestService");
+
+      Service service = Service.create(wsdlURL, serviceName);
+
+      return service;
+   }
+}

Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/java/org/jboss/test/ws/jaxws/jbws2187/TestEndpoint.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2187/TestEndpoint.java	2008-07-21 10:50:31 UTC (rev 7871)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/java/org/jboss/test/ws/jaxws/jbws2187/TestEndpoint.java	2008-10-09 15:21:19 UTC (rev 8419)
@@ -1,41 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, 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.test.ws.jaxws.jbws2187;
-
-import javax.jws.WebService;
-import javax.jws.soap.SOAPBinding;
-
-/**
- * [JBWS-2187] Handler Chain Management Prevents Service Re-Use
- * 
- * @author darran.lofthouse at jboss.com
- * @since 18th July 2008
- * @see https://jira.jboss.org/jira/browse/JBWS-2187
- */
- at WebService(targetNamespace = "http://ws.jboss.org/jbws2187")
- at SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL)
-public interface TestEndpoint
-{
-
-   public String echo(final String message);
-
-}

Copied: stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/java/org/jboss/test/ws/jaxws/jbws2187/TestEndpoint.java (from rev 7871, stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2187/TestEndpoint.java)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/java/org/jboss/test/ws/jaxws/jbws2187/TestEndpoint.java	                        (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/java/org/jboss/test/ws/jaxws/jbws2187/TestEndpoint.java	2008-10-09 15:21:19 UTC (rev 8419)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, 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.test.ws.jaxws.jbws2187;
+
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+/**
+ * [JBWS-2187] Handler Chain Management Prevents Service Re-Use
+ * 
+ * @author darran.lofthouse at jboss.com
+ * @since 18th July 2008
+ * @see https://jira.jboss.org/jira/browse/JBWS-2187
+ */
+ at WebService(targetNamespace = "http://ws.jboss.org/jbws2187")
+ at SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL)
+public interface TestEndpoint
+{
+
+   public String echo(final String message);
+
+}

Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/java/org/jboss/test/ws/jaxws/jbws2187/TestEndpointImpl.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2187/TestEndpointImpl.java	2008-07-21 10:50:31 UTC (rev 7871)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/java/org/jboss/test/ws/jaxws/jbws2187/TestEndpointImpl.java	2008-10-09 15:21:19 UTC (rev 8419)
@@ -1,42 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, 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.test.ws.jaxws.jbws2187;
-
-import javax.jws.WebService;
-
-/**
- * [JBWS-2187] Handler Chain Management Prevents Service Re-Use
- * 
- * @author darran.lofthouse at jboss.com
- * @since 18th July 2008
- * @see https://jira.jboss.org/jira/browse/JBWS-2187
- */
- at WebService(name = "TestEndpoint", targetNamespace = "http://ws.jboss.org/jbws2187", serviceName = "TestService")
-public class TestEndpointImpl implements TestEndpoint
-{
-
-   public String echo(String message)
-   {
-      return message;
-   }
-
-}

Copied: stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/java/org/jboss/test/ws/jaxws/jbws2187/TestEndpointImpl.java (from rev 7871, stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2187/TestEndpointImpl.java)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/java/org/jboss/test/ws/jaxws/jbws2187/TestEndpointImpl.java	                        (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/java/org/jboss/test/ws/jaxws/jbws2187/TestEndpointImpl.java	2008-10-09 15:21:19 UTC (rev 8419)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, 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.test.ws.jaxws.jbws2187;
+
+import javax.jws.WebService;
+
+/**
+ * [JBWS-2187] Handler Chain Management Prevents Service Re-Use
+ * 
+ * @author darran.lofthouse at jboss.com
+ * @since 18th July 2008
+ * @see https://jira.jboss.org/jira/browse/JBWS-2187
+ */
+ at WebService(name = "TestEndpoint", targetNamespace = "http://ws.jboss.org/jbws2187", serviceName = "TestService")
+public class TestEndpointImpl implements TestEndpoint
+{
+
+   public String echo(String message)
+   {
+      return message;
+   }
+
+}

Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/java/org/jboss/test/ws/jaxws/jbws2187/TestHandler.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2187/TestHandler.java	2008-07-21 10:50:31 UTC (rev 7871)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/java/org/jboss/test/ws/jaxws/jbws2187/TestHandler.java	2008-10-09 15:21:19 UTC (rev 8419)
@@ -1,57 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, 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.test.ws.jaxws.jbws2187;
-
-import javax.xml.ws.handler.MessageContext;
-
-import org.jboss.ws.core.jaxws.handler.GenericSOAPHandler;
-
-/**
- * [JBWS-2187] Handler Chain Management Prevents Service Re-Use
- * 
- * @author darran.lofthouse at jboss.com
- * @since 18th July 2008
- * @see https://jira.jboss.org/jira/browse/JBWS-2187
- */
-public class TestHandler extends GenericSOAPHandler
-{
-
-   private static int callCount = 0;
-
-   @Override
-   protected boolean handleOutbound(MessageContext msgContext)
-   {
-      callCount++;
-      return true;
-   }
-
-   public static int getCallCount()
-   {
-      return callCount;
-   }
-
-   public static void clear()
-   {
-      callCount = 0;
-   }
-
-}

Copied: stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/java/org/jboss/test/ws/jaxws/jbws2187/TestHandler.java (from rev 7871, stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2187/TestHandler.java)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/java/org/jboss/test/ws/jaxws/jbws2187/TestHandler.java	                        (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/java/org/jboss/test/ws/jaxws/jbws2187/TestHandler.java	2008-10-09 15:21:19 UTC (rev 8419)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, 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.test.ws.jaxws.jbws2187;
+
+import javax.xml.ws.handler.MessageContext;
+
+import org.jboss.ws.core.jaxws.handler.GenericSOAPHandler;
+
+/**
+ * [JBWS-2187] Handler Chain Management Prevents Service Re-Use
+ * 
+ * @author darran.lofthouse at jboss.com
+ * @since 18th July 2008
+ * @see https://jira.jboss.org/jira/browse/JBWS-2187
+ */
+public class TestHandler extends GenericSOAPHandler
+{
+
+   private static int callCount = 0;
+
+   @Override
+   protected boolean handleOutbound(MessageContext msgContext)
+   {
+      callCount++;
+      return true;
+   }
+
+   public static int getCallCount()
+   {
+      return callCount;
+   }
+
+   public static void clear()
+   {
+      callCount = 0;
+   }
+
+}

Copied: stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/resources/jaxws/jbws2187 (from rev 7871, stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2187)

Copied: stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/resources/jaxws/jbws2187/META-INF (from rev 7871, stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2187/META-INF)

Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/resources/jaxws/jbws2187/META-INF/jbws2187-client-config.xml
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2187/META-INF/jbws2187-client-config.xml	2008-07-21 10:50:31 UTC (rev 7871)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/resources/jaxws/jbws2187/META-INF/jbws2187-client-config.xml	2008-10-09 15:21:19 UTC (rev 8419)
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<jaxws-config
-  xmlns="urn:jboss:jaxws-config:2.0"
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xmlns:javaee="http://java.sun.com/xml/ns/javaee"
-  xsi:schemaLocation="urn:jboss:jaxws-config:2.0 jaxws-config_2_0.xsd">
-
-  <client-config>
-    <config-name>JBWS2187 Config</config-name>
-	
-    <post-handler-chains>
-      <javaee:handler-chain>
-        <javaee:protocol-bindings>##SOAP11_HTTP</javaee:protocol-bindings>
-        <javaee:handler>
-          <javaee:handler-name>JBWS2187 Test Handler</javaee:handler-name>
-          <javaee:handler-class>org.jboss.test.ws.jaxws.jbws2187.TestHandler</javaee:handler-class>
-        </javaee:handler>
-      </javaee:handler-chain>
-    </post-handler-chains>
-  </client-config>
-
-
-</jaxws-config>

Copied: stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/resources/jaxws/jbws2187/META-INF/jbws2187-client-config.xml (from rev 7871, stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2187/META-INF/jbws2187-client-config.xml)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/resources/jaxws/jbws2187/META-INF/jbws2187-client-config.xml	                        (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/resources/jaxws/jbws2187/META-INF/jbws2187-client-config.xml	2008-10-09 15:21:19 UTC (rev 8419)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jaxws-config
+  xmlns="urn:jboss:jaxws-config:2.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+  xsi:schemaLocation="urn:jboss:jaxws-config:2.0 jaxws-config_2_0.xsd">
+
+  <client-config>
+    <config-name>JBWS2187 Config</config-name>
+	
+    <post-handler-chains>
+      <javaee:handler-chain>
+        <javaee:protocol-bindings>##SOAP11_HTTP</javaee:protocol-bindings>
+        <javaee:handler>
+          <javaee:handler-name>JBWS2187 Test Handler</javaee:handler-name>
+          <javaee:handler-class>org.jboss.test.ws.jaxws.jbws2187.TestHandler</javaee:handler-class>
+        </javaee:handler>
+      </javaee:handler-chain>
+    </post-handler-chains>
+  </client-config>
+
+
+</jaxws-config>

Copied: stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/resources/jaxws/jbws2187/WEB-INF (from rev 7871, stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2187/WEB-INF)

Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/resources/jaxws/jbws2187/WEB-INF/jboss-web.xml
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2187/WEB-INF/jboss-web.xml	2008-07-21 10:50:31 UTC (rev 7871)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/resources/jaxws/jbws2187/WEB-INF/jboss-web.xml	2008-10-09 15:21:19 UTC (rev 8419)
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.4//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_4_0.dtd">
-
-<jboss-web>
-   <context-root>/jaxws-jbws2187</context-root>   
-</jboss-web>
\ No newline at end of file

Copied: stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/resources/jaxws/jbws2187/WEB-INF/jboss-web.xml (from rev 7871, stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2187/WEB-INF/jboss-web.xml)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/resources/jaxws/jbws2187/WEB-INF/jboss-web.xml	                        (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/resources/jaxws/jbws2187/WEB-INF/jboss-web.xml	2008-10-09 15:21:19 UTC (rev 8419)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.4//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_4_0.dtd">
+
+<jboss-web>
+   <context-root>/jaxws-jbws2187</context-root>   
+</jboss-web>
\ No newline at end of file

Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/resources/jaxws/jbws2187/WEB-INF/web.xml
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2187/WEB-INF/web.xml	2008-07-21 10:50:31 UTC (rev 7871)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/resources/jaxws/jbws2187/WEB-INF/web.xml	2008-10-09 15:21:19 UTC (rev 8419)
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
-
-   <servlet>
-      <servlet-name>TestEndpoint</servlet-name>
-      <servlet-class>org.jboss.test.ws.jaxws.jbws2187.TestEndpointImpl</servlet-class>
-   </servlet>
-   
-   <servlet-mapping>
-      <servlet-name>TestEndpoint</servlet-name>
-      <url-pattern>/*</url-pattern>
-   </servlet-mapping>
-
-</web-app>
\ No newline at end of file

Copied: stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/resources/jaxws/jbws2187/WEB-INF/web.xml (from rev 7871, stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2187/WEB-INF/web.xml)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/resources/jaxws/jbws2187/WEB-INF/web.xml	                        (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_JBPAPP-1276/src/test/resources/jaxws/jbws2187/WEB-INF/web.xml	2008-10-09 15:21:19 UTC (rev 8419)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+
+   <servlet>
+      <servlet-name>TestEndpoint</servlet-name>
+      <servlet-class>org.jboss.test.ws.jaxws.jbws2187.TestEndpointImpl</servlet-class>
+   </servlet>
+   
+   <servlet-mapping>
+      <servlet-name>TestEndpoint</servlet-name>
+      <url-pattern>/*</url-pattern>
+   </servlet-mapping>
+
+</web-app>
\ No newline at end of file




More information about the jbossws-commits mailing list