cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andreasm...@apache.org
Subject svn commit: r560232 - in /incubator/cxf/trunk: api/src/main/java/org/apache/cxf/ rt/core/src/main/java/org/apache/cxf/bus/ rt/core/src/main/java/org/apache/cxf/bus/spring/ rt/core/src/main/resources/schemas/ rt/core/src/test/java/org/apache/cxf/bus/ rt...
Date Fri, 27 Jul 2007 13:57:48 GMT
Author: andreasmyth
Date: Fri Jul 27 06:57:40 2007
New Revision: 560232

URL: http://svn.apache.org/viewvc?view=rev&rev=560232
Log:
* Defined string constant for default bus id in Bus interface and use consistently in SpringBusFactory,
CXFBusImpl and various bean definition parsers.
* Added documentation annotations to core.xsd

Modified:
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/Bus.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusDefinitionParser.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusExtensionPostProcessor.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBusFactory.java
    incubator/cxf/trunk/rt/core/src/main/resources/schemas/core.xsd
    incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/bus/CXFBusImplTest.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java
    incubator/cxf/trunk/rt/management/src/test/java/org/apache/cxf/management/interceptor/AbstractMessageResponseTestBase.java
    incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/ApplicationContextTest.java
    incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/spring/RMManagerBeanDefinitionParser.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/management/CountersClientServerTest.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=560232&r1=560231&r2=560232
