cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bimargul...@apache.org
Subject svn commit: r607000 - in /incubator/cxf/trunk/rt/databinding/aegis/src: main/java/org/apache/cxf/aegis/ main/java/org/apache/cxf/aegis/databinding/ main/java/org/apache/cxf/aegis/type/ main/java/org/apache/cxf/aegis/type/basic/ main/java/org/apache/cxf...
Date Thu, 27 Dec 2007 03:06:24 GMT
Author: bimargulies
Date: Wed Dec 26 19:06:20 2007
New Revision: 607000

URL: http://svn.apache.org/viewvc?rev=607000&view=rev
Log:
Some remodularization of Aegis, with the goal of supporting Jervis and JSR-131 and override types for more purposes, like Javascript. Reduce the Context object to being more of a stub, in favor of more state in the databinding object. Goal: eliminate the context object, as it is an XFire artifact. 

Added:
    incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/override/
    incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/override/OverrideTypeTest.java   (with props)
    incubator/cxf/trunk/rt/databinding/aegis/src/test/resources/org/apache/cxf/aegis/override/
    incubator/cxf/trunk/rt/databinding/aegis/src/test/resources/org/apache/cxf/aegis/override/employee.xml   (with props)
Modified:
    incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/Context.java
    incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java
    incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/ElementDataWriter.java
    incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataReader.java
    incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataWriter.java
    incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeUtil.java
    incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/ArrayType.java
    incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanType.java
    incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/collection/MapType.java
    incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/encoded/MarshalRegistry.java
    incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/encoded/SoapArrayType.java
    incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/encoded/SoapRefRegistry.java
    incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/encoded/StructType.java
    incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/inheritance/Employee.java
    incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/namespaces/NamespaceConfusionTest.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/SoapArrayTypeTest.java
    incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/encoded/StructTypeTest.java
    incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/AnnotatedTypeTest.java
    incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/EnumTypeTest.java

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/Context.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/Context.java?rev=607000&r1=606999&r2=607000&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/Context.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/Context.java Wed Dec 26 19:06:20 2007
@@ -20,41 +20,41 @@
 
 import java.util.Collection;
 import java.util.HashMap;
