cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r601763 - in /incubator/cxf/trunk/rt: core/src/main/java/org/apache/cxf/configuration/spring/ core/src/test/java/org/apache/cxf/configuration/spring/ frontend/jaxws/src/main/java/org/apache/cxf/jaxws/
Date Thu, 06 Dec 2007 15:51:52 GMT
Author: dkulp
Date: Thu Dec  6 07:51:50 2007
New Revision: 601763

URL: http://svn.apache.org/viewvc?rev=601763&view=rev
Log:
[CXF-1260] Fix spurious warnings and issues loading multiple contexts and such
Fix spurious warnings and issues loading multiple contexts and such


Modified:
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/configuration/spring/ConfigurerImpl.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/configuration/spring/Messages.properties
    incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/configuration/spring/ConfigurerImplTest.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/WrapperClassGenerator.java

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/configuration/spring/ConfigurerImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/configuration/spring/ConfigurerImpl.java?rev=601763&r1=601762&r2=601763&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/configuration/spring/ConfigurerImpl.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/configuration/spring/ConfigurerImpl.java
Thu Dec  6 07:51:50 2007
@@ -25,12 +25,10 @@
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
-import org.apache.cxf.bus.spring.BusApplicationContext;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.configuration.Configurable;
 import org.apache.cxf.configuration.Configurer;
 import org.apache.cxf.extension.BusExtension;
-import org.springframework.beans.BeansException;
 import org.springframework.beans.factory.NoSuchBeanDefinitionException;
 import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
 import org.springframework.beans.factory.config.BeanDefinition;
@@ -40,46 +38,23 @@
 import org.springframework.beans.factory.wiring.BeanWiringInfoResolver;
 import org.springframework.context.ApplicationContext;
 import org.springframework.context.ApplicationContextAware;