==============================================================================
--- 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 Fri Jul 27 06:57:40 2007
@@ -29,6 +29,8 @@
  */
 public interface Bus extends InterceptorProvider {
     
+    String DEFAULT_BUS_ID = "cxf";
+    
     <T> T getExtension(Class<T> extensionType);
     
     <T> void setExtension(T extension, Class<T> extensionType);

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java?view=diff&rev=560232&r1=560231&r2=560232
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java Fri Jul 27
06:57:40 2007
@@ -30,9 +30,8 @@
 import org.apache.cxf.interceptor.AbstractBasicInterceptorProvider;
 
 public class CXFBusImpl extends AbstractBasicInterceptorProvider implements Bus {    
-    protected static final String DEFAULT_BUS_ID = "CXF";
+    
     protected final Map<Class, Object> extensions;
-    private BusLifeCycleManager lifeCycleManager;
     private String id;
     private BusState state;      
     private Collection<AbstractFeature> features;
@@ -50,7 +49,7 @@
         this.extensions = extensions;
         
         state = BusState.INITIAL;
-        lifeCycleManager = this.getExtension(BusLifeCycleManager.class);
+        BusLifeCycleManager lifeCycleManager = this.getExtension(BusLifeCycleManager.class);
         if (null != lifeCycleManager) {
             lifeCycleManager.initComplete();
         }
@@ -116,7 +115,7 @@
     }
 
     public void shutdown(boolean wait) {
-        lifeCycleManager = this.getExtension(BusLifeCycleManager.class);
+        BusLifeCycleManager lifeCycleManager = this.getExtension(BusLifeCycleManager.class);
         if (null != lifeCycleManager) {
             lifeCycleManager.preShutdown();
         }

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusDefinitionParser.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusDefinitionParser.java?view=diff&rev=560232&r1=560231&r2=560232
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusDefinitionParser.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusDefinitionParser.java
Fri Jul 27 06:57:40 2007
@@ -23,6 +23,7 @@
 
 import org.w3c.dom.Element;
 
+import org.apache.cxf.Bus;
 import org.apache.cxf.bus.CXFBusImpl;
 import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.configuration.spring.AbstractBeanDefinitionParser;
@@ -59,7 +60,7 @@
     protected String getIdOrName(Element elem) {
         String id = super.getIdOrName(elem); 
         if (StringUtils.isEmpty(id)) {
-            id = "cxf";
+            id = Bus.DEFAULT_BUS_ID;
         }
         return id;
     }

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusExtensionPostProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusExtensionPostProcessor.java?view=diff&rev=560232&r1=560231&r2=560232
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusExtensionPostProcessor.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusExtensionPostProcessor.java
Fri Jul 27 06:57:40 2007
@@ -35,7 +35,7 @@
     public void setApplicationContext(ApplicationContext ctx) {
         //nothing to do
         if (bus == null) {
-            bus = (Bus)ctx.getBean("cxf");
+            bus = (Bus)ctx.getBean(Bus.DEFAULT_BUS_ID);
         }
     }
 

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBusFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBusFactory.java?view=diff&rev=560232&r1=560231&r2=560232
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBusFactory.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBusFactory.java
Fri Jul 27 06:57:40 2007
@@ -35,8 +35,6 @@
 
 public class SpringBusFactory extends BusFactory {
     
-    private static final String DEFAULT_BUS_ID = "cxf";
-    
     private static final Logger LOG = LogUtils.getL7dLogger(SpringBusFactory.class);
     
     private final ApplicationContext context;
@@ -55,7 +53,7 @@
     
     private boolean defaultBusNotExists() {
         if (null != context) {
-            context.containsBean("cxf");
+            context.containsBean(Bus.DEFAULT_BUS_ID);
             return false;
         } else {
             return true;
@@ -67,7 +65,7 @@
     }
         
     private Bus finishCreatingBus(BusApplicationContext bac) {
-        final Bus bus = (Bus)bac.getBean(DEFAULT_BUS_ID);
+        final Bus bus = (Bus)bac.getBean(Bus.DEFAULT_BUS_ID);
 
         bus.setExtension(new ConfigurerImpl(bac), Configurer.class);
 

Modified: incubator/cxf/trunk/rt/core/src/main/resources/schemas/core.xsd
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/resources/schemas/core.xsd?view=diff&rev=560232&r1=560231&r2=560232
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/resources/schemas/core.xsd (original)
+++ incubator/cxf/trunk/rt/core/src/main/resources/schemas/core.xsd Fri Jul 27 06:57:40 2007
@@ -28,7 +28,21 @@
   <xsd:import namespace="http://www.springframework.org/schema/beans" schemaLocation="http://www.springframework.org/schema/beans/spring-beans.xsd"/>
   <xsd:import namespace="http://cxf.apache.org/configuration/beans" schemaLocation="http://cxf.apache.org/schemas/configuration/cxf-beans.xsd"/>
 
+  <xsd:annotation>
+    <xsd:documentation>
+      This schema defines beans representing the CXF bus and its core features.
+    </xsd:documentation>
+  </xsd:annotation>
+
   <xsd:element name="logging">
+    <xsd:annotation>
+      <xsd:documentation>
+        The logging feature enables you to log the content of inbound and outbound messages
and faults.
+        The content is logged by all log handlers configured in your java.util.logging configuration
file, 
+        provided the log level for classes org.apache.cxf.interceptor.LoggingInInterceptor
and 
+        org.apache.cxf.interceptor.LoggingOutInterceptor is at least INFO.
+      </xsd:documentation>
+    </xsd:annotation>
     <xsd:complexType>
       <xsd:sequence />
     </xsd:complexType>
@@ -36,12 +50,52 @@
   
   <xsd:element name="bus">
     <xsd:complexType>
-      <xsd:all>
-        <xsd:element name="features" type="xsd:anyType" minOccurs="0"/>
-        <xsd:element name="inInterceptors" type="xsd:anyType" minOccurs="0"/>
-        <xsd:element name="inFaultInterceptors" type="xsd:anyType" minOccurs="0"/>
-        <xsd:element name="outInterceptors" type="xsd:anyType" minOccurs="0"/>
-        <xsd:element name="outFaultInterceptors" type="xsd:anyType" minOccurs="0"/>
+      <xsd:all>        
+        <xsd:element name="features" type="xsd:anyType" minOccurs="0">
+          <xsd:annotation>
+            <xsd:documentation>
+                The list of features that are applied to the bus.
+                Child elements of this element must be beans whose bean class extends 
+                org.apache.cxf.AbstractFeature, or references to such beans.
+            </xsd:documentation>
+        </xsd:annotation>
+        </xsd:element>
+        <xsd:element name="inInterceptors" type="xsd:anyType" minOccurs="0">
+          <xsd:annotation>
+            <xsd:documentation>
+                The list of interceptors that the bus contributes to all inbound message
interceptor chains.
+                Child elements of this element must be beans whose bean class implements

+                org.apache.cxf.Interceptor, or references to such beans.
+            </xsd:documentation>          
+          </xsd:annotation>
+        </xsd:element>
+        <xsd:element name="inFaultInterceptors" type="xsd:anyType" minOccurs="0">
+          <xsd:annotation>
+            <xsd:documentation>
+                The list of interceptors that the bus contributes to all inbound fault interceptor
chains.
+                Child elements of this element must be beans whose bean class implements

+                org.apache.cxf.Interceptor, or references to such beans.
+            </xsd:documentation>          
+          </xsd:annotation>
+        </xsd:element>
+        <xsd:element name="outInterceptors" type="xsd:anyType" minOccurs="0">
+          <xsd:annotation>
+            <xsd:documentation>
+                The list of interceptors that the bus contributes to all outbound message
interceptor chains.
+                Child elements of this element must be beans whose bean class implements

+                org.apache.cxf.Interceptor, or references to such beans.
+            </xsd:documentation>          
+          </xsd:annotation>
+        </xsd:element>
+        <xsd:element name="outFaultInterceptors" type="xsd:anyType" minOccurs="0">
+          <xsd:annotation>
+            <xsd:documentation>
+                The list of interceptors that the bus contributes to all outbound fault interceptor
chains.
+                Child elements of this element must be beans whose bean class implements

+                org.apache.cxf.Interceptor, or references to such beans.
+            </xsd:documentation>          
+          </xsd:annotation>
+        </xsd:element>
       </xsd:all>
       <xsd:attributeGroup ref="cxf-beans:beanAttributes"/>          
     </xsd:complexType>

Modified: incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/bus/CXFBusImplTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/bus/CXFBusImplTest.java?view=diff&rev=560232&r1=560231&r2=560232
==============================================================================
--- incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/bus/CXFBusImplTest.java (original)
+++ incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/bus/CXFBusImplTest.java Fri Jul
27 06:57:40 2007
@@ -22,6 +22,7 @@
 import java.util.HashMap;
 import java.util.Map;
 
+import org.apache.cxf.Bus;
 import org.apache.cxf.BusException;
 import org.apache.cxf.binding.BindingFactoryManager;
 import org.apache.cxf.bus.extension.ExtensionManagerBus;
@@ -98,7 +99,7 @@
     public void testBusID() {
         CXFBusImpl bus = new CXFBusImpl();
         String id = bus.getId();
-        assertEquals("The bus id should be cxf", id, CXFBusImpl.DEFAULT_BUS_ID + bus.hashCode());
+        assertEquals("The bus id should be cxf", id, Bus.DEFAULT_BUS_ID + bus.hashCode());
         bus.setId("test");
         assertEquals("The bus id should be changed", bus.getId(), "test");
     }

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java?view=diff&rev=560232&r1=560231&r2=560232
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java
Fri Jul 27 06:57:40 2007
@@ -29,6 +29,7 @@
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
+import org.apache.cxf.Bus;
 import org.apache.cxf.common.classloader.ClassLoaderUtils;
 import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.configuration.spring.AbstractBeanDefinitionParser;
@@ -59,8 +60,8 @@
         NamedNodeMap atts = element.getAttributes();
         String bus = element.getAttribute("bus");
         if (StringUtils.isEmpty(bus)) {
-            if (ctx.getRegistry().containsBeanDefinition("cxf")) {
-                bean.addConstructorArgReference("cxf");
+            if (ctx.getRegistry().containsBeanDefinition(Bus.DEFAULT_BUS_ID)) {
+                bean.addConstructorArgReference(Bus.DEFAULT_BUS_ID);
             }
         } else {
             if (ctx.getRegistry().containsBeanDefinition(bus)) {

Modified: incubator/cxf/trunk/rt/management/src/test/java/org/apache/cxf/management/interceptor/AbstractMessageResponseTestBase.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/management/src/test/java/org/apache/cxf/management/interceptor/AbstractMessageResponseTestBase.java?view=diff&rev=560232&r1=560231&r2=560232
==============================================================================
--- incubator/cxf/trunk/rt/management/src/test/java/org/apache/cxf/management/interceptor/AbstractMessageResponseTestBase.java
(original)
+++ incubator/cxf/trunk/rt/management/src/test/java/org/apache/cxf/management/interceptor/AbstractMessageResponseTestBase.java
Fri Jul 27 06:57:40 2007
@@ -93,7 +93,7 @@
         bus.getExtension(CounterRepository.class);
         EasyMock.expectLastCall().andReturn(cRepository);
         if (increase) {
-            EasyMock.expect(bus.getId()).andReturn("cxf");
+            EasyMock.expect(bus.getId()).andReturn(Bus.DEFAULT_BUS_ID);
             cRepository.increaseCounter(EasyMock.eq(serviceCounterOName),
                                                EasyMock.isA(MessageHandlingTimeRecorder.class));
             EasyMock.expectLastCall();

Modified: incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/ApplicationContextTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/ApplicationContextTest.java?view=diff&rev=560232&r1=560231&r2=560232
==============================================================================
--- incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/ApplicationContextTest.java
(original)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/ApplicationContextTest.java
Fri Jul 27 06:57:40 2007
@@ -95,7 +95,7 @@
         
         EndpointInfo info = getEndpointInfo("bla", "Foo", "http://localhost:9000");
         
-        Bus bus = (Bus) ctx.getBean("cxf");
+        Bus bus = (Bus) ctx.getBean(Bus.DEFAULT_BUS_ID);
         bus.setExtension(cfg, Configurer.class);
         
         DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);

Modified: incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/spring/RMManagerBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/spring/RMManagerBeanDefinitionParser.java?view=diff&rev=560232&r1=560231&r2=560232
==============================================================================
--- incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/spring/RMManagerBeanDefinitionParser.java
(original)
+++ incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/spring/RMManagerBeanDefinitionParser.java
Fri Jul 27 06:57:40 2007
@@ -22,6 +22,7 @@
 
 import org.w3c.dom.Element;
 
+import org.apache.cxf.Bus;
 import org.apache.cxf.configuration.spring.AbstractBeanDefinitionParser;
 import org.apache.cxf.ws.rm.RMManager;
 import org.apache.cxf.ws.rm.policy.RMAssertion;
@@ -49,8 +50,8 @@
         ctx.getDelegate().parsePropertyElements(element, bean.getBeanDefinition());
         
         String bus = element.getAttribute("bus");
-        if (bus == null || "".equals(bus) && ctx.getRegistry().containsBeanDefinition("cxf"))
{
-            bean.addPropertyReference("bus", "cxf");
+        if (bus == null || "".equals(bus) && ctx.getRegistry().containsBeanDefinition(Bus.DEFAULT_BUS_ID))
{
+            bean.addPropertyReference("bus", Bus.DEFAULT_BUS_ID);
         } else {
             bean.addPropertyReference("bus", bus);
         }

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/management/CountersClientServerTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/management/CountersClientServerTest.java?view=diff&rev=560232&r1=560231&r2=560232
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/management/CountersClientServerTest.java
(original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/management/CountersClientServerTest.java
Fri Jul 27 06:57:40 2007
@@ -98,7 +98,7 @@
         MBeanServer mbs = im.getMBeanServer();
         ObjectName name = new ObjectName(ManagementConstants.DEFAULT_DOMAIN_NAME 
                                          + ":" + ManagementConstants.BUS_ID_PROP
-                                         + "=CXF" + bus.hashCode() + ",*");        
+                                         + "=cxf" + bus.hashCode() + ",*");        
         
         SOAPService service = new SOAPService();
         assertNotNull(service);        



Mime
View raw message