-import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
+import org.apache.cxf.aegis.databinding.AegisDatabinding;
 import org.apache.cxf.aegis.type.TypeMapping;
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.message.Attachment;
 
 /**
- * Holds inforrmation about the message request and response.
+ * Holds information about the message request and response.
  * 
  * @author <a href="mailto:dan@envoisolutions.com">Dan Diephouse</a>
  * @since Feb 13, 2004
  */
 public class Context implements Map<String, Object> {
+    private AegisDatabinding databinding;
     private TypeMapping typeMapping;
     private Collection<Attachment> attachments;
-    private boolean writeXsiTypes;
-    private boolean readXsiTypes = true;
-    private List<String> overrideTypes;
     private Fault fault;
     private Map<String, Object> properties;
     
-    public Context() {
-       this(new HashMap<String, Object>());
+    public Context(AegisDatabinding databinding) {
+       this(databinding, new HashMap<String, Object>());
     }
 
-    public Context(Map<String, Object> properties) {
-        this.properties = properties;
+    public Context(AegisDatabinding databinding, boolean initializeProps) {
+        this.databinding = databinding;
+        if (initializeProps) {
+            properties = new HashMap<String, Object>();
+        }
     }
 
-    public Context(boolean initProps) {
-        if (initProps) {
-            this.properties = new HashMap<String, Object>();
-        }
+    public Context(AegisDatabinding databinding, Map<String, Object> properties) {
+        this.databinding = databinding;
+        this.properties = properties;
     }
 
     public TypeMapping getTypeMapping() {
@@ -74,27 +74,11 @@
     }
 
     public boolean isWriteXsiTypes() {
-        return writeXsiTypes;
-    }
-
-    public void setWriteXsiTypes(boolean writeXsiTypes) {
-        this.writeXsiTypes = writeXsiTypes;
+        return databinding.isWriteXsiTypes();
     }
 
     public boolean isReadXsiTypes() {
-        return readXsiTypes;
-    }
-
-    public void setReadXsiTypes(boolean readXsiTypes) {
-        this.readXsiTypes = readXsiTypes;
-    }
-
-    public List<String> getOverrideTypes() {
-        return overrideTypes;
-    }
-
-    public void setOverrideTypes(List<String> overrideTypes) {
-        this.overrideTypes = overrideTypes;
+        return databinding.isReadXsiTypes();
     }
 
     public void setFault(Fault fault) {
@@ -106,22 +90,17 @@
     }
 
     public void clear() {
-        // TODO Auto-generated method stub
-        
     }
 
     public boolean containsKey(Object key) {
-        // TODO Auto-generated method stub
         return false;
     }
 
     public boolean containsValue(Object value) {
-        // TODO Auto-generated method stub
         return false;
     }
 
     public Set<java.util.Map.Entry<String, Object>> entrySet() {
-        // TODO Auto-generated method stub
         return null;
     }
 
@@ -159,6 +138,10 @@
 
     public void setDelegateProperties(Map<String, Object> p) {
         this.properties = p;
+    }
+
+    public AegisDatabinding getDataBinding() {
+        return databinding;
     }
     
     

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java?rev=607000&r1=606999&r2=607000&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java Wed Dec 26 19:06:20 2007
@@ -73,34 +73,63 @@
 /**
  * Handles DataBinding functions for Aegis.
  * <p>
- * NOTE: There is an assumed 1:1 mapping between an AegisDatabinding and a Service!
+ * NOTE: There is an assumed 1:1 mapping between an AegisDatabinding and a Service;
+ * the code in here gets and puts properties on the service. This looks as if it's leftover
+ * from some idea of sharing a databinding amongst services, which I (bimargulies) didn't
+ * think was especially valid. Why not just keep these items right here in the data binding?
+ * 
  */
 public class AegisDatabinding extends AbstractDataBinding implements DataBinding {
     
-    public static final String CURRENT_MESSAGE_PART = "currentMessagePart";
-    public static final String TYPE_MAPPING_KEY = "type.mapping";
-    public static final String ENCODING_URI_KEY = "type.encodingUri";
-    public static final String WRITE_XSI_TYPE_KEY = "writeXsiType";
-    public static final String OVERRIDE_TYPES_KEY = "overrideTypesList";
-    public static final String READ_XSI_TYPE_KEY = "readXsiType";
+    public static final String WRITE_XSI_TYPE_KEY = "org.apache.cxf.databinding.aegis.writeXsiType";
+    public static final String READ_XSI_TYPE_KEY = "org.apache.cxf.databinding.aegis.readXsiType";
+    public static final String OVERRIDE_TYPES_KEY = "org.apache.cxf.databinding.aegis.overrideTypesList";
 
     protected static final int IN_PARAM = 0;
     protected static final int OUT_PARAM = 1;
     protected static final int FAULT_PARAM = 2;
+    
+    static final String OLD_WRITE_XSI_TYPE_KEY = "writeXsiType";
+    static final String OLD_OVERRIDE_TYPES_KEY = "overrideTypesList";
+    static final String OLD_READ_XSI_TYPE_KEY = "readXsiType";
+    private boolean writeXsiTypes;
+    private boolean readXsiTypes = true;
 
     private TypeMappingRegistry typeMappingRegistry;
     private Map<MessagePartInfo, Type> part2Type;
-    private List overrideTypes;
+    private Set<String> overrideTypes;
+    private Set<Class<?>> overrideClasses;
+    private Set<QName> overrideQNames;
     private Service service;
+    // There's a split personality in here. Much of the code of Aegis assumes that 
+    // types get registered based an 'encoding style' URL, presumably either Soap 1.1 or 1.2.
+    // However, the override types, and apparently some others, end up registered against
+    // an extra type mapping object created for the service's namespace. This is odd insofar
+    // as the XML mapping for for the service could have a mapping uri in it.
+    // Until this is better understood, we keep this extra one around.
+    private TypeMapping serviceTypeMapping;
+    private boolean isInitialized;
     
     public AegisDatabinding() {
         super();
         this.typeMappingRegistry = new DefaultTypeMappingRegistry(true);
         part2Type = new HashMap<MessagePartInfo, Type>();
     }
+    
+    public static boolean isOverrideTypesKey(String key) {
+        return OVERRIDE_TYPES_KEY.equals(key)
+            || OLD_OVERRIDE_TYPES_KEY.equals(key);
+    }
+    
+    private void ensureInitialized() {
+        if (!isInitialized) {
+            initializeWithoutService();
+        }
+    }
 
     @SuppressWarnings("unchecked")
     public <T> DataReader<T> createReader(Class<T> cls) {
+        ensureInitialized();
         if (cls.equals(XMLStreamReader.class)) {
             return (DataReader<T>) new XMLStreamDataReader(this);
         } else if (cls.equals(Node.class)) {
@@ -112,6 +141,7 @@
 
     @SuppressWarnings("unchecked")
     public <T> DataWriter<T> createWriter(Class<T> cls) {
+        ensureInitialized();
         if (cls.equals(XMLStreamWriter.class)) {
             return (DataWriter<T>)new XMLStreamDataWriter(this);
         } else if (cls.equals(Node.class)) {
@@ -136,29 +166,82 @@
     public void setTypeMappingRegistry(TypeMappingRegistry typeMappingRegistry) {
         this.typeMappingRegistry = typeMappingRegistry;
     }
+    
+    /**
+     * This is the central point of override processing on the write side.
+     * @param clazz
+     * @return
+     */
+    public Type getOverrideType(Class clazz) {
+        ensureInitialized();
+        if (overrideClasses.contains(clazz)) {
+            return serviceTypeMapping.getType(clazz);
+        } else {
+            return null;
+        }
+    }
+    
+    /**
+     * This is the central point of override processing on the read side.
+     * @param schemaTypeName
+     * @return
+     */
+    public Type getOverrideType(QName schemaTypeName) {
+        ensureInitialized();
+        if (overrideQNames.contains(schemaTypeName)) {
+            return serviceTypeMapping.getType(schemaTypeName);
+        } else {
+            return null;
+        }
+    }
+    
+    private void initializeWithoutService() {
+        isInitialized = true;
+        serviceTypeMapping  = typeMappingRegistry.createTypeMapping(SOAPConstants.XSD, true);
+        typeMappingRegistry.register("urn:dummyService", serviceTypeMapping);
+        processOverrideTypes();
+    }
 
     public void initialize(Service s) {
+        isInitialized = true;
         this.service = s;
         
         QName serviceName = s.getServiceInfos().get(0).getName();
-        TypeMapping serviceTM = typeMappingRegistry.createTypeMapping(SOAPConstants.XSD, true);
-        typeMappingRegistry.register(serviceName.getNamespaceURI(), serviceTM);
+        serviceTypeMapping = typeMappingRegistry.createTypeMapping(SOAPConstants.XSD, true);
+        typeMappingRegistry.register(serviceName.getNamespaceURI(), serviceTypeMapping);
+        
+        Object val = s.get(AegisDatabinding.READ_XSI_TYPE_KEY);
+        
+        if (val == null) {
+            val = s.get(AegisDatabinding.OLD_READ_XSI_TYPE_KEY);
+        }
+        if ("false".equals(val) || Boolean.FALSE.equals(val)) {
+            readXsiTypes = false;
+        }
+
+        val = s.get(AegisDatabinding.WRITE_XSI_TYPE_KEY);
+        
+        if (val == null) {
+            val = s.get(AegisDatabinding.OLD_WRITE_XSI_TYPE_KEY);
+        }
+        if ("true".equals(val) || Boolean.TRUE.equals(val)) {
+            writeXsiTypes = true;
+        }
 
-        s.put(TypeMapping.class.getName(), serviceTM);
 
         Set<Type> deps = new HashSet<Type>();
 
         for (ServiceInfo info : s.getServiceInfos()) {
             for (OperationInfo opInfo : info.getInterface().getOperations()) {
                 if (opInfo.isUnwrappedCapable()) {
-                    initializeOperation(s, serviceTM, opInfo.getUnwrappedOperation(), deps);
+                    initializeOperation(s, serviceTypeMapping, opInfo.getUnwrappedOperation(), deps);
                 } else {
-                    initializeOperation(s, serviceTM, opInfo, deps);
+                    initializeOperation(s, serviceTypeMapping, opInfo, deps);
                 }
             }
         }
 
-        List<Type> additional = getAdditionalTypes(s, serviceTM);
+        List<Type> additional = getAdditionalTypes(s);
 
         if (additional != null) {
             for (Type t : additional) {
@@ -180,27 +263,52 @@
         }
     }
 
-    List<Type> getAdditionalTypes(Service s, TypeMapping tm) {
+    private List<Type> getAdditionalTypes(Service s) {
         List classes = (List)s.get(OVERRIDE_TYPES_KEY);
+        if (classes == null) {
+            classes = (List)s.get(OLD_OVERRIDE_TYPES_KEY);
+        } 
+        if (classes != null) {
+            if (this.overrideTypes == null) {
+                this.overrideTypes = new HashSet<String>();
+            }
+            
+            for (Object classNameObject : classes) {
+                String className = (String) classNameObject;
+                this.overrideTypes.add(className);
+            }
+        }
 
-        this.overrideTypes = classes;
+        return processOverrideTypes();
+    }
 
-        if (classes != null) {
+    /**
+     * Examine a list of override classes, and register all of them.
+     * @param tm      type manager for this binding
+     * @param classes list of class names
+     * @return        list of Types.
+     */
+    private List<Type> processOverrideTypes() {
+        overrideClasses = new HashSet<Class<?>>();
+        overrideQNames = new HashSet<QName>();
+        if (this.overrideTypes != null) {
             List<Type> types = new ArrayList<Type>();
-            for (Iterator it = classes.iterator(); it.hasNext();) {
-                String typeName = (String)it.next();
-                Class c;
+            for (String typeName : overrideTypes) {
+                Class c = null;
                 try {
                     c = ClassLoaderUtils.loadClass(typeName, TypeUtil.class);
                 } catch (ClassNotFoundException e) {
                     throw new DatabindingException("Could not find override type class: " + typeName, e);
                 }
-
-                Type t = tm.getType(c);
+                
+                overrideClasses.add(c);
+                
+                Type t = serviceTypeMapping.getType(c);
                 if (t == null) {
-                    t = tm.getTypeCreator().createType(c);
-                    tm.register(t);
+                    t = serviceTypeMapping.getTypeCreator().createType(c);
+                    serviceTypeMapping.register(t);
                 }
+                overrideQNames.add(t.getSchemaType());
                 if (t instanceof BeanType) {
                     BeanType bt = (BeanType)t;
                     bt.getTypeInfo().setExtension(true);
@@ -208,8 +316,9 @@
                 }
             }
             return types;
+        } else {
+            return null;
         }
-        return null;
     }
 
     private void initializeOperation(Service s, TypeMapping serviceTM, OperationInfo opInfo,
@@ -475,9 +584,13 @@
         return part2Type.get(part);
     }
 
-    public List getOverrideTypes() {
+    public Set<String> getOverrideTypes() {
         return overrideTypes;
     }
+    
+    public void setOverrideTypes(Set<String> typeNames) {
+        overrideTypes = typeNames;
+    }
 
     public Service getService() {
         return service;
@@ -498,5 +611,25 @@
      */
     public void setConfiguration(Configuration configuration) {
         typeMappingRegistry.setConfiguration(configuration);
+    }
+
+    public boolean isWriteXsiTypes() {
+        return writeXsiTypes;
+    }
+
+    public boolean isReadXsiTypes() {
+        return readXsiTypes;
+    }
+
+    public void setWriteXsiTypes(boolean flag) {
+        this.writeXsiTypes = flag;
+    }
+
+    public void setReadXsiTypes(boolean flag) {
+        this.readXsiTypes = flag;
+    }
+
+    public TypeMapping getServiceTypeMapping() {
+        return serviceTypeMapping;
     }
 }

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/ElementDataWriter.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/ElementDataWriter.java?rev=607000&r1=606999&r2=607000&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/ElementDataWriter.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/ElementDataWriter.java Wed Dec 26 19:06:20 2007
@@ -38,7 +38,6 @@
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.databinding.DataWriter;
 import org.apache.cxf.endpoint.Endpoint;
-import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.message.Attachment;
 import org.apache.cxf.service.model.MessagePartInfo;
@@ -63,8 +62,6 @@
     }
 
     public void setSchema(Schema s) {
-        // TODO Auto-generated method stub
-
     }
 
     public void write(Object obj, MessagePartInfo part, Element output) {
@@ -79,18 +76,12 @@
         if (props == null) {
             props = new HashMap<String, Object>();
         }
-        Context context = new Context(props);
+        Context context = new Context(databinding, props);
 
         // I'm not sure that this is the right type mapping
         context.setTypeMapping(type.getTypeMapping());
-        context.setOverrideTypes(CastUtils.cast(databinding.getOverrideTypes(), String.class));
         context.setAttachments(attachments);
-        Object val = databinding.getService().get(AegisDatabinding.WRITE_XSI_TYPE_KEY);
-        if ("true".equals(val) || Boolean.TRUE.equals(val)) {
-            context.setWriteXsiTypes(true);
-        }
-
-        type = TypeUtil.getWriteType(context, obj, type);
+        type = TypeUtil.getWriteType(databinding, obj, type);
         try {
             W3CDOMStreamWriter domWriter = new W3CDOMStreamWriter(output);
             ElementWriter writer = new ElementWriter(domWriter);

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataReader.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataReader.java?rev=607000&r1=606999&r2=607000&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataReader.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataReader.java Wed Dec 26 19:06:20 2007
@@ -24,6 +24,8 @@
 import java.util.logging.Logger;
 
 import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
 import javax.xml.validation.Schema;
 
@@ -36,7 +38,6 @@
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.databinding.DataReader;
 import org.apache.cxf.endpoint.Endpoint;
-import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.message.Attachment;
 import org.apache.cxf.service.model.MessagePartInfo;
@@ -53,7 +54,8 @@
     
     public XMLStreamDataReader(AegisDatabinding databinding) {
         this.databinding = databinding;
-        this.context = new Context(false);
+        // optimize by avoiding the properties until we need them.
+        this.context = new Context(databinding, false);
     }
 
     public Object read(MessagePartInfo part, XMLStreamReader input) {
@@ -71,14 +73,8 @@
         }
         context.setDelegateProperties(props);
         
-         // I don't think this is the right type mapping
-        context.setTypeMapping(type.getTypeMapping());
-        context.setOverrideTypes(CastUtils.cast(databinding.getOverrideTypes(), String.class));
+        context.setTypeMapping(null); // let it delegate to the databinding
         context.setFault((Fault) getProperty(DataReader.FAULT));
-        Object val = databinding.getService().get(AegisDatabinding.READ_XSI_TYPE_KEY);
-        if ("false".equals(val) || Boolean.FALSE.equals(val)) {
-            context.setReadXsiTypes(false);
-        }
         
         ElementReader elReader = new ElementReader(input);
         if (elReader.isXsiNil()) {
@@ -101,13 +97,45 @@
     }
 
     public Object read(QName name, XMLStreamReader input, Class type) {
-        // TODO Auto-generated method stub
         return null;
     }
 
-    public Object read(XMLStreamReader input) {
-        // TODO Auto-generated method stub
-        return null;
+    public Object read(XMLStreamReader reader) {
+        Map<String, Object> props = new HashMap<String, Object>();
+        context.setDelegateProperties(props);
+        
+        context.setTypeMapping(null); // let it delegate to the databinding
+        context.setFault((Fault) getProperty(DataReader.FAULT));
+        // JAXB will take a start_document, so should we.
+        if (reader.getEventType() == XMLStreamConstants.START_DOCUMENT) {
+            while (XMLStreamConstants.START_ELEMENT != reader.getEventType()) {
+                try {
+                    reader.nextTag();
+                } catch (XMLStreamException e) {
+                    throw new RuntimeException(e);
+                }
+            }
+        }
+        ElementReader elReader = new ElementReader(reader);
+
+        if (elReader.isXsiNil()) {
+            elReader.readToEnd();
+            return null;
+        }
+        
+        
+        Type type = TypeUtil.getReadType(reader, context, null);
+        
+        if (type == null) {
+            return null; // throw ?
+        }
+        
+
+        try {
+            return type.readObject(elReader, context);
+        } catch (DatabindingException e) {
+            throw new RuntimeException(e);
+        }
     }
 
     public void setAttachments(Collection<Attachment> attachments) {
@@ -123,8 +151,6 @@
     }
 
     public void setSchema(Schema s) {
-        // TODO Auto-generated method stub
-
     }
 
 }

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataWriter.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataWriter.java?rev=607000&r1=606999&r2=607000&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataWriter.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataWriter.java Wed Dec 26 19:06:20 2007
@@ -36,7 +36,6 @@
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.databinding.DataWriter;
 import org.apache.cxf.endpoint.Endpoint;
-import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.message.Attachment;
 import org.apache.cxf.service.model.MessagePartInfo;
@@ -61,8 +60,6 @@
     }
 
     public void setSchema(Schema s) {
-        // TODO Auto-generated method stub
-
     }
 
     public void write(Object obj, MessagePartInfo part, XMLStreamWriter output) {
@@ -77,18 +74,11 @@
         if (props == null) {
             props = new HashMap<String, Object>();
         }
-        Context context = new Context(props);
+        Context context = new Context(databinding, props);
         
-        // I'm not sure that this is the right type mapping
-        context.setTypeMapping(type.getTypeMapping());
-        context.setOverrideTypes(CastUtils.cast(databinding.getOverrideTypes(), String.class));
+        context.setTypeMapping(null);
         context.setAttachments(attachments);
-        Object val = databinding.getService().get(AegisDatabinding.WRITE_XSI_TYPE_KEY);
-        if ("true".equals(val) || Boolean.TRUE.equals(val)) {
-            context.setWriteXsiTypes(true);
-        }
-        
-        type = TypeUtil.getWriteType(context, obj, type);
+        type = TypeUtil.getWriteType(databinding, obj, type);
         
         try {
             if (obj == null) {

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeUtil.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeUtil.java?rev=607000&r1=606999&r2=607000&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeUtil.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeUtil.java Wed Dec 26 19:06:20 2007
@@ -18,12 +18,12 @@
  */
 package org.apache.cxf.aegis.type;
 
-import java.util.List;
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamReader;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.cxf.aegis.Context;
+import org.apache.cxf.aegis.databinding.AegisDatabinding;
 import org.apache.cxf.aegis.util.NamespaceHelper;
 import org.apache.cxf.common.util.SOAPConstants;
 
@@ -39,33 +39,59 @@
         //utility class
     }
     
-    public static Type getReadType(XMLStreamReader xsr, Context context, Type type) {
+    public static Type getReadType(XMLStreamReader xsr, Context context, Type baseType) {
+
         if (!context.isReadXsiTypes()) {
-            return type;
+            if (baseType == null) {
+                LOG.warn("xsi:type reading disabled, and no type available for "  
+                         + xsr.getName());
+            }
+            return baseType;
         }
-    
+        
         String overrideType = xsr.getAttributeValue(SOAPConstants.XSI_NS, "type");
         if (overrideType != null) {
-            QName overrideTypeName = NamespaceHelper.createQName(xsr.getNamespaceContext(), overrideType);
-            if (!overrideTypeName.equals(type.getSchemaType())) {
-                Type type2 = type.getTypeMapping().getType(overrideTypeName);
-                if (type2 == null) {
-                    LOG.info("xsi:type=\"" + overrideTypeName
-                             + "\" was specified, but no corresponding Type was registered; defaulting to "
-                             + type.getSchemaType());
-                } else {
-                    type = type2;
+            QName overrideName = NamespaceHelper.createQName(xsr.getNamespaceContext(), overrideType);
+
+            if (baseType == null || !overrideName.equals(baseType.getSchemaType())) {
+                Type improvedType = null;
+                TypeMapping tm;
+                if (baseType != null) {
+                    tm = baseType.getTypeMapping();
+                    improvedType = tm.getType(overrideName);
                 }
+                if (improvedType == null) {
+                    improvedType = context.getDataBinding().getOverrideType(overrideName);
+                }
+                if (improvedType != null) {
+                    return improvedType;
+                }
+            }
+        
+            if (baseType != null) {
+                LOG.info("xsi:type=\"" + overrideName
+                         + "\" was specified, but no corresponding Type was registered; defaulting to "
+                         + baseType.getSchemaType());
+                return baseType;
+            } else {
+                LOG.warn("xsi:type=\"" + overrideName
+                         + "\" was specified, but no corresponding Type was registered; no default.");
+                return null;
+            }
+        } else {
+            if (baseType == null) {
+                LOG.warn("xsi:type absent, and no type available for "  
+                         + xsr.getName());
             }
+            return baseType;
         }
-        return type;
     }
 
-    public static Type getWriteType(Context context, Object value, Type type) {
+    public static Type getWriteType(AegisDatabinding databinding, Object value, Type type) {
         if (value != null && type != null && type.getTypeClass() != value.getClass()) {
-            List<String> l = context.getOverrideTypes();
-            if (l != null && l.contains(value.getClass().getName())) {
-                type = type.getTypeMapping().getType(value.getClass());
+            Type overrideType = databinding.getOverrideType(value.getClass());
+            if (overrideType != null) {
+                return overrideType;
             }
         }
         return type;

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/ArrayType.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/ArrayType.java?rev=607000&r1=606999&r2=607000&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/ArrayType.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/ArrayType.java Wed Dec 26 19:06:20 2007
@@ -241,7 +241,7 @@
 
     protected void writeValue(Object value, MessageWriter writer, Context context, Type type, String name,
                               String ns) throws DatabindingException {
-        type = TypeUtil.getWriteType(context, value, type);
+        type = TypeUtil.getWriteType(context.getDataBinding(), value, type);
         MessageWriter cwriter;
         if (type.isWriteOuter()) {
             cwriter = writer.getElementWriter(name, ns);

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanType.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanType.java?rev=607000&r1=606999&r2=607000&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanType.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanType.java Wed Dec 26 19:06:20 2007
@@ -322,7 +322,7 @@
             Object value = readProperty(object, name);
 
             Type defaultType = getType(inf, name);
-            Type type = TypeUtil.getWriteType(context, value, defaultType);
+            Type type = TypeUtil.getWriteType(context.getDataBinding(), value, defaultType);
 
             // Write the value if it is not null.
             if (value != null) {

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/collection/MapType.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/collection/MapType.java?rev=607000&r1=606999&r2=607000&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/collection/MapType.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/collection/MapType.java Wed Dec 26 19:06:20 2007
@@ -158,8 +158,8 @@
     private void writeEntry(MessageWriter writer, Context context,
                             Type kType, Type vType,
                             Map.Entry entry) throws DatabindingException {
-        kType = TypeUtil.getWriteType(context, entry.getKey(), kType);
-        vType = TypeUtil.getWriteType(context, entry.getValue(), vType);
+        kType = TypeUtil.getWriteType(context.getDataBinding(), entry.getKey(), kType);
+        vType = TypeUtil.getWriteType(context.getDataBinding(), entry.getValue(), vType);
 
         MessageWriter entryWriter = writer.getElementWriter(getEntryName());
 

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/encoded/MarshalRegistry.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/encoded/MarshalRegistry.java?rev=607000&r1=606999&r2=607000&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/encoded/MarshalRegistry.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/encoded/MarshalRegistry.java Wed Dec 26 19:06:20 2007
@@ -26,8 +26,8 @@
 import org.apache.cxf.aegis.Context;
 
 /**
- * MarshalRegistry maintains tracks which object instnces have been marshalled and which objects still need to
- * be marshalled.
+ * MarshalRegistry maintains tracks which object instances have been marshaled 
+ * and which objects still need to be marshaled.
  * <p/>
  * Note: only the StructType register objects with this class.
  */

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/encoded/SoapArrayType.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/encoded/SoapArrayType.java?rev=607000&r1=606999&r2=607000&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/encoded/SoapArrayType.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/encoded/SoapArrayType.java Wed Dec 26 19:06:20 2007
@@ -309,7 +309,7 @@
             Context context,
             Type type) throws DatabindingException {
 
-        type = TypeUtil.getWriteType(context, value, type);
+        type = TypeUtil.getWriteType(context.getDataBinding(), value, type);
 
         MessageWriter cwriter = writer.getElementWriter(type.getSchemaType().getLocalPart(), "");
 

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/encoded/SoapRefRegistry.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/encoded/SoapRefRegistry.java?rev=607000&r1=606999&r2=607000&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/encoded/SoapRefRegistry.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/encoded/SoapRefRegistry.java Wed Dec 26 19:06:20 2007
@@ -32,7 +32,7 @@
  * SoapRefRegistry handles resolving all SOAP encoded references.  After each object is unmarshalled if the
  * xml contained a SOAP id attribute it is registered with that attribute.  As each object is unmarshalled if
  * any nested elements have a SOAP ref attribute it, the references is registered.  If there is a object
- * instance already registered with the referenced id, the SOAP reference is immedately set. Otherwise, the
+ * instance already registered with the referenced id, the SOAP reference is immediately set. Otherwise, the
  * reference is set when an object instance is registered with the id.  This allows for the objects to occur
  * in any order in the XML document.
  * <p/>

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/encoded/StructType.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/encoded/StructType.java?rev=607000&r1=606999&r2=607000&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/encoded/StructType.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/encoded/StructType.java Wed Dec 26 19:06:20 2007
@@ -37,7 +37,7 @@
  * <li>Struct MAY contain a SOAP id attribute</li>
  * </ul>
  * </p>
- * When writting, the class will always write the struct in the following connonical format:
+ * When writting, the class will always write the struct in the following canonical format:
  * <ul>
  * <li>Struct will contain a SOAP id</li>
  * <li>Nested structs will be written as SOAP references (with SoapRefType)</li>

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/inheritance/Employee.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/inheritance/Employee.java?rev=607000&r1=606999&r2=607000&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/inheritance/Employee.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/inheritance/Employee.java Wed Dec 26 19:06:20 2007
@@ -21,7 +21,6 @@
  */
 package org.apache.cxf.aegis.inheritance;
 
-// @XmlType(namespace="urn:xfire:inheritance")
 public class Employee extends AbstractUser {
     private String division;
 

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/namespaces/NamespaceConfusionTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/namespaces/NamespaceConfusionTest.java?rev=607000&r1=606999&r2=607000&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/namespaces/NamespaceConfusionTest.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/namespaces/NamespaceConfusionTest.java Wed Dec 26 19:06:20 2007
@@ -30,6 +30,7 @@
 import org.w3c.dom.NodeList;
 
 import org.apache.cxf.aegis.AbstractAegisTest;
+import org.apache.cxf.aegis.databinding.AegisDatabinding;
 import org.apache.cxf.aegis.namespaces.data.Name;
 import org.apache.cxf.aegis.namespaces.impl.NameServiceImpl;
 import org.apache.cxf.aegis.type.Type;
@@ -51,6 +52,7 @@
     
     private TypeMapping tm;
     private Service service;
+    private AegisDatabinding databinding;
 
     @Before
     public void setUp() throws Exception {
@@ -58,8 +60,8 @@
         
         Server s = createService(NameServiceImpl.class, null);
         service = s.getEndpoint().getService();
-
-        tm = (TypeMapping)service.get(TypeMapping.class.getName());
+        databinding = (AegisDatabinding)service.getDataBinding();
+        tm = databinding.getServiceTypeMapping();
     }
     
     private String getNamespaceForPrefix(Element rootElement, 

Added: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/override/OverrideTypeTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/override/OverrideTypeTest.java?rev=607000&view=auto
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/override/OverrideTypeTest.java (added)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/override/OverrideTypeTest.java Wed Dec 26 19:06:20 2007
@@ -0,0 +1,60 @@
+/**
+ * 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.override;
+
+import java.io.InputStream;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamReader;
+
+import org.apache.cxf.aegis.AbstractAegisTest;
+import org.apache.cxf.aegis.databinding.AegisDatabinding;
+import org.apache.cxf.aegis.inheritance.Employee;
+import org.apache.cxf.databinding.DataReader;
+import org.junit.Test;
+
+/**
+ * 
+ */
+public class OverrideTypeTest extends AbstractAegisTest {
+    
+    @Test
+    public void testOverrideBean() throws Exception {
+        AegisDatabinding aegisDatabinding = new AegisDatabinding();
+        Set<String> types = new HashSet<String>();
+        types.add("org.apache.cxf.aegis.inheritance.Employee");
+        aegisDatabinding.setOverrideTypes(types);
+        DataReader<XMLStreamReader> dataReader = 
+            aegisDatabinding.createReader(XMLStreamReader.class);
+        InputStream employeeBytes = 
+            testUtilities.getResourceAsStream("/org/apache/cxf/aegis/override/employee.xml");
+        
+        XMLInputFactory readerFactory = XMLInputFactory.newInstance();
+        XMLStreamReader reader = readerFactory.createXMLStreamReader(employeeBytes);
+        Object objectRead = dataReader.read(reader);
+        assertNotNull(objectRead);
+        assertTrue(objectRead instanceof Employee);
+        Employee e = (Employee)objectRead;
+        assertEquals("long", e.getDivision());
+    }
+
+}

Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/override/OverrideTypeTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/override/OverrideTypeTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

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=607000&r1=606999&r2=607000&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 Dec 26 19:06:20 2007
@@ -27,6 +27,7 @@
 
 import org.apache.cxf.aegis.AbstractAegisTest;
 import org.apache.cxf.aegis.Context;
+import org.apache.cxf.aegis.databinding.AegisDatabinding;
 import org.apache.cxf.aegis.services.SimpleBean;
 import org.apache.cxf.aegis.type.Configuration;
 import org.apache.cxf.aegis.type.DefaultTypeMappingRegistry;
@@ -46,9 +47,14 @@
 public class BeanTest extends AbstractAegisTest {
     TypeMapping mapping;
     private DefaultTypeMappingRegistry reg;
+    private AegisDatabinding databinding;
+    private Context getContext() {
+        return new Context(databinding);
+    }
 
     public void setUp() throws Exception {
         super.setUp();
+        databinding = new AegisDatabinding();
 
         addNamespace("b", "urn:Bean");
         addNamespace("a", "urn:anotherns");
@@ -67,7 +73,7 @@
         // Test reading
         ElementReader reader = new ElementReader(getResourceAsStream("bean1.xml"));
 
-        SimpleBean bean = (SimpleBean)type.readObject(reader, new Context());
+        SimpleBean bean = (SimpleBean)type.readObject(reader, getContext());
         assertEquals("bleh", bean.getBleh());
         assertEquals("howdy", bean.getHowdy());
 
@@ -75,14 +81,14 @@
 
         // Test reading with extra elements
         reader = new ElementReader(getResourceAsStream("bean2.xml"));
-        bean = (SimpleBean)type.readObject(reader, new Context());
+        bean = (SimpleBean)type.readObject(reader, getContext());
         assertEquals("bleh", bean.getBleh());
         assertEquals("howdy", bean.getHowdy());
         reader.getXMLStreamReader().close();
 
         // test <bleh/> element
         reader = new ElementReader(getResourceAsStream("bean7.xml"));
-        bean = (SimpleBean)type.readObject(reader, new Context());
+        bean = (SimpleBean)type.readObject(reader, getContext());
         assertEquals("", bean.getBleh());
         assertEquals("howdy", bean.getHowdy());
         reader.getXMLStreamReader().close();
@@ -92,7 +98,7 @@
         // Test writing
         Element element = new Element("root", "b", "urn:Bean");
         new Document(element);
-        type.writeObject(bean, new JDOMWriter(element), new Context());
+        type.writeObject(bean, new JDOMWriter(element), getContext());
 
         assertValid("/b:root/b:bleh[text()='bleh']", element);
         assertValid("/b:root/b:howdy[text()='howdy']", element);
@@ -120,8 +126,8 @@
         // Test reading
         ElementReader reader = new ElementReader(getResourceAsStream("bean9.xml"));
 
-        Context ctx = new Context();
-        ctx.setReadXsiTypes(false);
+        databinding.setReadXsiTypes(false);
+        Context ctx = getContext();
 
         SimpleBean bean = (SimpleBean)type.readObject(reader, ctx);
         assertEquals("bleh", bean.getBleh());
@@ -132,7 +138,7 @@
         // Test writing
         Element element = new Element("root", "b", "urn:Bean");
         new Document(element);
-        type.writeObject(bean, new JDOMWriter(element), new Context());
+        type.writeObject(bean, new JDOMWriter(element), getContext());
 
         assertValid("/b:root/b:bleh[text()='bleh']", element);
         assertValid("/b:root/b:howdy[text()='howdy']", element);
@@ -156,7 +162,7 @@
 
         ElementReader reader = new ElementReader(getResourceAsStream("bean3.xml"));
 
-        SimpleBean bean = (SimpleBean)type.readObject(reader, new Context());
+        SimpleBean bean = (SimpleBean)type.readObject(reader, getContext());
         assertEquals("howdy", bean.getHowdy());
         assertNull(bean.getBleh());
 
@@ -165,7 +171,7 @@
         // Test writing
         Element element = new Element("root", "b", "urn:Bean");
         new Document(element);
-        type.writeObject(bean, new JDOMWriter(element), new Context());
+        type.writeObject(bean, new JDOMWriter(element), getContext());
 
         assertInvalid("/b:root/b:bleh", element);
         assertValid("/b:root/b:howdycustom[text()='howdy']", element);
@@ -185,7 +191,7 @@
 
         ElementReader reader = new ElementReader(getResourceAsStream("bean4.xml"));
 
-        SimpleBean bean = (SimpleBean)type.readObject(reader, new Context());
+        SimpleBean bean = (SimpleBean)type.readObject(reader, getContext());
         assertEquals("bleh", bean.getBleh());
         assertEquals("howdy", bean.getHowdy());
 
@@ -194,7 +200,7 @@
         // Test writing
         Element element = new Element("root", "b", "urn:Bean");
         new Document(element);
-        type.writeObject(bean, new JDOMWriter(element), new Context());
+        type.writeObject(bean, new JDOMWriter(element), getContext());
 
         assertValid("/b:root[@b:bleh='bleh']", element);
         assertValid("/b:root[@b:howdy='howdy']", element);
@@ -225,7 +231,7 @@
 
         ElementReader reader = new ElementReader(getResourceAsStream("bean8.xml"));
 
-        SimpleBean bean = (SimpleBean)type.readObject(reader, new Context());
+        SimpleBean bean = (SimpleBean)type.readObject(reader, getContext());
         assertEquals("bleh", bean.getBleh());
         assertEquals("howdy", bean.getHowdy());
 
@@ -235,7 +241,7 @@
 
         ByteArrayOutputStream bos = new ByteArrayOutputStream();
         ElementWriter writer = new ElementWriter(bos, "root", "urn:Bean");
-        type.writeObject(bean, writer, new Context());
+        type.writeObject(bean, writer, getContext());
         writer.close();
         writer.flush();
 
@@ -267,7 +273,7 @@
         // Test writing
         Element element = new Element("root", "b", "urn:Bean");
         new Document(element);
-        type.writeObject(bean, new JDOMWriter(element), new Context());
+        type.writeObject(bean, new JDOMWriter(element), getContext());
 
         assertInvalid("/b:root[@b:howdy]", element);
         assertValid("/b:root/b:bleh[@xsi:nil='true']", element);
@@ -356,7 +362,7 @@
         // Test writing
         Element element = new Element("root", "b", "urn:Bean");
         new Document(element);
-        type.writeObject(bean, new JDOMWriter(element), new Context());
+        type.writeObject(bean, new JDOMWriter(element), getContext());
 
         // Make sure the date doesn't have an element. Its non nillable so it
         // just
@@ -382,7 +388,7 @@
 
         Element element = new Element("root", "b", "urn:Bean");
         new Document(element);
-        type.writeObject(bean, new JDOMWriter(element), new Context());
+        type.writeObject(bean, new JDOMWriter(element), getContext());
 
         assertValid("/b:root/b:howdy[text()='howdy']", element);
     }
@@ -407,7 +413,7 @@
         // Test writing
         Element element = new Element("root", "b", "urn:Bean");
         new Document(element);
-        type.writeObject(bean, new JDOMWriter(element), new Context());
+        type.writeObject(bean, new JDOMWriter(element), getContext());
 
         // Make sure the date doesn't have an element. Its non nillable so it
         // just
@@ -416,7 +422,7 @@
         addNamespace("xsi", SOAPConstants.XSI_NS);
         assertValid("/b:root/b:data[@xsi:nil='true']", element);
 
-        bean = (ByteBean)type.readObject(new JDOMReader(element), new Context());
+        bean = (ByteBean)type.readObject(new JDOMReader(element), getContext());
         assertNotNull(bean);
         assertNull(bean.getData());
     }

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=607000&r1=606999&r2=607000&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 Dec 26 19:06:20 2007
@@ -22,6 +22,7 @@
 
 import org.apache.cxf.aegis.AbstractAegisTest;
 import org.apache.cxf.aegis.Context;
+import org.apache.cxf.aegis.databinding.AegisDatabinding;
 import org.apache.cxf.aegis.type.DefaultTypeMappingRegistry;
 import org.apache.cxf.aegis.type.TypeMapping;
 import org.apache.cxf.aegis.type.TypeMappingRegistry;
@@ -30,12 +31,18 @@
 
 public class DynamicProxyTest extends AbstractAegisTest {
     TypeMapping mapping;
+    AegisDatabinding databinding;
 
     public void setUp() throws Exception {
         super.setUp();
 
         TypeMappingRegistry reg = new DefaultTypeMappingRegistry(true);
         mapping = reg.createTypeMapping(true);
+        databinding = new AegisDatabinding();
+    }
+    
+    private Context getContext() {
+        return new Context(databinding);
     }
 
 
@@ -47,7 +54,7 @@
         type.setSchemaType(new QName("urn:MyInterface", "data"));
 
         ElementReader reader = new ElementReader(getResourceAsStream("MyInterface.xml"));
-        IMyInterface data = (IMyInterface)type.readObject(reader, new Context());
+        IMyInterface data = (IMyInterface)type.readObject(reader, getContext());
         assertEquals("junk", data.getName());
         assertEquals(true, data.isUseless());
         data.setName("bigjunk");
@@ -75,7 +82,7 @@
         type.setSchemaType(new QName("urn:MyInterface", "data"));
 
         ElementReader reader = new ElementReader(getResourceAsStream("MyInterface.xml"));
-        IMyInterface data = (IMyInterface)type.readObject(reader, new Context());
+        IMyInterface data = (IMyInterface)type.readObject(reader, getContext());
 
         try {
             data.getNameById(0);
@@ -100,7 +107,7 @@
         type.setSchemaType(new QName("urn:MyInterface", "data"));
 
         ElementReader reader = new ElementReader(getResourceAsStream("MyInterface.xml"));
-        IMyInterface data = (IMyInterface)type.readObject(reader, new Context());
+        IMyInterface data = (IMyInterface)type.readObject(reader, getContext());
 
         try {
             data.setNameNoParams();
@@ -125,7 +132,7 @@
         type.setSchemaType(new QName("urn:MyInterface", "data"));
 
         ElementReader reader = new ElementReader(getResourceAsStream("MyInterface.xml"));
-        IMyInterface data = (IMyInterface)type.readObject(reader, new Context());
+        IMyInterface data = (IMyInterface)type.readObject(reader, getContext());
 
         try {
             data.doSomething();
@@ -143,7 +150,7 @@
         type.setSchemaType(new QName("urn:MyInterface", "data"));
 
         ElementReader reader = new ElementReader(getResourceAsStream("MyInterface.xml"));
-        IMyInterface data = (IMyInterface)type.readObject(reader, new Context());
+        IMyInterface data = (IMyInterface)type.readObject(reader, getContext());
 
         assertEquals("junk", data.getName());
         assertNull(data.getType());
@@ -162,7 +169,7 @@
         type2.getTypeInfo().mapType(new QName("urn:MyInterface", "myInterface"), type);
 
         ElementReader reader = new ElementReader(getResourceAsStream("MyInterface2.xml"));
-        IMyInterface2 data = (IMyInterface2)type2.readObject(reader, new Context());
+        IMyInterface2 data = (IMyInterface2)type2.readObject(reader, getContext());
 
         assertNotNull(data.getMyInterface());
         assertEquals("junk", data.getMyInterface().getName());

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=607000&r1=606999&r2=607000&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 Dec 26 19:06:20 2007
@@ -26,6 +26,7 @@
 import org.apache.cxf.aegis.AbstractAegisTest;
 import org.apache.cxf.aegis.Context;
 import org.apache.cxf.aegis.DatabindingException;
+import org.apache.cxf.aegis.databinding.AegisDatabinding;
 import org.apache.cxf.aegis.type.DefaultTypeMappingRegistry;
 import org.apache.cxf.aegis.type.Type;
 import org.apache.cxf.aegis.type.TypeMapping;
@@ -61,9 +62,15 @@
         // serialization root type
         trailingBlocks = new TrailingBlocks();
     }
+    
+    protected Context getContext() {
+        AegisDatabinding databinding = new AegisDatabinding();
+        databinding.setWriteXsiTypes(true);
+        return new Context(databinding);
+    }
 
     public <T> T readWriteReadRef(String file, Class<T> typeClass) throws XMLStreamException {
-        Context context = new Context();
+        Context context = getContext();
         context.setTypeMapping(mapping);
 
         Type type = mapping.getType(typeClass);
@@ -96,7 +103,7 @@
     }
 
     public Object readRef(ElementReader root) throws XMLStreamException {
-        Context context = new Context();
+        Context context = getContext();
         context.setTypeMapping(mapping);
 
         // get Type based on the element qname
@@ -131,7 +138,7 @@
         }
         new Document(element);
         JDOMWriter rootWriter = new JDOMWriter(element);
-        Context context = new Context();
+        Context context = getContext();
         context.setTypeMapping(mapping);
 
         // get Type based on the object instance
@@ -157,7 +164,7 @@
         Type type = mapping.getType(expectedType);
         assertNotNull("type is null", type);
 
-        Context context = new Context();
+        Context context = getContext();
         context.setTypeMapping(mapping);
 
         ElementReader reader = new ElementReader(getClass().getResourceAsStream(resourceName));

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/encoded/SoapArrayTypeTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/encoded/SoapArrayTypeTest.java?rev=607000&r1=606999&r2=607000&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/encoded/SoapArrayTypeTest.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/encoded/SoapArrayTypeTest.java Wed Dec 26 19:06:20 2007
@@ -92,7 +92,7 @@
 
     @Test
     public void testSimpleArray() throws Exception {
-        Context context = new Context();
+        Context context = getContext();
         context.setTypeMapping(mapping);
 
         // xsd:int[2]
@@ -108,7 +108,7 @@
 
     @Test
     public void testUrTypeArray() throws Exception {
-        Context context = new Context();
+        Context context = getContext();
         context.setTypeMapping(mapping);
 
         // ur-type[4] nested elements have xsi:type
@@ -132,7 +132,7 @@
 
     @Test
     public void testAnyTypeArray() throws Exception {
-        Context context = new Context();
+        Context context = getContext();
         context.setTypeMapping(mapping);
 
         // ur-type[4] nested elements have xsi:type
@@ -156,7 +156,7 @@
 
     @Test
     public void testStructArray() throws Exception {
-        Context context = new Context();
+        Context context = getContext();
         context.setTypeMapping(mapping);
 
         // b:address[2]
@@ -174,7 +174,7 @@
 
     @Test
     public void testSquareArray() throws Exception {
-        Context context = new Context();
+        Context context = getContext();
         context.setTypeMapping(mapping);
 
         // xsd:string[2,3,4]
@@ -190,7 +190,7 @@
 
     @Test
     public void testArrayOfArrays() throws Exception {
-        Context context = new Context();
+        Context context = getContext();
         context.setTypeMapping(mapping);
 
         // xsd:string[,][2]
@@ -206,7 +206,7 @@
 
     @Test
     public void testPartiallyTransmitted() throws Exception {
-        Context context = new Context();
+        Context context = getContext();
         context.setTypeMapping(mapping);
 
         // xsd:int[5] offset="[2]"
@@ -223,7 +223,7 @@
 
     @Test
     public void testSparseArray() throws Exception {
-        Context context = new Context();
+        Context context = getContext();
         context.setTypeMapping(mapping);
 
         // xsd:string[2,3,4]

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/encoded/StructTypeTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/encoded/StructTypeTest.java?rev=607000&r1=606999&r2=607000&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/encoded/StructTypeTest.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/encoded/StructTypeTest.java Wed Dec 26 19:06:20 2007
@@ -22,7 +22,6 @@
 import java.util.TreeMap;
 import javax.xml.namespace.QName;
 
-import org.apache.cxf.aegis.Context;
 import org.apache.cxf.aegis.type.basic.BeanTypeInfo;
 import org.apache.cxf.aegis.xml.jdom.JDOMWriter;
 import org.apache.cxf.aegis.xml.stax.ElementReader;
@@ -65,20 +64,20 @@
     public void testSimpleStruct() throws Exception {
         // Test reading
         ElementReader reader = new ElementReader(getClass().getResourceAsStream("struct1.xml"));
-        Address address = (Address) addressType.readObject(reader, new Context());
+        Address address = (Address) addressType.readObject(reader, getContext());
         validateShippingAddress(address);
         reader.getXMLStreamReader().close();
 
         // Test reading - no namespace on nested elements
         reader = new ElementReader(getClass().getResourceAsStream("struct2.xml"));
-        address = (Address) addressType.readObject(reader, new Context());
+        address = (Address) addressType.readObject(reader, getContext());
         validateShippingAddress(address);
         reader.getXMLStreamReader().close();
 
         // Test writing
         Element element = new Element("root", "b", "urn:Bean");
         new Document(element);
-        addressType.writeObject(address, new JDOMWriter(element), new Context());
+        addressType.writeObject(address, new JDOMWriter(element), getContext());
         validateShippingAddress(element);
     }
 
@@ -86,13 +85,13 @@
     public void testComplexStruct() throws Exception {
         // Test reading
         ElementReader reader = new ElementReader(getClass().getResourceAsStream("struct3.xml"));
-        PurchaseOrder po = (PurchaseOrder) purchaseOrderType.readObject(reader, new Context());
+        PurchaseOrder po = (PurchaseOrder) purchaseOrderType.readObject(reader, getContext());
         validatePurchaseOrder(po);
         reader.getXMLStreamReader().close();
 
         // Test reading - no namespace on nested elements
         reader = new ElementReader(getClass().getResourceAsStream("struct4.xml"));
-        po = (PurchaseOrder) purchaseOrderType.readObject(reader, new Context());
+        po = (PurchaseOrder) purchaseOrderType.readObject(reader, getContext());
         validatePurchaseOrder(po);
         reader.getXMLStreamReader().close();
 

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/AnnotatedTypeTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/AnnotatedTypeTest.java?rev=607000&r1=606999&r2=607000&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/AnnotatedTypeTest.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/AnnotatedTypeTest.java Wed Dec 26 19:06:20 2007
@@ -25,6 +25,7 @@
 import org.w3c.dom.Document;
 
 import org.apache.cxf.aegis.AbstractAegisTest;
+import org.apache.cxf.aegis.databinding.AegisDatabinding;
 import org.apache.cxf.aegis.type.Type;
 import org.apache.cxf.aegis.type.TypeMapping;
 import org.apache.cxf.aegis.type.XMLTypeCreator;
@@ -39,6 +40,7 @@
 public class AnnotatedTypeTest extends AbstractAegisTest {
     private TypeMapping tm;
     private Service service;
+    private AegisDatabinding databinding;
 
     @Before
     public void setUp() throws Exception {
@@ -46,8 +48,9 @@
 
         Server s = createService(AnnotatedService.class, null);
         service = s.getEndpoint().getService();
+        databinding = (AegisDatabinding) service.getDataBinding();
 
-        tm = (TypeMapping)service.get(TypeMapping.class.getName());
+        tm = databinding.getServiceTypeMapping();
     }
 
     @Test

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=607000&r1=606999&r2=607000&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 Dec 26 19:06:20 2007
@@ -24,6 +24,7 @@
 
 import org.apache.cxf.aegis.AbstractAegisTest;
 import org.apache.cxf.aegis.Context;
+import org.apache.cxf.aegis.databinding.AegisDatabinding;
 import org.apache.cxf.aegis.type.Configuration;
 import org.apache.cxf.aegis.type.CustomTypeMapping;
 import org.apache.cxf.aegis.type.Type;
@@ -38,6 +39,7 @@
 
 public class EnumTypeTest extends AbstractAegisTest {
     private CustomTypeMapping tm;
+    private AegisDatabinding databinding;
 
     private enum smallEnum {
         VALUE1, VALUE2
@@ -46,12 +48,17 @@
     @Before
     public void setUp() throws Exception {
         super.setUp();
+        databinding = new AegisDatabinding();
 
         tm = new CustomTypeMapping();
         Java5TypeCreator creator = new Java5TypeCreator();
         creator.setConfiguration(new Configuration());
         tm.setTypeCreator(creator);
     }
+    
+    private Context getContext() {
+        return new Context(databinding);
+    }
 
     @Test
     public void testType() throws Exception {
@@ -64,12 +71,12 @@
         Element root = new Element("root");
         JDOMWriter writer = new JDOMWriter(root);
 
-        type.writeObject(smallEnum.VALUE1, writer, new Context());
+        type.writeObject(smallEnum.VALUE1, writer, getContext());
 
         assertEquals("VALUE1", root.getValue());
 
         JDOMReader reader = new JDOMReader(root);
-        Object value = type.readObject(reader, new Context());
+        Object value = type.readObject(reader, getContext());
 
         assertEquals(smallEnum.VALUE1, value);
     }
@@ -129,10 +136,10 @@
         Element root = new Element("root");
         JDOMWriter writer = new JDOMWriter(root);
 
-        type.writeObject(new EnumBean(), writer, new Context());
+        type.writeObject(new EnumBean(), writer, getContext());
 
         JDOMReader reader = new JDOMReader(root);
-        Object value = type.readObject(reader, new Context());
+        Object value = type.readObject(reader, getContext());
 
         assertTrue(value instanceof EnumBean);
         EnumBean bean = (EnumBean)value;

Added: incubator/cxf/trunk/rt/databinding/aegis/src/test/resources/org/apache/cxf/aegis/override/employee.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/test/resources/org/apache/cxf/aegis/override/employee.xml?rev=607000&view=auto
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/test/resources/org/apache/cxf/aegis/override/employee.xml (added)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/test/resources/org/apache/cxf/aegis/override/employee.xml Wed Dec 26 19:06:20 2007
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the v 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.
+-->
+<employee xmlns="http://inheritance.aegis.cxf.apache.org" 
+		  xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+		  xsi:type="Employee">
+  <division>long</division>
+</employee>

Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/test/resources/org/apache/cxf/aegis/override/employee.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/test/resources/org/apache/cxf/aegis/override/employee.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/test/resources/org/apache/cxf/aegis/override/employee.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml



Mime
View raw message