Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D34D9CDD5 for ; Mon, 3 Jun 2013 08:37:08 +0000 (UTC) Received: (qmail 21929 invoked by uid 500); 3 Jun 2013 08:37:08 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 21714 invoked by uid 500); 3 Jun 2013 08:37:06 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 21634 invoked by uid 99); 3 Jun 2013 08:37:05 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Jun 2013 08:37:05 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Jun 2013 08:37:02 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 47D072388847; Mon, 3 Jun 2013 08:36:42 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: svn commit: r1488891 - in /cxf/branches/2.7.x-fixes: ./ rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java Date: Mon, 03 Jun 2013 08:36:42 -0000 To: commits@cxf.apache.org From: ffang@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130603083642.47D072388847@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ffang Date: Mon Jun 3 08:36:41 2013 New Revision: 1488891 URL: http://svn.apache.org/r1488891 Log: Merged revisions 1488890 via svnmerge from https://svn.apache.org/repos/asf/cxf/trunk ........ r1488890 | ffang | 2013-06-03 16:26:30 +0800 (δΈ€, 03 6 2013) | 1 line [CXF-5049]Support for schema compiler options in DynamicClientFactory ........ Modified: cxf/branches/2.7.x-fixes/ (props changed) cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java Propchange: cxf/branches/2.7.x-fixes/ ------------------------------------------------------------------------------ Merged /cxf/trunk:r1488890 Propchange: cxf/branches/2.7.x-fixes/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java?rev=1488891&r1=1488890&r2=1488891&view=diff ============================================================================== --- cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java (original) +++ cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java Mon Jun 3 08:36:41 2013 @@ -133,6 +133,7 @@ public class DynamicClientFactory { private boolean allowRefs; private Map jaxbContextProperties; + private String[] schemaCompilerOptions; protected DynamicClientFactory(Bus bus) { this.bus = bus; @@ -150,6 +151,10 @@ public class DynamicClientFactory { allowRefs = b; } + public void setSchemaCompilerOptions(String[] options) { + this.schemaCompilerOptions = options; + } + /** * Create a new instance using a specific Bus. * @@ -278,8 +283,6 @@ public class DynamicClientFactory { return createClient(wsdlUrl.toString(), service, classLoader, port, bindingFiles); } - - public Client createClient(String wsdlUrl, QName service, ClassLoader classLoader, QName port, List bindingFiles) { @@ -300,8 +303,7 @@ public class DynamicClientFactory { //all SI's should have the same schemas SchemaCollection schemas = svc.getServiceInfos().get(0).getXmlSchemaCollection(); - SchemaCompiler compiler = - JAXBUtils.createSchemaCompilerWithDefaultAllocator(new HashSet()); + SchemaCompiler compiler = createSchemaCompiler(); InnerErrorListener listener = new InnerErrorListener(wsdlUrl); Object elForRun = ReflectionInvokationHandler @@ -416,6 +418,15 @@ public class DynamicClientFactory { return false; } + protected SchemaCompiler createSchemaCompiler() { + SchemaCompiler compiler = + JAXBUtils.createSchemaCompilerWithDefaultAllocator(new HashSet()); + if (schemaCompilerOptions != null && schemaCompilerOptions.length > 0) { + compiler.getOptions().parseArguments(schemaCompilerOptions); + } + return compiler; + } + private void addBindingFiles(List bindingFiles, SchemaCompiler compiler) { if (bindingFiles != null) { for (String s : bindingFiles) { @@ -795,8 +806,7 @@ public class DynamicClientFactory { public void setJaxbContextProperties(Map jaxbContextProperties) { this.jaxbContextProperties = jaxbContextProperties; } - - + private void hackInNewInternalizationLogic(SchemaCompiler schemaCompiler, final OASISCatalogManager catalog) { try {