cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1089067 - in /cxf/trunk/rt: bindings/soap/ bindings/soap/src/main/java/org/apache/cxf/binding/soap/blueprint/ bindings/soap/src/main/resources/OSGI-INF/ bindings/soap/src/main/resources/OSGI-INF/blueprint/ bindings/soap/src/main/resources/...
Date Tue, 05 Apr 2011 14:48:29 GMT
Author: dkulp
Date: Tue Apr  5 14:48:28 2011
New Revision: 1089067

URL: http://svn.apache.org/viewvc?rev=1089067&view=rev
Log:
[CXF-3439] Add blueprint support for the soap binding customizations
Patch from Johan Edstrom applied

Added:
    cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/blueprint/
    cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/blueprint/SoapBindingBPHandler.java
  (with props)
    cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/blueprint/SoapBindingBPInfoConfigDefinitionParser.java
  (with props)
    cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/blueprint/SoapVersionTypeConverter.java
  (with props)
    cxf/trunk/rt/bindings/soap/src/main/resources/OSGI-INF/
    cxf/trunk/rt/bindings/soap/src/main/resources/OSGI-INF/blueprint/
    cxf/trunk/rt/bindings/soap/src/main/resources/OSGI-INF/blueprint/soap-binding.xml   (with
props)
    cxf/trunk/rt/bindings/soap/src/main/resources/schemas/configuration/blueprint/
    cxf/trunk/rt/bindings/soap/src/main/resources/schemas/configuration/blueprint/soap.xsd
  (with props)
Modified:
    cxf/trunk/rt/bindings/soap/pom.xml
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/configuration/blueprint/AbstractBPBeanDefinitionParser.java

Modified: cxf/trunk/rt/bindings/soap/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/soap/pom.xml?rev=1089067&r1=1089066&r2=1089067&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/soap/pom.xml (original)
+++ cxf/trunk/rt/bindings/soap/pom.xml Tue Apr  5 14:48:28 2011
@@ -32,6 +32,14 @@
 
     <dependencies>
         <dependency>
+            <groupId>org.apache.aries.blueprint</groupId>
+            <artifactId>org.apache.aries.blueprint.core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.core</artifactId>
+        </dependency>
+        <dependency>
             <groupId>org.springframework</groupId>
             <artifactId>spring-core</artifactId>
             <optional>true</optional>

Added: cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/blueprint/SoapBindingBPHandler.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/blueprint/SoapBindingBPHandler.java?rev=1089067&view=auto
==============================================================================
--- cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/blueprint/SoapBindingBPHandler.java
(added)
+++ cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/blueprint/SoapBindingBPHandler.java
Tue Apr  5 14:48:28 2011
@@ -0,0 +1,49 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.binding.soap.blueprint;
+
+import java.net.URL;
+import java.util.Set;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+import org.apache.aries.blueprint.NamespaceHandler;
+import org.apache.aries.blueprint.ParserContext;
+import org.osgi.service.blueprint.reflect.ComponentMetadata;
+import org.osgi.service.blueprint.reflect.Metadata;
+
+public class SoapBindingBPHandler implements NamespaceHandler {
+
+    public URL getSchemaLocation(String s) {
+        return getClass().getClassLoader().getResource("/schemas/configuration/blueprint/soap.xsd");
+    }
+
+    public Set<Class> getManagedClasses() {
+        return null;
+    }
+
+    public Metadata parse(Element element, ParserContext context) {
+        return new SoapBindingBPInfoConfigDefinitionParser().parse(element, context);
+    }
+
+    public ComponentMetadata decorate(Node node, ComponentMetadata componentMetadata, ParserContext
context) {
+        return null;
+    }
+}

