cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r807745 - in /cxf/trunk: common/common/src/main/java/org/apache/cxf/common/injection/ common/common/src/main/java/org/apache/cxf/configuration/spring/ common/common/src/main/java/org/apache/cxf/resource/ rt/core/src/main/java/org/apache/cxf...
Date Tue, 25 Aug 2009 18:21:40 GMT
Author: dkulp
Date: Tue Aug 25 18:21:38 2009
New Revision: 807745

URL: http://svn.apache.org/viewvc?rev=807745&view=rev
Log:
Work on reducing startup time by lazy-initting things and marking
classes that Jsr250BeanPostProcessor don't need to deal with

Added:
    cxf/trunk/common/common/src/main/java/org/apache/cxf/common/injection/NoJSR250Annotations.java
      - copied, changed from r807205, cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/ClasspathResolver.java
Modified:
    cxf/trunk/common/common/src/main/java/org/apache/cxf/common/injection/ResourceInjector.java
    cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/SpringBeanMap.java
    cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/ClassLoaderResolver.java
    cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/ClasspathResolver.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/resource/ResourceManagerImpl.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusApplicationContextResourceResolver.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusExtensionPostProcessor.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/Jsr250BeanPostProcessor.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/buslifecycle/CXFBusLifeCycleManager.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/catalog/OASISCatalogManager.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/configuration/spring/ConfigurerImpl.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/EndpointResolverRegistryImpl.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ServerRegistryImpl.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ServiceContractResolverRegistryImpl.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/headers/HeaderManagerImpl.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/FactoryBeanListenerManager.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/http/QueryHandlerRegistryImpl.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/http/WSDLQueryHandler.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/workqueue/WorkQueueManagerImpl.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLManagerImpl.java
    cxf/trunk/rt/core/src/main/resources/META-INF/cxf/cxf.xml
    cxf/trunk/rt/core/src/test/java/org/apache/cxf/endpoint/EndpointResolverRegistryImplTest.java
    cxf/trunk/rt/core/src/test/java/org/apache/cxf/endpoint/ServiceContractResolverRegistryImplTest.java
    cxf/trunk/systests/src/test/java/org/apache/cxf/systest/resolver/JarResolverTest.java

Copied: cxf/trunk/common/common/src/main/java/org/apache/cxf/common/injection/NoJSR250Annotations.java (from r807205, cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/ClasspathResolver.java)
URL: http://svn.apache.org/viewvc/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/injection/NoJSR250Annotations.java?p2=cxf/trunk/common/common/src/main/java/org/apache/cxf/common/injection/NoJSR250Annotations.java&p1=cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/ClasspathResolver.java&r1=807205&r2=807745&rev=807745&view=diff
==============================================================================
--- cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/ClasspathResolver.java (original)
+++ cxf/trunk/common/common/src/main/java/org/apache/cxf/common/injection/NoJSR250Annotations.java Tue Aug 25 18:21:38 2009
@@ -17,29 +17,25 @@
  * under the License.
  */
 
-package org.apache.cxf.resource;
+package org.apache.cxf.common.injection;
 
-
-import java.io.InputStream;
-import java.net.URL;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
 
 /**
- * Resolve resources from the system class path.
+ * Marker annotation to let our JSR250 Processor know
+ * not to bother examining the class for annotations
+ * as it's know not to have any 
  */
-public class ClasspathResolver implements ResourceResolver {
-
-    public <T> T resolve(String resourceName, Class<T> resourceType) { 
-        if (resourceName == null) {
-            return null;
-        }
-        URL url = ClassLoader.getSystemResource(resourceName);
-        if (resourceType.isInstance(url)) {
-            return resourceType.cast(url);
-        }
-        return null;
-    } 
-
-    public InputStream getAsStream(String name) { 
-        return ClassLoader.getSystemResourceAsStream(name);
-    } 
+@Target({ ElementType.TYPE })
+@Retention(RetentionPolicy.RUNTIME)
+public @interface NoJSR250Annotations {
+    
+    /**
+     * If these fields are null, it will go ahead and do JSR250 processing
+     * as it assumes the values were not set via a constructor
+     */
+    String[] unlessNull() default { };
 }

Modified: cxf/trunk/common/common/src/main/java/org/apache/cxf/common/injection/ResourceInjector.java
URL: http://svn.apache.org/viewvc/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/injection/ResourceInjector.java?rev=807745&r1=807744&r2=807745&view=diff
==============================================================================
--- cxf/trunk/common/common/src/main/java/org/apache/cxf/common/injection/ResourceInjector.java (original)
+++ cxf/trunk/common/common/src/main/java/org/apache/cxf/common/injection/ResourceInjector.java Tue Aug 25 18:21:38 2009
@@ -34,6 +34,8 @@
 import javax.annotation.PreDestroy;
 import javax.annotation.Resource;
 import javax.annotation.Resources;
+import javax.xml.namespace.QName;
+
 
 import org.apache.cxf.common.annotation.AbstractAnnotationVisitor;
 import org.apache.cxf.common.annotation.AnnotationProcessor;
@@ -52,12 +54,12 @@
     private static final List<Class<? extends Annotation>> ANNOTATIONS = 
         new ArrayList<Class<? extends Annotation>>();
     
-        
     static {
         ANNOTATIONS.add(Resource.class);
         ANNOTATIONS.add(Resources.class);
     }
     
+    
     private final ResourceManager resourceManager; 
     private final List<ResourceResolver> resourceResolvers;
 
@@ -71,29 +73,69 @@
         resourceResolvers = resolvers;
     }
     
+    private static Field getField(Class<?> cls, String name) {
+        if (cls == null) {
+            return null;
+        }
+        try {
+            return cls.getDeclaredField(name);
+        } catch (Exception ex) {
+            return getField(cls.getSuperclass(), name);
+        }
+    }
+    
+    public static boolean processable(Class<?> cls, Object o) {
+        if (QName.class.equals(cls)) {
+            return false;
+        }
+        NoJSR250Annotations njsr = cls.getAnnotation(NoJSR250Annotations.class);
+        if (njsr != null) {
+            for (String s : njsr.unlessNull()) {
+                try {
+                    Field f = getField(cls, s);
+                    f.setAccessible(true);
+                    if (f.get(o) == null) {
+                        return true;
+                    }
+                } catch (Exception ex) {
+                    return true;
+                }
+            }
+            return false;
+        }
+        return true;
+    }
     
     public void inject(Object o) {        
         inject(o, o.getClass());
     }
     