-import org.springframework.core.io.ClassPathResource;
 
 public class ConfigurerImpl extends BeanConfigurerSupport 
     implements Configurer, ApplicationContextAware, BusExtension {
     
     private static final Logger LOG = LogUtils.getL7dLogger(ConfigurerImpl.class);
-    private static final String DEFAULT_USER_CFG_FILE = "cxf.xml";
 
     private ApplicationContext appContext;
     private final Map<String, String> wildCardBeanDefinitions = new HashMap<String,
String>();
     
     public ConfigurerImpl() {
-        this(DEFAULT_USER_CFG_FILE);
+        // complete
     }
     
-    public ConfigurerImpl(String cfgFile) {
-        if (null == cfgFile) {
-            cfgFile = System.getProperty(USER_CFG_FILE_PROPERTY_NAME);
-        }
-        if (null == cfgFile) {
-            cfgFile = DEFAULT_USER_CFG_FILE;
-        }
-        ClassPathResource cpr = new ClassPathResource(cfgFile);
-        if (cpr.exists()) {
-            try {
-                BusApplicationContext ac = new BusApplicationContext(cfgFile, false);
-                ac.refresh();
-                setApplicationContext(ac);
-            } catch (BeansException ex) {
-                LogUtils.log(LOG, Level.WARNING, "APP_CONTEXT_CREATION_FAILED_MSG", ex, (Object[])null);
-            }
-        } else {
-            LogUtils.log(LOG, Level.INFO, "USER_CFG_FILE_NOT_FOUND_MSG", cfgFile);
-        }
-    }
-
     public ConfigurerImpl(ApplicationContext ac) {
         setApplicationContext(ac);
     }
-    
+        
     private void initWildcardDefinitionMap() {
         if (null != appContext) {
             for (String n : appContext.getBeanDefinitionNames()) {

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/configuration/spring/Messages.properties
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/configuration/spring/Messages.properties?rev=601763&r1=601762&r2=601763&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/configuration/spring/Messages.properties
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/configuration/spring/Messages.properties
Thu Dec  6 07:51:50 2007
@@ -21,8 +21,6 @@
 NO_MATCHING_BEAN_MSG = Could not find a definition for bean with id {0} - no injection will
be performed.
 COULD_NOT_DETERMINE_BEAN_NAME_MSG = Could not determine bean name for instance of class {0}.
 ERROR_DETERMINING_BEAN_NAME_EXC = Failed to determine bean name.
-USER_CFG_FILE_NOT_FOUND_MSG = Could not find the configuration file {0} on the classpath.
 JAXB_PROPERTY_EDITOR_EXC = Property editor failed to bind element {0}.
-APP_CONTEXT_CREATION_FAILED_MSG = Failed to create application context.
 WILDCARD_BEAN_ID_WITH_NO_CLASS_MSG = Configuration bean with id {0} that uses a '*' or wildcard
must have a class attribute.
 ONE_WILDCARD_BEAN_ID_PER_CLASS_MSG = A wildcard configuration bean with id {0} already exists
for class {1}. The wildcard bean with id {2} will be ignored.  

Modified: incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/configuration/spring/ConfigurerImplTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/configuration/spring/ConfigurerImplTest.java?rev=601763&r1=601762&r2=601763&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/configuration/spring/ConfigurerImplTest.java
(original)
+++ incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/configuration/spring/ConfigurerImplTest.java
Thu Dec  6 07:51:50 2007
@@ -28,6 +28,7 @@
 
 import com.sun.xml.bind.DatatypeConverterImpl;
 
+import org.apache.cxf.bus.spring.BusApplicationContext;
 import org.apache.cxf.configuration.Configurable;
 import org.junit.Assert;
 import org.junit.Test;
@@ -43,8 +44,12 @@
     @Test
     public void testConfigureSimpleNoMatchingBean() {
         SimpleBean sb = new SimpleBean("unknown");
-        ConfigurerImpl configurer =
-            new ConfigurerImpl("/org/apache/cxf/configuration/spring/test-beans.xml");
+        
+        BusApplicationContext ac = 
+            new BusApplicationContext("/org/apache/cxf/configuration/spring/test-beans.xml",
+                                      false);
+
+        ConfigurerImpl configurer = new ConfigurerImpl(ac);
         configurer.configureBean(sb);
         assertEquals("Unexpected value for attribute stringAttr", 
                      "hello", sb.getStringAttr());
@@ -96,8 +101,13 @@
     @Test
     public void testConfigureSimple() {
         SimpleBean sb = new SimpleBean("simple");
-        ConfigurerImpl configurer =
-            new ConfigurerImpl("/org/apache/cxf/configuration/spring/test-beans.xml");
+        BusApplicationContext ac = 
+            new BusApplicationContext("/org/apache/cxf/configuration/spring/test-beans.xml",
+                                      false);
+
+        ConfigurerImpl configurer = new ConfigurerImpl();
+        configurer.setApplicationContext(ac);
+        
         configurer.configureBean(sb);
         assertEquals("Unexpected value for attribute stringAttr", 
                      "hallo", sb.getStringAttr());
@@ -155,8 +165,12 @@
     @Test
     public void testConfigureSimpleMatchingStarBeanId() {
         SimpleBean sb = new SimpleBean("simple2");
-        ConfigurerImpl configurer =
-            new ConfigurerImpl("/org/apache/cxf/configuration/spring/test-beans.xml");
+        BusApplicationContext ac = 
+            new BusApplicationContext("/org/apache/cxf/configuration/spring/test-beans.xml",
+                                      false);
+
+        ConfigurerImpl configurer = new ConfigurerImpl();
+        configurer.setApplicationContext(ac);
         configurer.configureBean(sb);
         assertTrue("Unexpected value for attribute booleanAttr", 
                    !sb.getBooleanAttr());
@@ -168,7 +182,7 @@
     
     @Test
     public void testGetBeanName() {
-        ConfigurerImpl configurer = new ConfigurerImpl((String)null);
+        ConfigurerImpl configurer = new ConfigurerImpl();
         Object beanInstance = new Configurable() {
 
             public String getBeanName() {

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/WrapperClassGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/WrapperClassGenerator.java?rev=601763&r1=601762&r2=601763&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/WrapperClassGenerator.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/WrapperClassGenerator.java
Thu Dec  6 07:51:50 2007
@@ -216,14 +216,4 @@
     
     }
     
-    
-    private static class TypeHelperClassLoader extends ClassLoader {
-        TypeHelperClassLoader(ClassLoader parent) {
-            super(parent);
-        }
-        public Class<?> defineClass(String name, byte bytes[]) {
-            return super.defineClass(name, bytes, 0, bytes.length);
-        }
-    }
-    
 }



Mime
View raw message