cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andreasm...@apache.org
Subject svn commit: r448562 - in /incubator/cxf/trunk: api/src/main/java/org/apache/cxf/ common/common/src/main/java/org/apache/cxf/configuration/ common/common/src/main/java/org/apache/cxf/configuration/spring/ common/common/src/main/java/org/apache/cxf/oldcf...
Date Thu, 21 Sep 2006 14:22:07 GMT
Author: andreasmyth
Date: Thu Sep 21 07:22:05 2006
New Revision: 448562

URL: http://svn.apache.org/viewvc?view=rev&rev=448562
Log:
[JIRA CXF-25] Removed remaining dependencies on old configuration API in instrumentation manager
and bus.
Simplified instrumentation manager configuration schema.
Removed oldcfg package in common and bean generator mojo.
Added fragments for registration of wsdl extensions to rt-transports-http, rt-transports-jms
and rt-binding-xml (removed the fragment in core).

Added:
    incubator/cxf/trunk/rt/bindings/xml/src/main/resources/META-INF/extensions.xml   (with
props)
    incubator/cxf/trunk/rt/transports/http/src/main/resources/META-INF/extensions.xml   (with
props)
    incubator/cxf/trunk/rt/transports/jms/src/main/resources/META-INF/extensions.xml
      - copied, changed from r448258, incubator/cxf/trunk/rt/core/src/main/resources/META-INF/extensions.xml
Removed:
    incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/oldcfg/
    incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/spring/
    incubator/cxf/trunk/common/common/src/test/java/org/apache/cxf/oldcfg/
    incubator/cxf/trunk/common/xsd/src/main/java/org/apache/cxf/maven_plugin/BeanGenMojo.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/BusConfigurationHelper.java
    incubator/cxf/trunk/rt/core/src/main/resources/META-INF/extensions.xml
    incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ToolConfig.java
Modified:
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/Bus.java
    incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/Configurer.java
    incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/ConfigurerImpl.java
    incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/Messages.properties
    incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/cxf/test/DummyBus.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBus.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusFactory.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLManagerImpl.java
    incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/bus/CXFBusTest.java
    incubator/cxf/trunk/rt/management/pom.xml
    incubator/cxf/trunk/rt/management/src/main/java/org/apache/cxf/management/InstrumentationManagerImpl.java
    incubator/cxf/trunk/rt/management/src/main/java/org/apache/cxf/management/jmx/JMXManagedComponentManager.java
    incubator/cxf/trunk/rt/management/src/main/resources/schemas/configuration/instrumentation.xsd
    incubator/cxf/trunk/rt/management/src/test/java/org/apache/cxf/management/jmx/JMXManagedComponentManagerTest.java
    incubator/cxf/trunk/rt/pom.xml
    incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java
    incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
    incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/ServiceModelHttpConfigurationProvider.java

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/Bus.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/Bus.java?view=diff&rev=448562&r1=448561&r2=448562
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/Bus.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/Bus.java Thu Sep 21 07:22:05 2006
@@ -20,15 +20,12 @@
 package org.apache.cxf;
 
 import org.apache.cxf.interceptor.InterceptorProvider;
