You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2007/10/02 20:31:34 UTC

svn commit: r581341 - in /incubator/cxf/trunk: ./ common/common/src/main/java/org/apache/cxf/configuration/spring/ common/common/src/test/java/org/apache/cxf/configuration/spring/ parent/ rt/bindings/http/src/test/java/org/apache/cxf/binding/http/bare/...

Author: dkulp
Date: Tue Oct  2 11:31:33 2007
New Revision: 581341

URL: http://svn.apache.org/viewvc?rev=581341&view=rev
Log:
[CXF-1060]
* Workaround bug in Spring where Maps injected into contructors are always copied into LinkedHashMaps thus loosing concurrency contraints as well as causing all "delayed" beans to be creates/resolved immediately.  (This includes bindings, conduits, destinations, and a bunch of ws-policy assertion things).
* Create ClientOnlyHTTPTransportFactory for use with clients that don't need ws-a style callback things.  (this is part 1.   There are still areas in the code that check for transport Id's from the destinations instead of conduits.   In this case, there will not be a destination registered.)
* For our tests, don't close down the port.  It's causing all kinds of hangs on my Linux box.  (probably bug in JDK or jetty)
* Update to latest gpg plugin


Added:
    incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractSpringBeanMap.java   (with props)
    incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/MapProvider.java   (with props)
    incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/ClientOnlyHTTPTransportFactory.java   (with props)
Removed:
    incubator/cxf/trunk/testutils/src/main/java/de/
Modified:
    incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/SpringBeanMap.java
    incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/SpringBeanQNameMap.java
    incubator/cxf/trunk/common/common/src/test/java/org/apache/cxf/configuration/spring/SpringBeanMapTest.java
    incubator/cxf/trunk/common/common/src/test/java/org/apache/cxf/configuration/spring/SpringBeanQNameMapTest.java
    incubator/cxf/trunk/parent/pom.xml
    incubator/cxf/trunk/pom.xml
    incubator/cxf/trunk/rt/bindings/http/src/test/java/org/apache/cxf/binding/http/bare/ClientTest.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapTransportFactory.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/binding/BindingFactoryManagerImpl.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/AbstractTransportFactory.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/ConduitInitiatorManagerImpl.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/DestinationFactoryManagerImpl.java
    incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java
    incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPTransportFactory.java
    incubator/cxf/trunk/rt/transports/http-jetty/src/main/resources/META-INF/cxf/cxf-extension-http-jetty.xml
    incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPTransportFactory.java
    incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletTransportFactory.java
    incubator/cxf/trunk/rt/transports/http/src/main/resources/META-INF/cxf/cxf-extension-http.xml
    incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/AssertionBuilderRegistryImpl.java
    incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyInterceptorProviderRegistryImpl.java
    incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/external/DomainExpressionBuilderRegistry.java
    incubator/cxf/trunk/systests/src/test/resources/extrajaxbclass.xml
    incubator/cxf/trunk/testutils/src/main/java/org/apache/cxf/testutil/common/ServerLauncher.java

