From cxf-commits-returnmelendeztammy@example.org Tue Jan 01 02:44:52 2008 Return-Path: <cxf-commits-returnmelendeztammy@example.org> Delivered-To: melendeztammy@example.org Received: (qmail 34017 invoked from network); 1 Jan 2008 02:44:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 Jan 2008 02:44:52 -0000 Received: (qmail 96932 invoked by uid 500); 1 Jan 2008 02:44:40 -0000 Delivered-To: melendeztammy@example.org Received: (qmail 96861 invoked by uid 500); 1 Jan 2008 02:44:40 -0000 Mailing-List: contact melendeztammy@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:melendeztammy@example.org> List-Unsubscribe: <mailto:melendeztammy@example.org> List-Post: <mailto:melendeztammy@example.org> List-Id: <cxf-commits.incubator.apache.org> Reply-To: melendeztammy@example.org Delivered-To: mailing list melendeztammy@example.org Received: (qmail 96852 invoked by uid 99); 1 Jan 2008 02:44:40 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 31 Dec 2007 18:44:40 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Jan 2008 02:44:25 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 6E0C51A9838; Mon, 31 Dec 2007 18:44:16 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r607793 - in /incubator/cxf/trunk/rt: core/src/main/java/org/apache/cxf/test/ databinding/aegis/src/main/java/org/apache/cxf/aegis/ databinding/aegis/src/main/java/org/apache/cxf/aegis/type/ databinding/aegis/src/test/java/org/apache/cxf/ae... Date: Tue, 01 Jan 2008 02:44:15 -0000 To: melendeztammy@example.org From: melendeztammy@example.org X-Mailer: svnmailer-1.0.8 Message-Id: <melendeztammy@example.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: bimargulies Date: Mon Dec 31 18:44:12 2007 New Revision: 607793 URL: http://svn.apache.org/viewvc?rev=607793&view=rev Log: Begin to actually turn on the standalone Aegis binding. Here it is reading a string. Well, one has to start someplace. Added: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/standalone/ incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/standalone/StandaloneReadTest.java (with props) incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/standalone/stringElement.xml (with props) Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/test/TestUtilities.java incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisXMLStreamDataReader.java incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeUtil.java incubator/cxf/trunk/rt/databinding/aegis/src/test/resources/org/apache/cxf/aegis/integration/anyTypeArrayJDOM.xml incubator/cxf/trunk/rt/databinding/aegis/src/test/resources/org/apache/cxf/aegis/integration/anyTypeArrayW3C.xml Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/test/TestUtilities.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/test/TestUtilities.java?rev=607793&r1=607792&r2=607793&view=diff ============================================================================== --- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/test/TestUtilities.java (original) +++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/test/TestUtilities.java Mon Dec 31 18:44:12 2007 @@ -35,6 +35,9 @@ import javax.wsdl.factory.WSDLFactory; import javax.wsdl.xml.WSDLWriter; import javax.xml.namespace.QName; +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.XMLStreamReader; import org.w3c.dom.Document; import org.w3c.dom.Node; @@ -66,11 +69,10 @@ private static final Charset UTF8 = Charset.forName("utf-8"); private static String preKeepAlive; - private static String basedirPath; protected Bus bus; protected Class<?> classpathAnchor; - + private XMLInputFactory xmlInputFactory; /** * Namespaces for the XPath expressions. @@ -87,6 +89,7 @@ */ public TestUtilities(Class<?> classpathReference) { classpathAnchor = classpathReference; + xmlInputFactory = XMLInputFactory.newInstance(); } public static void setKeepAliveSystemProperty(boolean setAlive) { @@ -248,6 +251,10 @@ public Reader getResourceAsReader(String resource) { return new InputStreamReader(getResourceAsStream(resource), UTF8); + } + + public XMLStreamReader getResourceAsXMLStreamReader(String resource) throws XMLStreamException { + return xmlInputFactory.createXMLStreamReader(getResourceAsStream(resource)); } public File getTestFile(String relativePath) { Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisXMLStreamDataReader.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisXMLStreamDataReader.java?rev=607793&r1=607792&r2=607793&view=diff ============================================================================== --- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisXMLStreamDataReader.java (original) +++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisXMLStreamDataReader.java Mon Dec 31 18:44:12 2007 @@ -71,7 +71,7 @@ return null; } - Type type = TypeUtil.getReadType(reader, aegisContext, desiredType); + Type type = TypeUtil.getReadTypeStandalone(reader, aegisContext, desiredType); if (type == null) { throw new DatabindingException(new Message("NO_MAPPING", LOG)); 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=607793&r1=607792&r2=607793&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 Mon Dec 31 18:44:12 2007 @@ -86,6 +86,50 @@ } } + /** + * getReadType cannot just look up the xsi:type in the mapping. This function must be + * called instead at the root where there is no initial mapping to start from, as from + * a part or an element of some containing item. + * @param xsr + * @param context + * @return + */ + public static Type getReadTypeStandalone(XMLStreamReader xsr, AegisContext context, Type baseType) { + + if (baseType != null) { + return getReadType(xsr, context, baseType); + } + + if (!context.isReadXsiTypes()) { + LOG.warn("xsi:type reading disabled, and no type available for " + + xsr.getName()); + return null; + } + + String typeNameString = xsr.getAttributeValue(SOAPConstants.XSI_NS, "type"); + if (typeNameString != null) { + QName schemaTypeName = NamespaceHelper.createQName(xsr.getNamespaceContext(), + typeNameString); + TypeMapping tm; + tm = context.getTypeMapping(); + Type type = tm.getType(schemaTypeName); + + if (type == null) { + type = context.getOverrideType(schemaTypeName); + } + + if (type != null) { + return type; + } + + LOG.warn("xsi:type=\"" + schemaTypeName + + "\" was specified, but no corresponding Type was registered; no default."); + return null; + } + LOG.warn("xsi:type was not specified for top-level element " + xsr.getName()); + return null; + } + public static Type getWriteType(AegisContext globalContext, Object value, Type type) { if (value != null && type != null && type.getTypeClass() != value.getClass()) { Type overrideType = globalContext.getOverrideType(value.getClass()); Added: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/standalone/StandaloneReadTest.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/standalone/StandaloneReadTest.java?rev=607793&view=auto ============================================================================== --- incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/standalone/StandaloneReadTest.java (added) +++ incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/standalone/StandaloneReadTest.java Mon Dec 31 18:44:12 2007 @@ -0,0 +1,53 @@ +/** + * 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.standalone; + +import javax.xml.stream.XMLStreamReader; + +import org.apache.cxf.aegis.AegisContext; +import org.apache.cxf.aegis.AegisXMLStreamDataReader; +import org.apache.cxf.test.TestUtilities; +import org.junit.Before; +import org.junit.Test; +import static org.junit.Assert.assertTrue; + +/** + * + */ +public class StandaloneReadTest { + private AegisContext context; + private TestUtilities testUtilities; + + @Before + public void before() { + testUtilities = new TestUtilities(getClass()); + context = new AegisContext(); + context.initialize(); + } + + @Test + public void testBasicTypeRead() throws Exception { + XMLStreamReader streamReader = testUtilities.getResourceAsXMLStreamReader("stringElement.xml"); + AegisXMLStreamDataReader reader = + context.createReader(AegisXMLStreamDataReader.class, XMLStreamReader.class); + Object something = reader.read(streamReader); + assertTrue("ball-of-yarn".equals(something)); + } +} Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/standalone/StandaloneReadTest.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/standalone/StandaloneReadTest.java ------------------------------------------------------------------------------ svn:keywords = Rev Date Added: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/standalone/stringElement.xml URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/standalone/stringElement.xml?rev=607793&view=auto ============================================================================== --- incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/standalone/stringElement.xml (added) +++ incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/standalone/stringElement.xml Mon Dec 31 18:44:12 2007 @@ -0,0 +1,23 @@ +<?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. +--> +<cat-toy xmlns='urn:meow' + xmlns:xsd='http://www.w3.org/2001/XMLSchema' + xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' + xsi:type='xsd:string'>ball-of-yarn</cat-toy> Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/standalone/stringElement.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/standalone/stringElement.xml ------------------------------------------------------------------------------ svn:keywords = Rev Date Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/standalone/stringElement.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml Modified: incubator/cxf/trunk/rt/databinding/aegis/src/test/resources/org/apache/cxf/aegis/integration/anyTypeArrayJDOM.xml URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/test/resources/org/apache/cxf/aegis/integration/anyTypeArrayJDOM.xml?rev=607793&r1=607792&r2=607793&view=diff ============================================================================== --- incubator/cxf/trunk/rt/databinding/aegis/src/test/resources/org/apache/cxf/aegis/integration/anyTypeArrayJDOM.xml (original) +++ incubator/cxf/trunk/rt/databinding/aegis/src/test/resources/org/apache/cxf/aegis/integration/anyTypeArrayJDOM.xml Mon Dec 31 18:44:12 2007 @@ -1,4 +1,22 @@ <?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. +--> <soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"> <soap-env:Body xmlns:jns0='urn:Array' > Modified: incubator/cxf/trunk/rt/databinding/aegis/src/test/resources/org/apache/cxf/aegis/integration/anyTypeArrayW3C.xml URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/test/resources/org/apache/cxf/aegis/integration/anyTypeArrayW3C.xml?rev=607793&r1=607792&r2=607793&view=diff ============================================================================== --- incubator/cxf/trunk/rt/databinding/aegis/src/test/resources/org/apache/cxf/aegis/integration/anyTypeArrayW3C.xml (original) +++ incubator/cxf/trunk/rt/databinding/aegis/src/test/resources/org/apache/cxf/aegis/integration/anyTypeArrayW3C.xml Mon Dec 31 18:44:12 2007 @@ -1,4 +1,22 @@ <?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. +--> <soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"> <soap-env:Body xmlns:jns0='urn:Array' > From cxf-commits-returnmelendeztammy@example.org Tue Jan 01 19:55:53 2008 Return-Path: <cxf-commits-returnmelendeztammy@example.org> Delivered-To: melendeztammy@example.org Received: (qmail 24322 invoked from network); 1 Jan 2008 19:55:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 Jan 2008 19:55:53 -0000 Received: (qmail 74491 invoked by uid 500); 1 Jan 2008 19:55:42 -0000 Delivered-To: melendeztammy@example.org Received: (qmail 74417 invoked by uid 500); 1 Jan 2008 19:55:41 -0000 Mailing-List: contact melendeztammy@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:melendeztammy@example.org> List-Unsubscribe: <mailto:melendeztammy@example.org> List-Post: <mailto:melendeztammy@example.org> List-Id: <cxf-commits.incubator.apache.org> Reply-To: melendeztammy@example.org Delivered-To: mailing list melendeztammy@example.org Received: (qmail 74407 invoked by uid 99); 1 Jan 2008 19:55:41 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Jan 2008 11:55:41 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Jan 2008 19:55:36 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 6DFB21A984E; Tue, 1 Jan 2008 11:55:27 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r607899 - 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/ test/java/org/apache/cxf/aegis/inheritance/ test/java/org/apache/cx... Date: Tue, 01 Jan 2008 19:55:25 -0000 To: melendeztammy@example.org From: melendeztammy@example.org X-Mailer: svnmailer-1.0.8 Message-Id: <melendeztammy@example.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: bimargulies Date: Tue Jan 1 11:55:25 2008 New Revision: 607899 URL: http://svn.apache.org/viewvc?rev=607899&view=rev Log: Perhaps complete the standalone reader department. Modify some existing test stuff to use a .aegis.xml file to make a better test case for the standalone reader. Added: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/standalone/simpleBean1.xml (with props) 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/databinding/AegisDatabinding.java incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeUtil.java incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/inheritance/ExceptionInheritanceTest.java incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/inheritance/InheritancePOJOTest.java incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/integration/WrappedTest.java incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/oldconfig/Pre21ConfigCompatTest.java incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/services/SimpleBean.aegis.xml incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/standalone/StandaloneReadTest.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=607899&r1=607898&r2=607899&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 Tue Jan 1 11:55:25 2008 @@ -48,6 +48,22 @@ * This class has no API that maps from a Class or QName to a Type or visa versa. Our goal is to allow * Aegis-sans-CXF, but the marshal/unmarshal-level APIs aren't sorted out yet. * + * At the level of the data binding, the 'root elements' are defined by the WSDL message parts. + * Additional classes that participate are termed 'override' classes. + * + * Aegis, unlike JAXB, has no concept of a 'root element'. So, an application that + * uses Aegis without a web service has to either depend on xsi:type (at least for + * root elements) or have its own mapping from elements to classes, and pass the + * resulting Class objects to the readers. + * + * At this level, the initial set of classes are just the initial set of classes. + * If the application leaves this list empty, and reads, then no .aegis.xml files + * are used unless the application feeds in a Class&lt;T&gt; for the root of a + * particular item read. Specifically, if the application just leaves it to Aegis to + * map an xsi:type spec to a class, Aegis can't know that some arbitrary class in + * some arbitrary package is mapped to a particular schema type by QName in a + * mapping XML file. + * */ public class AegisContext { // perhaps this should be SoapConstants.XSD? Or perhaps the code that looks for that should look for this? @@ -57,12 +73,12 @@ private String mappingNamespaceURI = DEFAULT_ENCODING_STYLE_URI; private TypeMappingRegistry typeMappingRegistry; - private Set<String> overrideTypes; - private Set<Class<?>> overrideClasses; - private Set<QName> overrideQNames; + private Set<String> rootClassNames; + private Set<Class<?>> rootClasses; + private Set<QName> rootTypeQNames; // this type mapping is the front of the chain of delegating type mappings. private TypeMapping typeMapping; - private Set<Type> additionalTypes; + private Set<Type> rootTypes; private Map<Class<?>, String> beanImplementationMap; private Configuration configuration; @@ -71,8 +87,8 @@ */ public AegisContext() { beanImplementationMap = new HashMap<Class<?>, String>(); - overrideClasses = new HashSet<Class<?>>(); - overrideQNames = new HashSet<QName>(); + rootClasses = new HashSet<Class<?>>(); + rootTypeQNames = new HashSet<QName>(); } /** @@ -90,7 +106,7 @@ // The use of the XSD URI in the mapping is, MAGIC. typeMapping = typeMappingRegistry.createTypeMapping(SOAPConstants.XSD, true); typeMappingRegistry.register(mappingNamespaceURI, typeMapping); - processOverrideTypes(); + processRootTypes(); } @@ -121,13 +137,13 @@ } /** - * If a class was provided as part of the 'override' list, retrieve it's Type by + * If a class was provided as part of the 'root' list, retrieve it's Type by * Class. * @param clazz * @return */ - public Type getOverrideType(Class clazz) { - if (overrideClasses.contains(clazz)) { + public Type getRootType(Class clazz) { + if (rootClasses.contains(clazz)) { return typeMapping.getType(clazz); } else { return null; @@ -135,13 +151,13 @@ } /** - * If a class was provided as part of the override list, retrieve it's Type by schema + * If a class was provided as part of the root list, retrieve it's Type by schema * type QName. * @param schemaTypeName * @return */ - public Type getOverrideType(QName schemaTypeName) { - if (overrideQNames.contains(schemaTypeName)) { + public Type getRootType(QName schemaTypeName) { + if (rootTypeQNames.contains(schemaTypeName)) { return typeMapping.getType(schemaTypeName); } else { return null; @@ -153,12 +169,15 @@ * @param tm type manager for this binding * @param classes list of class names */ - private void processOverrideTypes() { - additionalTypes = new HashSet<Type>(); - overrideClasses = new HashSet<Class<?>>(); - overrideQNames = new HashSet<QName>(); - if (this.overrideTypes != null) { - for (String typeName : overrideTypes) { + private void processRootTypes() { + rootTypes = new HashSet<Type>(); + // app may have already supplied classes. + if (rootClasses == null) { + rootClasses = new HashSet<Class<?>>(); + } + rootTypeQNames = new HashSet<QName>(); + if (this.rootClassNames != null) { + for (String typeName : rootClassNames) { Class c = null; try { c = ClassLoaderUtils.loadClass(typeName, TypeUtil.class); @@ -166,34 +185,48 @@ throw new DatabindingException("Could not find override type class: " + typeName, e); } - overrideClasses.add(c); - - Type t = typeMapping.getType(c); - if (t == null) { - t = typeMapping.getTypeCreator().createType(c); - typeMapping.register(t); - } - overrideQNames.add(t.getSchemaType()); - if (t instanceof BeanType) { - BeanType bt = (BeanType)t; - bt.getTypeInfo().setExtension(true); - additionalTypes.add(bt); - } + rootClasses.add(c); + } + } + + for (Class<?> c : rootClasses) { + Type t = typeMapping.getType(c); + if (t == null) { + t = typeMapping.getTypeCreator().createType(c); + typeMapping.register(t); + } + rootTypeQNames.add(t.getSchemaType()); + if (t instanceof BeanType) { + BeanType bt = (BeanType)t; + bt.getTypeInfo().setExtension(true); + rootTypes.add(bt); } } } - public Set<String> getOverrideTypes() { - return overrideTypes; + /** + * Retrieve the set of root class names. Note that if the application + * specifies the root classes by Class instead of by name, this will + * return null. + * @return + */ + public Set<String> getRootClassNames() { + return rootClassNames; } - public void setOverrideTypes(Set<String> typeNames) { - overrideTypes = typeNames; + /** + * Set the root class names. This function is a convenience for Spring + * configuration. It sets the same underlying + * collection as {@link #setRootClasses(Set)}. + * + * @param classNames + */ + public void setRootClassNames(Set<String> classNames) { + rootClassNames = classNames; } /** * Return the type mapping configuration associated with this context. - * The configuration is retrieved from the type mapping registry. * @return Returns the configuration. */ public Configuration getConfiguration() { @@ -206,7 +239,8 @@ } /** - * Set the configuration for this databinding object. + * Set the configuration object. The configuration specifies default + * type mapping behaviors. * @param configuration The configuration to set. */ public void setConfiguration(Configuration newConfiguration) { @@ -224,24 +258,47 @@ return readXsiTypes; } + /** + * Controls whether Aegis writes xsi:type attributes on all elements. + * False by default. + * @param flag + */ public void setWriteXsiTypes(boolean flag) { this.writeXsiTypes = flag; } + /** + * Controls the use of xsi:type attributes when reading objects. By default, + * xsi:type reading is enabled. When disabled, Aegis will only map for objects + * in the type mapping. + * @param flag + */ public void setReadXsiTypes(boolean flag) { this.readXsiTypes = flag; } + /** + * Return the type mapping object used by this context. + * @return + */ public TypeMapping getTypeMapping() { return typeMapping; } + /** + * Set the type mapping object used by this context. + * @param typeMapping + */ public void setTypeMapping(TypeMapping typeMapping) { this.typeMapping = typeMapping; } - public Set<Type> getAdditionalTypes() { - return additionalTypes; + /** + * Retrieve the Aegis type objects for the root classes. + * @return the set of type objects. + */ + public Set<Type> getRootTypes() { + return rootTypes; } public Map<Class<?>, String> getBeanImplementationMap() { @@ -254,6 +311,14 @@ public void setMappingNamespaceURI(String uri) { this.mappingNamespaceURI = uri; + } + + public Set<Class<?>> getRootClasses() { + return rootClasses; + } + + public void setRootClasses(Set<Class<?>> rootClasses) { + this.rootClasses = rootClasses; } } 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=607899&r1=607898&r2=607899&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 Tue Jan 1 11:55:25 2008 @@ -116,7 +116,7 @@ if (aegisContext == null) { aegisContext = new AegisContext(); if (overrideTypes != null) { - aegisContext.setOverrideTypes(overrideTypes); + aegisContext.setRootClassNames(overrideTypes); } if (configuration != null) { aegisContext.setConfiguration(configuration); @@ -221,7 +221,7 @@ } if (overrideTypes != null) { - aegisContext.setOverrideTypes(overrideTypes); + aegisContext.setRootClassNames(overrideTypes); } if (configuration != null) { aegisContext.setConfiguration(configuration); @@ -249,7 +249,7 @@ } } - Collection<Type> additional = aegisContext.getAdditionalTypes(); + Collection<Type> additional = aegisContext.getRootTypes(); if (additional != null) { for (Type t : additional) { 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=607899&r1=607898&r2=607899&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 Tue Jan 1 11:55:25 2008 @@ -60,7 +60,7 @@ improvedType = tm.getType(overrideName); } if (improvedType == null) { - improvedType = context.getOverrideType(overrideName); + improvedType = context.getRootType(overrideName); } if (improvedType != null) { return improvedType; @@ -115,7 +115,7 @@ Type type = tm.getType(schemaTypeName); if (type == null) { - type = context.getOverrideType(schemaTypeName); + type = context.getRootType(schemaTypeName); } if (type != null) { @@ -132,7 +132,7 @@ public static Type getWriteType(AegisContext globalContext, Object value, Type type) { if (value != null && type != null && type.getTypeClass() != value.getClass()) { - Type overrideType = globalContext.getOverrideType(value.getClass()); + Type overrideType = globalContext.getRootType(value.getClass()); if (overrideType != null) { return overrideType; } Modified: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/inheritance/ExceptionInheritanceTest.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/inheritance/ExceptionInheritanceTest.java?rev=607899&r1=607898&r2=607899&view=diff ============================================================================== --- incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/inheritance/ExceptionInheritanceTest.java (original) +++ incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/inheritance/ExceptionInheritanceTest.java Tue Jan 1 11:55:25 2008 @@ -51,7 +51,7 @@ Set<String> l = new HashSet<String>(); l.add(SimpleBean.class.getName()); l.add(WS1ExtendedException.class.getName()); - globalContext.setOverrideTypes(l); + globalContext.setRootClassNames(l); AegisDatabinding binding = new AegisDatabinding(); binding.setAegisContext(globalContext); Modified: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/inheritance/InheritancePOJOTest.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/inheritance/InheritancePOJOTest.java?rev=607899&r1=607898&r2=607899&view=diff ============================================================================== --- incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/inheritance/InheritancePOJOTest.java (original) +++ incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/inheritance/InheritancePOJOTest.java Tue Jan 1 11:55:25 2008 @@ -53,7 +53,7 @@ Set<String> l = new HashSet<String>(); l.add(Employee.class.getName()); - globalContext.setOverrideTypes(l); + globalContext.setRootClassNames(l); AegisDatabinding binding = new AegisDatabinding(); binding.setAegisContext(globalContext); Modified: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/integration/WrappedTest.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/integration/WrappedTest.java?rev=607899&r1=607898&r2=607899&view=diff ============================================================================== --- incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/integration/WrappedTest.java (original) +++ incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/integration/WrappedTest.java Tue Jan 1 11:55:25 2008 @@ -49,10 +49,11 @@ Node response = invoke("BeanService", "bean11.xml"); addNamespace("sb", "http://services.aegis.cxf.apache.org"); + addNamespace("beanz", "urn:beanz"); assertValid("/s:Envelope/s:Body/sb:getSimpleBeanResponse", response); assertValid("//sb:getSimpleBeanResponse/sb:return", response); - assertValid("//sb:getSimpleBeanResponse/sb:return/sb:howdy[text()=\"howdy\"]", response); - assertValid("//sb:getSimpleBeanResponse/sb:return/sb:bleh[text()=\"bleh\"]", response); + assertValid("//sb:getSimpleBeanResponse/sb:return/beanz:howdy[text()=\"howdy\"]", response); + assertValid("//sb:getSimpleBeanResponse/sb:return/beanz:bleh[text()=\"bleh\"]", response); } @Test @@ -70,28 +71,28 @@ assertValid("//xsd:complexType[@name='getSubmitBean']/xsd:sequence" + "/xsd:element[@name='bleh'][@type='xsd:string'][@minOccurs='0']", doc); assertValid("//xsd:complexType[@name='getSubmitBean']/xsd:sequence" - + "/xsd:element[@name='bean'][@type='tns:SimpleBean'][@minOccurs='0']", doc); + + "/xsd:element[@name='bean'][@type='ns0:SimpleBean'][@minOccurs='0']", doc); assertValid("/wsdl:definitions/wsdl:types" + "/xsd:schema[@targetNamespace='http://services.aegis.cxf.apache.org']", doc); assertValid("/wsdl:definitions/wsdl:types" - + "/xsd:schema[@targetNamespace='http://services.aegis.cxf.apache.org']" + + "/xsd:schema[@targetNamespace='urn:beanz']" + "/xsd:complexType[@name=\"SimpleBean\"]", doc); assertValid( "/wsdl:definitions/wsdl:types" - + "/xsd:schema[@targetNamespace='http://services.aegis.cxf.apache.org']" + + "/xsd:schema[@targetNamespace='urn:beanz']" + "/xsd:complexType[@name=\"SimpleBean\"]/xsd:sequence/xsd:element" + "[@name=\"bleh\"][@minOccurs='0']", doc); assertValid( "/wsdl:definitions/wsdl:types" - + "/xsd:schema[@targetNamespace='http://services.aegis.cxf.apache.org']" + + "/xsd:schema[@targetNamespace='urn:beanz']" + "/xsd:complexType[@name=\"SimpleBean\"]/xsd:sequence/xsd:element" + "[@name=\"howdy\"][@minOccurs='0']", doc); assertValid( "/wsdl:definitions/wsdl:types" - + "/xsd:schema[@targetNamespace='http://services.aegis.cxf.apache.org']" + + "/xsd:schema[@targetNamespace='urn:beanz']" + "/xsd:complexType[@name=\"SimpleBean\"]/xsd:sequence/xsd:element" + "[@type=\"xsd:string\"]", doc); Modified: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/oldconfig/Pre21ConfigCompatTest.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/oldconfig/Pre21ConfigCompatTest.java?rev=607899&r1=607898&r2=607899&view=diff ============================================================================== --- incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/oldconfig/Pre21ConfigCompatTest.java (original) +++ incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/oldconfig/Pre21ConfigCompatTest.java Tue Jan 1 11:55:25 2008 @@ -66,7 +66,7 @@ AegisContext context = db.getAegisContext(); assertTrue(context.isWriteXsiTypes()); assertFalse(context.isReadXsiTypes()); - Set<String> classes = context.getOverrideTypes(); + Set<String> classes = context.getRootClassNames(); assertTrue(classes.contains(SimpleBean.class.getName())); assertEquals(MyHello.class.getName(), context.getBeanImplementationMap().get(Hello.class)); } Modified: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/services/SimpleBean.aegis.xml URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/services/SimpleBean.aegis.xml?rev=607899&r1=607898&r2=607899&view=diff ============================================================================== --- incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/services/SimpleBean.aegis.xml (original) +++ incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/services/SimpleBean.aegis.xml Tue Jan 1 11:55:25 2008 @@ -17,8 +17,8 @@ specific language governing permissions and limitations under the License. --> -<mappings> - <mapping name="SimpleBean"> +<mappings xmlns:stalk='urn:beanz'> + <mapping name="stalk:SimpleBean"> <property name='numbers' nillable='false' minOccurs='2' maxOccurs='50' /> </mapping> </mappings> Modified: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/standalone/StandaloneReadTest.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/standalone/StandaloneReadTest.java?rev=607899&r1=607898&r2=607899&view=diff ============================================================================== --- incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/standalone/StandaloneReadTest.java (original) +++ incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/standalone/StandaloneReadTest.java Tue Jan 1 11:55:25 2008 @@ -19,13 +19,18 @@ package org.apache.cxf.aegis.standalone; +import java.util.HashSet; +import java.util.Set; + import javax.xml.stream.XMLStreamReader; import org.apache.cxf.aegis.AegisContext; import org.apache.cxf.aegis.AegisXMLStreamDataReader; +import org.apache.cxf.aegis.services.SimpleBean; import org.apache.cxf.test.TestUtilities; import org.junit.Before; import org.junit.Test; +import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; /** @@ -38,16 +43,34 @@ @Before public void before() { testUtilities = new TestUtilities(getClass()); - context = new AegisContext(); - context.initialize(); } @Test public void testBasicTypeRead() throws Exception { + context = new AegisContext(); + context.initialize(); XMLStreamReader streamReader = testUtilities.getResourceAsXMLStreamReader("stringElement.xml"); AegisXMLStreamDataReader reader = context.createReader(AegisXMLStreamDataReader.class, XMLStreamReader.class); Object something = reader.read(streamReader); assertTrue("ball-of-yarn".equals(something)); + } + + // test using a .aegis.xml + @Test + public void testSimpleBeanRead() throws Exception { + context = new AegisContext(); + Set<Class<?>> rootClasses = new HashSet<Class<?>>(); + rootClasses.add(SimpleBean.class); + context.setRootClasses(rootClasses); + context.initialize(); + XMLStreamReader streamReader = + testUtilities.getResourceAsXMLStreamReader("simpleBean1.xml"); + AegisXMLStreamDataReader reader = + context.createReader(AegisXMLStreamDataReader.class, XMLStreamReader.class); + Object something = reader.read(streamReader); + assertTrue(something instanceof SimpleBean); + SimpleBean simpleBean = (SimpleBean) something; + assertEquals("howdy", simpleBean.getHowdy()); } } Added: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/standalone/simpleBean1.xml URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/standalone/simpleBean1.xml?rev=607899&view=auto ============================================================================== --- incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/standalone/simpleBean1.xml (added) +++ incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/standalone/simpleBean1.xml Tue Jan 1 11:55:25 2008 @@ -0,0 +1,25 @@ +<!-- + 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. +--> +<!-- namespace goes with SimpleBean.aegis.xml --> +<b:bean xmlns:b="urn:beanz" + xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' + xsi:type='b:SimpleBean'> + <b:bleh>bleh</b:bleh> + <b:howdy>howdy</b:howdy> +</b:bean> \ No newline at end of file Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/standalone/simpleBean1.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/standalone/simpleBean1.xml ------------------------------------------------------------------------------ svn:executable = * Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/standalone/simpleBean1.xml ------------------------------------------------------------------------------ svn:keywords = Rev Date Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/standalone/simpleBean1.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml From cxf-commits-returnmelendeztammy@example.org Tue Jan 01 22:03:33 2008 Return-Path: <cxf-commits-returnmelendeztammy@example.org> Delivered-To: melendeztammy@example.org Received: (qmail 79634 invoked from network); 1 Jan 2008 22:03:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 Jan 2008 22:03:32 -0000 Received: (qmail 39463 invoked by uid 500); 1 Jan 2008 22:03:21 -0000 Delivered-To: melendeztammy@example.org Received: (qmail 39408 invoked by uid 500); 1 Jan 2008 22:03:21 -0000 Mailing-List: contact melendeztammy@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:melendeztammy@example.org> List-Unsubscribe: <mailto:melendeztammy@example.org> List-Post: <mailto:melendeztammy@example.org> List-Id: <cxf-commits.incubator.apache.org> Reply-To: melendeztammy@example.org Delivered-To: mailing list melendeztammy@example.org Received: (qmail 39399 invoked by uid 99); 1 Jan 2008 22:03:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Jan 2008 14:03:21 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Jan 2008 22:03:07 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id A5F561A9838; Tue, 1 Jan 2008 14:03:11 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r607927 - /incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/Messages.properties Date: Tue, 01 Jan 2008 22:03:11 -0000 To: melendeztammy@example.org From: melendeztammy@example.org X-Mailer: svnmailer-1.0.8 Message-Id: <melendeztammy@example.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: gmazza Date: Tue Jan 1 14:03:10 2008 New Revision: 607927 URL: http://svn.apache.org/viewvc?rev=607927&view=rev Log: Minor text changes. Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/Messages.properties Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/Messages.properties URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/Messages.properties?rev=607927&r1=607926&r2=607927&view=diff ============================================================================== --- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/Messages.properties (original) +++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/Messages.properties Tue Jan 1 14:03:10 2008 @@ -20,8 +20,8 @@ # NO_INPUT_STREAM_EXC = No input stream available. NO_OUTPUT_STREAM_EXC = No output stream available. -ANNOTATION_WITHOUT_URL_EXC = @HandlerChain annotation does not contain a file name or url. -HANDLER_CFG_FILE_NOT_FOUND_EXC = Unable to load handler configuration file specified by annotation: {0} " +ANNOTATION_WITHOUT_URL_EXC = @HandlerChain annotation is missing "file" member-value +HANDLER_CFG_FILE_NOT_FOUND_EXC = Could not find the handler configuration file {0} specified by @HandlerChain annotation HANDLER_INSTANTIATION_EXC = Failed to instantiate handler CHAIN_NOT_SPECIFIED_EXC = Chain not specified SEI_LOAD_FAILURE_EXC = Failed to load service endpoint interface. From cxf-commits-returnmelendeztammy@example.org Wed Jan 02 01:21:51 2008 Return-Path: <cxf-commits-returnmelendeztammy@example.org> Delivered-To: melendeztammy@example.org Received: (qmail 23028 invoked from network); 2 Jan 2008 01:21:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Jan 2008 01:21:51 -0000 Received: (qmail 64480 invoked by uid 500); 2 Jan 2008 01:21:39 -0000 Delivered-To: melendeztammy@example.org Received: (qmail 64422 invoked by uid 500); 2 Jan 2008 01:21:39 -0000 Mailing-List: contact melendeztammy@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:melendeztammy@example.org> List-Unsubscribe: <mailto:melendeztammy@example.org> List-Post: <mailto:melendeztammy@example.org> List-Id: <cxf-commits.incubator.apache.org> Reply-To: melendeztammy@example.org Delivered-To: mailing list melendeztammy@example.org Received: (qmail 64413 invoked by uid 99); 2 Jan 2008 01:21:39 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Jan 2008 17:21:39 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Jan 2008 01:21:35 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 6CE3C1A9844; Tue, 1 Jan 2008 17:21:25 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r607956 - in /incubator/cxf/trunk/rt/databinding/aegis/src: main/java/org/apache/cxf/aegis/ main/java/org/apache/cxf/aegis/type/ test/java/org/apache/cxf/aegis/standalone/ Date: Wed, 02 Jan 2008 01:21:23 -0000 To: melendeztammy@example.org From: melendeztammy@example.org X-Mailer: svnmailer-1.0.8 Message-Id: <melendeztammy@example.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: bimargulies Date: Tue Jan 1 17:21:17 2008 New Revision: 607956 URL: http://svn.apache.org/viewvc?rev=607956&view=rev Log: Start to sketch in the write side. More to the point, get rid of the silly exercise in overparameterization in the AegisContext. Added: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AbstractAegisIoImpl.java - copied, changed from r607763, incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AbstractAegisDataReaderImpl.java incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisIo.java - copied, changed from r607763, incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisDataReader.java incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisReader.java (with props) incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisWriter.java (with props) incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisXMLStreamDataWriter.java (with props) Removed: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AbstractAegisDataReaderImpl.java incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisDataReader.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/AegisElementDataReader.java incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisXMLStreamDataReader.java incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeUtil.java incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/standalone/StandaloneReadTest.java Copied: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AbstractAegisIoImpl.java (from r607763, incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AbstractAegisDataReaderImpl.java) URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AbstractAegisIoImpl.java?p2=incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AbstractAegisIoImpl.java&p1=incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AbstractAegisDataReaderImpl.java&r1=607763&r2=607956&rev=607956&view=diff ============================================================================== --- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AbstractAegisDataReaderImpl.java (original) +++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AbstractAegisIoImpl.java Tue Jan 1 17:21:17 2008 @@ -29,15 +29,15 @@ import org.apache.cxf.interceptor.Fault; /** - * Common implementation of the Aegis data readers. + * Common implementation of the Aegis data readers and writer. */ -public abstract class AbstractAegisDataReaderImpl implements AegisDataReader { +public abstract class AbstractAegisIoImpl { protected Map<String, Object> properties; protected Schema schema; protected AegisContext aegisContext; protected Context context; - protected AbstractAegisDataReaderImpl(AegisContext globalContext) { + protected AbstractAegisIoImpl(AegisContext globalContext) { aegisContext = globalContext; context = new Context(globalContext); properties = new HashMap<String, Object>(); @@ -49,7 +49,7 @@ * @param globalContext * @param context */ - protected AbstractAegisDataReaderImpl(AegisContext globalContext, Context context) { + protected AbstractAegisIoImpl(AegisContext globalContext, Context context) { aegisContext = globalContext; this.context = context; properties = new HashMap<String, Object>(); 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=607956&r1=607955&r2=607956&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 Tue Jan 1 17:21:17 2008 @@ -110,14 +110,14 @@ } - public <Reader extends AbstractAegisDataReaderImpl, Source> - Reader createReader(Class<Reader> readerClass, Class<Source> sourceClass) { - if (sourceClass == org.w3c.dom.Element.class) { - return readerClass.cast(new AegisElementDataReader(this)); - } else if (sourceClass == XMLStreamReader.class) { - return readerClass.cast(new AegisXMLStreamDataReader(this)); - } - return null; // throw? + public AegisReader<org.w3c.dom.Element> + createDomElementReader() { + return new AegisElementDataReader(this); + } + + public AegisReader<XMLStreamReader> + createXMLStreamReader() { + return new AegisXMLStreamDataReader(this); } /** Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisElementDataReader.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisElementDataReader.java?rev=607956&r1=607955&r2=607956&view=diff ============================================================================== --- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisElementDataReader.java (original) +++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisElementDataReader.java Tue Jan 1 17:21:17 2008 @@ -24,8 +24,8 @@ import org.apache.cxf.aegis.type.Type; import org.apache.cxf.staxutils.W3CDOMStreamReader; -public class AegisElementDataReader extends AbstractAegisDataReaderImpl { - +public class AegisElementDataReader extends AbstractAegisIoImpl + implements AegisReader<Element> { protected AegisXMLStreamDataReader reader; public AegisElementDataReader(AegisContext globalContext) { Copied: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisIo.java (from r607763, incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisDataReader.java) URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisIo.java?p2=incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisIo.java&p1=incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisDataReader.java&r1=607763&r2=607956&rev=607956&view=diff ============================================================================== --- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisDataReader.java (original) +++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisIo.java Tue Jan 1 17:21:17 2008 @@ -29,7 +29,7 @@ * the type of the source object, the read method is not specified here in the interface, but is provided * in the specific type. */ -public interface AegisDataReader { +public interface AegisIo { /** * Supply a schema to validate the input. Bindings silently ignore this parameter if they * do not support schema validation, or the particular form of validation implied by Added: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisReader.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisReader.java?rev=607956&view=auto ============================================================================== --- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisReader.java (added) +++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisReader.java Tue Jan 1 17:21:17 2008 @@ -0,0 +1,45 @@ +/** + * 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; + +import org.apache.cxf.aegis.type.Type; + +/** + * Interface for Aegis readers. + * @param <ReaderT> + */ +public interface AegisReader<ReaderT> extends AegisIo { + + /** + * Read an object. + * @param reader the source. + * @return + * @throws Exception + */ + Object read(ReaderT reader) throws Exception; + /** + * Read an object expecting a particular input type. + * @param reader the source. + * @param desiredType the expected input type. + * @return + * @throws Exception + */ + Object read(ReaderT reader, Type desiredType) throws Exception; + +} Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisReader.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisReader.java ------------------------------------------------------------------------------ svn:keywords = Rev Date Added: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisWriter.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisWriter.java?rev=607956&view=auto ============================================================================== --- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisWriter.java (added) +++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisWriter.java Tue Jan 1 17:21:17 2008 @@ -0,0 +1,45 @@ +/** + * 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; + +import javax.xml.namespace.QName; + +import org.apache.cxf.aegis.type.Type; + +/** + * Interface for Aegis writers. + * @param <SinkT> + */ +public interface AegisWriter<SinkT> extends AegisIo { + /** + * Write an object to the sink. + * @param obj The object. + * @param elementName The element QName. + * @param optional true to omit for null. (minOccurs=0) + * @param output The output sink. + * @param aegisType The aegis type to use. Null is allowed, but only if + * obj is not null. + * @throws Exception + */ + void write(Object obj, + QName elementName, + boolean optional, + SinkT output, + Type aegisType) throws Exception; +} Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisWriter.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisWriter.java ------------------------------------------------------------------------------ svn:keywords = Rev Date Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisXMLStreamDataReader.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisXMLStreamDataReader.java?rev=607956&r1=607955&r2=607956&view=diff ============================================================================== --- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisXMLStreamDataReader.java (original) +++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisXMLStreamDataReader.java Tue Jan 1 17:21:17 2008 @@ -28,7 +28,7 @@ import org.apache.cxf.common.i18n.Message; import org.apache.cxf.common.logging.LogUtils; -public class AegisXMLStreamDataReader extends AbstractAegisDataReaderImpl { +public class AegisXMLStreamDataReader extends AbstractAegisIoImpl implements AegisReader<XMLStreamReader> { private static final Logger LOG = LogUtils.getL7dLogger(AegisXMLStreamDataReader.class); @@ -58,10 +58,12 @@ } } + /** {@inheritDoc}*/ public Object read(XMLStreamReader reader) throws Exception { return read(reader, null); } + /** {@inheritDoc}*/ public Object read(XMLStreamReader reader, Type desiredType) throws Exception { setupReaderPosition(reader); ElementReader elReader = new ElementReader(reader); Added: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisXMLStreamDataWriter.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisXMLStreamDataWriter.java?rev=607956&view=auto ============================================================================== --- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisXMLStreamDataWriter.java (added) +++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisXMLStreamDataWriter.java Tue Jan 1 17:21:17 2008 @@ -0,0 +1,83 @@ +/** + * 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; + +import java.util.logging.Logger; + +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamWriter; + +import org.apache.cxf.aegis.type.Type; +import org.apache.cxf.aegis.type.TypeUtil; +import org.apache.cxf.aegis.xml.MessageWriter; +import org.apache.cxf.aegis.xml.stax.ElementWriter; +import org.apache.cxf.common.i18n.Message; +import org.apache.cxf.common.logging.LogUtils; + +public class AegisXMLStreamDataWriter extends AbstractAegisIoImpl implements AegisWriter<XMLStreamWriter> { + + private static final Logger LOG = LogUtils.getL7dLogger(AegisXMLStreamDataWriter.class); + + AegisXMLStreamDataWriter(AegisContext globalContext) { + super(globalContext); + } + + /** + * Write an object to the output. + * @param obj The object to write. + * @param elementName the QName of the XML Element. + * @param optional set this for minOccurs = 0. It omits null elements. + * @param output the output stream + * @param aegisType the aegis type. + * @throws Exception + */ + public void write(Object obj, + QName elementName, + boolean optional, + XMLStreamWriter output, + Type aegisType) throws Exception { + + if (obj == null && aegisType == null && !optional) { + Message message = new Message("WRITE_NEEDS_TYPE", LOG); + throw new DatabindingException(message); + } + + if (obj != null) { + aegisType = TypeUtil.getWriteType(aegisContext, obj, aegisType); + } + + if (obj == null) { + if (optional) { // minOccurs = 0 + return; + } + if (aegisType.isNillable() && aegisType.isWriteOuter()) { + ElementWriter writer = new ElementWriter(output); + MessageWriter w2 = writer.getElementWriter(elementName); + w2.writeXsiNil(); + w2.close(); + return; + } + } + + ElementWriter writer = new ElementWriter(output); + MessageWriter w2 = writer.getElementWriter(elementName); + aegisType.writeObject(obj, w2, context); + w2.close(); + } +} Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisXMLStreamDataWriter.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisXMLStreamDataWriter.java ------------------------------------------------------------------------------ svn:keywords = Rev Date 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=607956&r1=607955&r2=607956&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 Tue Jan 1 17:21:17 2008 @@ -140,4 +140,17 @@ return type; } + public static Type getWriteTypeStandalone(AegisContext globalContext, Object value, Type type) { + if (type != null) { + return getWriteType(globalContext, value, type); + } + + TypeMapping tm; + tm = globalContext.getTypeMapping(); + // don't use this for null! + type = tm.getType(value.getClass()); + + return type; + } + } Modified: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/standalone/StandaloneReadTest.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/standalone/StandaloneReadTest.java?rev=607956&r1=607955&r2=607956&view=diff ============================================================================== --- incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/standalone/StandaloneReadTest.java (original) +++ incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/standalone/StandaloneReadTest.java Tue Jan 1 17:21:17 2008 @@ -25,7 +25,7 @@ import javax.xml.stream.XMLStreamReader; import org.apache.cxf.aegis.AegisContext; -import org.apache.cxf.aegis.AegisXMLStreamDataReader; +import org.apache.cxf.aegis.AegisReader; import org.apache.cxf.aegis.services.SimpleBean; import org.apache.cxf.test.TestUtilities; import org.junit.Before; @@ -50,8 +50,7 @@ context = new AegisContext(); context.initialize(); XMLStreamReader streamReader = testUtilities.getResourceAsXMLStreamReader("stringElement.xml"); - AegisXMLStreamDataReader reader = - context.createReader(AegisXMLStreamDataReader.class, XMLStreamReader.class); + AegisReader<XMLStreamReader> reader = context.createXMLStreamReader(); Object something = reader.read(streamReader); assertTrue("ball-of-yarn".equals(something)); } @@ -66,8 +65,7 @@ context.initialize(); XMLStreamReader streamReader = testUtilities.getResourceAsXMLStreamReader("simpleBean1.xml"); - AegisXMLStreamDataReader reader = - context.createReader(AegisXMLStreamDataReader.class, XMLStreamReader.class); + AegisReader<XMLStreamReader> reader = context.createXMLStreamReader(); Object something = reader.read(streamReader); assertTrue(something instanceof SimpleBean); SimpleBean simpleBean = (SimpleBean) something; From cxf-commits-returnmelendeztammy@example.org Wed Jan 02 08:53:54 2008 Return-Path: <cxf-commits-returnmelendeztammy@example.org> Delivered-To: melendeztammy@example.org Received: (qmail 15852 invoked from network); 2 Jan 2008 08:53:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Jan 2008 08:53:54 -0000 Received: (qmail 54861 invoked by uid 500); 2 Jan 2008 08:53:43 -0000 Delivered-To: melendeztammy@example.org Received: (qmail 54796 invoked by uid 500); 2 Jan 2008 08:53:42 -0000 Mailing-List: contact melendeztammy@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:melendeztammy@example.org> List-Unsubscribe: <mailto:melendeztammy@example.org> List-Post: <mailto:melendeztammy@example.org> List-Id: <cxf-commits.incubator.apache.org> Reply-To: melendeztammy@example.org Delivered-To: mailing list melendeztammy@example.org Received: (qmail 54785 invoked by uid 99); 2 Jan 2008 08:53:42 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Jan 2008 00:53:42 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Jan 2008 08:53:39 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 305051A9838; Wed, 2 Jan 2008 00:53:31 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r608043 - /incubator/cxf/trunk/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/WSDL2JavaMojo.java Date: Wed, 02 Jan 2008 08:53:30 -0000 To: melendeztammy@example.org From: melendeztammy@example.org X-Mailer: svnmailer-1.0.8 Message-Id: <melendeztammy@example.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mmao Date: Wed Jan 2 00:53:07 2008 New Revision: 608043 URL: http://svn.apache.org/viewvc?rev=608043&view=rev Log: * Add the specific wsdlRoot into the wsdlOptions array as well Modified: incubator/cxf/trunk/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/WSDL2JavaMojo.java Modified: incubator/cxf/trunk/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/WSDL2JavaMojo.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/WSDL2JavaMojo.java?rev=608043&r1=608042&r2=608043&view=diff ============================================================================== --- incubator/cxf/trunk/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/WSDL2JavaMojo.java (original) +++ incubator/cxf/trunk/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/WSDL2JavaMojo.java Wed Jan 2 00:53:07 2008 @@ -116,6 +116,8 @@ if (testWsdlRoot.exists()) { options.addAll(getWsdlOptionsFromDir(testWsdlRoot)); } + } else { + options.addAll(getWsdlOptionsFromDir(new File(wsdlRoot))); } if (wsdlOptions != null) { From cxf-commits-returnmelendeztammy@example.org Wed Jan 02 12:39:46 2008 Return-Path: <cxf-commits-returnmelendeztammy@example.org> Delivered-To: melendeztammy@example.org Received: (qmail 60920 invoked from network); 2 Jan 2008 12:39:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Jan 2008 12:39:45 -0000 Received: (qmail 28633 invoked by uid 500); 2 Jan 2008 12:39:34 -0000 Delivered-To: melendeztammy@example.org Received: (qmail 28320 invoked by uid 500); 2 Jan 2008 12:39:33 -0000 Mailing-List: contact melendeztammy@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:melendeztammy@example.org> List-Unsubscribe: <mailto:melendeztammy@example.org> List-Post: <mailto:melendeztammy@example.org> List-Id: <cxf-commits.incubator.apache.org> Reply-To: melendeztammy@example.org Delivered-To: mailing list melendeztammy@example.org Received: (qmail 28253 invoked by uid 99); 2 Jan 2008 12:39:33 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Jan 2008 04:39:33 -0800 X-ASF-Spam-Status: No, hits=2.7 required=10.0 tests=FRT_OPPORTUN2,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of melendeztammy@example.org designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO amer-mx1.iona.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Jan 2008 12:39:22 +0000 X-IronPort-AV: E=Sophos;i="4.24,234,1196658000"; d="scan'208";a="8405880" Received: from amer-ems1.ionaglobal.com ([83.161.120.155]) by amer-mx1.iona.com with ESMTP; 02 Jan 2008 07:39:12 -0500 Received: from [83.161.120.155] ([83.161.120.155]) by amer-ems1.IONAGLOBAL.COM with Microsoft SMTPSVC+1-561-916-4685); Wed, 2 Jan 2008 07:39:09 -0500 Message-ID: <melendeztammy@example.org> Date: Wed, 02 Jan 2008 20:39:06 +0800 From: James Mao <melendeztammy@example.org> User-Agent: Thunderbird 83.161.120.155 (Windows/20071031) MIME-Version: 1.0 To: melendeztammy@example.org CC: melendeztammy@example.org Subject: Re: svn commit: r607222 - in /incubator/cxf/trunk: rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/ rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/ systests/src/test/java/org/... References: <melendeztammy@example.org> In-Reply-To: <melendeztammy@example.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 02 Jan 2008 12:39:10.0254 (UTC) FILETIME=[78F1ACE0:01C84D3C] X-Virus-Checked: Checked by ClamAV on apache.org Jervis, I believe your commit broken the TCK, can you kindly look through your commits. Thanks, James > Author: jliu > Date: Fri Dec 28 04:28:18 2007 > New Revision: 607222 > > URL: http://svn.apache.org/viewvc?rev=607222&view=rev > Log: > Configure JAX-WS handlers per port per service. > > Added: > incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/HandlerTestServiceWithAnnotation.java (with props) > incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/TestUnusedHandler.java (with props) > incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/handlers_invocation_testunused.xml (with props) > Modified: > incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsServerFactoryBean.java > incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/AnnotationHandlerChainBuilder.java > incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/HandlerResolverImpl.java > incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/AnnotationHandlerChainBuilderTest.java > incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/handlers.xml > incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/HandlerInvocationTest.java > > Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsServerFactoryBean.java > URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsServerFactoryBean.java?rev=607222&r1=607221&r2=607222&view=diff > ============================================================================== > --- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsServerFactoryBean.java (original) > +++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsServerFactoryBean.java Fri Dec 28 04:28:18 2007 > @@ -171,9 +171,10 @@ > */ > private void buildHandlerChain() { > AnnotationHandlerChainBuilder builder = new AnnotationHandlerChainBuilder(); > - > - List<Handler> chain = builder.buildHandlerChainFromClass(getServiceBeanClass(), > - getEndpointName()); > + JaxWsServiceFactoryBean sf = (JaxWsServiceFactoryBean)getServiceFactory(); > + > + List<Handler> chain = builder.buildHandlerChainFromClass(getServiceBeanClass(), sf.getEndpointInfo() > + .getName(), sf.getServiceQName()); > for (Handler h : chain) { > injectResources(h); > } > > Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/AnnotationHandlerChainBuilder.java > URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/AnnotationHandlerChainBuilder.java?rev=607222&r1=607221&r2=607222&view=diff > ============================================================================== > --- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/AnnotationHandlerChainBuilder.java (original) > +++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/AnnotationHandlerChainBuilder.java Fri Dec 28 04:28:18 2007 > @@ -60,7 +60,7 @@ > * @return > */ > public List<Handler> buildHandlerChainFromClass(Class<?> clz, List<Handler> existingHandlers, > - QName endpointName) { > + QName portQName, QName serviceQName) { > LOG.fine("building handler chain"); > HandlerChainAnnotation hcAnn = findHandlerChainAnnotation(clz, true); > List<Handler> chain = null; > @@ -94,11 +94,19 @@ > for (HandlerChainType hc : handlerChainsType.getHandlerChain()) { > //Only add handlers if <port-name-pattern> is not presented or is matched. > //TODO: match the namespace, match the wild card etc. JSR-181, Appendix B. > - if (hc.getPortNamePattern() != null && endpointName != null) { > + if (hc.getPortNamePattern() != null && portQName != null) { > String portNamePattern = hc.getPortNamePattern(); > String localPart = portNamePattern.substring(portNamePattern.indexOf(':') + 1, > portNamePattern.length()); > - if (!localPart.equals(endpointName.getLocalPart())) { > + if (!localPart.equals(portQName.getLocalPart())) { > + continue; > + } > + } > + if (hc.getServiceNamePattern() != null && serviceQName != null) { > + String serviceNamePattern = hc.getServiceNamePattern(); > + String localPart = serviceNamePattern.substring(serviceNamePattern.indexOf(':') + 1, > + serviceNamePattern.length()); > + if (!localPart.equals(serviceQName.getLocalPart())) { > continue; > } > } > @@ -116,14 +124,14 @@ > return sortHandlers(chain); > } > > + public List<Handler> buildHandlerChainFromClass(Class<?> clz, QName portQName, QName serviceQName) { > + return buildHandlerChainFromClass(clz, null, portQName, serviceQName); > + } > + > protected URL resolveHandlerChainAnnotationFile(Class clazz, String name) { > return clazz.getResource(name); > } > - > - public List<Handler> buildHandlerChainFromClass(Class<?> clz, QName endpointName) { > - return buildHandlerChainFromClass(clz, null, endpointName); > - } > - > + > public List<Handler> buildHandlerChainFromClass(Class<?> clz) { > return buildHandlerChainFromClass(clz, null, null); > } > > Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/HandlerResolverImpl.java > URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/HandlerResolverImpl.java?rev=607222&r1=607221&r2=607222&view=diff > ============================================================================== > --- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/HandlerResolverImpl.java (original) > +++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/HandlerResolverImpl.java Fri Dec 28 04:28:18 2007 > @@ -69,7 +69,7 @@ > chain = new ArrayList<Handler>(); > } > if (annotationClass != null) { > - chain.addAll(getHandlersFromAnnotation(annotationClass)); > + chain.addAll(getHandlersFromAnnotation(annotationClass, portInfo)); > } > > for (Handler h : chain) { > @@ -85,11 +85,12 @@ > * @param obj A endpoint implementation class or a SEI, or a generated > * service class. > */ > - private List<Handler> getHandlersFromAnnotation(Class<?> clazz) { > + private List<Handler> getHandlersFromAnnotation(Class<?> clazz, PortInfo portInfo) { > AnnotationHandlerChainBuilder builder = new AnnotationHandlerChainBuilder(); > > - List<Handler> chain = builder.buildHandlerChainFromClass(clazz); > - > + List<Handler> chain = builder.buildHandlerChainFromClass(clazz, portInfo != null ? portInfo > + .getPortName() : null, portInfo != null ? portInfo.getServiceName() : null); > + > return chain; > } > > > Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/AnnotationHandlerChainBuilderTest.java > URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/AnnotationHandlerChainBuilderTest.java?rev=607222&r1=607221&r2=607222&view=diff > ============================================================================== > --- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/AnnotationHandlerChainBuilderTest.java (original) > +++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/AnnotationHandlerChainBuilderTest.java Fri Dec 28 04:28:18 2007 > @@ -46,23 +46,38 @@ > AnnotationHandlerChainBuilder chainBuilder = new AnnotationHandlerChainBuilder(); > List<Handler> handlers = chainBuilder.buildHandlerChainFromClass(handlerTestImpl.getClass()); > assertNotNull(handlers); > - assertEquals(5, handlers.size()); > + assertEquals(7, handlers.size()); > assertEquals(TestLogicalHandler.class, handlers.get(0).getClass()); > assertEquals(TestLogicalHandler.class, handlers.get(1).getClass()); > assertEquals(TestLogicalHandler.class, handlers.get(2).getClass()); > assertEquals(TestLogicalHandler.class, handlers.get(3).getClass()); > - assertEquals(TestProtocolHandler.class, handlers.get(4).getClass()); > + assertEquals(TestLogicalHandler.class, handlers.get(4).getClass()); > + assertEquals(TestLogicalHandler.class, handlers.get(5).getClass()); > + assertEquals(TestProtocolHandler.class, handlers.get(6).getClass()); > } > > @Test > - public void testFindHandlerChainAnnotationPerPort() { > + public void testFindHandlerChainAnnotationPerPortPerService() { > HandlerTestImpl handlerTestImpl = new HandlerTestImpl(); > AnnotationHandlerChainBuilder chainBuilder = new AnnotationHandlerChainBuilder(); > - QName portName = new QName("namespacedoesntsupportyet", "SoapPort1"); > + QName portQName = new QName("namespacedoesntsupportyet", "SoapPort1"); > + QName serviceQName = new QName("namespacedoesntsupportyet", "SoapService1"); > List<Handler> handlers = chainBuilder > - .buildHandlerChainFromClass(handlerTestImpl.getClass(), portName); > + .buildHandlerChainFromClass(handlerTestImpl.getClass(), portQName, serviceQName); > assertNotNull(handlers); > - assertEquals(5, handlers.size()); > + assertEquals(7, handlers.size()); > + } > + > + @Test > + public void testFindHandlerChainAnnotationPerPortPerServiceNegative() { > + HandlerTestImpl handlerTestImpl = new HandlerTestImpl(); > + AnnotationHandlerChainBuilder chainBuilder = new AnnotationHandlerChainBuilder(); > + QName portQName = new QName("namespacedoesntsupportyet", "SoapPortUnknown"); > + QName serviceQName = new QName("namespacedoesntsupportyet", "SoapServiceUnknown"); > + List<Handler> handlers = chainBuilder > + .buildHandlerChainFromClass(handlerTestImpl.getClass(), portQName, serviceQName); > + assertNotNull(handlers); > + assertEquals(3, handlers.size()); > } > > public static class TestLogicalHandler implements LogicalHandler { > > Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/handlers.xml > URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/handlers.xml?rev=607222&r1=607221&r2=607222&view=diff > ============================================================================== > --- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/handlers.xml (original) > +++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/handlers.xml Fri Dec 28 04:28:18 2007 > @@ -70,4 +70,23 @@ > </handler-class> > </handler> > </handler-chain> > + > + <handler-chain> > + <service-name-pattern > + xmlns:ns1="http://apache.org/handler_test"> > + ns1:SoapService1 > + </service-name-pattern> > + <handler> > + <handler-name>Handler1</handler-name> > + <handler-class> > + org.apache.cxf.jaxws.handler.AnnotationHandlerChainBuilderTest$TestLogicalHandler > + </handler-class> > + </handler> > + <handler> > + <handler-name>Handler2</handler-name> > + <handler-class> > + org.apache.cxf.jaxws.handler.AnnotationHandlerChainBuilderTest$TestLogicalHandler > + </handler-class> > + </handler> > + </handler-chain> > </handler-chains> > > Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/HandlerInvocationTest.java > URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/HandlerInvocationTest.java?rev=607222&r1=607221&r2=607222&view=diff > ============================================================================== > --- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/HandlerInvocationTest.java (original) > +++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/HandlerInvocationTest.java Fri Dec 28 04:28:18 2007 > @@ -30,6 +30,7 @@ > import javax.xml.soap.MessageFactory; > import javax.xml.soap.SOAPMessage; > import javax.xml.transform.Source; > +import javax.xml.ws.Binding; > import javax.xml.ws.BindingProvider; > import javax.xml.ws.Dispatch; > import javax.xml.ws.LogicalMessage; > @@ -106,6 +107,17 @@ > assertEquals(1, handler2.getHandleMessageInvoked()); > } > > + @Test > + public void testAddingUnusedHandlersThroughConfigFile() { > + HandlerTestServiceWithAnnotation service1 = new HandlerTestServiceWithAnnotation(wsdl, serviceName); > + HandlerTest handlerTest1 = service1.getPort(portName, HandlerTest.class); > + > + BindingProvider bp1 = (BindingProvider)handlerTest1; > + Binding binding1 = bp1.getBinding(); > + List<Handler> port1HandlerChain = binding1.getHandlerChain(); > + assertEquals(0, port1HandlerChain.size()); > + } > + > @Test > public void testLogicalHandlerOneWay() { > TestHandler<LogicalMessageContext> handler1 = new TestHandler<LogicalMessageContext>(false); > > Added: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/HandlerTestServiceWithAnnotation.java > URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/HandlerTestServiceWithAnnotation.java?rev=607222&view=auto > ============================================================================== > --- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/HandlerTestServiceWithAnnotation.java (added) > +++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/HandlerTestServiceWithAnnotation.java Fri Dec 28 04:28:18 2007 > @@ -0,0 +1,112 @@ > +/** > + * 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.systest.handlers; > + > +import java.net.MalformedURLException; > +import java.net.URL; > + > +import javax.jws.HandlerChain; > +import javax.xml.namespace.QName; > +import javax.xml.ws.Service; > +import javax.xml.ws.WebEndpoint; > +import javax.xml.ws.WebServiceClient; > +import javax.xml.ws.WebServiceFeature; > + > +import org.apache.handler_test.HandlerTest; > +import org.apache.handler_test.HandlerTest1; > + > +/** > + * This class was generated by Apache CXF (incubator) 2.1-incubator-SNAPSHOT Tue > + * Dec 25 12:27:03 CST 2007 Generated source version: 2.1-incubator-SNAPSHOT > + */ > + > +@WebServiceClient(name = "HandlerTestService", > + targetNamespace = "http://apache.org/handler_test", > + wsdlLocation = "file:/D:/svn/cxf/trunk/testutils/src/main/resources/wsdl/handler_test.wsdl") > +@HandlerChain(file = "./handlers_invocation_testunused.xml", name = "TestHandlerChain") > +public class HandlerTestServiceWithAnnotation extends Service { > + > + static { > + URL url = null; > + try { > + url = new URL("file:/D:/svn/cxf/trunk/testutils/src/main/resources/wsdl/handler_test.wsdl"); > + } catch (MalformedURLException e) { > + e.printStackTrace(); > + } > + WSDL_LOCATION = url; > + } > + > + public static final QName SERVICE = new QName("http://apache.org/handler_test", "HandlerTestService"); > + public static final QName SOAPPORT = new QName("http://apache.org/handler_test", "SoapPort"); > + public static final QName SOAPPORT1 = new QName("http://apache.org/handler_test", "SoapPort1"); > + public static final URL WSDL_LOCATION; > + > + public HandlerTestServiceWithAnnotation(URL wsdlLocation) { > + super(wsdlLocation, SERVICE); > + } > + > + public HandlerTestServiceWithAnnotation(URL wsdlLocation, QName serviceName) { > + super(wsdlLocation, serviceName); > + } > + > + public HandlerTestServiceWithAnnotation() { > + super(WSDL_LOCATION, SERVICE); > + } > + > + /** > + * @return returns HandlerTest > + */ > + @WebEndpoint(name = "SoapPort") > + public HandlerTest getSoapPort() { > + return (HandlerTest)super.getPort(SOAPPORT, HandlerTest.class); > + } > + > + /** > + * @param features A list of {@link javax.xml.ws.WebServiceFeature} to > + * configure on the proxy. Supported features not in the > + * <code>features</code> parameter will have their default > + * values. > + * @return returns HandlerTest > + */ > + @WebEndpoint(name = "SoapPort") > + public HandlerTest getSoapPort(WebServiceFeature... features) { > + return (HandlerTest)super.getPort(SOAPPORT, HandlerTest.class, features); > + } > + > + /** > + * @return returns HandlerTest1 > + */ > + @WebEndpoint(name = "SoapPort1") > + public HandlerTest1 getSoapPort1() { > + return (HandlerTest1)super.getPort(SOAPPORT1, HandlerTest1.class); > + } > + > + /** > + * @param features A list of {@link javax.xml.ws.WebServiceFeature} to > + * configure on the proxy. Supported features not in the > + * <code>features</code> parameter will have their default > + * values. > + * @return returns HandlerTest1 > + */ > + @WebEndpoint(name = "SoapPort1") > + public HandlerTest1 getSoapPort1(WebServiceFeature... features) { > + return (HandlerTest1)super.getPort(SOAPPORT1, HandlerTest1.class, features); > + } > + > +} > > Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/HandlerTestServiceWithAnnotation.java > ------------------------------------------------------------------------------ > svn:eol-style = native > > Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/HandlerTestServiceWithAnnotation.java > ------------------------------------------------------------------------------ > svn:keywords = Rev Date > > Added: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/TestUnusedHandler.java > URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/TestUnusedHandler.java?rev=607222&view=auto > ============================================================================== > --- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/TestUnusedHandler.java (added) > +++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/TestUnusedHandler.java Fri Dec 28 04:28:18 2007 > @@ -0,0 +1,66 @@ > +/** > + * 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,
{'source': 'Apache Software Foundation Public Mail Archives'}