Propchange: cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/blueprint/SoapBindingBPHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/blueprint/SoapBindingBPHandler.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/blueprint/SoapBindingBPInfoConfigDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/blueprint/SoapBindingBPInfoConfigDefinitionParser.java?rev=1089067&view=auto
==============================================================================
--- cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/blueprint/SoapBindingBPInfoConfigDefinitionParser.java
(added)
+++ cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/blueprint/SoapBindingBPInfoConfigDefinitionParser.java
Tue Apr  5 14:48:28 2011
@@ -0,0 +1,59 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.binding.soap.blueprint;
+
+import org.w3c.dom.Element;
+
+import org.apache.aries.blueprint.ParserContext;
+import org.apache.aries.blueprint.mutable.MutableBeanMetadata;
+import org.apache.aries.blueprint.mutable.MutablePassThroughMetadata;
+import org.apache.cxf.binding.soap.SoapBindingConfiguration;
+import org.apache.cxf.configuration.blueprint.AbstractBPBeanDefinitionParser;
+import org.osgi.service.blueprint.reflect.Metadata;
+
+public class SoapBindingBPInfoConfigDefinitionParser extends AbstractBPBeanDefinitionParser
{
+
+    public Metadata parse(Element element, ParserContext context) {
+        if (!context.getComponentDefinitionRegistry()
+                .containsComponentDefinition(SoapVersionTypeConverter.class.getName())) {
+            MutablePassThroughMetadata md = context.createMetadata(MutablePassThroughMetadata.class);
+            md.setObject(new SoapVersionTypeConverter());
+            md.setId(SoapVersionTypeConverter.class.getName());
+            context.getComponentDefinitionRegistry().registerTypeConverter(md);
+        }
+
+        MutableBeanMetadata cxfBean = context.createMetadata(MutableBeanMetadata.class);
+        cxfBean.setRuntimeClass(SoapBindingConfiguration.class);
+        parseAttributes(element, context, cxfBean);
+        parseChildElements(element, context, cxfBean);
+
+        return cxfBean;
+    }
+
+    @Override
+    protected void mapElement(ParserContext ctx, MutableBeanMetadata bean, Element el, String
name) {
+
+        if ("version".equals(name) 
+            || "mtomEnabled".equals(name) 
+            || "style".equals(name) 
+            || "use".equals(name)) {
+            bean.addProperty(name, parseMapData(ctx, bean, el));
+        }
+    }
+}