Added: incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractSpringBeanMap.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractSpringBeanMap.java?rev=581341&view=auto
==============================================================================
--- incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractSpringBeanMap.java (added)
+++ incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractSpringBeanMap.java Tue Oct  2 11:31:33 2007
@@ -0,0 +1,268 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.configuration.spring;
+
+import java.beans.PropertyDescriptor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+import org.apache.cxf.helpers.CastUtils;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.BeanInitializationException;
+import org.springframework.beans.factory.InitializingBean;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+
+abstract class AbstractSpringBeanMap<X, V> 
+    implements ApplicationContextAware, InitializingBean, MapProvider<X, V> {
+    protected ApplicationContext context;
+    protected Class<?> type;
+    protected String idsProperty;
+    protected Map<X, List<String>> idToBeanName = new ConcurrentHashMap<X, List<String>>();
+    protected Map<X, V> putStore = new ConcurrentHashMap<X, V>();
+
+    public void setApplicationContext(ApplicationContext ctx) throws BeansException {
+        this.context = ctx;
+    }
+
+    public void afterPropertiesSet() throws Exception {
+        processBeans(context);
+    }
+    
+    public Map<X, V> createMap() {
+        return new SpringBeanMapWrapper(); 
+    }
+    
+    protected abstract void processBeans(ApplicationContext beanFactory);
+
+    protected synchronized List<String> getBeanListForId(X id) {
+        List<String> lst = idToBeanName.get(id);
+        if (lst == null) {
+            lst = new CopyOnWriteArrayList<String>();
+            idToBeanName.put(id, lst);
+        }
+        return lst;
+    }
+
+    protected Collection<String> getIds(Object bean) {
+        try {
+            PropertyDescriptor pd = BeanUtils.getPropertyDescriptor(bean.getClass(), idsProperty);
+            Method method = pd.getReadMethod();
+            Collection<String> c = CastUtils.cast((Collection<?>)method.invoke(bean, new Object[0]));
+
+            return c;
+        } catch (IllegalArgumentException e) {
+            throw new BeanInitializationException("Could not retrieve ids.", e);
+        } catch (IllegalAccessException e) {
+            throw new BeanInitializationException("Could not access id getter.", e);
+        } catch (InvocationTargetException e) {
+            throw new BeanInitializationException("Could not invoke id getter.", e);
+        } catch (SecurityException e) {
+            throw new BeanInitializationException("Could not invoke id getter.", e);
+        }
+    }
+
+    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
+        return bean;
+    }
+
+    public Class<?> getType() {
+        return type;
+    }
+
+    public void setType(Class<?> type) {
+        this.type = type;
+    }
+
+    public String getIdsProperty() {
+        return idsProperty;
+    }
+
+    public void setIdsProperty(String idsProperty) {
+        this.idsProperty = idsProperty;
+    }
+
+    public void clear() {
+        throw new UnsupportedOperationException();
+    }
+
+    public boolean containsKey(Object key) {
+        return idToBeanName.containsKey(key) || putStore.containsKey(key);
+    }
+
+    public boolean containsValue(Object arg0) {
+        throw new UnsupportedOperationException();
+    }
+
+    public Set<java.util.Map.Entry<X, V>> entrySet() {
+        Set<Map.Entry<X, V>> entries = new LinkedHashSet<Map.Entry<X, V>>();
+        for (X k : keySet()) {
+            entries.add(new Entry<X, V>(this, k));
+        }
+        return entries;
+    }
+
+    @SuppressWarnings("unchecked")
+    public V get(Object key) {
+        List<String> names = idToBeanName.get(key);
+        
+        if (names != null) {
+            for (String name : names) {
+                context.getBean(name);
+            }
+            if (putStore.containsKey(key)) {
+                return putStore.get(key);
+            }
+            V v = (V)context.getBean(names.get(0));
+            putStore.put((X)key, v);
+            idToBeanName.remove(key);
+            return v;
+        } else {
+            return putStore.get(key);
+        }
+    }
+
+    public boolean isEmpty() {
+        return idToBeanName.isEmpty() && putStore.isEmpty();
+    }
+
+    public Set<X> keySet() {
+        Set<X> keys = new LinkedHashSet<X>();
+        keys.addAll(putStore.keySet());
+        keys.addAll(idToBeanName.keySet());
+        return keys;
+    }
+
+    public V put(X key, V value) {
+        // Make sure we don't take the key from Spring any more
+        idToBeanName.remove(key);
+        return putStore.put(key, value);
+    }
+
+    public void putAll(Map<? extends X, ? extends V> m) {
+        putStore.putAll(m);
+    }
+
+    public V remove(Object key) {
+        V v = get(key);
+        if (v != null) {
+            idToBeanName.remove(key);
+        } else {
+            v = putStore.get(key);
+        }
+
+        return v;
+    }
+
+    public int size() {
+        return idToBeanName.size() + putStore.size();
+    }
+
+    public Collection<V> values() {
+        List<V> values = new ArrayList<V>();
+        values.addAll(putStore.values());
+        for (X id : idToBeanName.keySet()) {
+            values.add(get(id));
+        }
+        return values;
+    }
+    
+    public static class Entry<X, V> implements Map.Entry<X, V> {
+        private AbstractSpringBeanMap<X, V> map;
+        private X key;
+
+        public Entry(AbstractSpringBeanMap<X, V> map, X key) {
+            this.map = map;
+            this.key = key;
+        }
+        
+        public X getKey() {
+            return key;
+        }
+
+        public V getValue() {
+            return map.get(key);
+        }
+
+        public V setValue(V value) {
+            return map.put(key, value);
+        }
+    }
+    
+    private class SpringBeanMapWrapper implements Map<X, V> {
+
+        public void clear() {
+            AbstractSpringBeanMap.this.clear();
+        }
+
+        public boolean containsKey(Object key) {
+            return AbstractSpringBeanMap.this.containsKey(key);
+        }
+
+        public boolean containsValue(Object value) {
+            return AbstractSpringBeanMap.this.containsValue(value);
+        }
+
+        public Set<java.util.Map.Entry<X, V>> entrySet() {
+            return AbstractSpringBeanMap.this.entrySet();
+        }
+
+        public V get(Object key) {
+            return AbstractSpringBeanMap.this.get(key);
+        }
+
+        public boolean isEmpty() {
+            return AbstractSpringBeanMap.this.isEmpty();
+        }
+
+        public Set<X> keySet() {
+            return AbstractSpringBeanMap.this.keySet();
+        }
+
+        public V put(X key, V value) {
+            return AbstractSpringBeanMap.this.put(key, value);
+        }
+
+        public void putAll(Map<? extends X, ? extends V> t) {
+            AbstractSpringBeanMap.this.putAll(t);
+        }
+
+        public V remove(Object key) {
+            return AbstractSpringBeanMap.this.remove(key);
+        }
+
+        public int size() {
+            return AbstractSpringBeanMap.this.size();
+        }
+
+        public Collection<V> values() {
+            return AbstractSpringBeanMap.this.values();
+        }
+        
+    }
+}

Propchange: incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractSpringBeanMap.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractSpringBeanMap.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/MapProvider.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/MapProvider.java?rev=581341&view=auto
==============================================================================
--- incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/MapProvider.java (added)
+++ incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/MapProvider.java Tue Oct  2 11:31:33 2007
@@ -0,0 +1,38 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.configuration.spring;
+
+import java.util.Map;
+
+/**
+ * This is to workaround an issue with Spring.
+ * 
+ * In spring, if you inject a Map<X, V> into a contructor, it 
+ * ALWAYS will call entrySet and copy the entries into a new
+ * map (HashMap).    Thus, any "deferred" processing will happen
+ * immediately.  Also, things like the Bus may not be completely
+ * initialized.  
+ * 
+ * We'll mark some of our Spring things with this interface and 
+ * allow the MapProvider to be injected.   
+ */
+public interface MapProvider<X, V> {
+    Map<X, V> createMap();
+}

Propchange: incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/MapProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/MapProvider.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/SpringBeanMap.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/SpringBeanMap.java?rev=581341&r1=581340&r2=581341&view=diff
==============================================================================
--- incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/SpringBeanMap.java (original)
+++ incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/SpringBeanMap.java Tue Oct  2 11:31:33 2007
@@ -18,50 +18,26 @@
  */
 package org.apache.cxf.configuration.spring;
 
-import java.beans.PropertyDescriptor;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-
-import org.apache.cxf.helpers.CastUtils;
-import org.springframework.beans.BeanUtils;
-import org.springframework.beans.BeansException;
+
 import org.springframework.beans.Mergeable;
 import org.springframework.beans.PropertyValue;
-import org.springframework.beans.factory.BeanInitializationException;
 import org.springframework.beans.factory.BeanIsAbstractException;
-import org.springframework.beans.factory.InitializingBean;
 import org.springframework.beans.factory.config.BeanDefinition;
 import org.springframework.beans.factory.config.TypedStringValue;
 import org.springframework.beans.factory.support.ManagedList;
 import org.springframework.beans.factory.support.ManagedSet;
 import org.springframework.context.ApplicationContext;
-import org.springframework.context.ApplicationContextAware;
 import org.springframework.context.ConfigurableApplicationContext;
 
