cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bimargul...@apache.org
Subject svn commit: r631587 - in /incubator/cxf/trunk/rt/databinding/aegis/src: main/java/org/apache/cxf/aegis/ main/java/org/apache/cxf/aegis/type/ main/java/org/apache/cxf/aegis/xml/jdom/ test/java/org/apache/cxf/aegis/type/basic/ test/java/org/apache/cxf/ae...
Date Wed, 27 Feb 2008 13:38:46 GMT
Author: bimargulies
Date: Wed Feb 27 05:38:41 2008
New Revision: 631587

URL: http://svn.apache.org/viewvc?rev=631587&view=rev
Log:
Simplify Aegis by removing unnecessary XFire modularity. The type mapping registry is gone,
the CustomTypeMapping is now the DefaultTypeMapping.

Added:
    incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/DefaultTypeMapping.java   (with props)
Removed:
    incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/AbstractTypeMappingRegistry.java
    incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/CustomTypeMapping.java
    incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/DefaultTypeMappingRegistry.java
    incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeMappingRegistry.java
Modified:
    incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisContext.java
    incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/AbstractTypeCreator.java
    incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeMapping.java
    incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/XMLTypeCreator.java
    incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/xml/jdom/JDOMWriter.java
    incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/BadXMLTest.java
    incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/BeanTest.java
    incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/DynamicProxyTest.java
    incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/encoded/AbstractEncodedTest.java
    incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/encoded/ArrayTypeInfoTest.java
    incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/CollectionTest.java
    incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/ConfigurationTest.java
    incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/EnumTypeTest.java
    incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/JaxbXmlParamTypeTest.java
    incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/MapTest.java
    incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/XFireXmlParamTypeTest.java
    incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/XmlParamTypeTest.java

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisContext.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisContext.java?rev=631587&r1=631586&r2=631587&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisContext.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisContext.java Wed Feb 27 05:38:41 2008
@@ -27,13 +27,17 @@
 import javax.xml.stream.XMLStreamReader;
 import javax.xml.stream.XMLStreamWriter;
 
+import org.apache.cxf.aegis.type.AbstractTypeCreator;
 import org.apache.cxf.aegis.type.Configuration;
-import org.apache.cxf.aegis.type.DefaultTypeMappingRegistry;
+import org.apache.cxf.aegis.type.DefaultTypeCreator;
+import org.apache.cxf.aegis.type.DefaultTypeMapping;
 import org.apache.cxf.aegis.type.Type;
+import org.apache.cxf.aegis.type.TypeCreator;
 import org.apache.cxf.aegis.type.TypeMapping;
-import org.apache.cxf.aegis.type.TypeMappingRegistry;
 import org.apache.cxf.aegis.type.TypeUtil;
+import org.apache.cxf.aegis.type.XMLTypeCreator;
 import org.apache.cxf.aegis.type.basic.BeanType;
+import org.apache.cxf.aegis.type.java5.Java5TypeCreator;
 import org.apache.cxf.common.classloader.ClassLoaderUtils;
 import org.apache.cxf.common.util.SOAPConstants;
 