-    public void inject(Object o, Class claz) {
-        AnnotationProcessor processor = new AnnotationProcessor(o); 
-        processor.accept(this, claz); 
+    public void inject(Object o, Class<?> claz) {
+        if (processable(claz, o)) {
+            AnnotationProcessor processor = new AnnotationProcessor(o); 
+            processor.accept(this, claz);
+        }
     }
     
     public void construct(Object o) {
         setTarget(o);
-        invokePostConstruct();
+        if (processable(targetClass, o)) {
+            invokePostConstruct();
+        }
     }
     public void construct(Object o, Class<?> cls) {
         setTarget(o, cls);
-        invokePostConstruct();
+        if (processable(targetClass, o)) {
+            invokePostConstruct();
+        }
     }
 
 
     public void destroy(Object o) {
         setTarget(o);
-        invokePreDestroy();
+        if (processable(targetClass, o)) {
+            invokePreDestroy();
+        }
     }
 
 

Modified: cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/SpringBeanMap.java
URL: http://svn.apache.org/viewvc/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/SpringBeanMap.java?rev=807745&r1=807744&r2=807745&view=diff
==============================================================================
--- cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/SpringBeanMap.java (original)
+++ cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/SpringBeanMap.java Tue Aug 25 18:21:38 2009
@@ -23,6 +23,7 @@
 import java.util.Iterator;
 import java.util.List;
 
+import org.apache.cxf.common.injection.NoJSR250Annotations;
 import org.springframework.beans.Mergeable;
 import org.springframework.beans.PropertyValue;
 import org.springframework.beans.factory.BeanIsAbstractException;
@@ -33,6 +34,7 @@
 import org.springframework.context.ApplicationContext;
 import org.springframework.context.ConfigurableApplicationContext;
 
+@NoJSR250Annotations
 public class SpringBeanMap<V> 
     extends AbstractSpringBeanMap<String, V> {
 

Modified: cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/ClassLoaderResolver.java
URL: http://svn.apache.org/viewvc/cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/ClassLoaderResolver.java?rev=807745&r1=807744&r2=807745&view=diff
==============================================================================
--- cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/ClassLoaderResolver.java (original)
+++ cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/ClassLoaderResolver.java Tue Aug 25 18:21:38 2009
@@ -20,8 +20,12 @@
 package org.apache.cxf.resource;
 
 import java.io.InputStream;
+
 import java.net.URL;
 
+import org.apache.cxf.common.injection.NoJSR250Annotations;
+
+@NoJSR250Annotations
 public class ClassLoaderResolver implements ResourceResolver {
 
     private final ClassLoader loader; 

Modified: cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/ClasspathResolver.java
URL: http://svn.apache.org/viewvc/cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/ClasspathResolver.java?rev=807745&r1=807744&r2=807745&view=diff
==============================================================================
--- cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/ClasspathResolver.java (original)
+++ cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/ClasspathResolver.java Tue Aug 25 18:21:38 2009
@@ -23,9 +23,12 @@
 import java.io.InputStream;
 import java.net.URL;
 
+import org.apache.cxf.common.injection.NoJSR250Annotations;
+
 /**
  * Resolve resources from the system class path.
  */
+@NoJSR250Annotations
 public class ClasspathResolver implements ResourceResolver {
 
     public <T> T resolve(String resourceName, Class<T> resourceType) { 

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java?rev=807745&r1=807744&r2=807745&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java Tue Aug 25 18:21:38 2009
@@ -26,9 +26,11 @@
 import org.apache.cxf.Bus;
 import org.apache.cxf.BusFactory;
 import org.apache.cxf.buslifecycle.BusLifeCycleManager;
+import org.apache.cxf.common.injection.NoJSR250Annotations;
 import org.apache.cxf.feature.AbstractFeature;
 import org.apache.cxf.interceptor.AbstractBasicInterceptorProvider;
 
+@NoJSR250Annotations
 public class CXFBusImpl extends AbstractBasicInterceptorProvider implements Bus {    
     
     protected final Map<Class, Object> extensions;

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/resource/ResourceManagerImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/resource/ResourceManagerImpl.java?rev=807745&r1=807744&r2=807745&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/resource/ResourceManagerImpl.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/resource/ResourceManagerImpl.java Tue Aug 25 18:21:38 2009
@@ -22,10 +22,10 @@
 import java.util.List;
 import java.util.Map;
 
-import javax.annotation.PostConstruct;
 import javax.annotation.Resource;
 
 import org.apache.cxf.Bus;
+import org.apache.cxf.common.injection.NoJSR250Annotations;
 import org.apache.cxf.extension.BusExtension;
 import org.apache.cxf.resource.DefaultResourceManager;
 import org.apache.cxf.resource.ObjectTypeResolver;
@@ -33,7 +33,7 @@
 import org.apache.cxf.resource.ResourceManager;
 import org.apache.cxf.resource.ResourceResolver;
 
-
+@NoJSR250Annotations(unlessNull = "bus")
 public class ResourceManagerImpl extends DefaultResourceManager implements BusExtension {
 
     private Bus bus;
@@ -44,6 +44,10 @@
     public ResourceManagerImpl(List<ResourceResolver> r) {
         super(r);
     }
+    public ResourceManagerImpl(Bus b, List<ResourceResolver> r) {
+        super(r);
+        setBus(b);
+    }
 
     public ResourceManagerImpl(Map<String, Object> properties) { 
         super();
@@ -62,14 +66,10 @@
     }
     
     @Resource
-    public void setBus(Bus b) {
+    public final void setBus(Bus b) {
         bus = b;
-    }
-
-    @PostConstruct
-    public void register() {
         super.addResourceResolver(new ObjectTypeResolver(bus));
-        if (null != bus && bus.getExtension(ResourceManager.class) != this) {
+        if (null != bus) {
             bus.setExtension(this, ResourceManager.class);
         }
     }

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusApplicationContextResourceResolver.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusApplicationContextResourceResolver.java?rev=807745&r1=807744&r2=807745&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusApplicationContextResourceResolver.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusApplicationContextResourceResolver.java Tue Aug 25 18:21:38 2009
@@ -22,6 +22,7 @@
 import java.io.InputStream;
 import java.net.URL;
 
+import org.apache.cxf.common.injection.NoJSR250Annotations;
 import org.apache.cxf.resource.ResourceResolver;
 
 import org.springframework.beans.BeansException;
@@ -30,7 +31,7 @@
 import org.springframework.context.ApplicationContextAware;
 import org.springframework.core.io.Resource;
 
-
+@NoJSR250Annotations
 public class BusApplicationContextResourceResolver 
     implements ResourceResolver, ApplicationContextAware {
     

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusExtensionPostProcessor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusExtensionPostProcessor.java?rev=807745&r1=807744&r2=807745&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusExtensionPostProcessor.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusExtensionPostProcessor.java Tue Aug 25 18:21:38 2009
@@ -21,6 +21,7 @@
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.bus.CXFBusImpl;
+import org.apache.cxf.common.injection.NoJSR250Annotations;
 import org.apache.cxf.extension.BusExtension;
 
 import org.springframework.beans.BeansException;
@@ -30,6 +31,7 @@
 import org.springframework.context.ApplicationContextAware;
 import org.springframework.core.Ordered;
 
+@NoJSR250Annotations
 public class BusExtensionPostProcessor implements BeanPostProcessor, ApplicationContextAware, Ordered {
 
     private Bus bus;

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/Jsr250BeanPostProcessor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/Jsr250BeanPostProcessor.java?rev=807745&r1=807744&r2=807745&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/Jsr250BeanPostProcessor.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/Jsr250BeanPostProcessor.java Tue Aug 25 18:21:38 2009
@@ -19,16 +19,11 @@
 
 package org.apache.cxf.bus.spring;
 
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
 
 
+import org.apache.cxf.Bus;
 import org.apache.cxf.common.injection.ResourceInjector;
-import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.resource.ResourceManager;
-import org.apache.cxf.resource.ResourceResolver;
 import org.springframework.beans.BeansException;
 import org.springframework.beans.factory.config.DestructionAwareBeanPostProcessor;
 import org.springframework.context.ApplicationContext;
@@ -39,12 +34,11 @@
     implements DestructionAwareBeanPostProcessor, Ordered, ApplicationContextAware {
 
     private ResourceManager resourceManager;
-    private List<ResourceResolver> resolvers;
-    
     private ApplicationContext context;
 
     private boolean isProcessing = true;
-    
+    //private int count;
+
     Jsr250BeanPostProcessor() {
     }
     
@@ -63,20 +57,27 @@
         return 1010;
     }
         
+    private boolean injectable(Object bean, String beanId) {
+        return !"cxf".equals(beanId) && ResourceInjector.processable(bean.getClass(), bean);
+    }
+    private ResourceManager getResourceManager(Object bean) {
+        if (resourceManager == null) {
+            if (bean instanceof ResourceManager) {
+                resourceManager = (ResourceManager)bean;
+            } else {
+                Bus b = (Bus)context.getBean("cxf");
+                resourceManager = b.getExtension(ResourceManager.class);
+            }
+        }
+        return resourceManager;
+    }
     public Object postProcessAfterInitialization(Object bean, String beanId) throws BeansException {
         if (!isProcessing) {
             return bean;
         }
-        if (bean != null) {
-            new ResourceInjector(resourceManager, resolvers).construct(bean);
-        }
-        if (bean instanceof ResourceManager) {
-            resourceManager = (ResourceManager)bean;
-
-            Map<String, Object> mp = CastUtils.cast(context.getBeansOfType(ResourceResolver.class));
-            Collection<ResourceResolver> resolvs = CastUtils.cast(mp.values());
-            resolvers = new ArrayList<ResourceResolver>(resourceManager.getResourceResolvers());
-            resolvers.addAll(resolvs);
+        if (bean != null 
+            && injectable(bean, beanId)) {
+            new ResourceInjector(getResourceManager(bean)).construct(bean);
         }
         return bean;
     }
@@ -85,8 +86,10 @@
         if (!isProcessing) {
             return bean;
         }
-        if (bean != null) {
-            new ResourceInjector(resourceManager, resolvers).inject(bean);
+        if (bean != null 
+            && injectable(bean, beanId)) {
+            //System.err.println(++count + ": " + bean.getClass().getName() + " " + beanId);
+            new ResourceInjector(getResourceManager(bean)).inject(bean);
         }
         return bean;
     }
@@ -95,8 +98,9 @@
         if (!isProcessing) {
             return;
         }
-        if (bean != null) {
-            new ResourceInjector(resourceManager, resolvers).destroy(bean);
+        if (bean != null 
+            && injectable(bean, beanId)) {
+            new ResourceInjector(getResourceManager(bean)).destroy(bean);
         }
     }
 

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/buslifecycle/CXFBusLifeCycleManager.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/buslifecycle/CXFBusLifeCycleManager.java?rev=807745&r1=807744&r2=807745&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/buslifecycle/CXFBusLifeCycleManager.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/buslifecycle/CXFBusLifeCycleManager.java Tue Aug 25 18:21:38 2009
@@ -22,11 +22,12 @@
 import java.util.List;
 import java.util.concurrent.CopyOnWriteArrayList;
 
-import javax.annotation.PostConstruct;
 import javax.annotation.Resource;
 
 import org.apache.cxf.Bus;
+import org.apache.cxf.common.injection.NoJSR250Annotations;
 
+@NoJSR250Annotations(unlessNull = "bus")
 public class CXFBusLifeCycleManager implements BusLifeCycleManager {
 
     private final List<BusLifeCycleListener> listeners;
@@ -37,14 +38,14 @@
     public CXFBusLifeCycleManager() {
         listeners = new CopyOnWriteArrayList<BusLifeCycleListener>();
     }
+    public CXFBusLifeCycleManager(Bus b) {
+        listeners = new CopyOnWriteArrayList<BusLifeCycleListener>();
+        setBus(b);
+    }
     
     @Resource
-    public void setBus(Bus b) {
+    public final void setBus(Bus b) {
         bus = b;
-    }
-    
-    @PostConstruct
-    public void register() {
         if (null != bus) {
             bus.setExtension(this, BusLifeCycleManager.class);
         }

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/catalog/OASISCatalogManager.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/catalog/OASISCatalogManager.java?rev=807745&r1=807744&r2=807745&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/catalog/OASISCatalogManager.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/catalog/OASISCatalogManager.java Tue Aug 25 18:21:38 2009
@@ -31,15 +31,16 @@
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
-import javax.annotation.PostConstruct;
 import javax.annotation.Resource;
 
 import org.apache.cxf.Bus;
+import org.apache.cxf.common.injection.NoJSR250Annotations;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.xml.resolver.Catalog;
 import org.apache.xml.resolver.CatalogManager;
 import org.apache.xml.resolver.tools.CatalogResolver;
 
+@NoJSR250Annotations(unlessNull = "bus")
 public class OASISCatalogManager {
     public static final String DEFAULT_CATALOG_NAME = "META-INF/jax-ws-catalog.xml";
     public static final String CATALOG_DEBUG_KEY = "OASISCatalogManager.catalog.debug.level";
@@ -48,7 +49,6 @@
         LogUtils.getL7dLogger(OASISCatalogManager.class);
     private static final String DEBUG_LEVEL = System.getProperty(CATALOG_DEBUG_KEY);
     
-    
 
     private Object resolver;
     private Set<URL> loadedCatalogs = Collections.synchronizedSet(new HashSet<URL>());
@@ -58,6 +58,12 @@
         resolver = getResolver();
     }
     
+    public OASISCatalogManager(Bus b) {
+        bus = b;
+        resolver = getResolver();
+        loadContextCatalogs(DEFAULT_CATALOG_NAME);
+    }
+    
     private static Object getResolver() {
         try {
             CatalogManager catalogManager = new CatalogManager();
@@ -81,25 +87,16 @@
     @Resource
     public void setBus(Bus bus) {
         this.bus = bus;
-    }
-
-    @PostConstruct
-    public void register() {
         if (null != bus) {
             bus.setExtension(this, OASISCatalogManager.class);
         }
         loadContextCatalogs();
     }
 
-    /*
-    public Catalog getCatalog() {
-        return this.resolver;
-    }
-*/
     public void loadContextCatalogs() {
         loadContextCatalogs(DEFAULT_CATALOG_NAME);
     }
-    public void loadContextCatalogs(String name) {
+    public final void loadContextCatalogs(String name) {
         try {
             loadCatalogs(Thread.currentThread().getContextClassLoader(), name);
         } catch (IOException e) {
@@ -107,7 +104,7 @@
         }
     }
 
-    public void loadCatalogs(ClassLoader classLoader, String name) throws IOException {
+    public final void loadCatalogs(ClassLoader classLoader, String name) throws IOException {
         if (classLoader == null || resolver == null) {
             return;
         }
@@ -122,7 +119,7 @@
         }
     }
 
-    public void loadCatalog(URL catalogURL) throws IOException {
+    public final void loadCatalog(URL catalogURL) throws IOException {
         if (!loadedCatalogs.contains(catalogURL) && resolver != null) {
             if ("file".equals(catalogURL.getProtocol())) {
                 try {

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/configuration/spring/ConfigurerImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/configuration/spring/ConfigurerImpl.java?rev=807745&r1=807744&r2=807745&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/configuration/spring/ConfigurerImpl.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/configuration/spring/ConfigurerImpl.java Tue Aug 25 18:21:38 2009
@@ -32,6 +32,7 @@
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
+import org.apache.cxf.common.injection.NoJSR250Annotations;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.configuration.Configurable;
 import org.apache.cxf.configuration.Configurer;
@@ -47,6 +48,7 @@
 import org.springframework.context.ApplicationContextAware;
 import org.springframework.context.ConfigurableApplicationContext;
 
+@NoJSR250Annotations
 public class ConfigurerImpl extends BeanConfigurerSupport 
     implements Configurer, ApplicationContextAware, BusExtension {
     

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/EndpointResolverRegistryImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/EndpointResolverRegistryImpl.java?rev=807745&r1=807744&r2=807745&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/EndpointResolverRegistryImpl.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/EndpointResolverRegistryImpl.java Tue Aug 25 18:21:38 2009
@@ -19,10 +19,9 @@
 
 package org.apache.cxf.endpoint;
 
-import java.util.ArrayList;
 import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
 
-import javax.annotation.PostConstruct;
 import javax.xml.namespace.QName;
 
 import org.apache.cxf.Bus;
@@ -42,14 +41,21 @@
 public class EndpointResolverRegistryImpl implements EndpointResolverRegistry {
 
     private Bus bus;
-    private List<EndpointResolver> resolvers;
+    private List<EndpointResolver> resolvers 
+        = new CopyOnWriteArrayList<EndpointResolver>();
+    
+    public EndpointResolverRegistryImpl() {
+        
+    }
+    public EndpointResolverRegistryImpl(Bus b) {
+        setBus(b);
+    }
     
     /**
-     * Initialize registry, and expose as Bus extension.
-     */
-    @PostConstruct
-    public void init() {
-        resolvers = new ArrayList<EndpointResolver>();
+     * @param b Bus to encapsulate
+     */ 
+    public final void setBus(Bus b) {
+        bus = b;
         if (bus != null) {
             bus.setExtension(this, EndpointResolverRegistry.class);
         }
@@ -166,10 +172,5 @@
         return resolvers;
     }
     
-    /**
-     * @param b Bus to encapsulate
-     */
-    public void setBus(Bus b) {
-        bus = b;
-    }
+
 }

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ServerRegistryImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ServerRegistryImpl.java?rev=807745&r1=807744&r2=807745&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ServerRegistryImpl.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ServerRegistryImpl.java Tue Aug 25 18:21:38 2009
@@ -22,14 +22,15 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import javax.annotation.PostConstruct;
 import javax.annotation.PreDestroy;
 import javax.annotation.Resource;
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.buslifecycle.BusLifeCycleListener;
 import org.apache.cxf.buslifecycle.BusLifeCycleManager;
+import org.apache.cxf.common.injection.NoJSR250Annotations;
 
+@NoJSR250Annotations(unlessNull = "bus")
 public class ServerRegistryImpl implements ServerRegistry, BusLifeCycleListener {
     
     List<Server> serversList;
@@ -39,18 +40,18 @@
     public ServerRegistryImpl() {
         serversList = new ArrayList<Server>();
     }
+    public ServerRegistryImpl(Bus b) {
+        serversList = new ArrayList<Server>();
+        setBus(b);
+    }
 
     public Bus getBus() {
         return bus;
     }
     
     @Resource
-    public void setBus(Bus bus) {        
+    public final void setBus(Bus bus) {        
         this.bus = bus;        
-    }
-    
-    @PostConstruct
-    public void register() {
         if (null != bus) {
             bus.setExtension(this, ServerRegistry.class);
             lifeCycleManager = bus.getExtension(BusLifeCycleManager.class);

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ServiceContractResolverRegistryImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ServiceContractResolverRegistryImpl.java?rev=807745&r1=807744&r2=807745&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ServiceContractResolverRegistryImpl.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ServiceContractResolverRegistryImpl.java Tue Aug 25 18:21:38 2009
@@ -20,29 +20,40 @@
 package org.apache.cxf.endpoint;
 
 import java.net.URI;
-import java.util.ArrayList;
 import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
 
-import javax.annotation.PostConstruct;
 import javax.xml.namespace.QName;
 
 import org.apache.cxf.Bus;
+import org.apache.cxf.common.injection.NoJSR250Annotations;
 
 /**
  * A simple contract resolver registry. It maintains a list of contract resolvers in an
  * <code>ArrayList</code>.
  */
+@NoJSR250Annotations(unlessNull = "bus")
 public class ServiceContractResolverRegistryImpl implements ServiceContractResolverRegistry {
 
     private Bus bus;
-    private List<ServiceContractResolver> resolvers;
+    private List<ServiceContractResolver> resolvers 
+        = new CopyOnWriteArrayList<ServiceContractResolver>();
+
+    public ServiceContractResolverRegistryImpl() {
+        
+    }
+    public ServiceContractResolverRegistryImpl(Bus b) {
+        setBus(b);
+    }
+    
 
     /**
-     * Initialize registry, and register itself on Bus as an extension.
+     * Sets the bus with which the registry is associated.
+     *
+     * @param bus
      */
-    @PostConstruct
-    public void init() {
-        resolvers = new ArrayList<ServiceContractResolver>();
+    public final void setBus(Bus b) {
+        this.bus = b;
         if (bus != null) {
             bus.setExtension(this, ServiceContractResolverRegistry.class);
         }
@@ -94,14 +105,6 @@
         resolvers.remove(resolver);        
     }
 
-    /**
-     * Sets the bus with which the registry is associated.
-     *
-     * @param bus
-     */
-    public void setBus(Bus bus) {
-        this.bus = bus;
-    }
     
     protected List<ServiceContractResolver> getResolvers() {
         return resolvers;

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/headers/HeaderManagerImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/headers/HeaderManagerImpl.java?rev=807745&r1=807744&r2=807745&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/headers/HeaderManagerImpl.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/headers/HeaderManagerImpl.java Tue Aug 25 18:21:38 2009
@@ -21,26 +21,29 @@
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 
-import javax.annotation.PostConstruct;
 import javax.annotation.Resource;
 
 import org.apache.cxf.Bus;
+import org.apache.cxf.common.injection.NoJSR250Annotations;
 
+@NoJSR250Annotations(unlessNull = "bus")
 public class HeaderManagerImpl implements HeaderManager {
     Map<String, HeaderProcessor> processors = new ConcurrentHashMap<String, HeaderProcessor>();
     Bus bus;  
     
+    public HeaderManagerImpl() {
+    }
+    public HeaderManagerImpl(Bus b) {
+        setBus(b);
+    }
+    
     public Bus getBus() {
         return bus;
     }
     
     @Resource
-    public void setBus(Bus bus) {        
+    public final void setBus(Bus bus) {        
         this.bus = bus;
-    }
-    
-    @PostConstruct
-    public void register() {
         if (null != bus) {
             bus.setExtension(this, HeaderManager.class);
         }

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/FactoryBeanListenerManager.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/FactoryBeanListenerManager.java?rev=807745&r1=807744&r2=807745&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/FactoryBeanListenerManager.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/FactoryBeanListenerManager.java Tue Aug 25 18:21:38 2009
@@ -25,10 +25,12 @@
 import javax.annotation.Resource;
 
 import org.apache.cxf.Bus;
+import org.apache.cxf.common.injection.NoJSR250Annotations;
 
 /**
  * 
  */
+@NoJSR250Annotations(unlessNull = "bus")
 public class FactoryBeanListenerManager {
     List<FactoryBeanListener> listeners
         = new CopyOnWriteArrayList<FactoryBeanListener>();
@@ -36,9 +38,13 @@
     public FactoryBeanListenerManager() {
         listeners.add(new AnnotationsFactoryBeanListener());
     }
+    public FactoryBeanListenerManager(Bus b) {
+        this();
+        setBus(b);
+    }
     
     @Resource
-    public void setBus(Bus bus) {
+    public final void setBus(Bus bus) {
         bus.setExtension(this, FactoryBeanListenerManager.class);
     }
     

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/http/QueryHandlerRegistryImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/http/QueryHandlerRegistryImpl.java?rev=807745&r1=807744&r2=807745&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/http/QueryHandlerRegistryImpl.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/http/QueryHandlerRegistryImpl.java Tue Aug 25 18:21:38 2009
@@ -22,13 +22,14 @@
 import java.util.List;
 import java.util.concurrent.CopyOnWriteArrayList;
 
-import javax.annotation.PostConstruct;
 import javax.annotation.Resource;
 
 import org.apache.cxf.Bus;
+import org.apache.cxf.common.injection.NoJSR250Annotations;
 import org.apache.cxf.transports.http.QueryHandler;
 import org.apache.cxf.transports.http.QueryHandlerRegistry;
 
+@NoJSR250Annotations(unlessNull = "bus")
 public class QueryHandlerRegistryImpl implements QueryHandlerRegistry {
     
     List<QueryHandler> queryHandlers;
@@ -39,16 +40,20 @@
     }
     
     public QueryHandlerRegistryImpl(Bus b, List<QueryHandler> handlers) {
-        bus = b;
         queryHandlers = new CopyOnWriteArrayList<QueryHandler>(handlers);
+        setBus(b);
     }
     
     public void setQueryHandlers(List<QueryHandler> handlers) {
         this.queryHandlers = new CopyOnWriteArrayList<QueryHandler>(handlers);
     }
-
-    @PostConstruct
-    public void register() {
+    
+    public Bus getBus() {
+        return bus;
+    }
+    @Resource
+    public final void setBus(Bus b) {
+        bus = b;
         if (queryHandlers == null) {
             queryHandlers = new CopyOnWriteArrayList<QueryHandler>();
             if (bus != null) {
@@ -73,15 +78,7 @@
     public void registerHandler(QueryHandler handler, int position) {
         queryHandlers.add(position, handler);
     }
-    
-    @Resource
-    public void setBus(Bus b) {
-        bus = b;
-    }
 
-    public Bus getBus() {
-        return bus;
-    }
 
 }
 

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/http/WSDLQueryHandler.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/http/WSDLQueryHandler.java?rev=807745&r1=807744&r2=807745&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/http/WSDLQueryHandler.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/http/WSDLQueryHandler.java Tue Aug 25 18:21:38 2009
@@ -51,6 +51,7 @@
 import org.apache.cxf.Bus;
 import org.apache.cxf.catalog.OASISCatalogManager;
 import org.apache.cxf.common.i18n.Message;
+import org.apache.cxf.common.injection.NoJSR250Annotations;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.helpers.DOMUtils;
@@ -63,6 +64,7 @@
 import org.apache.cxf.wsdl11.ServiceWSDLBuilder;
 
 
+@NoJSR250Annotations
 public class WSDLQueryHandler implements StemMatchingQueryHandler {
     private static final Logger LOG = LogUtils.getL7dLogger(WSDLQueryHandler.class, "QueryMessages");
     private Bus bus;

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/workqueue/WorkQueueManagerImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/workqueue/WorkQueueManagerImpl.java?rev=807745&r1=807744&r2=807745&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/workqueue/WorkQueueManagerImpl.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/workqueue/WorkQueueManagerImpl.java Tue Aug 25 18:21:38 2009
@@ -24,14 +24,15 @@
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
-import javax.annotation.PostConstruct;
 import javax.annotation.Resource;
 import javax.management.JMException;
 
 import org.apache.cxf.Bus;
+import org.apache.cxf.common.injection.NoJSR250Annotations;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.management.InstrumentationManager;
 
+@NoJSR250Annotations(unlessNull = "bus")
 public class WorkQueueManagerImpl implements WorkQueueManager {
 
     private static final Logger LOG =
@@ -42,17 +43,20 @@
     boolean inShutdown;
     Bus bus;  
     
+    public WorkQueueManagerImpl() {
+        
+    }
+    public WorkQueueManagerImpl(Bus b) {
+        setBus(b);
+    }
+    
     public Bus getBus() {
         return bus;
     }
     
     @Resource
-    public void setBus(Bus bus) {        
+    public final void setBus(Bus bus) {        
         this.bus = bus;
-    }
-    
-    @PostConstruct
-    public void register() {
         if (null != bus) {
             bus.setExtension(this, WorkQueueManager.class);
             InstrumentationManager manager = bus.getExtension(InstrumentationManager.class);

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLManagerImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLManagerImpl.java?rev=807745&r1=807744&r2=807745&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLManagerImpl.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLManagerImpl.java Tue Aug 25 18:21:38 2009
@@ -31,7 +31,6 @@
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
-import javax.annotation.PostConstruct;
 import javax.annotation.Resource;
 import javax.wsdl.Definition;
 import javax.wsdl.Types;
@@ -52,6 +51,7 @@
 import org.apache.cxf.BusException;
 import org.apache.cxf.catalog.CatalogWSDLLocator;
 import org.apache.cxf.common.WSDLConstants;
+import org.apache.cxf.common.injection.NoJSR250Annotations;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.common.util.CacheMap;
 import org.apache.cxf.common.util.PropertiesLoaderUtils;
@@ -64,6 +64,7 @@
  * 
  * @author dkulp
  */
+@NoJSR250Annotations(unlessNull = "bus")
 public class WSDLManagerImpl implements WSDLManager {
 
     private static final Logger LOG = LogUtils.getL7dLogger(WSDLManagerImpl.class);
@@ -108,14 +109,14 @@
 
         registerInitialExtensions();
     }
+    public WSDLManagerImpl(Bus b) throws BusException {
+        this();
+        bus = b;
+    }
     
     @Resource
     public void setBus(Bus b) {
         bus = b;
-    }
-    
-    @PostConstruct
-    public void register() {
         if (null != bus) {
             bus.setExtension(this, WSDLManager.class);
         }

Modified: cxf/trunk/rt/core/src/main/resources/META-INF/cxf/cxf.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/resources/META-INF/cxf/cxf.xml?rev=807745&r1=807744&r2=807745&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/resources/META-INF/cxf/cxf.xml (original)
+++ cxf/trunk/rt/core/src/main/resources/META-INF/cxf/cxf.xml Tue Aug 25 18:21:38 2009
@@ -34,21 +34,26 @@
     <bean id="org.apache.cxf.bus.spring.Jsr250BeanPostProcessor" class="org.apache.cxf.bus.spring.Jsr250BeanPostProcessor"/>    
     <bean id="org.apache.cxf.bus.spring.BusExtensionPostProcessor" class="org.apache.cxf.bus.spring.BusExtensionPostProcessor"/>
     
-    <bean id="org.apache.cxf.resource.ResourceManager" class="org.apache.cxf.bus.resource.ResourceManagerImpl">
-       <property name="resolvers">
+    <bean id="org.apache.cxf.resource.ResourceManager" 
+    	class="org.apache.cxf.bus.resource.ResourceManagerImpl" 
+    	lazy-init="true">
+    	<constructor-arg ref="cxf"/>
+       	<constructor-arg>
             <list>
                 <bean class="org.apache.cxf.resource.ClasspathResolver"/>
                 <bean class="org.apache.cxf.resource.ClassLoaderResolver"/>
                 <bean class="org.apache.cxf.bus.spring.BusApplicationContextResourceResolver"/>
             </list>
-       </property>
-       <property name="bus" ref="cxf"/>
+       </constructor-arg>
     </bean>
+
     <bean id="org.apache.cxf.configuration.Configurer" 
-    	class="org.apache.cxf.configuration.spring.ConfigurerImpl">
-    </bean>    
+    	class="org.apache.cxf.configuration.spring.ConfigurerImpl" 
+    	lazy-init="true"/>
         
-    <bean id="org.apache.cxf.binding.BindingFactoryManager" class="org.apache.cxf.binding.BindingFactoryManagerImpl">
+    <bean id="org.apache.cxf.binding.BindingFactoryManager"
+     	class="org.apache.cxf.binding.BindingFactoryManagerImpl"
+     	lazy-init="true">
         <property name="mapProvider">
             <bean class="org.apache.cxf.configuration.spring.SpringBeanMap">
               <property name="type" value="org.apache.cxf.binding.BindingFactory"/>
@@ -58,7 +63,9 @@
         <property name="bus" ref="cxf"/>
     </bean>
     
-    <bean id="org.apache.cxf.transport.DestinationFactoryManager" class="org.apache.cxf.transport.DestinationFactoryManagerImpl">
+    <bean id="org.apache.cxf.transport.DestinationFactoryManager"
+    	class="org.apache.cxf.transport.DestinationFactoryManagerImpl"
+    	lazy-init="true">
         <property name="mapProvider">
             <bean class="org.apache.cxf.configuration.spring.SpringBeanMap">
               <property name="type" value="org.apache.cxf.transport.DestinationFactory"/>
@@ -68,7 +75,9 @@
         <property name="bus" ref="cxf"/>
     </bean>
     
-    <bean id="org.apache.cxf.transport.ConduitInitiatorManager" class="org.apache.cxf.transport.ConduitInitiatorManagerImpl">
+    <bean id="org.apache.cxf.transport.ConduitInitiatorManager" 
+    	class="org.apache.cxf.transport.ConduitInitiatorManagerImpl"
+    	lazy-init="true">
         <property name="mapProvider">
             <bean class="org.apache.cxf.configuration.spring.SpringBeanMap">
               <property name="type" value="org.apache.cxf.transport.ConduitInitiator"/>
@@ -78,54 +87,79 @@
         <property name="bus" ref="cxf"/>
     </bean>
     
-    <bean id="org.apache.cxf.wsdl.WSDLManager" class="org.apache.cxf.wsdl11.WSDLManagerImpl">
-        <property name="bus" ref="cxf"/>
+    <bean id="org.apache.cxf.wsdl.WSDLManager" 
+    	class="org.apache.cxf.wsdl11.WSDLManagerImpl" 
+    	lazy-init="true">
+        <constructor-arg ref="cxf"/>
     </bean>
     
-    <bean id="org.apache.cxf.phase.PhaseManager" class="org.apache.cxf.phase.PhaseManagerImpl">
-        
-    </bean>
+    <bean id="org.apache.cxf.phase.PhaseManager" 
+    	class="org.apache.cxf.phase.PhaseManagerImpl" 
+    	lazy-init="true"/>
     
-    <bean id="org.apache.cxf.workqueue.WorkQueueManager" class="org.apache.cxf.workqueue.WorkQueueManagerImpl">
-        <property name="bus" ref="cxf"/>
+    <bean id="org.apache.cxf.workqueue.WorkQueueManager" 
+    	class="org.apache.cxf.workqueue.WorkQueueManagerImpl"
+		lazy-init="true">
+        <constructor-arg ref="cxf"/>
     </bean>
     
-    <bean id="org.apache.cxf.buslifecycle.BusLifeCycleManager" class="org.apache.cxf.buslifecycle.CXFBusLifeCycleManager">
-        <property name="bus" ref="cxf"/>
+    <bean id="org.apache.cxf.buslifecycle.BusLifeCycleManager" 
+    	class="org.apache.cxf.buslifecycle.CXFBusLifeCycleManager"
+    	lazy-init="true">
+        <constructor-arg ref="cxf"/>
     </bean>
     
-    <bean id="org.apache.cxf.endpoint.ServerRegistry" class="org.apache.cxf.endpoint.ServerRegistryImpl">
-        <property name="bus" ref="cxf"/>
+    <bean id="org.apache.cxf.endpoint.ServerRegistry" 
+    	class="org.apache.cxf.endpoint.ServerRegistryImpl"
+    	lazy-init="true">
+        <constructor-arg ref="cxf"/>
     </bean>
 
-    <bean id="org.apache.cxf.endpoint.ServerLifeCycleManager" class="org.apache.cxf.endpoint.ServerLifeCycleManagerImpl"/>
-    <bean id="org.apache.cxf.endpoint.ClientLifeCycleManager" class="org.apache.cxf.endpoint.ClientLifeCycleManagerImpl"/>
+    <bean id="org.apache.cxf.endpoint.ServerLifeCycleManager"
+    	class="org.apache.cxf.endpoint.ServerLifeCycleManagerImpl"
+    	lazy-init="true"/>
+    <bean id="org.apache.cxf.endpoint.ClientLifeCycleManager"
+    	class="org.apache.cxf.endpoint.ClientLifeCycleManagerImpl"
+    	lazy-init="true"/>
         
 
-    <bean id="org.apache.cxf.transports.http.QueryHandlerRegistry" class="org.apache.cxf.transport.http.QueryHandlerRegistryImpl">
-        <property name="bus" ref="cxf"/>
-        <property name="queryHandlers">
+    <bean id="org.apache.cxf.transports.http.QueryHandlerRegistry" 
+    	class="org.apache.cxf.transport.http.QueryHandlerRegistryImpl"
+    	lazy-init="true">
+        <constructor-arg ref="cxf"/>
+        <constructor-arg>
         	<list>
         		<bean class="org.apache.cxf.transport.http.WSDLQueryHandler">
-			        <property name="bus" ref="cxf"/>
+			        <constructor-arg ref="cxf"/>
         		</bean>	
         	</list>
-        </property>
+        </constructor-arg>
     </bean>
 
-    <bean id="org.apache.cxf.endpoint.EndpointResolverRegistry" class="org.apache.cxf.endpoint.EndpointResolverRegistryImpl">
-        <property name="bus" ref="cxf"/>
-    </bean>
-    <bean id="org.apache.cxf.headers.HeaderManager" class="org.apache.cxf.headers.HeaderManagerImpl">
-        <property name="bus" ref="cxf"/>
-    </bean>
-    <bean id="org.apache.cxf.catalog.OASISCatalogManager" class="org.apache.cxf.catalog.OASISCatalogManager">
-        <property name="bus" ref="cxf"/>
-    </bean>
-    <bean id="org.apache.cxf.service.factory.FactoryBeanListenerManager" class="org.apache.cxf.service.factory.FactoryBeanListenerManager">
-        <property name="bus" ref="cxf"/>
-    </bean>
-    <bean id="org.apache.cxf.endpoint.ServiceContractResolverRegistry" class="org.apache.cxf.endpoint.ServiceContractResolverRegistryImpl">
-        <property name="bus" ref="cxf"/>
+    <bean id="org.apache.cxf.endpoint.EndpointResolverRegistry" 
+    	class="org.apache.cxf.endpoint.EndpointResolverRegistryImpl"
+    	lazy-init="true">
+        <constructor-arg ref="cxf"/>
+    </bean>
+    <bean id="org.apache.cxf.headers.HeaderManager" 
+    	class="org.apache.cxf.headers.HeaderManagerImpl"
+    	lazy-init="true">
+        <constructor-arg ref="cxf"/>
+    </bean>
+    <bean id="org.apache.cxf.catalog.OASISCatalogManager" 
+    	class="org.apache.cxf.catalog.OASISCatalogManager"  
+    	lazy-init="true">
+        <constructor-arg ref="cxf"/>
+    </bean>
+    <bean id="org.apache.cxf.service.factory.FactoryBeanListenerManager"
+    	class="org.apache.cxf.service.factory.FactoryBeanListenerManager"
+    	lazy-init="true">
+        <constructor-arg ref="cxf"/>
+    </bean>
+    
+    <bean id="org.apache.cxf.endpoint.ServiceContractResolverRegistry" 
+    	class="org.apache.cxf.endpoint.ServiceContractResolverRegistryImpl"
+    	lazy-init="true">
+        <constructor-arg ref="cxf"/>
     </bean>
 </beans>

Modified: cxf/trunk/rt/core/src/test/java/org/apache/cxf/endpoint/EndpointResolverRegistryImplTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/test/java/org/apache/cxf/endpoint/EndpointResolverRegistryImplTest.java?rev=807745&r1=807744&r2=807745&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/test/java/org/apache/cxf/endpoint/EndpointResolverRegistryImplTest.java (original)
+++ cxf/trunk/rt/core/src/test/java/org/apache/cxf/endpoint/EndpointResolverRegistryImplTest.java Tue Aug 25 18:21:38 2009
@@ -21,7 +21,6 @@
 
 import javax.xml.namespace.QName;
 
-import org.apache.cxf.Bus;
 import org.apache.cxf.ws.addressing.EndpointReferenceType;
 import org.easymock.classextension.EasyMock;
 import org.easymock.classextension.IMocksControl;
@@ -64,22 +63,7 @@
     }
 
     @Test
-    public void testInit() {
-        assertNull("unexpected resolvers list", registry.getResolvers());
-        Bus bus = control.createMock(Bus.class);
-        registry.setBus(bus);
-        bus.setExtension(registry, EndpointResolverRegistry.class);
-        control.replay();
-        
-        registry.init();
-        
-        assertNotNull("expected resolvers list", registry.getResolvers());
-        control.verify();
-    }
-    
-    @Test
     public void testRegister() {
-        registry.init();
         assertEquals("unexpected resolver count",
                      0,
                      registry.getResolvers().size());
@@ -124,7 +108,6 @@
     
     @Test
     public void testResolve() {
-        registry.init();
         registry.register(resolver1);
         registry.register(resolver2);
         resolver1.resolve(logical);
@@ -163,7 +146,6 @@
     
     @Test
     public void testRenew() {
-        registry.init();
         registry.register(resolver1);
         registry.register(resolver2);
         resolver1.renew(logical, physical);
@@ -202,7 +184,6 @@
     
     @Test
     public void testMintFromServiceName() {
-        registry.init();
         registry.register(resolver1);
         registry.register(resolver2);
         resolver1.mint(serviceName);
@@ -241,7 +222,6 @@
     
     @Test
     public void testMintFromPhysical() {
-        registry.init();
         registry.register(resolver1);
         registry.register(resolver2);
         resolver1.mint(physical);

Modified: cxf/trunk/rt/core/src/test/java/org/apache/cxf/endpoint/ServiceContractResolverRegistryImplTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/test/java/org/apache/cxf/endpoint/ServiceContractResolverRegistryImplTest.java?rev=807745&r1=807744&r2=807745&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/test/java/org/apache/cxf/endpoint/ServiceContractResolverRegistryImplTest.java (original)
+++ cxf/trunk/rt/core/src/test/java/org/apache/cxf/endpoint/ServiceContractResolverRegistryImplTest.java Tue Aug 25 18:21:38 2009
@@ -24,7 +24,6 @@
 
 import javax.xml.namespace.QName;
 
-import org.apache.cxf.Bus;
 import org.easymock.classextension.EasyMock;
 import org.easymock.classextension.IMocksControl;
 import org.junit.After;
@@ -60,22 +59,7 @@
     }
     
     @Test
-    public void testInit() {
-        assertNull("unexpected resolvers list", registry.getResolvers());
-        Bus bus = control.createMock(Bus.class);
-        registry.setBus(bus);
-        bus.setExtension(registry, ServiceContractResolverRegistry.class);
-        control.replay();
-        
-        registry.init();
-        
-        assertNotNull("expected resolvers list", registry.getResolvers());
-        control.verify();
-    }
-
-    @Test
     public void testRegister() {
-        registry.init();
         assertEquals("unexpected resolver count",
                      0,
                      registry.getResolvers().size());
@@ -120,7 +104,6 @@
     
     @Test
     public void testGetContactLocation() {
-        registry.init();
         registry.register(resolver1);
         registry.register(resolver2);
         resolver1.getContractLocation(serviceName);

Modified: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/resolver/JarResolverTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/resolver/JarResolverTest.java?rev=807745&r1=807744&r2=807745&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/resolver/JarResolverTest.java (original)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/resolver/JarResolverTest.java Tue Aug 25 18:21:38 2009
@@ -52,7 +52,6 @@
         ServiceContractResolverRegistryImpl registry = 
             new ServiceContractResolverRegistryImpl();
         registry.setBus(bus);
-        registry.init();
         assertNotNull(bus.getExtension(ServiceContractResolverRegistry.class));
 
         JarServiceContractResolver resolver = new JarServiceContractResolver();



Mime
View raw message