-public class SpringBeanMap<V> implements ApplicationContextAware, InitializingBean, Map<String, V> {
-    private ApplicationContext context;
-    private Class<?> type;
-    private String idsProperty;
-    private Map<String, String> idToBeanName = new ConcurrentHashMap<String, String>();
-    private Map<String, V> putStore = new ConcurrentHashMap<String, V>();
-
-    public void setApplicationContext(ApplicationContext ctx) throws BeansException {
-        this.context = ctx;
-    }
-
-    public void afterPropertiesSet() throws Exception {
-        processBeans(context);
-    }
+public class SpringBeanMap<V> 
+    extends AbstractSpringBeanMap<String, V> {
 
-    private void processBeans(ApplicationContext beanFactory) {
+    
+    protected void processBeans(ApplicationContext beanFactory) {
         if (beanFactory == null) {
             return;
         }
@@ -117,7 +93,7 @@
                     ids = newIds;
                 }
                 for (Object id : ids) {
-                    idToBeanName.put(id.toString(), beanNames[i]);
+                    getBeanListForId(id.toString()).add(beanNames[i]);
                 }
             } catch (BeanIsAbstractException e) {
                 // The bean is abstract, we won't be doing anything with it.
@@ -126,140 +102,5 @@
         }
 
         processBeans(ctxt.getParent());
-    }
-
-    private Collection<String> getIds(Object bean) {
-        try {
-            PropertyDescriptor pd = BeanUtils.getPropertyDescriptor(bean.getClass(), idsProperty);
-            Method method = pd.getReadMethod();
-            Collection<String> c = CastUtils.cast((Collection<?>)method.invoke(bean, new Object[0]));
-
-            return c;
-        } catch (IllegalArgumentException e) {
-            throw new BeanInitializationException("Could not retrieve ids.", e);
-        } catch (IllegalAccessException e) {
-            throw new BeanInitializationException("Could not access id getter.", e);
-        } catch (InvocationTargetException e) {
-            throw new BeanInitializationException("Could not invoke id getter.", e);
-        } catch (SecurityException e) {
-            throw new BeanInitializationException("Could not invoke id getter.", e);
-        }
-    }
-
-    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
-        return bean;
-    }
-
-    public Class<?> getType() {
-        return type;
-    }
-
-    public void setType(Class<?> type) {
-        this.type = type;
-    }
-
-    public String getIdsProperty() {
-        return idsProperty;
-    }
-
-    public void setIdsProperty(String idsProperty) {
-        this.idsProperty = idsProperty;
-    }
-
-    public void clear() {
-        throw new UnsupportedOperationException();
-    }
-
-    public boolean containsKey(Object key) {
-        return idToBeanName.containsKey(key) || putStore.containsKey(key);
-    }
-
-    public boolean containsValue(Object arg0) {
-        throw new UnsupportedOperationException();
-    }
-
-    public Set<java.util.Map.Entry<String, V>> entrySet() {
-        Set<Map.Entry<String, V>> entries = new HashSet<Map.Entry<String, V>>();
-        for (String k : keySet()) {
-            entries.add(new Entry<V>(this, k));
-        }
-        return entries;
-    }
-
-    @SuppressWarnings("unchecked")
-    public V get(Object key) {
-        String name = idToBeanName.get(key);
-        if (name != null) {
-            return (V)context.getBean(name);
-        } else {
-            return putStore.get(key);
-        }
-    }
-
-    public boolean isEmpty() {
-        return idToBeanName.isEmpty() && putStore.isEmpty();
-    }
-
-    public Set<String> keySet() {
-        Set<String> keys = new HashSet<String>();
-        keys.addAll(idToBeanName.keySet());
-        keys.addAll(putStore.keySet());
-        return keys;
-    }
-
-    public V put(String key, V value) {
-        // Make sure we don't take the key from Spring any more
-        idToBeanName.remove(key);
-        return putStore.put(key, value);
-    }
-
-    public void putAll(Map<? extends String, ? extends V> m) {
-        putStore.putAll(m);
-    }
-
-    public V remove(Object key) {
-        V v = get(key);
-        if (v != null) {
-            idToBeanName.remove(key);
-        } else {
-            v = putStore.get(key);
-        }
-
-        return v;
-    }
-
-    public int size() {
-        return idToBeanName.size() + putStore.size();
-    }
-
-    public Collection<V> values() {
-        List<V> values = new ArrayList<V>();
-        values.addAll(putStore.values());
-        for (String id : idToBeanName.keySet()) {
-            values.add(get(id));
-        }
-        return values;
-    }
-    
-    public static class Entry<V> implements Map.Entry<String, V> {
-        private SpringBeanMap<V> map;
-        private String key;
-
-        public Entry(SpringBeanMap<V> map, String key) {
-            this.map = map;
-            this.key = key;
-        }
-        
-        public String getKey() {
-            return key;
-        }
-
-        public V getValue() {
-            return map.get(key);
-        }
-
-        public V setValue(V value) {
-            return map.put(key, value);
-        }
     }
 }

Modified: incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/SpringBeanQNameMap.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/SpringBeanQNameMap.java?rev=581341&r1=581340&r2=581341&view=diff
==============================================================================
--- incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/SpringBeanQNameMap.java (original)
+++ incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/SpringBeanQNameMap.java Tue Oct  2 11:31:33 2007
@@ -18,49 +18,23 @@
  */
 package org.apache.cxf.configuration.spring;
 
-import java.beans.PropertyDescriptor;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
 
 import javax.xml.namespace.QName;
 
-import org.apache.cxf.helpers.CastUtils;
-import org.springframework.beans.BeanUtils;
-import org.springframework.beans.BeansException;
 import org.springframework.beans.Mergeable;
 import org.springframework.beans.PropertyValue;
-import org.springframework.beans.factory.BeanInitializationException;
 import org.springframework.beans.factory.BeanIsAbstractException;
-import org.springframework.beans.factory.InitializingBean;
 import org.springframework.beans.factory.config.BeanDefinition;
 import org.springframework.beans.factory.config.BeanReference;
 import org.springframework.context.ApplicationContext;
-import org.springframework.context.ApplicationContextAware;
 import org.springframework.context.ConfigurableApplicationContext;
 