@@ -67,13 +71,9 @@
  * 
  */
 public class AegisContext {
-    // perhaps this should be SoapConstants.XSD? Or perhaps the code that looks for that should look for this?
-    private static final String DEFAULT_ENCODING_STYLE_URI = "urn:aegis.cxf.apache.org:defaultEncoding";
     private boolean writeXsiTypes;
     private boolean readXsiTypes = true;
-    private String mappingNamespaceURI = DEFAULT_ENCODING_STYLE_URI;
 
-    private TypeMappingRegistry typeMappingRegistry;
     private Set<String> rootClassNames;
     private Set<Class<?>> rootClasses;
     private Set<QName> rootTypeQNames;
@@ -84,6 +84,8 @@
     private Configuration configuration;
     private boolean mtomEnabled;
     private boolean mtomUseXmime;
+    // this URI goes into the type map.
+    private String mappingNamespaceURI; 
     
     /**
      * Construct a context.
@@ -93,6 +95,30 @@
         rootClasses = new HashSet<Class<?>>();
         rootTypeQNames = new HashSet<QName>();
     }
+    
+    public TypeCreator createTypeCreator() {
+        AbstractTypeCreator xmlCreator = createRootTypeCreator();
+
+        Java5TypeCreator j5Creator = new Java5TypeCreator();
+        j5Creator.setNextCreator(createDefaultTypeCreator());
+        j5Creator.setConfiguration(getConfiguration());
+        xmlCreator.setNextCreator(j5Creator);
+
+        return xmlCreator;
+    }
+
+    protected AbstractTypeCreator createRootTypeCreator() {
+        AbstractTypeCreator creator = new XMLTypeCreator();
+        creator.setConfiguration(getConfiguration());
+        return creator;
+    }
+
+    protected AbstractTypeCreator createDefaultTypeCreator() {
+        AbstractTypeCreator creator = new DefaultTypeCreator();
+        creator.setConfiguration(getConfiguration());
+        return creator;
+    }
+
 
     /**
      * Initialize the context. The encodingStyleURI allows .aegis.xml files to have multiple mappings 
@@ -100,15 +126,22 @@
      * @param mappingNamespaceURI URI to select mappings based on the encoding.
      */
     public void initialize() {
-        if (typeMappingRegistry == null) {
-            typeMappingRegistry = new DefaultTypeMappingRegistry(null, true, mtomUseXmime);
-        } 
-        if (configuration != null) {
-            typeMappingRegistry.setConfiguration(configuration);
+        // The use of the XSD URI in the mapping is, MAGIC. 
+        // allow spring config of an alternative mapping.
+        if (configuration == null) {
+            configuration = new Configuration();
+        }
+        if (typeMapping == null) {
+            boolean defaultNillable = configuration.isDefaultNillable();
+            TypeMapping baseTM = DefaultTypeMapping.createDefaultTypeMapping(defaultNillable, mtomUseXmime);
+            if (mappingNamespaceURI == null) {
+                mappingNamespaceURI = SOAPConstants.XSD;
+            }
+            DefaultTypeMapping defaultTypeMapping = new DefaultTypeMapping(mappingNamespaceURI, baseTM);
+            defaultTypeMapping.setTypeCreator(createTypeCreator());
+            typeMapping = defaultTypeMapping;
         }
-        // The use of the XSD URI in the mapping is, MAGIC.
-        typeMapping  = typeMappingRegistry.createTypeMapping(SOAPConstants.XSD, true);
-        typeMappingRegistry.register(mappingNamespaceURI, typeMapping);
+        
         processRootTypes();
     }
     
@@ -134,22 +167,6 @@
     }
     
     /**
-     * Retrieve the type mapping registry object.
-     * @return the registry.
-     */
-    public TypeMappingRegistry getTypeMappingRegistry() {
-        return typeMappingRegistry;
-    }
-
-    /**
-     * Set the type mapping registry. Call this after construction and before 'initialize'.
-     * @param typeMappingRegistry
-     */
-    public void setTypeMappingRegistry(TypeMappingRegistry typeMappingRegistry) {
-        this.typeMappingRegistry = typeMappingRegistry;
-    }
-    
-    /**
      * If a class was provided as part of the 'root' list, retrieve it's Type by
      * Class.
      * @param clazz
@@ -243,12 +260,7 @@
      * @return Returns the configuration.
      */
     public Configuration getConfiguration() {
-        if (typeMappingRegistry != null) {
-            return typeMappingRegistry.getConfiguration();
-        } else {
-            return configuration;
-        }
-            
+        return configuration;
     }
 
     /**
@@ -258,9 +270,6 @@
      */
     public void setConfiguration(Configuration newConfiguration) {
         this.configuration = newConfiguration;
-        if (typeMappingRegistry != null) {
-            typeMappingRegistry.setConfiguration(configuration);
-        }
     }
 
     public boolean isWriteXsiTypes() {
@@ -322,10 +331,6 @@
         this.beanImplementationMap = beanImplementationMap;
     }
 
-    public void setMappingNamespaceURI(String uri) {
-        this.mappingNamespaceURI = uri;
-    }
-
     public Set<Class<?>> getRootClasses() {
         return rootClasses;
     }
@@ -356,6 +361,21 @@
 
     public void setMtomUseXmime(boolean mtomUseXmime) {
         this.mtomUseXmime = mtomUseXmime;
+    }
+
+    /**
+     * What URI identifies the type mapping for this context? 
+     * When the XMLTypeCreator reads .aegis.xml file, it will only read mappings for
+     * this URI (or no URI). When the abstract type creator is otherwise at a loss
+     * for a namespace URI, it will use this URI.
+     * @return
+     */
+    public String getMappingNamespaceURI() {
+        return mappingNamespaceURI;
+    }
+
+    public void setMappingNamespaceURI(String mappingNamespaceURI) {
+        this.mappingNamespaceURI = mappingNamespaceURI;
     }
 
 }

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/AbstractTypeCreator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/AbstractTypeCreator.java?rev=631587&r1=631586&r2=631587&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/AbstractTypeCreator.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/AbstractTypeCreator.java Wed Feb 27 05:38:41 2008
@@ -275,7 +275,7 @@
                       + "Map";
 
         // TODO: Get namespace from XML?