Propchange: cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/blueprint/SoapBindingBPInfoConfigDefinitionParser.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/blueprint/SoapBindingBPInfoConfigDefinitionParser.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/blueprint/SoapVersionTypeConverter.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/blueprint/SoapVersionTypeConverter.java?rev=1089067&view=auto
==============================================================================
--- cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/blueprint/SoapVersionTypeConverter.java
(added)
+++ cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/blueprint/SoapVersionTypeConverter.java
Tue Apr  5 14:48:28 2011
@@ -0,0 +1,48 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.binding.soap.blueprint;
+
+import org.apache.cxf.binding.soap.Soap11;
+import org.apache.cxf.binding.soap.Soap12;
+import org.apache.cxf.binding.soap.SoapVersion;
+import org.osgi.service.blueprint.container.Converter;
+import org.osgi.service.blueprint.container.ReifiedType;
+
+public class SoapVersionTypeConverter implements Converter {
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean canConvert(Object sourceObject, ReifiedType targetType) {
+        return SoapVersion.class.isAssignableFrom(targetType.getRawClass());
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Object convert(Object sourceObject, ReifiedType targetType) throws Exception {
+        if ("1.2".equals(sourceObject)) {
+            return Soap12.getInstance();
+        } else if ("1.1".equals(sourceObject)) {
+            return Soap11.getInstance();
+        }
+        throw new IllegalArgumentException("Unimplemented SOAP version requested.");
+    }
+}

Propchange: cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/blueprint/SoapVersionTypeConverter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/blueprint/SoapVersionTypeConverter.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/trunk/rt/bindings/soap/src/main/resources/OSGI-INF/blueprint/soap-binding.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/soap/src/main/resources/OSGI-INF/blueprint/soap-binding.xml?rev=1089067&view=auto
==============================================================================
--- cxf/trunk/rt/bindings/soap/src/main/resources/OSGI-INF/blueprint/soap-binding.xml (added)
+++ cxf/trunk/rt/bindings/soap/src/main/resources/OSGI-INF/blueprint/soap-binding.xml Tue
Apr  5 14:48:28 2011
@@ -0,0 +1,31 @@
+<!--
+  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.
+  -->
+
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+           xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
+           xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+  <service interface="org.apache.aries.blueprint.NamespaceHandler">
+    <service-properties>
+      <entry key="osgi.service.blueprint.namespace" value="http://cxf.apache.org/blueprint/bindings/soap"/>
+    </service-properties>
+    <bean class="org.apache.cxf.binding.soap.blueprint.SoapBindingBPHandler"/>
+  </service>
+</blueprint>

Propchange: cxf/trunk/rt/bindings/soap/src/main/resources/OSGI-INF/blueprint/soap-binding.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/rt/bindings/soap/src/main/resources/OSGI-INF/blueprint/soap-binding.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: cxf/trunk/rt/bindings/soap/src/main/resources/OSGI-INF/blueprint/soap-binding.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cxf/trunk/rt/bindings/soap/src/main/resources/schemas/configuration/blueprint/soap.xsd
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/soap/src/main/resources/schemas/configuration/blueprint/soap.xsd?rev=1089067&view=auto
==============================================================================
--- cxf/trunk/rt/bindings/soap/src/main/resources/schemas/configuration/blueprint/soap.xsd
(added)
+++ cxf/trunk/rt/bindings/soap/src/main/resources/schemas/configuration/blueprint/soap.xsd
Tue Apr  5 14:48:28 2011
@@ -0,0 +1,48 @@
+<?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.
+-->
+<xsd:schema
+  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+  xmlns:beans="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+  xmlns:cxf-beans="http://cxf.apache.org/configuration/beans"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  targetNamespace="http://cxf.apache.org/blueprint/bindings/soap"
+  elementFormDefault="qualified"
+  attributeFormDefault="unqualified">
+
+  <xsd:import namespace="http://cxf.apache.org/configuration/beans" schemaLocation="http://cxf.apache.org/schemas/configuration/cxf-beans.xsd"/>
+  <xsd:import namespace="http://www.osgi.org/xmlns/blueprint/v1.0.0" schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd"/>
+
+  <xsd:element name="soapBinding">
+    <xsd:complexType>
+      <xsd:complexContent>
+        <xsd:extension base="beans:Tcomponent">
+         <!--
+          <xsd:attributeGroup ref="cxf-beans:beanAttributes"/>
+          -->
+          <xsd:attribute name="version" type="xsd:string"/>
+          <xsd:attribute name="mtomEnabled" type="xsd:string"/>
+          <xsd:attribute name="style" type="xsd:string"/>
+          <xsd:attribute name="use" type="xsd:string"/>
+        </xsd:extension>
+      </xsd:complexContent>
+    </xsd:complexType>
+  </xsd:element>
+
+</xsd:schema>

Propchange: cxf/trunk/rt/bindings/soap/src/main/resources/schemas/configuration/blueprint/soap.xsd
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/rt/bindings/soap/src/main/resources/schemas/configuration/blueprint/soap.xsd
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: cxf/trunk/rt/bindings/soap/src/main/resources/schemas/configuration/blueprint/soap.xsd
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/configuration/blueprint/AbstractBPBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/configuration/blueprint/AbstractBPBeanDefinitionParser.java?rev=1089067&r1=1089066&r2=1089067&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/configuration/blueprint/AbstractBPBeanDefinitionParser.java
(original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/configuration/blueprint/AbstractBPBeanDefinitionParser.java
Tue Apr  5 14:48:28 2011
@@ -18,9 +18,7 @@
  */
 package org.apache.cxf.configuration.blueprint;
 
-
 import java.util.List;
-
 import javax.xml.namespace.QName;
 import org.w3c.dom.Attr;
 import org.w3c.dom.Element;
@@ -47,6 +45,7 @@ import org.osgi.service.blueprint.reflec
 import org.osgi.service.blueprint.reflect.ValueMetadata;
 
 public abstract class AbstractBPBeanDefinitionParser {
+
     private static final String XMLNS_BLUEPRINT = "http://www.osgi.org/xmlns/blueprint/v1.0.0";
     private static final String COMPONENT_ID = "component-id";
 
@@ -65,22 +64,20 @@ public abstract class AbstractBPBeanDefi
     protected Metadata parseListData(ParserContext context, 
                                      ComponentMetadata enclosingComponent, 
                                      Element element) {
-        MutableCollectionMetadata m
-            = (MutableCollectionMetadata)context.parseElement(CollectionMetadata.class, 
-                                    enclosingComponent, 
-                                    element);
+        MutableCollectionMetadata m 
+            = (MutableCollectionMetadata) context.parseElement(CollectionMetadata.class,

+                                                               enclosingComponent, element);
         m.setCollectionClass(List.class);
         return m;
     }
+
     protected Metadata parseMapData(ParserContext context, 
-                                     ComponentMetadata enclosingComponent, 
-                                     Element element) {
-        return context.parseElement(MapMetadata.class, 
-                                    enclosingComponent, 
-                                    element);
+                                    ComponentMetadata enclosingComponent, 
+                                    Element element) {
+        return context.parseElement(MapMetadata.class, enclosingComponent, element);
     }
 
-    protected void setFirstChildAsProperty(Element element,
+    protected void setFirstChildAsProperty(Element element, 
                                            ParserContext ctx, 
                                            MutableBeanMetadata bean, 
                                            String propertyName) {
@@ -101,24 +98,11 @@ public abstract class AbstractBPBeanDefi
                 }
                 bean.addProperty(propertyName, createRef(ctx, id));
             } else {
-                if ("bean".equals(name)) {
-                    //TODO FIX beans and refs
-                    // /       BeanDefinitionHolder bdh = ctx.getDelegate().parseBeanDefinitionElement(first);
-                    //   child = bdh.getBeanDefinition();
-                    //     bean.addPropertyValue(propertyName, child);
-                } else {
-                    throw new UnsupportedOperationException(
-                        "Elements with the name " + name 
-                        + " are not currently " 
-                        + "supported as sub elements of " 
-                        + element.getLocalName());
-                }
+                //Rely on BP to handle these ones.
+                bean.addProperty(propertyName, ctx.parseElement(Metadata.class, bean, first));
             }
         } else {
-            throw new UnsupportedOperationException(
-                "Elements with the name " + first.getLocalName() 
-                + " are not currently " 
-                + "supported as sub elements of " + element.getLocalName());
+            bean.addProperty(propertyName, ctx.parseElement(Metadata.class, bean, first));
         }
     }
 
@@ -163,43 +147,42 @@ public abstract class AbstractBPBeanDefi
             String pre = node.getPrefix();
             String name = node.getLocalName();
             String prefix = node.getPrefix();
-            
+
             // Don't process namespaces
             if (isNamespace(name, prefix)) {
                 continue;
             }
-            
+
             if ("createdFromAPI".equals(name) || "abstract".equals(name)) {
                 bean.setScope(BeanMetadata.SCOPE_PROTOTYPE);
-            } else if ("depends-on".equals(name)) {
-                bean.addDependsOn(val);
-            } else if (!"id".equals(name) && !"name".equals(name) && isAttribute(pre,
name)) {
-                if ("bus".equals(name)) {
-                    if (this.hasBusProperty()) {
-                        bean.addProperty("bus", getBusRef(ctx, val));
+            } else {
+                if ("depends-on".equals(name)) {
+                    bean.addDependsOn(val);
+                } else if (!"id".equals(name) && !"name".equals(name) &&
isAttribute(pre, name)) {
+                    if ("bus".equals(name)) {
+                        if (this.hasBusProperty()) {
+                            bean.addProperty("bus", getBusRef(ctx, val));
+                        } else {
+                            bean.addArgument(getBusRef(ctx, val), null, 0);
+                        }
                     } else {
-                        bean.addArgument(getBusRef(ctx, val), null, 0);
+                        mapAttribute(bean, element, name, val, ctx);
                     }
-                } else {
-                    mapAttribute(bean, element, name, val, ctx);
-                }    
+                }
             }
-        } 
+        }
         return setBus;
     }
 