-import org.apache.cxf.oldcfg.Configuration;
 
 public interface Bus extends InterceptorProvider {
     
     <T> T getExtension(Class<T> extensionType);
     
     <T> void setExtension(T extension, Class<T> extensionType);
-
-    Configuration getConfiguration();
     
     String getId();
     

Modified: incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/Configurer.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/Configurer.java?view=diff&rev=448562&r1=448561&r2=448562
==============================================================================
--- incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/Configurer.java
(original)
+++ incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/Configurer.java
Thu Sep 21 07:22:05 2006
@@ -21,5 +21,9 @@
 
 public interface Configurer {
     
+    String DEFAULT_USER_CFG_FILE = "cxf.xml";
+
+    String USER_CFG_FILE_PROPERTY_NAME = "cxf.config.file";
+
     void configureBean(Configurable beanInstance);
 }

Modified: incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/ConfigurerImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/ConfigurerImpl.java?view=diff&rev=448562&r1=448561&r2=448562
==============================================================================
--- incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/ConfigurerImpl.java
(original)
+++ incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/ConfigurerImpl.java
Thu Sep 21 07:22:05 2006
@@ -22,36 +22,60 @@
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
+import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.configuration.Configurable;
 import org.apache.cxf.configuration.Configurer;
+import org.springframework.beans.BeansException;
 import org.springframework.beans.factory.NoSuchBeanDefinitionException;
 import org.springframework.beans.factory.wiring.BeanConfigurerSupport;
 import org.springframework.beans.factory.wiring.BeanWiringInfo;
 import org.springframework.beans.factory.wiring.BeanWiringInfoResolver;
 import org.springframework.context.ApplicationContext;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
+import org.springframework.core.io.ClassPathResource;
 
 public class ConfigurerImpl extends BeanConfigurerSupport implements Configurer {
     
     private static final Logger LOG = LogUtils.getL7dLogger(ConfigurerImpl.class);
     private static final String DEFAULT_USER_CFG_FILE = "cxf.xml";
+
+    private ApplicationContext appContext;
     
     public ConfigurerImpl() {
         this(DEFAULT_USER_CFG_FILE);
     }
     
     public ConfigurerImpl(String cfgFile) {
-        ApplicationContext appContext = new ClassPathXmlApplicationContext(cfgFile);
-        setApplicationContext(appContext);
+        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 {
+                ApplicationContext ac = new ClassPathXmlApplicationContext(cfgFile);
+                setApplicationContext(ac);
+            } catch (BeansException ex) {
+                LogUtils.log(LOG, Level.WARNING, "APP_CONTEXT_CREATION_FAILED_MSG", ex, null);
+            }
+        } else {
+            LOG.log(Level.INFO, new Message("USER_CFG_FILE_NOT_FOUND_MSG", LOG, cfgFile).toString());
+        }
     }
     
-    public ConfigurerImpl(ApplicationContext appContext) {
-        setApplicationContext(appContext);
+    public ConfigurerImpl(ApplicationContext ac) {
+        setApplicationContext(ac);
     }
     
     public void configureBean(Configurable beanInstance) {
 
+        if (null == appContext) {
+            return;
+        }
+
         final String beanName = beanInstance.getBeanName();
         
         setBeanWiringInfoResolver(new BeanWiringInfoResolver() {
@@ -70,11 +94,12 @@
             // users often wonder why the settings in their configuration files seem
             // to have no effect - the most common cause is that they have been using
             // incorrect bean ids
-            LOG.log(Level.INFO, "NO_MATCHING_BEAN", beanName);
+            LOG.log(Level.INFO, "NO_MATCHING_BEAN_MSG", beanName);
         }
     }
     
-    private void setApplicationContext(ApplicationContext appContext) {
+    private void setApplicationContext(ApplicationContext ac) {
+        appContext = ac;
         setBeanFactory(appContext.getAutowireCapableBeanFactory());
     }
 }

Modified: incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/Messages.properties
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/Messages.properties?view=diff&rev=448562&r1=448561&r2=448562
==============================================================================
--- incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/Messages.properties
(original)
+++ incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/Messages.properties
Thu Sep 21 07:22:05 2006
@@ -1,2 +1,4 @@
-NO_MATCHING_BEAN = Could not find a definition for bean with id {0} - no injection will be
performed."
-JAXB_PROPERTY_EDITOR_EXC = Property editor failed to bind element {0}.
\ No newline at end of file
+NO_MATCHING_BEAN _MSG= Could not find a definition for bean with id {0} - no injection will
be performed.
+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.

Modified: incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/cxf/test/DummyBus.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/cxf/test/DummyBus.java?view=diff&rev=448562&r1=448561&r2=448562
==============================================================================
--- incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/cxf/test/DummyBus.java (original)
+++ incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/cxf/test/DummyBus.java Thu Sep
21 07:22:05 2006
@@ -31,8 +31,6 @@
 //import org.apache.cxf.buslifecycle.BusLifeCycleManager;
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.interceptor.AbstractBasicInterceptorProvider;
-import org.apache.cxf.oldcfg.Configuration;
-//import org.apache.cxf.configuration.ConfigurationBuilder;
 //import org.apache.cxf.jaxws.EndpointRegistry;
 //import org.apache.cxf.management.InstrumentationManager;
 //import org.apache.cxf.plugins.PluginManager;
@@ -112,19 +110,6 @@
 //         return null;
 //     }
 
-//     @Override
-//     public ConfigurationBuilder getConfigurationBuilder() {
-//         // TODO Auto-generated method stub
-//         return null;
-//     }
-
-
-//     @Override
-//     public Configuration getConfiguration() {
-//         // TODO Auto-generated method stub
-//         return null;
-//     }
-
 
 //     @Override
 //     public TransportFactoryManager getTransportFactoryManager() {
@@ -189,11 +174,6 @@
     //    @Override
     public <T> void setExtension(T extension, Class<T> extensionType) {
 
-    }
-    
-    //    @Override
-    public Configuration getConfiguration() {
-        return null;
     }
     
     //    @Override

Added: incubator/cxf/trunk/rt/bindings/xml/src/main/resources/META-INF/extensions.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/xml/src/main/resources/META-INF/extensions.xml?view=auto&rev=448562
==============================================================================
--- incubator/cxf/trunk/rt/bindings/xml/src/main/resources/META-INF/extensions.xml (added)
+++ incubator/cxf/trunk/rt/bindings/xml/src/main/resources/META-INF/extensions.xml Thu Sep
21 07:22:05 2006
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
+<properties>
+    <entry key="org.apache.cxf.bindings.xml-1">javax.wsdl.BindingInput=org.apache.cxf.bindings.xformat.XMLBindingMessageFormat</entry>
+    <entry key="org.apache.cxf.bindings.xml-2">javax.wsdl.BindingOutput=org.apache.cxf.bindings.xformat.XMLBindingMessageFormat</entry>
+</properties>

Propchange: incubator/cxf/trunk/rt/bindings/xml/src/main/resources/META-INF/extensions.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/bindings/xml/src/main/resources/META-INF/extensions.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/rt/bindings/xml/src/main/resources/META-INF/extensions.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBus.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBus.java?view=diff&rev=448562&r1=448561&r2=448562
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBus.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBus.java Thu Sep 21 07:22:05
2006
@@ -25,11 +25,10 @@
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.buslifecycle.BusLifeCycleManager;
+import org.apache.cxf.configuration.Configurer;
+import org.apache.cxf.configuration.spring.ConfigurerImpl;
 import org.apache.cxf.extension.ExtensionManagerImpl;
 import org.apache.cxf.interceptor.AbstractBasicInterceptorProvider;
-import org.apache.cxf.oldcfg.Configuration;
-import org.apache.cxf.oldcfg.ConfigurationBuilder;
-import org.apache.cxf.oldcfg.impl.ConfigurationBuilderImpl;
 import org.apache.cxf.resource.DefaultResourceManager;
 import org.apache.cxf.resource.PropertiesResolver;
 import org.apache.cxf.resource.ResourceManager;
@@ -39,13 +38,14 @@
 public class CXFBus extends AbstractBasicInterceptorProvider implements Bus {
     
     public static final String BUS_PROPERTY_NAME = "bus";
+    private static final String BUS_ID_PROPERTY_NAME = "org.apache.cxf.bus.id";
+    private static final String DEFAULT_BUS_ID = "cxf";
     
     private static final String BUS_EXTENSION_RESOURCE = "META-INF/bus-extensions.xml";
     
     enum State { INITIAL, RUNNING, SHUTDOWN };
 
     private Map<Class, Object> extensions;
-    private Configuration configuration;
     private BusLifeCycleManager lifeCycleManager;
     private String id;
     private State state;
@@ -55,31 +55,25 @@
     }
 
     protected CXFBus(Map<Class, Object> e) {
-        this(e, null);
+        this(e, new HashMap<String, Object>());
     }
     
     protected CXFBus(Map<Class, Object> e, Map<String, Object> properties) {
         
         extensions = e;
-     
-        BusConfigurationHelper helper = new BusConfigurationHelper();
         
-        id = helper.getBusId(properties);
- 
-        ConfigurationBuilder builder = (ConfigurationBuilder)extensions.get(ConfigurationBuilder.class);
-        if (null == builder) {
-            builder = new ConfigurationBuilderImpl();
-            extensions.put(ConfigurationBuilder.class, builder);
+        Configurer configurer = (Configurer)extensions.get(Configurer.class);
+        if (null == configurer) {
+            String cfgFile = (String)properties.get(Configurer.USER_CFG_FILE_PROPERTY_NAME);
+            configurer = new ConfigurerImpl(cfgFile);
+            extensions.put(Configurer.class, configurer);
         }
-        configuration = helper.getConfiguration(builder, id);
+ 
+        id = getBusId(properties);
         
         ResourceManager resourceManager = new DefaultResourceManager();
         
-        if (properties == null) {
-            properties = new HashMap<String, Object>();
-        }
-        
-        properties.put(BusConfigurationHelper.BUS_ID_PROPERTY, BUS_PROPERTY_NAME);
+        properties.put(BUS_ID_PROPERTY_NAME, BUS_PROPERTY_NAME);
         properties.put(BUS_PROPERTY_NAME, this);
         
         ResourceResolver propertiesResolver = new PropertiesResolver(properties);
@@ -91,9 +85,9 @@
         extensions.put(ResourceManager.class, resourceManager);
 
         new ExtensionManagerImpl(BUS_EXTENSION_RESOURCE, 
-                                                    Thread.currentThread().getContextClassLoader(),
-                                                    extensions,
-                                                    resourceManager);
+                                 Thread.currentThread().getContextClassLoader(),
+                                 extensions,
+                                 resourceManager);
         
         state = State.INITIAL;
         
@@ -117,10 +111,6 @@
         extensions.put(extensionType, extension);
     }
 
-    public Configuration getConfiguration() {
-        return configuration;
-    }
-
     public String getId() {
         return id;
     }
@@ -160,5 +150,27 @@
     
     protected State getState() {
         return state;
+    }
+    
+    private String getBusId(Map<String, Object> properties) {
+
+        String busId = null;
+
+        // first check properties
+        if (null != properties) {
+            busId = (String)properties.get(BUS_ID_PROPERTY_NAME);
+            if (null != busId && !"".equals(busId)) {
+                return busId;
+            }
+        }
+
+        // next check system properties
+        busId = System.getProperty(BUS_ID_PROPERTY_NAME);
+        if (null != busId && !"".equals(busId)) {
+            return busId;
+        }
+
+        // otherwise use default
+        return DEFAULT_BUS_ID;
     }
 }

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusFactory.java?view=diff&rev=448562&r1=448561&r2=448562
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusFactory.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusFactory.java Thu Sep
21 07:22:05 2006
@@ -45,8 +45,7 @@
     }
     
     public Bus createBus(Map<Class, Object> e) {
-        return createBus(e, null);
-        
+        return createBus(e, new HashMap<String, Object>());
     }
     
     public Bus createBus(Map<Class, Object> e, Map<String, Object> properties)
{

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLManagerImpl.java?view=diff&rev=448562&r1=448561&r2=448562
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLManagerImpl.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLManagerImpl.java Thu
Sep 21 07:22:05 2006
@@ -167,6 +167,9 @@
             String parentType = st.nextToken();
             String elementType = st.nextToken();
             try {
+                if (LOG.isLoggable(Level.FINE)) {
+                    LOG.fine("Registering extension: " + elementType + " for parent: " +
parentType);
+                }
                 JAXBExtensionHelper.addExtensions(registry, parentType, elementType, getClass()
                                 .getClassLoader());
             } catch (ClassNotFoundException ex) {

Modified: incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/bus/CXFBusTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/bus/CXFBusTest.java?view=diff&rev=448562&r1=448561&r2=448562
==============================================================================
--- incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/bus/CXFBusTest.java (original)
+++ incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/bus/CXFBusTest.java Thu Sep 21
07:22:05 2006
@@ -31,7 +31,6 @@
 import org.apache.cxf.buslifecycle.BusLifeCycleManager;
 import org.apache.cxf.event.EventProcessor;
 import org.apache.cxf.management.InstrumentationManager;
-import org.apache.cxf.oldcfg.Configuration;
 import org.apache.cxf.phase.PhaseManager;
 import org.apache.cxf.transport.ConduitInitiatorManager;
 import org.apache.cxf.transport.DestinationFactoryManager;
@@ -91,13 +90,6 @@
         String extension = "CXF";
         bus.setExtension(extension, String.class);
         assertSame(extension, bus.getExtension(String.class));
-    }
-    
-    public void testConfiguration() {
-        CXFBus bus = new CXFBus();
-        Configuration c = bus.getConfiguration();
-        assertTrue("Unexpected value for servicesMonitoring property.",
-                   !c.getBoolean("servicesMonitoring"));
     }
     
     public void testRun() {

Modified: incubator/cxf/trunk/rt/management/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/management/pom.xml?view=diff&rev=448562&r1=448561&r2=448562
==============================================================================
--- incubator/cxf/trunk/rt/management/pom.xml (original)
+++ incubator/cxf/trunk/rt/management/pom.xml Thu Sep 21 07:22:05 2006
@@ -86,18 +86,35 @@
                             <xsdOptions>
                                 <xsdOption>
                                     <xsd>${basedir}/src/main/resources/schemas/configuration/instrumentation.xsd</xsd>
+                                    <extension>true</extension>
+                                    <extensionArgs>
+                                        <extensionArg>-Xcfg</extensionArg>
+                                    </extensionArgs>
                                 </xsdOption>
                             </xsdOptions>
-                            <beanfiles>
-                                <beanfile>${basedir}/src/main/resources/config-metadata/instrumentation-config.xml</beanfile>
-                            </beanfiles>
                         </configuration>
                         <goals>
                             <goal>xsdtojava</goal>
-                            <goal>beangen</goal>
                         </goals>
                     </execution>
                 </executions>
+                <dependencies>
+                    <dependency>
+                        <groupId>org.apache.cxf</groupId>
+                        <artifactId>cxf-tools-xjc-cfg</artifactId>
+                        <version>${project.version}</version>
+                    </dependency>
+                    <dependency>
+                        <groupId>org.apache.cxf</groupId>
+                        <artifactId>cxf-tools-xjc-dv</artifactId>
+                        <version>${project.version}</version>
+                    </dependency>
+                    <dependency>
+                        <groupId>org.apache.cxf</groupId>
+                        <artifactId>cxf-common-utilities</artifactId>
+                        <version>${project.version}</version>
+                    </dependency>
+                </dependencies>
             </plugin>
 
         </plugins>

Modified: incubator/cxf/trunk/rt/management/src/main/java/org/apache/cxf/management/InstrumentationManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/management/src/main/java/org/apache/cxf/management/InstrumentationManagerImpl.java?view=diff&rev=448562&r1=448561&r2=448562
==============================================================================
--- incubator/cxf/trunk/rt/management/src/main/java/org/apache/cxf/management/InstrumentationManagerImpl.java
(original)
+++ incubator/cxf/trunk/rt/management/src/main/java/org/apache/cxf/management/InstrumentationManagerImpl.java
Thu Sep 21 07:22:05 2006
@@ -30,45 +30,32 @@
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.common.logging.LogUtils;
-import org.apache.cxf.configuration.instrumentation.types.InstrumentationPolicyType;
-import org.apache.cxf.configuration.instrumentation.types.MBServerPolicyType;
 import org.apache.cxf.event.ComponentEventFilter;
 import org.apache.cxf.event.Event;
 import org.apache.cxf.event.EventListener;
 import org.apache.cxf.event.EventProcessor;
 import org.apache.cxf.management.jmx.JMXManagedComponentManager;
-import org.apache.cxf.oldcfg.CompoundName;
-import org.apache.cxf.oldcfg.Configuration;
-import org.apache.cxf.oldcfg.ConfigurationBuilder;
-import org.apache.cxf.oldcfg.impl.ConfigurationBuilderImpl;
 
 
 
 
-public class InstrumentationManagerImpl implements InstrumentationManager, EventListener
{
+public class InstrumentationManagerImpl extends InstrumentationManagerConfigBean
+    implements InstrumentationManager, EventListener {
     static final Logger LOG = LogUtils.getL7dLogger(InstrumentationManagerImpl.class);
-    static final String INSTRUMENTATION_CONFIGURATION_URI = 
-        "http://cxf.apache.org/configuration/instrumentation";
 
-    // TODO: avoid clashes with bus id
-
-    static final String INSTRUMENTATION_CONFIGURATION_ID = 
-        "instrumentation";
     Bus bus;
     
-    private Configuration configuration;
     private List <Instrumentation> instrumentations;
     private JMXManagedComponentManager jmxManagedComponentManager;
     
-    
+   
     public InstrumentationManagerImpl() {
-        this(new ConfigurationBuilderImpl());
-    }
-
-    public InstrumentationManagerImpl(ConfigurationBuilder builder) {
-        
-        configuration = getConfiguration(builder);
-        
+        if (null == getInstrumentation()) {
+            setInstrumentation(new InstrumentationType());
+        }      
+        if (null == getJMXConnectorPolicy()) {
+            setJMXConnectorPolicy(new JMXConnectorPolicyType());
+        }      
     }
     
     public Bus getBus() {
@@ -83,10 +70,8 @@
     
     public void initInstrumentationManagerImpl() {
         LOG.info("Setting up InstrumentationManager");
-        InstrumentationPolicyType ip = 
-            configuration.getObject(InstrumentationPolicyType.class, "InstrumentationControl");
  
         
-        if (ip.isInstrumentationEnabled()) {
+        if (getInstrumentation().isEnabled()) {
             instrumentations = new LinkedList<Instrumentation>();
             //regist to the event process
             ComponentEventFilter componentEventFilter = new ComponentEventFilter();
@@ -96,19 +81,12 @@
             }    
         }
             
-        if (ip.isJMXEnabled()) {           
+        if (getInstrumentation().isJMXEnabled()) {           
             jmxManagedComponentManager = new JMXManagedComponentManager();
-            MBServerPolicyType mbsp = configuration.getObject(MBServerPolicyType.class, "MBServer");
-            jmxManagedComponentManager.init(mbsp);
+            jmxManagedComponentManager.init(getJMXConnectorPolicy());
         }
     }
     
-    private Configuration getConfiguration(ConfigurationBuilder cb) {
-        
-        CompoundName id = new CompoundName(INSTRUMENTATION_CONFIGURATION_ID); 
-        return cb.getConfiguration(INSTRUMENTATION_CONFIGURATION_URI,  id);
-    }
-
     public void shutdown() {
         if (LOG.isLoggable(Level.INFO)) {
             LOG.info("Shutdown InstrumentationManager ");

Modified: incubator/cxf/trunk/rt/management/src/main/java/org/apache/cxf/management/jmx/JMXManagedComponentManager.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/management/src/main/java/org/apache/cxf/management/jmx/JMXManagedComponentManager.java?view=diff&rev=448562&r1=448561&r2=448562
==============================================================================
--- incubator/cxf/trunk/rt/management/src/main/java/org/apache/cxf/management/jmx/JMXManagedComponentManager.java
(original)
+++ incubator/cxf/trunk/rt/management/src/main/java/org/apache/cxf/management/jmx/JMXManagedComponentManager.java
Thu Sep 21 07:22:05 2006
@@ -42,8 +42,8 @@
 import javax.management.modelmbean.RequiredModelMBean;
 
 import org.apache.cxf.common.logging.LogUtils;
-import org.apache.cxf.configuration.instrumentation.types.MBServerPolicyType;
 import org.apache.cxf.management.Instrumentation;
+import org.apache.cxf.management.JMXConnectorPolicyType;
 import org.apache.cxf.management.jmx.export.runtime.ModelMBeanAssembler;
 
 
@@ -63,7 +63,7 @@
     }
     
        
-    public void init(MBServerPolicyType mbpt) {
+    public void init(JMXConnectorPolicyType cp) {
         
         // get the init information from configuration
         
@@ -74,9 +74,9 @@
         mbs = MBeanServerFactory.createMBeanServer(JMXUtils.DOMAIN_STRING);            
         mcf = MBServerConnectorFactory.getInstance();
         mcf.setMBeanServer(mbs);
-        mcf.setThreaded(mbpt.getJMXConnector().isThreaded());
-        mcf.setDaemon(mbpt.getJMXConnector().isDaemon());
-        mcf.setServiceUrl(mbpt.getJMXConnector().getJMXServiceURL());
+        mcf.setThreaded(cp.isThreaded());
+        mcf.setDaemon(cp.isDaemon());
+        mcf.setServiceUrl(cp.getJMXServiceURL());
         try {            
             mcf.createConnector();
         } catch (IOException ex) {

Modified: incubator/cxf/trunk/rt/management/src/main/resources/schemas/configuration/instrumentation.xsd
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/management/src/main/resources/schemas/configuration/instrumentation.xsd?view=diff&rev=448562&r1=448561&r2=448562
==============================================================================
--- incubator/cxf/trunk/rt/management/src/main/resources/schemas/configuration/instrumentation.xsd
(original)
+++ incubator/cxf/trunk/rt/management/src/main/resources/schemas/configuration/instrumentation.xsd
Thu Sep 21 07:22:05 2006
@@ -18,35 +18,40 @@
   under the License.
 -->
 
-<xs:schema targetNamespace="http://cxf.apache.org/configuration/instrumentation/types"
-           xmlns:tns="http://cxf.apache.org/configuration/instrumentation/types"
-           xmlns:xs="http://www.w3.org/2001/XMLSchema"
-           elementFormDefault="qualified" >
+<xs:schema targetNamespace="http://cxf.apache.org/management"
+    xmlns:tns="http://cxf.apache.org/management"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
+    xmlns:cfg="http://cxf.apache.org/configuration/cfg"
+    elementFormDefault="qualified" 
+    attributeFormDefault="unqualified"
+    jaxb:extensionBindingPrefixes="cfg"
+    jaxb:version="2.0">
     
-    <xs:complexType name="InstrumentationPolicyType">
-   		<xs:sequence>        
-        	<xs:element name="InstrumentationEnabled" type="xs:boolean" default="true"/>
-        	<xs:element name="JMXEnabled" type="xs:boolean" default="true"/>        
-        </xs:sequence>
+    <xs:complexType name="InstrumentationType">
+        <xs:attribute name="Enabled" type="xs:boolean" default="true"/>
+        <xs:attribute name="JMXEnabled" type="xs:boolean" default="false"/>       

     </xs:complexType>
     
     <xs:complexType name="JMXConnectorPolicyType">
-		<xs:sequence>                  
-        	<xs:element name="Threaded" type="xs:boolean"/>
-        	<xs:element name="Daemon" type="xs:boolean"/>
-        	<xs:element name="JMXServiceURL" type="xs:string"/>        
-        </xs:sequence>
+        <xs:attribute name="Threaded" type="xs:boolean" default="false"/>
+        <xs:attribute name="Daemon" type="xs:boolean" default="false"/>
+        <xs:attribute name="JMXServiceURL" type="xs:string" default="service:jmx:rmi:///jndi/rmi://localhost:9913/jmxrmi"/>
       
     </xs:complexType>
     
+    <xs:element name="instrumentation" type="tns:InstrumentationType"/>
+    <xs:element name="JMXConnectorPolicy" type="tns:JMXConnectorPolicyType"/>   
 
-    <xs:complexType name="MBServerPolicyType">
-    	<xs:sequence>
-    		<xs:element name="JMXConnector" type="tns:JMXConnectorPolicyType"/>   	    	
-    	</xs:sequence>	
+     <xs:complexType name="InstrumentationManagerConfigBean">        
+        <xs:annotation>
+            <xs:appinfo>                
+                <cfg:configurable/>
+            </xs:appinfo>
+        </xs:annotation>
+        <xs:sequence>
+            <xs:element ref="tns:instrumentation" minOccurs="0"/>
+            <xs:element ref="tns:JMXConnectorPolicy" minOccurs="0"/>
+        </xs:sequence>
     </xs:complexType>
-    
-	
-    <xs:element name="instrumentation" type="tns:InstrumentationPolicyType"/>
-    <xs:element name="MBServer" type="tns:MBServerPolicyType"/>   
 
 </xs:schema>

Modified: incubator/cxf/trunk/rt/management/src/test/java/org/apache/cxf/management/jmx/JMXManagedComponentManagerTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/management/src/test/java/org/apache/cxf/management/jmx/JMXManagedComponentManagerTest.java?view=diff&rev=448562&r1=448561&r2=448562
==============================================================================
--- incubator/cxf/trunk/rt/management/src/test/java/org/apache/cxf/management/jmx/JMXManagedComponentManagerTest.java
(original)
+++ incubator/cxf/trunk/rt/management/src/test/java/org/apache/cxf/management/jmx/JMXManagedComponentManagerTest.java
Thu Sep 21 07:22:05 2006
@@ -24,8 +24,7 @@
 import junit.framework.TestCase;
 
 import org.apache.cxf.BusException;
-import org.apache.cxf.configuration.instrumentation.types.JMXConnectorPolicyType;
-import org.apache.cxf.configuration.instrumentation.types.MBServerPolicyType;
+import org.apache.cxf.management.JMXConnectorPolicyType;
 import org.apache.cxf.management.jmx.export.AnnotationTestInstrumentation;
 
 
@@ -39,14 +38,12 @@
     }
         
     public void testJMXManagerInit() {
-        MBServerPolicyType policy = new MBServerPolicyType();
         JMXConnectorPolicyType connector = new JMXConnectorPolicyType();        
-        policy.setJMXConnector(connector);        
         connector.setDaemon(false);
         connector.setThreaded(true);
         connector.setJMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:9913/jmxrmi");
         try {
-            manager.init(policy); 
+            manager.init(connector); 
             Thread.sleep(300);
             manager.shutdown();
         } catch (Exception ex) {
@@ -56,13 +53,11 @@
     }
     
     public void testRegisterInstrumentation() {
-        MBServerPolicyType policy = new MBServerPolicyType();
         JMXConnectorPolicyType connector = new JMXConnectorPolicyType();        
-        policy.setJMXConnector(connector);        
         connector.setDaemon(false);
         connector.setThreaded(false);
         connector.setJMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:9913/jmxrmi");
-        manager.init(policy);
+        manager.init(connector);
         // setup the fack instrumentation
         AnnotationTestInstrumentation im = new AnnotationTestInstrumentation();
         ObjectName name = JMXUtils.getObjectName(im.getUniqueInstrumentationName(), 

Modified: incubator/cxf/trunk/rt/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/pom.xml?view=diff&rev=448562&r1=448561&r2=448562
==============================================================================
--- incubator/cxf/trunk/rt/pom.xml (original)
+++ incubator/cxf/trunk/rt/pom.xml Thu Sep 21 07:22:05 2006
@@ -41,9 +41,9 @@
         <module>core</module>
         <module>transports/local</module>
         <module>databinding/jaxb</module>
+        <module>bindings</module>
         <module>frontend/jaxws</module>
         <module>frontend/js</module>
-        <module>bindings</module>
         <module>transports/http</module>
         <module>transports/jms</module>
         <module>ws/addr</module>

Modified: incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java?view=diff&rev=448562&r1=448561&r2=448562
==============================================================================
--- incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java
(original)
+++ incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java
Thu Sep 21 07:22:05 2006
@@ -21,6 +21,7 @@
 
 import java.io.IOException;
 import java.net.URL;
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashMap;
 import java.util.List;
@@ -31,6 +32,7 @@
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.common.util.Base64Exception;
 import org.apache.cxf.common.util.Base64Utility;
+import org.apache.cxf.configuration.ConfigurationProvider;
 import org.apache.cxf.configuration.security.AuthorizationPolicy;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.service.model.EndpointInfo;
@@ -165,6 +167,13 @@
         if (!isSetServer()) {
             setServer(new HTTPServerPolicy());
         }
+        List <ConfigurationProvider> providers = getOverwriteProviders();
+        if (null == providers) {
+            providers = new ArrayList<ConfigurationProvider>();
+        }
+        ConfigurationProvider p = new ServiceModelHttpConfigurationProvider(endpointInfo,
true);
+        providers.add(p);
+        setOverwriteProviders(providers);
     }
 
     void setPolicies(Map<String, List<String>> headers) {

Modified: incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java?view=diff&rev=448562&r1=448561&r2=448562
==============================================================================
--- incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
(original)
+++ incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
Thu Sep 21 07:22:05 2006
@@ -28,6 +28,7 @@
 import java.net.Proxy;
 import java.net.URL;
 import java.net.URLConnection;
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashMap;
 import java.util.List;
@@ -40,6 +41,7 @@
 import org.apache.cxf.Bus;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.common.util.Base64Utility;
+import org.apache.cxf.configuration.ConfigurationProvider;
 import org.apache.cxf.configuration.security.AuthorizationPolicy;
 import org.apache.cxf.configuration.security.SSLClientPolicy;
 import org.apache.cxf.helpers.CastUtils;
@@ -540,6 +542,14 @@
         if (!isSetSslClient()) {
             setSslClient(new SSLClientPolicy());
         }
+
+        List <ConfigurationProvider> providers = getOverwriteProviders();
+        if (null == providers) {
+            providers = new ArrayList<ConfigurationProvider>();
+        }
+        ConfigurationProvider p = new ServiceModelHttpConfigurationProvider(endpointInfo,
false);
+        providers.add(p);
+        setOverwriteProviders(providers);
     }
 
     private String getAddress() {

Modified: incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/ServiceModelHttpConfigurationProvider.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/ServiceModelHttpConfigurationProvider.java?view=diff&rev=448562&r1=448561&r2=448562
==============================================================================
--- incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/ServiceModelHttpConfigurationProvider.java
(original)
+++ incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/ServiceModelHttpConfigurationProvider.java
Thu Sep 21 07:22:05 2006
@@ -19,7 +19,7 @@
 
 package org.apache.cxf.transport.http;
 
-import org.apache.cxf.oldcfg.ConfigurationProvider;
+import org.apache.cxf.configuration.ConfigurationProvider;
 import org.apache.cxf.service.model.EndpointInfo;
 import org.apache.cxf.transports.http.configuration.HTTPClientPolicy;
 import org.apache.cxf.transports.http.configuration.HTTPServerPolicy;
@@ -39,11 +39,11 @@
             return null;
         }
 
-        if (server && "httpServer".equals(name)) {
+        if (server && "server".equals(name)) {
             return info.getExtensor(HTTPServerPolicy.class);
         }
         
-        if (!server && "httpClient".equals(name)) {
+        if (!server && "client".equals(name)) {
             return info.getExtensor(HTTPClientPolicy.class);
         }
 

Added: incubator/cxf/trunk/rt/transports/http/src/main/resources/META-INF/extensions.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http/src/main/resources/META-INF/extensions.xml?view=auto&rev=448562
==============================================================================
--- incubator/cxf/trunk/rt/transports/http/src/main/resources/META-INF/extensions.xml (added)
+++ incubator/cxf/trunk/rt/transports/http/src/main/resources/META-INF/extensions.xml Thu
Sep 21 07:22:05 2006
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
+<properties>
+    <entry key="org.apache.cxf.transports.http-1">javax.wsdl.Port=org.apache.cxf.transports.http.configuration.HTTPClientPolicy</entry>
+    <entry key="org.apache.cxf.transports.http-2">javax.wsdl.Port=org.apache.cxf.transports.http.configuration.HTTPServerPolicy</entry>
+    <entry key="org.apache.cxf.transports.http-3">javax.wsdl.Port=org.xmlsoap.schemas.wsdl.http.AddressType</entry>
+</properties>

Propchange: incubator/cxf/trunk/rt/transports/http/src/main/resources/META-INF/extensions.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/transports/http/src/main/resources/META-INF/extensions.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/rt/transports/http/src/main/resources/META-INF/extensions.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Copied: incubator/cxf/trunk/rt/transports/jms/src/main/resources/META-INF/extensions.xml (from
r448258, incubator/cxf/trunk/rt/core/src/main/resources/META-INF/extensions.xml)
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/jms/src/main/resources/META-INF/extensions.xml?view=diff&rev=448562&p1=incubator/cxf/trunk/rt/core/src/main/resources/META-INF/extensions.xml&r1=448258&p2=incubator/cxf/trunk/rt/transports/jms/src/main/resources/META-INF/extensions.xml&r2=448562
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/resources/META-INF/extensions.xml (original)
+++ incubator/cxf/trunk/rt/transports/jms/src/main/resources/META-INF/extensions.xml Thu Sep
21 07:22:05 2006
@@ -19,9 +19,7 @@
 -->
 <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
 <properties>
-    <entry key="1">javax.wsdl.BindingInput=org.apache.cxf.bindings.xformat.XMLBindingMessageFormat</entry>
-    <entry key="2">javax.wsdl.BindingOutput=org.apache.cxf.bindings.xformat.XMLBindingMessageFormat</entry>
-    <entry key="3">javax.wsdl.Port=org.apache.cxf.transports.jms.JMSAddressPolicyType</entry>
-	<entry key="4">javax.wsdl.Port=org.apache.cxf.transports.jms.JMSClientBehaviorPolicyType</entry>
-	<entry key="5">javax.wsdl.Port=org.apache.cxf.transports.jms.JMSServerBehaviorPolicyType</entry>
+    <entry key="org.apache.cxf.transports.jms-1">javax.wsdl.Port=org.apache.cxf.transports.jms.JMSAddressPolicyType</entry>
+    <entry key="org.apache.cxf.transports.jms-2">javax.wsdl.Port=org.apache.cxf.transports.jms.JMSClientBehaviorPolicyType</entry>
+    <entry key="org.apache.cxf.transports.jms-3">javax.wsdl.Port=org.apache.cxf.transports.jms.JMSServerBehaviorPolicyType</entry>
 </properties>



Mime
View raw message