-        return new QName(tm.getEncodingStyleURI(), name);
+        return new QName(tm.getMappingIdentifierURI(), name);
     }
 
     protected boolean isMap(Class javaType) {
@@ -302,7 +302,7 @@
         if (type.isComplex()) {
             ns = type.getSchemaType().getNamespaceURI();
         } else {
-            ns = tm.getEncodingStyleURI();
+            ns = tm.getMappingIdentifierURI();
         }
         if (WSDLConstants.NS_SCHEMA_XSD.equals(ns)) {
             ns = "http://cxf.apache.org/arrays";

Added: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/DefaultTypeMapping.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/DefaultTypeMapping.java?rev=631587&view=auto
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/DefaultTypeMapping.java (added)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/DefaultTypeMapping.java Wed Feb 27 05:38:41 2008
@@ -0,0 +1,369 @@
+/**
+ * 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.aegis.type;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.net.URI;
+import java.sql.Time;
+import java.sql.Timestamp;
+import java.util.Calendar;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.activation.DataHandler;
+import javax.activation.DataSource;
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.transform.Source;
+
+import org.w3c.dom.Document;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.cxf.aegis.DatabindingException;
+import org.apache.cxf.aegis.type.basic.Base64Type;
+import org.apache.cxf.aegis.type.basic.BigDecimalType;
+import org.apache.cxf.aegis.type.basic.BigIntegerType;
+import org.apache.cxf.aegis.type.basic.BooleanType;
+import org.apache.cxf.aegis.type.basic.CalendarType;
+import org.apache.cxf.aegis.type.basic.CharacterType;
+import org.apache.cxf.aegis.type.basic.DateTimeType;
+import org.apache.cxf.aegis.type.basic.DoubleType;
+import org.apache.cxf.aegis.type.basic.FloatType;
+import org.apache.cxf.aegis.type.basic.IntType;
+import org.apache.cxf.aegis.type.basic.LongType;
+import org.apache.cxf.aegis.type.basic.ObjectType;
+import org.apache.cxf.aegis.type.basic.ShortType;
+import org.apache.cxf.aegis.type.basic.SqlDateType;
+import org.apache.cxf.aegis.type.basic.StringType;
+import org.apache.cxf.aegis.type.basic.TimeType;
+import org.apache.cxf.aegis.type.basic.TimestampType;
+import org.apache.cxf.aegis.type.basic.URIType;
+import org.apache.cxf.aegis.type.mtom.AbstractXOPType;
+import org.apache.cxf.aegis.type.mtom.DataHandlerType;
+import org.apache.cxf.aegis.type.mtom.DataSourceType;
+import org.apache.cxf.aegis.type.xml.DocumentType;
+import org.apache.cxf.aegis.type.xml.JDOMDocumentType;
+import org.apache.cxf.aegis.type.xml.JDOMElementType;
+import org.apache.cxf.aegis.type.xml.SourceType;
+import org.apache.cxf.aegis.type.xml.XMLStreamReaderType;
+import org.apache.cxf.binding.soap.Soap11;
+import org.apache.cxf.common.classloader.ClassLoaderUtils;
+import org.apache.cxf.common.util.SOAPConstants;
+import org.apache.cxf.common.util.XMLSchemaQNames;
+import org.jdom.Element;
+
+/**
+ * Contains type mappings for java/qname pairs.
+ */
+public class DefaultTypeMapping implements TypeMapping {
+    private static final Log LOG = LogFactory.getLog(DefaultTypeMapping.class);
+    private Map<Class, Type> class2Type;
+    private Map<QName, Type> xml2Type;
+    private Map<Class, QName> class2xml;
+    private TypeMapping nextTM;
+    private TypeCreator typeCreator;
+    private String identifierURI;
+
+    public DefaultTypeMapping(String identifierURI, TypeMapping defaultTM) {
+        this(identifierURI);
+
+        this.nextTM = defaultTM;
+    }
+    
+    public DefaultTypeMapping() {
+        this(SOAPConstants.XSD);
+    }
+
+    public DefaultTypeMapping(String identifierURI) {
+        this.identifierURI = identifierURI;
+        class2Type = Collections.synchronizedMap(new HashMap<Class, Type>());
+        class2xml = Collections.synchronizedMap(new HashMap<Class, QName>());
+        xml2Type = Collections.synchronizedMap(new HashMap<QName, Type>());
+    }
+
+    public boolean isRegistered(Class javaType) {
+        boolean registered = class2Type.containsKey(javaType);
+
+        if (!registered && nextTM != null) {
+            registered = nextTM.isRegistered(javaType);
+        }
+
+        return registered;
+    }
+
+    public boolean isRegistered(QName xmlType) {
+        boolean registered = xml2Type.containsKey(xmlType);
+
+        if (!registered && nextTM != null) {
+            registered = nextTM.isRegistered(xmlType);
+        }
+
+        return registered;
+    }
+
+    public void register(Class javaType, QName xmlType, Type type) {
+        type.setSchemaType(xmlType);
+        type.setTypeClass(javaType);
+
+        register(type);
+    }
+
+    public void register(Type type) {
+        type.setTypeMapping(this);
+        /*
+         * -- prb@codehaus.org; changing this to only register the type for
+         * actions that it supports, and it could be none.
+         */
+        if (type.getTypeClass() != null) {
+            class2xml.put(type.getTypeClass(), type.getSchemaType());
+            class2Type.put(type.getTypeClass(), type);
+        }
+        if (type.getSchemaType() != null) {
+            xml2Type.put(type.getSchemaType(), type);
+        }
+        if (type.getTypeClass() == null && type.getSchemaType() == null) {
+            LOG.warn("The type " + type.getClass().getName()
+                     + " supports neither serialization (non-null TypeClass)"
+                     + " nor deserialization (non-null SchemaType).");
+        }
+    }
+
+    public void removeType(Type type) {
+        if (!xml2Type.containsKey(type.getSchemaType())) {
+            nextTM.removeType(type);
+        } else {
+            xml2Type.remove(type.getSchemaType());
+            class2Type.remove(type.getTypeClass());
+            class2xml.remove(type.getTypeClass());
+        }
+    }
+
+    /**
+     * @see org.apache.cxf.aegis.type.TypeMapping#getType(java.lang.Class)
+     */
+    public Type getType(Class javaType) {
+        Type type = class2Type.get(javaType);
+
+        if (type == null && nextTM != null) {
+            type = nextTM.getType(javaType);
+        }
+
+        return type;
+    }
+
+    /**
+     * @see org.apache.cxf.aegis.type.TypeMapping#getType(javax.xml.namespace.QName)
+     */
+    public Type getType(QName xmlType) {
+        Type type = xml2Type.get(xmlType);
+
+        if (type == null && nextTM != null) {
+            type = nextTM.getType(xmlType);
+        }
+
+        return type;
+    }
+
+    /**
+     * @see org.apache.cxf.aegis.type.TypeMapping#getTypeQName(java.lang.Class)
+     */
+    public QName getTypeQName(Class clazz) {
+        QName qname = class2xml.get(clazz);
+
+        if (qname == null && nextTM != null) {
+            qname = nextTM.getTypeQName(clazz);
+        }
+
+        return qname;
+    }
+
+    public TypeCreator getTypeCreator() {
+        return typeCreator;
+    }
+
+    public void setTypeCreator(TypeCreator typeCreator) {
+        this.typeCreator = typeCreator;
+
+        typeCreator.setTypeMapping(this);
+    }
+
+    public TypeMapping getParent() {
+        return nextTM;
+    }
+
+    private static void defaultRegister(TypeMapping tm, boolean defaultNillable, Class class1, QName name,
+                                        Type type) {
+        if (!defaultNillable) {
+            type.setNillable(false);
+        }
+
+        tm.register(class1, name, type);
+    }
+
+    private static void fillStandardMappings(TypeMapping tm, boolean defaultNillable, 
+                                             boolean enableMtomXmime) {
+        defaultRegister(tm, defaultNillable, BigDecimal.class, XMLSchemaQNames.XSD_DECIMAL,
+                        new BigDecimalType());
+        defaultRegister(tm, defaultNillable, BigInteger.class, XMLSchemaQNames.XSD_INTEGER,
+                        new BigIntegerType());
+        defaultRegister(tm, defaultNillable, Boolean.class, XMLSchemaQNames.XSD_BOOLEAN,
+                        new BooleanType());
+        defaultRegister(tm, defaultNillable, Calendar.class, XMLSchemaQNames.XSD_DATETIME,
+                        new CalendarType());
+        defaultRegister(tm, defaultNillable, Character.class, Soap11.ENCODED_CHAR, new CharacterType());
+        defaultRegister(tm, defaultNillable, Date.class, XMLSchemaQNames.XSD_DATETIME, new DateTimeType());
+        defaultRegister(tm, defaultNillable, Document.class, XMLSchemaQNames.XSD_ANY, new DocumentType());
+        defaultRegister(tm, defaultNillable, Element.class, XMLSchemaQNames.XSD_ANY,
+                        new JDOMElementType());
+        defaultRegister(tm, defaultNillable, Float.class, XMLSchemaQNames.XSD_FLOAT, new FloatType());
+        defaultRegister(tm, defaultNillable, Integer.class, XMLSchemaQNames.XSD_INT, new IntType());
+        defaultRegister(tm, defaultNillable, Long.class, XMLSchemaQNames.XSD_LONG, new LongType());
+        defaultRegister(tm, defaultNillable, Object.class, XMLSchemaQNames.XSD_ANY, new ObjectType());
+        defaultRegister(tm, defaultNillable, Short.class, XMLSchemaQNames.XSD_SHORT, new ShortType());
+        defaultRegister(tm, defaultNillable, Source.class, XMLSchemaQNames.XSD_ANY, new SourceType());
+        defaultRegister(tm, defaultNillable, String.class, XMLSchemaQNames.XSD_STRING, new StringType());
+        defaultRegister(tm, defaultNillable, Time.class, XMLSchemaQNames.XSD_TIME, new TimeType());
+        defaultRegister(tm, defaultNillable, Timestamp.class, XMLSchemaQNames.XSD_DATETIME,
+                        new TimestampType());
+        defaultRegister(tm, defaultNillable, URI.class, XMLSchemaQNames.XSD_URI, new URIType());
+        defaultRegister(tm, defaultNillable, XMLStreamReader.class, XMLSchemaQNames.XSD_ANY,
+                        new XMLStreamReaderType());
+        
+        defaultRegister(tm, defaultNillable, boolean.class, XMLSchemaQNames.XSD_BOOLEAN,
+                        new BooleanType());
+        defaultRegister(tm, defaultNillable, byte[].class, XMLSchemaQNames.XSD_BASE64, new Base64Type());
+        defaultRegister(tm, defaultNillable, double.class, XMLSchemaQNames.XSD_DOUBLE, new DoubleType());
+        defaultRegister(tm, defaultNillable, float.class, XMLSchemaQNames.XSD_FLOAT, new FloatType());
+        defaultRegister(tm, defaultNillable, int.class, XMLSchemaQNames.XSD_INT, new IntType());
+        defaultRegister(tm, defaultNillable, short.class, XMLSchemaQNames.XSD_SHORT, new ShortType());
+        defaultRegister(tm, defaultNillable, long.class, XMLSchemaQNames.XSD_LONG, new LongType());
+
+        defaultRegister(tm, defaultNillable, java.sql.Date.class, XMLSchemaQNames.XSD_DATETIME,
+                        new SqlDateType());
+        defaultRegister(tm, defaultNillable, org.jdom.Document.class, XMLSchemaQNames.XSD_ANY,
+                        new JDOMDocumentType());
+        
+        QName mtomBase64 = XMLSchemaQNames.XSD_BASE64;
+        if (enableMtomXmime) {
+            mtomBase64 = AbstractXOPType.XML_MIME_BASE64;
+        }
+
+        defaultRegister(tm, defaultNillable, DataSource.class, mtomBase64,
+                        new DataSourceType(enableMtomXmime, null));
+        defaultRegister(tm, defaultNillable, DataHandler.class, mtomBase64,
+                        new DataHandlerType(enableMtomXmime, null));
+    }
+
+    public static DefaultTypeMapping createSoap11TypeMapping(boolean defaultNillable, 
+                                                             boolean enableMtomXmime) {
+        // Create a Type Mapping for SOAP 1.1 Encoding
+        DefaultTypeMapping soapTM = new DefaultTypeMapping(Soap11.SOAP_ENCODING_URI);
+        fillStandardMappings(soapTM, defaultNillable, enableMtomXmime);
+
+        defaultRegister(soapTM, defaultNillable, boolean.class, Soap11.ENCODED_BOOLEAN, new BooleanType());
+        defaultRegister(soapTM, defaultNillable, int.class, Soap11.ENCODED_INT, new IntType());
+        defaultRegister(soapTM, defaultNillable, short.class, Soap11.ENCODED_SHORT, new ShortType());
+        defaultRegister(soapTM, defaultNillable, double.class, Soap11.ENCODED_DOUBLE, new DoubleType());
+        defaultRegister(soapTM, defaultNillable, float.class, Soap11.ENCODED_FLOAT, new FloatType());
+        defaultRegister(soapTM, defaultNillable, long.class, Soap11.ENCODED_LONG, new LongType());
+        defaultRegister(soapTM, defaultNillable, char.class, Soap11.ENCODED_CHAR, new CharacterType());
+        defaultRegister(soapTM, defaultNillable, Character.class, Soap11.ENCODED_CHAR, new CharacterType());
+        defaultRegister(soapTM, defaultNillable, String.class, Soap11.ENCODED_STRING, new StringType());
+        defaultRegister(soapTM, defaultNillable, Boolean.class, Soap11.ENCODED_BOOLEAN, new BooleanType());
+        defaultRegister(soapTM, defaultNillable, Integer.class, Soap11.ENCODED_INT, new IntType());
+        defaultRegister(soapTM, defaultNillable, Short.class, Soap11.ENCODED_SHORT, new ShortType());
+        defaultRegister(soapTM, defaultNillable, Double.class, Soap11.ENCODED_DOUBLE, new DoubleType());
+        defaultRegister(soapTM, defaultNillable, Float.class, Soap11.ENCODED_FLOAT, new FloatType());
+        defaultRegister(soapTM, defaultNillable, Long.class, Soap11.ENCODED_LONG, new LongType());
+        defaultRegister(soapTM, defaultNillable, Date.class, Soap11.ENCODED_DATETIME, new DateTimeType());
+        defaultRegister(soapTM, defaultNillable, java.sql.Date.class, Soap11.ENCODED_DATETIME,
+                        new SqlDateType());
+        defaultRegister(soapTM, defaultNillable, Calendar.class, Soap11.ENCODED_DATETIME, new CalendarType());
+        defaultRegister(soapTM, defaultNillable, byte[].class, Soap11.ENCODED_BASE64, new Base64Type());
+        defaultRegister(soapTM, defaultNillable, BigDecimal.class, Soap11.ENCODED_DECIMAL,
+                        new BigDecimalType());
+        defaultRegister(soapTM, defaultNillable, BigInteger.class, Soap11.ENCODED_INTEGER,
+                        new BigIntegerType());
+
+        return soapTM;
+    }
+
+    public static DefaultTypeMapping createDefaultTypeMapping(boolean defaultNillable, 
+                                                              boolean enableMtomXmime) {
+        // by convention, the default mapping is against the XML schema URI.
+        DefaultTypeMapping tm = new DefaultTypeMapping(SOAPConstants.XSD);
+        fillStandardMappings(tm, defaultNillable, enableMtomXmime);
+
+        registerIfAvailable(tm, defaultNillable, "javax.xml.datatype.Duration", XMLSchemaQNames.XSD_DURATION,
+                            "org.apache.cxf.aegis.type.java5.DurationType");
+        registerIfAvailable(tm, defaultNillable, "javax.xml.datatype.XMLGregorianCalendar",
+                            XMLSchemaQNames.XSD_DATE,
+                            "org.apache.cxf.aegis.type.java5.XMLGregorianCalendarType");
+        registerIfAvailable(tm, defaultNillable, "javax.xml.datatype.XMLGregorianCalendar",
+                            XMLSchemaQNames.XSD_TIME,
+                            "org.apache.cxf.aegis.type.java5.XMLGregorianCalendarType");
+        registerIfAvailable(tm, defaultNillable, "javax.xml.datatype.XMLGregorianCalendar",
+                            XMLSchemaQNames.XSD_G_DAY,
+                            "org.apache.cxf.aegis.type.java5.XMLGregorianCalendarType");
+        registerIfAvailable(tm, defaultNillable, "javax.xml.datatype.XMLGregorianCalendar",
+                            XMLSchemaQNames.XSD_G_MONTH,
+                            "org.apache.cxf.aegis.type.java5.XMLGregorianCalendarType");
+        registerIfAvailable(tm, defaultNillable, "javax.xml.datatype.XMLGregorianCalendar",
+                            XMLSchemaQNames.XSD_G_MONTH_DAY,
+                            "org.apache.cxf.aegis.type.java5.XMLGregorianCalendarType");
+        registerIfAvailable(tm, defaultNillable, "javax.xml.datatype.XMLGregorianCalendar",
+                            XMLSchemaQNames.XSD_G_YEAR,
+                            "org.apache.cxf.aegis.type.java5.XMLGregorianCalendarType");
+        registerIfAvailable(tm, defaultNillable, "javax.xml.datatype.XMLGregorianCalendar",
+                            XMLSchemaQNames.XSD_G_YEAR_MONTH,
+                            "org.apache.cxf.aegis.type.java5.XMLGregorianCalendarType");
+        registerIfAvailable(tm, defaultNillable, "javax.xml.datatype.XMLGregorianCalendar",
+                            XMLSchemaQNames.XSD_DATETIME,
+                            "org.apache.cxf.aegis.type.java5.XMLGregorianCalendarType");
+        return tm;
+    }
+
+    private static void registerIfAvailable(TypeMapping tm, boolean defaultNillable, String className,
+                                            QName typeName, String typeClassName) {
+        try {
+            Class cls = ClassLoaderUtils.loadClass(className, DefaultTypeMapping.class);
+            Class typeCls = ClassLoaderUtils.loadClass(typeClassName, DefaultTypeMapping.class);
+            try {
+                Type type = (Type)typeCls.newInstance();
+
+                defaultRegister(tm, defaultNillable, cls, typeName, type);
+            } catch (InstantiationException e) {
+                throw new DatabindingException("Couldn't instantiate Type ", e);
+            } catch (IllegalAccessException e) {
+                throw new DatabindingException("Couldn't instantiate Type ", e);
+            }
+        } catch (ClassNotFoundException e) {
+            LOG.debug("Could not find optional Type " + className + ". Skipping.");
+        }
+
+    }
+
+    public String getMappingIdentifierURI() {
+        return identifierURI;
+    }
+}

Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/DefaultTypeMapping.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/DefaultTypeMapping.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeMapping.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeMapping.java?rev=631587&r1=631586&r2=631587&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeMapping.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeMapping.java Wed Feb 27 05:38:41 2008
@@ -51,9 +51,13 @@
 
     QName getTypeQName(Class clazz);
 
-    String getEncodingStyleURI();
-
-    void setEncodingStyleURI(String encodingStyleURI);
-
     TypeCreator getTypeCreator();
+    
+    /**
+     * Each mapping has a URI that identifies it.
+     * The mapping for a service uses the service URI.
+     * XML files can choose to only contribute mappings that match.
+     * @return the URI.
+     */
+    String getMappingIdentifierURI();
 }

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/XMLTypeCreator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/XMLTypeCreator.java?rev=631587&r1=631586&r2=631587&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/XMLTypeCreator.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/XMLTypeCreator.java Wed Feb 27 05:38:41 2008
@@ -267,8 +267,9 @@
             return null;
         }
 