-    protected void mapAttribute(MutableBeanMetadata bean, 
-                                Element e, String name, 
-                                String val, ParserContext context) {
+    protected void mapAttribute(MutableBeanMetadata bean, Element e, 
+                                String name, String val, ParserContext context) {
         mapToProperty(bean, name, val, context);
     }
 
     protected boolean isAttribute(String pre, String name) {
-        return !"xmlns".equals(name) 
-            && (pre == null || !pre.equals("xmlns")) 
-            && !"abstract".equals(name) 
-            && !"lazy-init".equals(name) && !"id"
-            .equals(name);
+        return !"xmlns".equals(name) && (pre == null || !pre.equals("xmlns")) 
+            && !"abstract".equals(name) && !"lazy-init".equals(name) 
+            && !"id".equals(name);
     }
 
     protected boolean isNamespace(String name, String prefix) {
@@ -225,6 +208,7 @@ public abstract class AbstractBPBeanDefi
             }
         }
     }
+
     public static ValueMetadata createValue(ParserContext context, String value) {
         MutableValueMetadata v = context.createMetadata(MutableValueMetadata.class);
         v.setStringValue(value);
@@ -236,14 +220,14 @@ public abstract class AbstractBPBeanDefi
         r.setComponentId(value);
         return r;
     }