-public class SpringBeanQNameMap<V> implements ApplicationContextAware, InitializingBean, Map<QName, V> {
-    private ApplicationContext context;
-    private Class<?> type;
-    private String idsProperty;
-    private Map<QName, String> idToBeanName = new ConcurrentHashMap<QName, String>();
-    private Map<QName, V> putStore = new ConcurrentHashMap<QName, V>();
+public class SpringBeanQNameMap<V> 
+    extends AbstractSpringBeanMap<QName, V> {
 
-    public void setApplicationContext(ApplicationContext ctx) throws BeansException {
-        this.context = ctx;
-    }
-
-    public void afterPropertiesSet() throws Exception {
-        processBeans(context);
-    }
-
-    private void processBeans(ApplicationContext beanFactory) {
+    protected void processBeans(ApplicationContext beanFactory) {
         if (beanFactory == null) {
             return;
         }
@@ -129,7 +103,7 @@
                 
                 for (Object id : ids) {
                     QName key = (QName)id;
-                    idToBeanName.put(key, beanNames[i]);
+                    getBeanListForId(key).add(beanNames[i]);
                 }
             } catch (BeanIsAbstractException e) {
                 // The bean is abstract, we won't be doing anything with it.
@@ -140,139 +114,4 @@
         processBeans(ctxt.getParent());
     }
 
-    private Collection<QName> getIds(Object bean) {
-        try {
-            PropertyDescriptor pd = BeanUtils.getPropertyDescriptor(bean.getClass(), idsProperty);
-            Method method = pd.getReadMethod();
-            Collection<QName> c = CastUtils.cast((Collection<?>)method.invoke(bean, new Object[0]),
-                QName.class);
-
-            return c;
-        } catch (IllegalArgumentException e) {
-            throw new BeanInitializationException("Could not retrieve ids.", e);
-        } catch (IllegalAccessException e) {
-            throw new BeanInitializationException("Could not access id getter.", e);
-        } catch (InvocationTargetException e) {
-            throw new BeanInitializationException("Could not invoke id getter.", e);
-        } catch (SecurityException e) {
-            throw new BeanInitializationException("Could not invoke id getter.", e);
-        }
-    }
-
-    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
-        return bean;
-    }
-
-    public Class<?> getType() {
-        return type;
-    }
-
-    public void setType(Class<?> type) {
-        this.type = type;
-    }
-
-    public String getIdsProperty() {
-        return idsProperty;
-    }
-
-    public void setIdsProperty(String idsProperty) {
-        this.idsProperty = idsProperty;
-    }
-
-    public void clear() {
-        throw new UnsupportedOperationException();
-    }
-
-    public boolean containsKey(Object key) {
-        return idToBeanName.containsKey(key) || putStore.containsKey(key);
-    }
-
-    public boolean containsValue(Object arg0) {
-        throw new UnsupportedOperationException();
-    }
-
-    public Set<java.util.Map.Entry<QName, V>> entrySet() {
-        Set<Map.Entry<QName, V>> entries = new HashSet<Map.Entry<QName, V>>();
-        for (QName k : keySet()) {
-            entries.add(new Entry<V>(this, k));
-        }
-        return entries;
-    }
-
-    @SuppressWarnings("unchecked")
-    public V get(Object key) {
-        String name = idToBeanName.get(key);
-        if (name != null) {
-            return (V)(context.getBean(name));
-        } else {
-            return putStore.get(key);
-        }
-    }
-
-    public boolean isEmpty() {
-        return idToBeanName.isEmpty() && putStore.isEmpty();
-    }
-
-    public Set<QName> keySet() {
-        Set<QName> keys = new HashSet<QName>();
-        keys.addAll(idToBeanName.keySet());
-        keys.addAll(putStore.keySet());
-        return keys;
-    }
-
-    public V put(QName key, V value) {
-        // Make sure we don't take the key from Spring any more
-        idToBeanName.remove(key);
-        return putStore.put(key, value);
-    }
-
-    public void putAll(Map<? extends QName, ? extends V> m) {
-        putStore.putAll(m);
-    }
-
-    public V remove(Object key) {
-        V v = get(key);
-        if (v != null) {
-            idToBeanName.remove(key);
-        } else {
-            v = putStore.get(key);
-        }
-
-        return v;
-    }
-
-    public int size() {
-        return idToBeanName.size() + putStore.size();
-    }
-
-    public Collection<V> values() {
-        List<V> values = new ArrayList<V>();
-        values.addAll(putStore.values());
-        for (QName id : idToBeanName.keySet()) {
-            values.add(get(id));
-        }
-        return values;
-    }
-    
-    public static class Entry<V> implements Map.Entry<QName, V> {
-        private SpringBeanQNameMap<V> map;
-        private QName key;
-
-        public Entry(SpringBeanQNameMap<V> map, QName key) {
-            this.map = map;
-            this.key = key;
-        }
-        
-        public QName getKey() {
-            return key;
-        }
-
-        public V getValue() {
-            return map.get(key);
-        }
-
-        public V setValue(V value) {
-            return map.put(key, value);
-        }
-    }
 }

Modified: incubator/cxf/trunk/common/common/src/test/java/org/apache/cxf/configuration/spring/SpringBeanMapTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/common/src/test/java/org/apache/cxf/configuration/spring/SpringBeanMapTest.java?rev=581341&r1=581340&r2=581341&view=diff
==============================================================================
--- incubator/cxf/trunk/common/common/src/test/java/org/apache/cxf/configuration/spring/SpringBeanMapTest.java (original)
+++ incubator/cxf/trunk/common/common/src/test/java/org/apache/cxf/configuration/spring/SpringBeanMapTest.java Tue Oct  2 11:31:33 2007
@@ -34,7 +34,9 @@
         ClassPathXmlApplicationContext context = 
             new ClassPathXmlApplicationContext("org/apache/cxf/configuration/spring/beanMap.xml");
 
-        Map<String, Person> beans = CastUtils.cast((Map)context.getBean("mapOfPersons"));
+        
+        Map<String, Person> beans = CastUtils.cast(((MapProvider)context.getBean("mapOfPersons"))
+                                                       .createMap());
         assertNotNull(beans);
 
         assertEquals(2, beans.size());

Modified: incubator/cxf/trunk/common/common/src/test/java/org/apache/cxf/configuration/spring/SpringBeanQNameMapTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/common/src/test/java/org/apache/cxf/configuration/spring/SpringBeanQNameMapTest.java?rev=581341&r1=581340&r2=581341&view=diff
==============================================================================
--- incubator/cxf/trunk/common/common/src/test/java/org/apache/cxf/configuration/spring/SpringBeanQNameMapTest.java (original)
+++ incubator/cxf/trunk/common/common/src/test/java/org/apache/cxf/configuration/spring/SpringBeanQNameMapTest.java Tue Oct  2 11:31:33 2007
@@ -38,7 +38,8 @@
         ClassPathXmlApplicationContext context = 
             new ClassPathXmlApplicationContext("org/apache/cxf/configuration/spring/beanQNameMap.xml");
 
-        Map<QName, Person> beans = CastUtils.cast((Map)context.getBean("committers"));
+        Map<QName, Person> beans = CastUtils.cast(((MapProvider)context.getBean("committers"))
+                                                   .createMap());
         assertNotNull(beans);
 
         assertEquals(2, PersonQNameImpl.getLoadCount());

Modified: incubator/cxf/trunk/parent/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/parent/pom.xml?rev=581341&r1=581340&r2=581341&view=diff
==============================================================================
--- incubator/cxf/trunk/parent/pom.xml (original)
+++ incubator/cxf/trunk/parent/pom.xml Tue Oct  2 11:31:33 2007
@@ -236,6 +236,13 @@
                                 <name>spring.validation.mode</name>
                                 <value>${spring.validation.mode}</value>
                             </property>
+                            <property>
+                                <!-- If we close the port after a client in the same JVM has oppened a keep-alive
+                                connection, on some Linux's, the socket remains consumed until
+                                some timeout occurs.   That may cause some tests to timeout/hang. -->
+                                <name>org.apache.cxf.transports.http_jetty.DontClosePort</name>
+                                <value>true</value>
+                            </property>
                         </systemProperties>
                     </configuration>
                 </plugin>
@@ -921,6 +928,13 @@
                                 <property>
                                     <name>spring.validation.mode</name>
                                     <value>${spring.validation.mode}</value>
+                                </property>
+                                <property>
+                                    <!-- If we close the port after a client in the same JVM has oppened a keep-alive
+                                    connection, on some Linux's, the socket remains consumed until
+                                    some timeout occurs.   That may cause some tests to timeout/hang. -->
+                                    <name>org.apache.cxf.transports.http_jetty.DontClosePort</name>
+                                    <value>true</value>
                                 </property>
                             </systemProperties>
                         </configuration>

Modified: incubator/cxf/trunk/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/pom.xml?rev=581341&r1=581340&r2=581341&view=diff
==============================================================================
--- incubator/cxf/trunk/pom.xml (original)
+++ incubator/cxf/trunk/pom.xml Tue Oct  2 11:31:33 2007
@@ -121,7 +121,7 @@
         </license>
     </licenses>
     <organization>
-        <name>Apache Software Foundation</name>
+        <name>The Apache Software Foundation</name>
         <url>http://www.apache.org/</url>
     </organization>
 
@@ -295,7 +295,7 @@
                     <!-- We want to sign the artifact, the POM, and all attached artifacts -->
                     <plugin>
                         <artifactId>maven-gpg-plugin</artifactId>
-                        <version>1.0-alpha-3</version>
+                        <version>1.0-alpha-4</version>
                         <executions>
                             <execution>
                                 <goals>

Modified: incubator/cxf/trunk/rt/bindings/http/src/test/java/org/apache/cxf/binding/http/bare/ClientTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/http/src/test/java/org/apache/cxf/binding/http/bare/ClientTest.java?rev=581341&r1=581340&r2=581341&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/bindings/http/src/test/java/org/apache/cxf/binding/http/bare/ClientTest.java (original)
+++ incubator/cxf/trunk/rt/bindings/http/src/test/java/org/apache/cxf/binding/http/bare/ClientTest.java Tue Oct  2 11:31:33 2007
@@ -47,7 +47,7 @@
         sf.setBus(getBus());
         sf.setServiceClass(CustomerService.class);
         sf.getServiceFactory().setWrapped(false);
-        sf.setAddress("http://localhost:9001/foo/");
+        sf.setAddress("http://localhost:9002/foo/");
         sf.setServiceBean(new CustomerService());
         //sf.setBindingId(HttpBindingFactory.HTTP_BINDING_ID);
         

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapTransportFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapTransportFactory.java?rev=581341&r1=581340&r2=581341&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapTransportFactory.java (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapTransportFactory.java Tue Oct  2 11:31:33 2007
@@ -171,7 +171,7 @@
         }
 
         DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
-        if (null != dfm) {
+        if (null != dfm && activationNamespaces != null) {
             for (String ns : activationNamespaces) {
                 dfm.registerDestinationFactory(ns, this);
             }

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/binding/BindingFactoryManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/binding/BindingFactoryManagerImpl.java?rev=581341&r1=581340&r2=581341&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/binding/BindingFactoryManagerImpl.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/binding/BindingFactoryManagerImpl.java Tue Oct  2 11:31:33 2007
@@ -30,6 +30,7 @@
 import org.apache.cxf.BusException;
 import org.apache.cxf.common.i18n.BundleUtils;
 import org.apache.cxf.common.i18n.Message;
+import org.apache.cxf.configuration.spring.MapProvider;
 
 public final class BindingFactoryManagerImpl implements BindingFactoryManager {
     
@@ -49,7 +50,10 @@
         }
         this.bindingFactories = bindingFactories;
     }
-
+    public BindingFactoryManagerImpl(MapProvider<String, BindingFactory> bindingFactories) {
+        super();
+        this.bindingFactories = bindingFactories.createMap();
+    }
 
     @Resource
     public void setBus(Bus b) {

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/AbstractTransportFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/AbstractTransportFactory.java?rev=581341&r1=581340&r2=581341&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/AbstractTransportFactory.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/AbstractTransportFactory.java Tue Oct  2 11:31:33 2007
@@ -27,7 +27,7 @@
 /**
  * Helper methods for {@link DestinationFactory}s and {@link ConduitInitiator}s.
  */
-public abstract class AbstractTransportFactory implements DestinationFactory {
+public abstract class AbstractTransportFactory {
     private List<String> transportIds;
 
     public List<String> getTransportIds() {

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/ConduitInitiatorManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/ConduitInitiatorManagerImpl.java?rev=581341&r1=581340&r2=581341&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/ConduitInitiatorManagerImpl.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/ConduitInitiatorManagerImpl.java Tue Oct  2 11:31:33 2007
@@ -31,6 +31,7 @@
 import org.apache.cxf.BusException;
 import org.apache.cxf.common.i18n.BundleUtils;
 import org.apache.cxf.common.i18n.Message;
+import org.apache.cxf.configuration.spring.MapProvider;
 
 public final class ConduitInitiatorManagerImpl implements ConduitInitiatorManager {
 
@@ -41,6 +42,11 @@
     private Bus bus;
     public ConduitInitiatorManagerImpl() {
         conduitInitiators = new ConcurrentHashMap<String, ConduitInitiator>();
+    }
+    
+
+    public ConduitInitiatorManagerImpl(MapProvider<String, ConduitInitiator> conduitInitiators) {
+        this.conduitInitiators = conduitInitiators.createMap();
     }
     
     public ConduitInitiatorManagerImpl(Map<String, ConduitInitiator> conduitInitiators) {

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/DestinationFactoryManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/DestinationFactoryManagerImpl.java?rev=581341&r1=581340&r2=581341&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/DestinationFactoryManagerImpl.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/DestinationFactoryManagerImpl.java Tue Oct  2 11:31:33 2007
@@ -33,6 +33,7 @@
 import org.apache.cxf.bus.extension.DeferredMap;
 import org.apache.cxf.common.i18n.BundleUtils;
 import org.apache.cxf.common.i18n.Message;
+import org.apache.cxf.configuration.spring.MapProvider;
 
 public final class DestinationFactoryManagerImpl implements DestinationFactoryManager {
 
@@ -50,6 +51,9 @@
     public DestinationFactoryManagerImpl(Map<String, DestinationFactory> destinationFactories) {
         this.destinationFactories = destinationFactories;
     }
+    public DestinationFactoryManagerImpl(MapProvider<String, DestinationFactory> destinationFactories) {
+        this.destinationFactories = destinationFactories.createMap();
+    }
 
     @Resource
     public void setBus(Bus b) {
@@ -111,10 +115,10 @@
 
     public DestinationFactory getDestinationFactoryForUri(String uri) {
         //first attempt the ones already registered
-        for (DestinationFactory df : destinationFactories.values()) {
-            for (String prefix : df.getUriPrefixes()) {
+        for (Map.Entry<String, DestinationFactory> df : destinationFactories.entrySet()) {
+            for (String prefix : df.getValue().getUriPrefixes()) {
                 if (uri.startsWith(prefix)) {
-                    return df;
+                    return df.getValue();
                 }
             }
         }

Modified: incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java?rev=581341&r1=581340&r2=581341&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java (original)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java Tue Oct  2 11:31:33 2007
@@ -165,13 +165,30 @@
      * remove it from the factory's cache. 
      */
     public void shutdown() {
-        if (servantCount == 0) {
-            factory.destroyForPort(port);
-        } else {
-            LOG.log(Level.WARNING, "FAILED_TO_SHOWDOWN_ENGINE_MSG", port);
+        if (shouldDestroyPort()) {
+            if (servantCount == 0) {
+                factory.destroyForPort(port);
+            } else {
+                LOG.log(Level.WARNING, "FAILED_TO_SHOWDOWN_ENGINE_MSG", port);
+            }
         }
     }
     
+    private boolean shouldDestroyPort() {
+        //if we shutdown the port, on SOME OS's/JVM's, if a client
+        //in the same jvm had been talking to it at some point and keep alives
+        //are on, then the port is held open for about 60 seconds
+        //afterword and if we restart, connections will then 
+        //get sent into the old stuff where there are 
+        //no longer any servant registered.   They pretty much just hang.
+        
+        //this is most often seen in our unit/system tests that 
+        //test things in the same VM.
+        
+        String s = System.getProperty("org.apache.cxf.transports.http_jetty.DontClosePort");
+        return !Boolean.valueOf(s);
+    }
+    
     /**
      * get the jetty server instance
      * @return
@@ -475,6 +492,8 @@
         }
     }
     
+
+    
     /**
      * This method is called by the ServerEngine Factory to destroy the 
      * listener.
@@ -482,10 +501,11 @@
      */
     protected void stop() throws Exception {
         if (server != null) {
+            
             connector.close();
             server.stop();
             server.destroy();
-            server   = null;
+            server = null;
         }
     }
     

Modified: incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPTransportFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPTransportFactory.java?rev=581341&r1=581340&r2=581341&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPTransportFactory.java (original)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPTransportFactory.java Tue Oct  2 11:31:33 2007
@@ -20,6 +20,7 @@
 
 import java.io.IOException;
 import java.security.GeneralSecurityException;
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -30,9 +31,12 @@
 import org.apache.cxf.Bus;
 import org.apache.cxf.service.model.EndpointInfo;
 import org.apache.cxf.transport.Destination;
+import org.apache.cxf.transport.DestinationFactory;
+import org.apache.cxf.transport.DestinationFactoryManager;
 import org.apache.cxf.transport.http.AbstractHTTPTransportFactory;
 
-public class JettyHTTPTransportFactory extends AbstractHTTPTransportFactory {
+public class JettyHTTPTransportFactory extends AbstractHTTPTransportFactory
+    implements DestinationFactory {
 
     private Map<String, JettyHTTPDestination> destinations = 
         new HashMap<String, JettyHTTPDestination>();
@@ -48,6 +52,23 @@
 
     @PostConstruct
     public void finalizeConfig() {
+        if (null == bus) {
+            return;
+        }
+        
+        if (getTransportIds() == null) {
+            setTransportIds(new ArrayList<String>(activationNamespaces));
+        }
+        if (activationNamespaces == null) {
+            activationNamespaces = getTransportIds();
+        }
+        DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
+        if (null != dfm && null != activationNamespaces) {
+            for (String ns : activationNamespaces) {
+                dfm.registerDestinationFactory(ns, this);
+            }
+        }
+
         // This call will register the server engine factory
         // with the Bus.
         getJettyHTTPServerEngineFactory();
@@ -73,7 +94,6 @@
         return serverEngineFactory;
     }
     
-    @Override
     public Destination getDestination(EndpointInfo endpointInfo) 
         throws IOException {
         

Modified: incubator/cxf/trunk/rt/transports/http-jetty/src/main/resources/META-INF/cxf/cxf-extension-http-jetty.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/main/resources/META-INF/cxf/cxf-extension-http-jetty.xml?rev=581341&r1=581340&r2=581341&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/transports/http-jetty/src/main/resources/META-INF/cxf/cxf-extension-http-jetty.xml (original)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/main/resources/META-INF/cxf/cxf-extension-http-jetty.xml Tue Oct  2 11:31:33 2007
@@ -23,7 +23,11 @@
        xsi:schemaLocation="
 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
     
-    <bean class="org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory" lazy-init="true">
+	<import resource="classpath:META-INF/cxf/cxf-extension-http.xml" />
+        
+    <bean class="org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory"
+    	lazy-init="false" 
+    	depends-on="org.apache.cxf.transport.http.ClientOnlyHTTPTransportFactory">
         <property name="bus" ref="cxf"/>
         <property name="transportIds">
             <list>
@@ -36,4 +40,5 @@
             </list>
         </property>
     </bean>
+
 </beans>

Modified: incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPTransportFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPTransportFactory.java?rev=581341&r1=581340&r2=581341&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPTransportFactory.java (original)
+++ incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPTransportFactory.java Tue Oct  2 11:31:33 2007
@@ -44,9 +44,6 @@
 import org.apache.cxf.transport.Conduit;
 import org.apache.cxf.transport.ConduitInitiator;
 import org.apache.cxf.transport.ConduitInitiatorManager;
-import org.apache.cxf.transport.Destination;
-import org.apache.cxf.transport.DestinationFactory;
-import org.apache.cxf.transport.DestinationFactoryManager;
 import org.apache.cxf.transport.https.HttpsURLConnectionFactory;
 import org.apache.cxf.ws.addressing.EndpointReferenceType;
 import org.apache.cxf.wsdl11.WSDLEndpointFactory;
@@ -57,13 +54,12 @@
  * As a ConduitInitiator, this class sets up new HTTPConduits for particular
  * endpoints.
  *
- * TODO: Document DestinationFactory
  * TODO: Document WSDLEndpointFactory
  *
  */
 public abstract class AbstractHTTPTransportFactory 
     extends AbstractTransportFactory 
-    implements ConduitInitiator, DestinationFactory, WSDLEndpointFactory {
+    implements ConduitInitiator, WSDLEndpointFactory {
 
     /**
      * This constant holds the prefixes served by this factory.
@@ -78,7 +74,7 @@
      * The CXF Bus which this HTTPTransportFactory
      * is governed.
      */
-    private Bus bus;
+    protected Bus bus;
   
     /**
      * This collection contains "activationNamespaces" which is synominous
@@ -86,7 +82,7 @@
      * AbstractTransportFactory.
      * TODO: Change these to "transportIds"?
      */
-    private Collection<String> activationNamespaces;
+    protected Collection<String> activationNamespaces;
 
     /**
      * This method is used by Spring to inject the bus.
@@ -129,22 +125,17 @@
         
         if (getTransportIds() == null) {
             setTransportIds(new ArrayList<String>(activationNamespaces));
+        } else if (activationNamespaces == null) {
+            activationNamespaces = getTransportIds();
         }
         
         ConduitInitiatorManager cim = bus.getExtension(ConduitInitiatorManager.class);
-
         //Note, activationNamespaces can be null
         if (null != cim && null != activationNamespaces) {
             for (String ns : activationNamespaces) {
                 cim.registerConduitInitiator(ns, this);
             }
         }
-        DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
-        if (null != dfm && null != activationNamespaces) {
-            for (String ns : activationNamespaces) {
-                dfm.registerDestinationFactory(ns, this);
-            }
-        }
     }
 
     /**
@@ -174,9 +165,6 @@
         conduit.finalizeConfig();
         return conduit;
     }
-
-    public abstract Destination getDestination(EndpointInfo endpointInfo) throws IOException;
-
 
     public EndpointInfo createEndpointInfo(
         ServiceInfo serviceInfo, 

Added: incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/ClientOnlyHTTPTransportFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/ClientOnlyHTTPTransportFactory.java?rev=581341&view=auto
==============================================================================
--- incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/ClientOnlyHTTPTransportFactory.java (added)
+++ incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/ClientOnlyHTTPTransportFactory.java Tue Oct  2 11:31:33 2007
@@ -0,0 +1,26 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.transport.http;
+
+public class ClientOnlyHTTPTransportFactory extends AbstractHTTPTransportFactory {
+
+    public ClientOnlyHTTPTransportFactory() {
+    }
+
+}

Propchange: incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/ClientOnlyHTTPTransportFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/ClientOnlyHTTPTransportFactory.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletTransportFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletTransportFactory.java?rev=581341&r1=581340&r2=581341&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletTransportFactory.java (original)
+++ incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletTransportFactory.java Tue Oct  2 11:31:33 2007
@@ -29,12 +29,14 @@
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 
+import javax.annotation.PostConstruct;
 import javax.annotation.Resource;
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.service.model.EndpointInfo;
 import org.apache.cxf.transport.Destination;
 import org.apache.cxf.transport.DestinationFactory;
+import org.apache.cxf.transport.DestinationFactoryManager;
 import org.apache.cxf.transport.http.AbstractHTTPTransportFactory;
 
 public class ServletTransportFactory extends AbstractHTTPTransportFactory
@@ -63,6 +65,19 @@
     @Resource(name = "bus")
     public void setBus(Bus b) {
         super.setBus(b);
+    }
+    
+    @PostConstruct
+    public void register() {
+        if (null == bus) {
+            return;
+        }
+        DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
+        if (null != dfm && null != activationNamespaces) {
+            for (String ns : activationNamespaces) {
+                dfm.registerDestinationFactory(ns, this);
+            }
+        }
     }
     
     public void removeDestination(String path) {

Modified: incubator/cxf/trunk/rt/transports/http/src/main/resources/META-INF/cxf/cxf-extension-http.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http/src/main/resources/META-INF/cxf/cxf-extension-http.xml?rev=581341&r1=581340&r2=581341&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/transports/http/src/main/resources/META-INF/cxf/cxf-extension-http.xml (original)
+++ incubator/cxf/trunk/rt/transports/http/src/main/resources/META-INF/cxf/cxf-extension-http.xml Tue Oct  2 11:31:33 2007
@@ -25,5 +25,21 @@
     
     <bean class="org.apache.cxf.transport.http.policy.HTTPClientAssertionBuilder"/>
     <bean class="org.apache.cxf.transport.http.policy.HTTPServerAssertionBuilder"/>
-
+    
+    
+    <bean class="org.apache.cxf.transport.http.ClientOnlyHTTPTransportFactory"
+    	id="org.apache.cxf.transport.http.ClientOnlyHTTPTransportFactory" 
+    	lazy-init="true">
+        <property name="bus" ref="cxf"/>
+        <property name="transportIds">
+            <list>
+                <value>http://schemas.xmlsoap.org/soap/http</value>
+                <value>http://schemas.xmlsoap.org/wsdl/http/</value>
+                <value>http://schemas.xmlsoap.org/wsdl/soap/http</value>
+ 	            <value>http://www.w3.org/2003/05/soap/bindings/HTTP/</value>
+                <value>http://cxf.apache.org/transports/http/configuration</value>
+                <value>http://cxf.apache.org/bindings/xformat</value>
+            </list>
+        </property>
+    </bean>
 </beans>

Modified: incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/AssertionBuilderRegistryImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/AssertionBuilderRegistryImpl.java?rev=581341&r1=581340&r2=581341&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/AssertionBuilderRegistryImpl.java (original)
+++ incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/AssertionBuilderRegistryImpl.java Tue Oct  2 11:31:33 2007
@@ -32,6 +32,7 @@
 import org.apache.cxf.common.i18n.BundleUtils;
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.configuration.spring.MapProvider;
 import org.apache.cxf.extension.BusExtension;
 import org.apache.cxf.extension.RegistryImpl;
 import org.apache.neethi.Assertion;
@@ -50,11 +51,14 @@
     private List<QName> ignored = new ArrayList<QName>(IGNORED_CACHE_SIZE);
     
     public AssertionBuilderRegistryImpl() {
-        this(null);
+        super(null);
     }
 
     public AssertionBuilderRegistryImpl(Map<QName, AssertionBuilder> builders) {
         super(builders);
+    }
+    public AssertionBuilderRegistryImpl(MapProvider<QName, AssertionBuilder> builders) {
+        super(builders.createMap());
     }
 
     public Class<?> getRegistrationType() {

Modified: incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyInterceptorProviderRegistryImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyInterceptorProviderRegistryImpl.java?rev=581341&r1=581340&r2=581341&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyInterceptorProviderRegistryImpl.java (original)
+++ incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyInterceptorProviderRegistryImpl.java Tue Oct  2 11:31:33 2007
@@ -26,6 +26,7 @@
 
 import javax.xml.namespace.QName;
 
+import org.apache.cxf.configuration.spring.MapProvider;
 import org.apache.cxf.extension.BusExtension;
 import org.apache.cxf.extension.RegistryImpl;
 import org.apache.cxf.interceptor.Interceptor;
@@ -39,11 +40,14 @@
     implements PolicyInterceptorProviderRegistry, BusExtension {
 
     public PolicyInterceptorProviderRegistryImpl() {
-        this(null);
+        super(null);
     }
 
     public PolicyInterceptorProviderRegistryImpl(Map<QName, PolicyInterceptorProvider> interceptors) {
         super(interceptors);
+    }    
+    public PolicyInterceptorProviderRegistryImpl(MapProvider<QName, PolicyInterceptorProvider> interceptors) {
+        super(interceptors.createMap());
     }    
 
     public Class<?> getRegistrationType() {

Modified: incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/external/DomainExpressionBuilderRegistry.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/external/DomainExpressionBuilderRegistry.java?rev=581341&r1=581340&r2=581341&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/external/DomainExpressionBuilderRegistry.java (original)
+++ incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/external/DomainExpressionBuilderRegistry.java Tue Oct  2 11:31:33 2007
@@ -28,6 +28,7 @@
 
 import org.apache.cxf.common.i18n.BundleUtils;
 import org.apache.cxf.common.i18n.Message;
+import org.apache.cxf.configuration.spring.MapProvider;
 import org.apache.cxf.extension.BusExtension;
 import org.apache.cxf.extension.RegistryImpl;
 import org.apache.cxf.ws.policy.AssertionBuilderRegistry;
@@ -42,11 +43,14 @@
     private static final ResourceBundle BUNDLE = BundleUtils.getBundle(AssertionBuilderRegistry.class);
     
     public DomainExpressionBuilderRegistry() {
-        this(null);
+        super(null);
     }
 
     public DomainExpressionBuilderRegistry(Map<QName, DomainExpressionBuilder> builders) {
         super(builders);
+    }
+    public DomainExpressionBuilderRegistry(MapProvider<QName, DomainExpressionBuilder> builders) {
+        super(builders.createMap());
     }
     
     public Class<?> getRegistrationType() {

Modified: incubator/cxf/trunk/systests/src/test/resources/extrajaxbclass.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/resources/extrajaxbclass.xml?rev=581341&r1=581340&r2=581341&view=diff
==============================================================================
--- incubator/cxf/trunk/systests/src/test/resources/extrajaxbclass.xml (original)
+++ incubator/cxf/trunk/systests/src/test/resources/extrajaxbclass.xml Tue Oct  2 11:31:33 2007
@@ -30,6 +30,7 @@
 	<!-- CXF -->
 	<import resource="classpath:META-INF/cxf/cxf.xml" />
 	<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
+	<import resource="classpath:META-INF/cxf/cxf-extension-http.xml" />
 	<import resource="classpath:META-INF/cxf/cxf-extension-http-jetty.xml" />
 
 

Modified: incubator/cxf/trunk/testutils/src/main/java/org/apache/cxf/testutil/common/ServerLauncher.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/testutils/src/main/java/org/apache/cxf/testutil/common/ServerLauncher.java?rev=581341&r1=581340&r2=581341&view=diff
==============================================================================
--- incubator/cxf/trunk/testutils/src/main/java/org/apache/cxf/testutil/common/ServerLauncher.java (original)
+++ incubator/cxf/trunk/testutils/src/main/java/org/apache/cxf/testutil/common/ServerLauncher.java Tue Oct  2 11:31:33 2007
@@ -324,6 +324,17 @@
         }
 
         cmd.add("-ea");
+        
+        cmd.add("-Djavax.xml.ws.spi.Provider=org.apache.cxf.bus.jaxws.spi.ProviderImpl");
+        String portClose = System.getProperty("org.apache.cxf.transports.http_jetty.DontClosePort");
+        if (portClose != null) {
+            cmd.add("-Dorg.apache.cxf.transports.http_jetty.DontClosePort=" + portClose);
+        }
+        String loggingPropertiesFile = System.getProperty("java.util.logging.config.file");
+        if (null != loggingPropertiesFile) {
+            cmd.add("-Djava.util.logging.config.file=" + loggingPropertiesFile);
+        } 
+        
         cmd.add("-classpath");
         
         ClassLoader loader = this.getClass().getClassLoader();
@@ -337,12 +348,6 @@
         }
         cmd.add(classpath.toString());
         
-        cmd.add("-Djavax.xml.ws.spi.Provider=org.apache.cxf.bus.jaxws.spi.ProviderImpl");
-        
-        String loggingPropertiesFile = System.getProperty("java.util.logging.config.file");
-        if (null != loggingPropertiesFile) {
-            cmd.add("-Djava.util.logging.config.file=" + loggingPropertiesFile);
-        } 
 
         // If the client set the transformer factory property,
         // we want the server to also set that property.