-        Element mapping = getMatch(doc, "/mappings/mapping[@uri='" + getTypeMapping().getEncodingStyleURI()
-                                        + "']");
+        Element mapping = getMatch(doc, "/mappings/mapping[@uri='" 
+                                   + getTypeMapping().getMappingIdentifierURI()
+                                   + "']");
         if (mapping == null) {
             mapping = getMatch(doc, "/mappings/mapping[not(@uri)]");
         }
@@ -668,7 +669,7 @@
         int index = value.indexOf(":");
 
         if (index == -1) {
-            return new QName(getTypeMapping().getEncodingStyleURI(), value);
+            return new QName(getTypeMapping().getMappingIdentifierURI(), value);
         }
 
         String prefix = value.substring(0, index);

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/xml/jdom/JDOMWriter.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/xml/jdom/JDOMWriter.java?rev=631587&r1=631586&r2=631587&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/xml/jdom/JDOMWriter.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/xml/jdom/JDOMWriter.java Wed Feb 27 05:38:41 2008
@@ -36,7 +36,11 @@
     }
 
     public void writeValue(Object value) {
-        element.addContent(value.toString());
+        // an NPE is not helpful, and code at a higher level is responsible for
+        // xsi:nil processing.
+        if (value != null) {
+            element.addContent(value.toString());
+        }
     }
 
     public void writeValue(Object value, String ns, String attr) {

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/BadXMLTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/BadXMLTest.java?rev=631587&r1=631586&r2=631587&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/BadXMLTest.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/BadXMLTest.java Wed Feb 27 05:38:41 2008
@@ -19,20 +19,21 @@
 package org.apache.cxf.aegis.type.basic;
 
 import junit.framework.TestCase;
+
+import org.apache.cxf.aegis.AegisContext;
 import org.apache.cxf.aegis.DatabindingException;
-import org.apache.cxf.aegis.type.DefaultTypeMappingRegistry;
 import org.apache.cxf.aegis.type.TypeMapping;
 import org.junit.Test;
 
 public class BadXMLTest extends TestCase {
     TypeMapping mapping;
-    private DefaultTypeMappingRegistry reg;
+
 
     @Test
     public void testBadDescriptorNS() throws Exception {
-
-        reg = new DefaultTypeMappingRegistry(true);
-        mapping = reg.createTypeMapping(true);
+        AegisContext context = new AegisContext();
+        context.initialize();
+        mapping = context.getTypeMapping();
         try {
             mapping.getTypeCreator().createType(BadBeanDescriptor.class);
             fail("No exception was thrown");

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/BeanTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/BeanTest.java?rev=631587&r1=631586&r2=631587&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/BeanTest.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/BeanTest.java Wed Feb 27 05:38:41 2008
@@ -26,10 +26,10 @@
 import javax.xml.namespace.QName;
 
 import org.apache.cxf.aegis.AbstractAegisTest;
+import org.apache.cxf.aegis.AegisContext;
 import org.apache.cxf.aegis.Context;
 import org.apache.cxf.aegis.services.SimpleBean;
 import org.apache.cxf.aegis.type.Configuration;
-import org.apache.cxf.aegis.type.DefaultTypeMappingRegistry;
 import org.apache.cxf.aegis.type.Type;
 import org.apache.cxf.aegis.type.TypeMapping;
 import org.apache.cxf.aegis.util.jdom.StaxBuilder;
@@ -45,7 +45,7 @@
 
 public class BeanTest extends AbstractAegisTest {
     TypeMapping mapping;
-    private DefaultTypeMappingRegistry reg;
+    private AegisContext context;
 
     public void setUp() throws Exception {
         super.setUp();
@@ -54,8 +54,9 @@
         addNamespace("a", "urn:anotherns");
         addNamespace("xsi", SOAPConstants.XSI_NS);
 
-        reg = new DefaultTypeMappingRegistry(true);
-        mapping = reg.createTypeMapping(true);
+        context = new AegisContext();
+        context.initialize();
+        mapping = context.getTypeMapping();
     }
 
     public void testBean() throws Exception {
@@ -312,14 +313,14 @@
     }
     @Test
     public void testNillableIntMinOccurs1() throws Exception {
-        reg = new DefaultTypeMappingRegistry();
+        context = new AegisContext();
 
-        Configuration config = reg.getConfiguration();
+        Configuration config = new Configuration();
         config.setDefaultMinOccurs(1);
         config.setDefaultNillable(false);
-
-        reg.createDefaultMappings();
-        mapping = reg.createTypeMapping(true);
+        context.setConfiguration(config);
+        context.initialize();
+        mapping = context.getTypeMapping();
 
         BeanType type = (BeanType)mapping.getTypeCreator().createType(IntBean.class);
         type.setTypeClass(IntBean.class);

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/DynamicProxyTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/DynamicProxyTest.java?rev=631587&r1=631586&r2=631587&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/DynamicProxyTest.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/DynamicProxyTest.java Wed Feb 27 05:38:41 2008
@@ -21,9 +21,8 @@
 import javax.xml.namespace.QName;
 
 import org.apache.cxf.aegis.AbstractAegisTest;
-import org.apache.cxf.aegis.type.DefaultTypeMappingRegistry;
+import org.apache.cxf.aegis.AegisContext;
 import org.apache.cxf.aegis.type.TypeMapping;
-import org.apache.cxf.aegis.type.TypeMappingRegistry;
 import org.apache.cxf.aegis.xml.stax.ElementReader;
 import org.junit.Test;
 
@@ -33,8 +32,9 @@
     public void setUp() throws Exception {
         super.setUp();
 
-        TypeMappingRegistry reg = new DefaultTypeMappingRegistry(true);
-        mapping = reg.createTypeMapping(true);
+        AegisContext context = new AegisContext();
+        context.initialize();
+        mapping = context.getTypeMapping();
     }
     
     @Test

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/encoded/AbstractEncodedTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/encoded/AbstractEncodedTest.java?rev=631587&r1=631586&r2=631587&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/encoded/AbstractEncodedTest.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/encoded/AbstractEncodedTest.java Wed Feb 27 05:38:41 2008
@@ -27,7 +27,7 @@
 import org.apache.cxf.aegis.AegisContext;
 import org.apache.cxf.aegis.Context;
 import org.apache.cxf.aegis.DatabindingException;
-import org.apache.cxf.aegis.type.DefaultTypeMappingRegistry;
+import org.apache.cxf.aegis.type.DefaultTypeMapping;
 import org.apache.cxf.aegis.type.Type;
 import org.apache.cxf.aegis.type.TypeMapping;
 import org.apache.cxf.aegis.xml.MessageReader;
@@ -44,7 +44,7 @@
 import org.junit.Before;
 
 public abstract class AbstractEncodedTest extends AbstractAegisTest {
-    protected TypeMapping mapping;
+    protected DefaultTypeMapping mapping;
     protected TrailingBlocks trailingBlocks;
 
     @Before
@@ -56,9 +56,13 @@
         addNamespace("xsi", SOAPConstants.XSI_NS);
         addNamespace("soapenc", Soap11.getInstance().getSoapEncodingStyle());
 
-        DefaultTypeMappingRegistry reg = new DefaultTypeMappingRegistry(true);
-        mapping = reg.createTypeMapping(Soap11.getInstance().getSoapEncodingStyle(), true);
-
+        AegisContext context = new AegisContext();
+        // create a different mapping than the context creates.
+        TypeMapping baseMapping = DefaultTypeMapping.createSoap11TypeMapping(true, false);
+        mapping = new DefaultTypeMapping(SOAPConstants.XSD, baseMapping);
+        mapping.setTypeCreator(context.createTypeCreator());
+        context.setTypeMapping(mapping);
+        context.initialize();
         // serialization root type
         trailingBlocks = new TrailingBlocks();
     }

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/encoded/ArrayTypeInfoTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/encoded/ArrayTypeInfoTest.java?rev=631587&r1=631586&r2=631587&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/encoded/ArrayTypeInfoTest.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/encoded/ArrayTypeInfoTest.java Wed Feb 27 05:38:41 2008
@@ -22,7 +22,7 @@
 import javax.xml.namespace.QName;
 
 import org.apache.cxf.aegis.AbstractAegisTest;
-import org.apache.cxf.aegis.type.DefaultTypeMappingRegistry;
+import org.apache.cxf.aegis.AegisContext;
 import org.apache.cxf.aegis.type.TypeMapping;
 import org.apache.cxf.aegis.type.basic.BeanTypeInfo;
 import org.apache.cxf.aegis.xml.stax.ElementReader;
@@ -40,8 +40,9 @@
         addNamespace("a", "urn:anotherns");
         addNamespace("xsi", SOAPConstants.XSI_NS);
 
-        DefaultTypeMappingRegistry reg = new DefaultTypeMappingRegistry(true);
-        mapping = reg.createTypeMapping(true);
+        AegisContext context = new AegisContext();
+        context.initialize();
+        mapping = context.getTypeMapping();
 
         // address type
         BeanTypeInfo addressInfo = new BeanTypeInfo(Address.class, "urn:Bean");

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/CollectionTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/CollectionTest.java?rev=631587&r1=631586&r2=631587&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/CollectionTest.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/CollectionTest.java Wed Feb 27 05:38:41 2008
@@ -30,24 +30,25 @@
 
 import org.apache.cxf.aegis.AbstractAegisTest;
 import org.apache.cxf.aegis.type.Configuration;
-import org.apache.cxf.aegis.type.CustomTypeMapping;
+import org.apache.cxf.aegis.type.DefaultTypeMapping;
 import org.apache.cxf.aegis.type.Type;
 import org.apache.cxf.aegis.type.collection.CollectionType;
 import org.apache.cxf.aegis.type.java5.dto.CollectionDTO;
 import org.apache.cxf.aegis.type.java5.dto.DTOService;
 import org.apache.cxf.aegis.type.java5.dto.ObjectDTO;
+import org.apache.cxf.common.util.SOAPConstants;
 import org.junit.Before;
 import org.junit.Test;
 
 public class CollectionTest extends AbstractAegisTest {
-    private CustomTypeMapping tm;
+    private DefaultTypeMapping tm;
     private Java5TypeCreator creator;
 
     @Before
     public void setUp() throws Exception {
         super.setUp();
 
-        tm = new CustomTypeMapping();
+        tm = new DefaultTypeMapping(SOAPConstants.XSD);
         creator = new Java5TypeCreator();
         creator.setConfiguration(new Configuration());
         tm.setTypeCreator(creator);
@@ -118,7 +119,7 @@
 
     @Test
     public void testCollectionDTO() {
-        tm = new CustomTypeMapping();
+        tm = new DefaultTypeMapping(SOAPConstants.XSD);
         creator = new Java5TypeCreator();
         creator.setConfiguration(new Configuration());
         tm.setTypeCreator(creator);
@@ -141,7 +142,7 @@
 
     @Test
     public void testObjectDTO() {
-        tm = new CustomTypeMapping();
+        tm = new DefaultTypeMapping(SOAPConstants.XSD);
         creator = new Java5TypeCreator();
         creator.setConfiguration(new Configuration());
         tm.setTypeCreator(creator);

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/ConfigurationTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/ConfigurationTest.java?rev=631587&r1=631586&r2=631587&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/ConfigurationTest.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/ConfigurationTest.java Wed Feb 27 05:38:41 2008
@@ -21,9 +21,9 @@
 import javax.xml.namespace.QName;
 
 import org.apache.cxf.aegis.AbstractAegisTest;
+import org.apache.cxf.aegis.AegisContext;
 import org.apache.cxf.aegis.type.Configuration;
-import org.apache.cxf.aegis.type.CustomTypeMapping;
-import org.apache.cxf.aegis.type.DefaultTypeMappingRegistry;
+import org.apache.cxf.aegis.type.DefaultTypeMapping;
 import org.apache.cxf.aegis.type.Type;
 import org.apache.cxf.aegis.type.XMLTypeCreator;
 import org.apache.cxf.aegis.type.basic.BeanType;
@@ -31,12 +31,9 @@
 import org.junit.Before;
 import org.junit.Test;
 
-/**
- * @author adam
- */
 public class ConfigurationTest extends AbstractAegisTest {
 
-    CustomTypeMapping tm;
+    DefaultTypeMapping tm;
 
     Configuration config;
 
@@ -44,15 +41,17 @@
     public void setUp() throws Exception {
         super.setUp();
 
-        DefaultTypeMappingRegistry reg = new DefaultTypeMappingRegistry();
-        config = reg.getConfiguration();
+        AegisContext context = new AegisContext();
+        config = new Configuration();
+        context.setConfiguration(config);
+        context.initialize();
         XMLTypeCreator creator = new XMLTypeCreator();
-        creator.setConfiguration(reg.getConfiguration());
+        creator.setConfiguration(config);
         Java5TypeCreator next = new Java5TypeCreator();
-        next.setConfiguration(reg.getConfiguration());
+        next.setConfiguration(config);
         creator.setNextCreator(next);
-        reg.createDefaultMappings();
-        tm = (CustomTypeMapping)reg.getDefaultTypeMapping();
+
+        tm = (DefaultTypeMapping)context.getTypeMapping();
         tm.setTypeCreator(creator);
     }
 

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/EnumTypeTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/EnumTypeTest.java?rev=631587&r1=631586&r2=631587&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/EnumTypeTest.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/EnumTypeTest.java Wed Feb 27 05:38:41 2008
@@ -24,7 +24,7 @@
 
 import org.apache.cxf.aegis.AbstractAegisTest;
 import org.apache.cxf.aegis.type.Configuration;
-import org.apache.cxf.aegis.type.CustomTypeMapping;
+import org.apache.cxf.aegis.type.DefaultTypeMapping;
 import org.apache.cxf.aegis.type.Type;
 import org.apache.cxf.aegis.type.java5.CurrencyService.Currency;
 import org.apache.cxf.aegis.xml.jdom.JDOMReader;
@@ -36,7 +36,7 @@
 import org.junit.Test;
 
 public class EnumTypeTest extends AbstractAegisTest {
-    private CustomTypeMapping tm;
+    private DefaultTypeMapping tm;
 
     private enum smallEnum {
         VALUE1, VALUE2
@@ -46,7 +46,7 @@
     public void setUp() throws Exception {
         super.setUp();
 
-        tm = new CustomTypeMapping();
+        tm = new DefaultTypeMapping();
         Java5TypeCreator creator = new Java5TypeCreator();
         creator.setConfiguration(new Configuration());
         tm.setTypeCreator(creator);

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/JaxbXmlParamTypeTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/JaxbXmlParamTypeTest.java?rev=631587&r1=631586&r2=631587&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/JaxbXmlParamTypeTest.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/JaxbXmlParamTypeTest.java Wed Feb 27 05:38:41 2008
@@ -25,21 +25,21 @@
 
 import org.apache.cxf.aegis.AbstractAegisTest;
 import org.apache.cxf.aegis.type.Configuration;
-import org.apache.cxf.aegis.type.CustomTypeMapping;
 import org.apache.cxf.aegis.type.DefaultTypeCreator;
+import org.apache.cxf.aegis.type.DefaultTypeMapping;
 import org.apache.cxf.aegis.type.Type;
 import org.junit.Before;
 import org.junit.Test;
 
 public class JaxbXmlParamTypeTest extends AbstractAegisTest {
-    private CustomTypeMapping tm;
+    private DefaultTypeMapping tm;
     private Java5TypeCreator creator;
 
     @Before
     public void setUp() throws Exception {
         super.setUp();
 
-        tm = new CustomTypeMapping();
+        tm = new DefaultTypeMapping();
         creator = new Java5TypeCreator();
         creator.setNextCreator(new DefaultTypeCreator());
         creator.setConfiguration(new Configuration());

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/MapTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/MapTest.java?rev=631587&r1=631586&r2=631587&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/MapTest.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/MapTest.java Wed Feb 27 05:38:41 2008
@@ -29,7 +29,7 @@
 
 import org.apache.cxf.aegis.AbstractAegisTest;
 import org.apache.cxf.aegis.type.Configuration;
-import org.apache.cxf.aegis.type.CustomTypeMapping;
+import org.apache.cxf.aegis.type.DefaultTypeMapping;
 import org.apache.cxf.aegis.type.Type;
 import org.apache.cxf.aegis.type.collection.CollectionType;
 import org.apache.cxf.aegis.type.collection.MapType;
@@ -39,14 +39,14 @@
 import org.junit.Test;
 
 public class MapTest extends AbstractAegisTest {
-    private CustomTypeMapping tm;
+    private DefaultTypeMapping tm;
     private Java5TypeCreator creator;
 
     @Before
     public void setUp() throws Exception {
         super.setUp();
 
-        tm = new CustomTypeMapping();
+        tm = new DefaultTypeMapping();
         creator = new Java5TypeCreator();
         creator.setConfiguration(new Configuration());
         tm.setTypeCreator(creator);
@@ -122,7 +122,7 @@
     @SuppressWarnings("unchecked")
     @Test
     public void testMapDTO() {
-        tm = new CustomTypeMapping();
+        tm = new DefaultTypeMapping();
         creator = new Java5TypeCreator();
         creator.setConfiguration(new Configuration());
         tm.setTypeCreator(creator);

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/XFireXmlParamTypeTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/XFireXmlParamTypeTest.java?rev=631587&r1=631586&r2=631587&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/XFireXmlParamTypeTest.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/XFireXmlParamTypeTest.java Wed Feb 27 05:38:41 2008
@@ -24,22 +24,22 @@
 
 import org.apache.cxf.aegis.AbstractAegisTest;
 import org.apache.cxf.aegis.type.Configuration;
-import org.apache.cxf.aegis.type.CustomTypeMapping;
 import org.apache.cxf.aegis.type.DefaultTypeCreator;
+import org.apache.cxf.aegis.type.DefaultTypeMapping;
 import org.apache.cxf.aegis.type.Type;
 import org.junit.Before;
 import org.junit.Test;
 
 @SuppressWarnings("deprecation")
 public class XFireXmlParamTypeTest extends AbstractAegisTest {
-    private CustomTypeMapping tm;
+    private DefaultTypeMapping tm;
     private Java5TypeCreator creator;
 
     @Before
     public void setUp() throws Exception {
         super.setUp();
 
-        tm = new CustomTypeMapping();
+        tm = new DefaultTypeMapping();
         creator = new Java5TypeCreator();
         creator.setNextCreator(new DefaultTypeCreator());
         creator.setConfiguration(new Configuration());

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/XmlParamTypeTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/XmlParamTypeTest.java?rev=631587&r1=631586&r2=631587&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/XmlParamTypeTest.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/XmlParamTypeTest.java Wed Feb 27 05:38:41 2008
@@ -26,21 +26,21 @@
 
 import org.apache.cxf.aegis.AbstractAegisTest;
 import org.apache.cxf.aegis.type.Configuration;
-import org.apache.cxf.aegis.type.CustomTypeMapping;
 import org.apache.cxf.aegis.type.DefaultTypeCreator;
+import org.apache.cxf.aegis.type.DefaultTypeMapping;
 import org.apache.cxf.aegis.type.Type;
 import org.junit.Before;
 import org.junit.Test;
 
 public class XmlParamTypeTest extends AbstractAegisTest {
-    private CustomTypeMapping tm;
+    private DefaultTypeMapping tm;
     private Java5TypeCreator creator;
 
     @Before
     public void setUp() throws Exception {
         super.setUp();
 
-        tm = new CustomTypeMapping();
+        tm = new DefaultTypeMapping();
         creator = new Java5TypeCreator();
         creator.setNextCreator(new DefaultTypeCreator());
         creator.setConfiguration(new Configuration());



Mime
View raw message