+
     public static MutableBeanMetadata createObjectOfClass(ParserContext context, String value)
{
         MutableBeanMetadata v = context.createMetadata(MutableBeanMetadata.class);
         v.setClassName(value);
         return v;
     }
 
-    protected MutableBeanMetadata getBus(ParserContext context,
-                                    String name) {
+    protected MutableBeanMetadata getBus(ParserContext context, String name) {
         ComponentDefinitionRegistry cdr = context.getComponentDefinitionRegistry();
         ComponentMetadata meta = cdr.getComponentDefinition("blueprintBundle");
 
@@ -254,14 +238,13 @@ public abstract class AbstractBPBeanDefi
         if (!cdr.containsComponentDefinition(InterceptorTypeConverter.class.getName())) {
             MutablePassThroughMetadata md = context.createMetadata(MutablePassThroughMetadata.class);
             md.setObject(new InterceptorTypeConverter());
-            
+
             md.setId(InterceptorTypeConverter.class.getName());
             context.getComponentDefinitionRegistry().registerTypeConverter(md);
         }
-        if (blueprintBundle != null
-            && !cdr.containsComponentDefinition(name)) {
+        if (blueprintBundle != null && !cdr.containsComponentDefinition(name)) {
             //Create a bus
-            
+
             MutableBeanMetadata bus = context.createMetadata(MutableBeanMetadata.class);
             bus.setId(name);
             bus.setRuntimeClass(BlueprintBus.class);
@@ -269,20 +252,20 @@ public abstract class AbstractBPBeanDefi
             bus.addProperty("blueprintContainer", createRef(context, "blueprintContainer"));
             bus.setDestroyMethod("shutdown");
             bus.setInitMethod("initialize");
-            
+
             context.getComponentDefinitionRegistry().registerComponentDefinition(bus);
-            
+
             return bus;
         }
-        return (MutableBeanMetadata)cdr.getComponentDefinition(name);
+        return (MutableBeanMetadata) cdr.getComponentDefinition(name);
     }
-    protected RefMetadata getBusRef(ParserContext context,
-                                    String name) {
+
+    protected RefMetadata getBusRef(ParserContext context, String name) {
 
         getBus(context, name);
         return createRef(context, name);
     }
-    
+
     protected void parseChildElements(Element element, ParserContext ctx, MutableBeanMetadata
bean) {
         Element el = DOMUtils.getFirstElement(element);
         while (el != null) {
@@ -291,6 +274,4 @@ public abstract class AbstractBPBeanDefi
             el = DOMUtils.getNextElement(el);
         }
     }
-    
-
 }



Mime
View raw message