Return-Path: Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: (qmail 52329 invoked from network); 26 Jul 2009 09:30:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 26 Jul 2009 09:30:07 -0000 Received: (qmail 55855 invoked by uid 500); 26 Jul 2009 09:31:12 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 55745 invoked by uid 500); 26 Jul 2009 09:31:12 -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 55736 invoked by uid 99); 26 Jul 2009 09:31:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 26 Jul 2009 09:31:12 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.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; Sun, 26 Jul 2009 09:31:03 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 20800238898B; Sun, 26 Jul 2009 09:30:43 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r797883 - in /cxf/trunk/rt/bindings/jbi/src: main/java/org/apache/cxf/binding/jbi/ main/java/org/apache/cxf/binding/jbi/spring/ main/resources/META-INF/ main/resources/schemas/configuration/ test/java/org/apache/cxf/binding/jbi/spring/ Date: Sun, 26 Jul 2009 09:30:42 -0000 To: commits@cxf.apache.org From: ningjiang@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090726093043.20800238898B@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ningjiang Date: Sun Jul 26 09:30:41 2009 New Revision: 797883 URL: http://svn.apache.org/viewvc?rev=797883&view=rev Log: CXF-2361 Adding JBIBindingConfiguration Added: cxf/trunk/rt/bindings/jbi/src/main/java/org/apache/cxf/binding/jbi/JBIBindingConfiguration.java (with props) cxf/trunk/rt/bindings/jbi/src/main/java/org/apache/cxf/binding/jbi/spring/ cxf/trunk/rt/bindings/jbi/src/main/java/org/apache/cxf/binding/jbi/spring/JBIBindingInfoConfigBeanDefinitionParser.java (with props) cxf/trunk/rt/bindings/jbi/src/main/java/org/apache/cxf/binding/jbi/spring/NamespaceHandler.java (with props) cxf/trunk/rt/bindings/jbi/src/main/resources/META-INF/spring.handlers cxf/trunk/rt/bindings/jbi/src/main/resources/META-INF/spring.schemas cxf/trunk/rt/bindings/jbi/src/main/resources/schemas/configuration/ cxf/trunk/rt/bindings/jbi/src/main/resources/schemas/configuration/jbi.xsd (with props) cxf/trunk/rt/bindings/jbi/src/test/java/org/apache/cxf/binding/jbi/spring/ cxf/trunk/rt/bindings/jbi/src/test/java/org/apache/cxf/binding/jbi/spring/JBIBindingConfigurationInfoTest.java (with props) cxf/trunk/rt/bindings/jbi/src/test/java/org/apache/cxf/binding/jbi/spring/binding.xml (with props) Modified: cxf/trunk/rt/bindings/jbi/src/main/java/org/apache/cxf/binding/jbi/JBIBindingFactory.java cxf/trunk/rt/bindings/jbi/src/main/java/org/apache/cxf/binding/jbi/JBIBindingInfo.java Added: cxf/trunk/rt/bindings/jbi/src/main/java/org/apache/cxf/binding/jbi/JBIBindingConfiguration.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/jbi/src/main/java/org/apache/cxf/binding/jbi/JBIBindingConfiguration.java?rev=797883&view=auto ============================================================================== --- cxf/trunk/rt/bindings/jbi/src/main/java/org/apache/cxf/binding/jbi/JBIBindingConfiguration.java (added) +++ cxf/trunk/rt/bindings/jbi/src/main/java/org/apache/cxf/binding/jbi/JBIBindingConfiguration.java Sun Jul 26 09:30:41 2009 @@ -0,0 +1,41 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.cxf.binding.jbi; + +import org.apache.cxf.binding.BindingConfiguration; + +public class JBIBindingConfiguration extends BindingConfiguration { + + // set the MTOM and other configuration here + private boolean mtomEnabled; + + @Override + public String getBindingId() { + return JBIConstants.NS_JBI_BINDING; + } + + public boolean isMtomEnabled() { + return mtomEnabled; + } + + public void setMtomEnabled(boolean flag) { + mtomEnabled = flag; + } + +} Propchange: cxf/trunk/rt/bindings/jbi/src/main/java/org/apache/cxf/binding/jbi/JBIBindingConfiguration.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: cxf/trunk/rt/bindings/jbi/src/main/java/org/apache/cxf/binding/jbi/JBIBindingConfiguration.java ------------------------------------------------------------------------------ svn:keywords = Rev Date Modified: cxf/trunk/rt/bindings/jbi/src/main/java/org/apache/cxf/binding/jbi/JBIBindingFactory.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/jbi/src/main/java/org/apache/cxf/binding/jbi/JBIBindingFactory.java?rev=797883&r1=797882&r2=797883&view=diff ============================================================================== --- cxf/trunk/rt/bindings/jbi/src/main/java/org/apache/cxf/binding/jbi/JBIBindingFactory.java (original) +++ cxf/trunk/rt/bindings/jbi/src/main/java/org/apache/cxf/binding/jbi/JBIBindingFactory.java Sun Jul 26 09:30:41 2009 @@ -27,6 +27,8 @@ import org.apache.cxf.binding.jbi.interceptor.JBIOperationInInterceptor; import org.apache.cxf.binding.jbi.interceptor.JBIWrapperInInterceptor; import org.apache.cxf.binding.jbi.interceptor.JBIWrapperOutInterceptor; +import org.apache.cxf.interceptor.AttachmentInInterceptor; +import org.apache.cxf.interceptor.AttachmentOutInterceptor; import org.apache.cxf.interceptor.StaxInInterceptor; import org.apache.cxf.interceptor.StaxOutInterceptor; import org.apache.cxf.service.model.BindingInfo; @@ -37,7 +39,9 @@ public class JBIBindingFactory extends AbstractBindingFactory { public Binding createBinding(BindingInfo binding) { - JBIBinding jb = new JBIBinding((JBIBindingInfo) binding); + JBIBindingInfo bindingInfo = (JBIBindingInfo) binding; + JBIBinding jb = new JBIBinding(bindingInfo); + jb.getInInterceptors().add(new StaxInInterceptor()); jb.getInInterceptors().add(new JBIOperationInInterceptor()); jb.getInInterceptors().add(new JBIWrapperInInterceptor()); @@ -47,11 +51,23 @@ jb.getOutFaultInterceptors().add(new JBIFaultOutInterceptor()); jb.getInFaultInterceptors().add(new JBIFaultInInterceptor()); + + if (bindingInfo.getJBIBindingConfiguration().isMtomEnabled()) { + jb.getInInterceptors().add(new AttachmentInInterceptor()); + jb.getOutInterceptors().add(new AttachmentOutInterceptor()); + } return jb; } public BindingInfo createBindingInfo(ServiceInfo service, String namespace, Object config) { - JBIBindingInfo info = new JBIBindingInfo(service, JBIConstants.NS_JBI_BINDING); + JBIBindingConfiguration configuration; + if (config instanceof JBIBindingConfiguration) { + configuration = (JBIBindingConfiguration) config; + } else { + configuration = new JBIBindingConfiguration(); + } + JBIBindingInfo info = new JBIBindingInfo(service, JBIConstants.NS_JBI_BINDING); + info.setJBIBindingConfiguration(configuration); info.setName(new QName(service.getName().getNamespaceURI(), service.getName().getLocalPart() + "JBIBinding")); Modified: cxf/trunk/rt/bindings/jbi/src/main/java/org/apache/cxf/binding/jbi/JBIBindingInfo.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/jbi/src/main/java/org/apache/cxf/binding/jbi/JBIBindingInfo.java?rev=797883&r1=797882&r2=797883&view=diff ============================================================================== --- cxf/trunk/rt/bindings/jbi/src/main/java/org/apache/cxf/binding/jbi/JBIBindingInfo.java (original) +++ cxf/trunk/rt/bindings/jbi/src/main/java/org/apache/cxf/binding/jbi/JBIBindingInfo.java Sun Jul 26 09:30:41 2009 @@ -22,9 +22,21 @@ import org.apache.cxf.service.model.ServiceInfo; public class JBIBindingInfo extends BindingInfo { - + private JBIBindingConfiguration configuration; + public JBIBindingInfo(ServiceInfo service, String bindingId) { super(service, bindingId); } + + public void setJBIBindingConfiguration(JBIBindingConfiguration conf) { + configuration = conf; + } + + public JBIBindingConfiguration getJBIBindingConfiguration() { + if (configuration == null) { + configuration = new JBIBindingConfiguration(); + } + return configuration; + } } Added: cxf/trunk/rt/bindings/jbi/src/main/java/org/apache/cxf/binding/jbi/spring/JBIBindingInfoConfigBeanDefinitionParser.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/jbi/src/main/java/org/apache/cxf/binding/jbi/spring/JBIBindingInfoConfigBeanDefinitionParser.java?rev=797883&view=auto ============================================================================== --- cxf/trunk/rt/bindings/jbi/src/main/java/org/apache/cxf/binding/jbi/spring/JBIBindingInfoConfigBeanDefinitionParser.java (added) +++ cxf/trunk/rt/bindings/jbi/src/main/java/org/apache/cxf/binding/jbi/spring/JBIBindingInfoConfigBeanDefinitionParser.java Sun Jul 26 09:30:41 2009 @@ -0,0 +1,33 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.cxf.binding.jbi.spring; + +import org.w3c.dom.Element; + +import org.apache.cxf.binding.jbi.JBIBindingConfiguration; +import org.apache.cxf.configuration.spring.AbstractBeanDefinitionParser; + +public class JBIBindingInfoConfigBeanDefinitionParser extends AbstractBeanDefinitionParser { + + @Override + protected Class getBeanClass(Element arg0) { + return JBIBindingConfiguration.class; + } + +} Propchange: cxf/trunk/rt/bindings/jbi/src/main/java/org/apache/cxf/binding/jbi/spring/JBIBindingInfoConfigBeanDefinitionParser.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: cxf/trunk/rt/bindings/jbi/src/main/java/org/apache/cxf/binding/jbi/spring/JBIBindingInfoConfigBeanDefinitionParser.java ------------------------------------------------------------------------------ svn:keywords = Rev Date Added: cxf/trunk/rt/bindings/jbi/src/main/java/org/apache/cxf/binding/jbi/spring/NamespaceHandler.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/jbi/src/main/java/org/apache/cxf/binding/jbi/spring/NamespaceHandler.java?rev=797883&view=auto ============================================================================== --- cxf/trunk/rt/bindings/jbi/src/main/java/org/apache/cxf/binding/jbi/spring/NamespaceHandler.java (added) +++ cxf/trunk/rt/bindings/jbi/src/main/java/org/apache/cxf/binding/jbi/spring/NamespaceHandler.java Sun Jul 26 09:30:41 2009 @@ -0,0 +1,27 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.cxf.binding.jbi.spring; + +import org.springframework.beans.factory.xml.NamespaceHandlerSupport; + +public class NamespaceHandler extends NamespaceHandlerSupport { + public void init() { + registerBeanDefinitionParser("jbiBinding", new JBIBindingInfoConfigBeanDefinitionParser()); + } +} Propchange: cxf/trunk/rt/bindings/jbi/src/main/java/org/apache/cxf/binding/jbi/spring/NamespaceHandler.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: cxf/trunk/rt/bindings/jbi/src/main/java/org/apache/cxf/binding/jbi/spring/NamespaceHandler.java ------------------------------------------------------------------------------ svn:keywords = Rev Date Added: cxf/trunk/rt/bindings/jbi/src/main/resources/META-INF/spring.handlers URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/jbi/src/main/resources/META-INF/spring.handlers?rev=797883&view=auto ============================================================================== --- cxf/trunk/rt/bindings/jbi/src/main/resources/META-INF/spring.handlers (added) +++ cxf/trunk/rt/bindings/jbi/src/main/resources/META-INF/spring.handlers Sun Jul 26 09:30:41 2009 @@ -0,0 +1,21 @@ +# +# +# 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. +# +# +http\://cxf.apache.org/bindings/jbi=org.apache.cxf.binding.jbi.spring.NamespaceHandler \ No newline at end of file Added: cxf/trunk/rt/bindings/jbi/src/main/resources/META-INF/spring.schemas URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/jbi/src/main/resources/META-INF/spring.schemas?rev=797883&view=auto ============================================================================== --- cxf/trunk/rt/bindings/jbi/src/main/resources/META-INF/spring.schemas (added) +++ cxf/trunk/rt/bindings/jbi/src/main/resources/META-INF/spring.schemas Sun Jul 26 09:30:41 2009 @@ -0,0 +1,21 @@ +# +# +# 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. +# +# +http\://cxf.apache.org/schemas/configuration/jbi.xsd=schemas/configuration/jbi.xsd \ No newline at end of file Added: cxf/trunk/rt/bindings/jbi/src/main/resources/schemas/configuration/jbi.xsd URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/jbi/src/main/resources/schemas/configuration/jbi.xsd?rev=797883&view=auto ============================================================================== --- cxf/trunk/rt/bindings/jbi/src/main/resources/schemas/configuration/jbi.xsd (added) +++ cxf/trunk/rt/bindings/jbi/src/main/resources/schemas/configuration/jbi.xsd Sun Jul 26 09:30:41 2009 @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + Propchange: cxf/trunk/rt/bindings/jbi/src/main/resources/schemas/configuration/jbi.xsd ------------------------------------------------------------------------------ svn:eol-style = native Propchange: cxf/trunk/rt/bindings/jbi/src/main/resources/schemas/configuration/jbi.xsd ------------------------------------------------------------------------------ svn:keywords = Rev Date Propchange: cxf/trunk/rt/bindings/jbi/src/main/resources/schemas/configuration/jbi.xsd ------------------------------------------------------------------------------ svn:mime-type = text/xml Added: cxf/trunk/rt/bindings/jbi/src/test/java/org/apache/cxf/binding/jbi/spring/JBIBindingConfigurationInfoTest.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/jbi/src/test/java/org/apache/cxf/binding/jbi/spring/JBIBindingConfigurationInfoTest.java?rev=797883&view=auto ============================================================================== --- cxf/trunk/rt/bindings/jbi/src/test/java/org/apache/cxf/binding/jbi/spring/JBIBindingConfigurationInfoTest.java (added) +++ cxf/trunk/rt/bindings/jbi/src/test/java/org/apache/cxf/binding/jbi/spring/JBIBindingConfigurationInfoTest.java Sun Jul 26 09:30:41 2009 @@ -0,0 +1,39 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.cxf.binding.jbi.spring; + +import org.apache.cxf.binding.jbi.JBIBindingConfiguration; +import org.junit.Assert; +import org.junit.Test; +import org.springframework.context.support.ClassPathXmlApplicationContext; + +public class JBIBindingConfigurationInfoTest extends Assert { + + @Test + public void testConfiguration() { + ClassPathXmlApplicationContext context = + new ClassPathXmlApplicationContext( + new String[] {"/org/apache/cxf/binding/jbi/spring/binding.xml"}); + JBIBindingConfiguration bindingConfiguration = + (JBIBindingConfiguration) context.getBean("myJBIBinding"); + assertNotNull("The configuration should not be null", bindingConfiguration); + assertEquals("The mtom property should be true", bindingConfiguration.isMtomEnabled(), true); + } + +} Propchange: cxf/trunk/rt/bindings/jbi/src/test/java/org/apache/cxf/binding/jbi/spring/JBIBindingConfigurationInfoTest.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: cxf/trunk/rt/bindings/jbi/src/test/java/org/apache/cxf/binding/jbi/spring/JBIBindingConfigurationInfoTest.java ------------------------------------------------------------------------------ svn:keywords = Rev Date Added: cxf/trunk/rt/bindings/jbi/src/test/java/org/apache/cxf/binding/jbi/spring/binding.xml URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/jbi/src/test/java/org/apache/cxf/binding/jbi/spring/binding.xml?rev=797883&view=auto ============================================================================== --- cxf/trunk/rt/bindings/jbi/src/test/java/org/apache/cxf/binding/jbi/spring/binding.xml (added) +++ cxf/trunk/rt/bindings/jbi/src/test/java/org/apache/cxf/binding/jbi/spring/binding.xml Sun Jul 26 09:30:41 2009 @@ -0,0 +1,29 @@ + + + + + + + Propchange: cxf/trunk/rt/bindings/jbi/src/test/java/org/apache/cxf/binding/jbi/spring/binding.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: cxf/trunk/rt/bindings/jbi/src/test/java/org/apache/cxf/binding/jbi/spring/binding.xml ------------------------------------------------------------------------------ svn:keywords = Rev Date Propchange: cxf/trunk/rt/bindings/jbi/src/test/java/org/apache/cxf/binding/jbi/spring/binding.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml