You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by ff...@apache.org on 2008/05/07 10:29:11 UTC
svn commit: r654031 - in /servicemix/smx3/branches/servicemix-3.2: ./
deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/
deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/i...
Author: ffang
Date: Wed May 7 01:29:10 2008
New Revision: 654031
URL: http://svn.apache.org/viewvc?rev=654031&view=rev
Log:
[SM-1336]CXF-SE should convert outbound DataHandlers into JBI Attachments
Added:
servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/interceptors/AttachmentOutInterceptor.java (with props)
Modified:
servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.java
servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/interceptors/JbiOutInterceptor.java
servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/CxfSeEndpoint.java
servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/interceptors/AttachmentInInterceptor.java
servicemix/smx3/branches/servicemix-3.2/pom.xml
Modified: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.java?rev=654031&r1=654030&r2=654031&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.java (original)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.java Wed May 7 01:29:10 2008
@@ -284,6 +284,7 @@
cxfService.getOutInterceptors().add(
new JbiOutWsdl1Interceptor(isUseJBIWrapper()));
+
cxfService.getOutInterceptors().add(new SoapActionOutInterceptor());
cxfService.getOutInterceptors().add(new AttachmentOutInterceptor());
cxfService.getOutInterceptors().add(
Modified: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/interceptors/JbiOutInterceptor.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/interceptors/JbiOutInterceptor.java?rev=654031&r1=654030&r2=654031&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/interceptors/JbiOutInterceptor.java (original)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/interceptors/JbiOutInterceptor.java Wed May 7 01:29:10 2008
@@ -60,6 +60,9 @@
public void handleMessage(Message message) {
MessageExchange me = message.get(MessageExchange.class);
+ if (me == null) {
+ me = message.getContent(MessageExchange.class);
+ }
NormalizedMessage nm = me.getMessage("in");
fromNMSAttachments(message, nm);
fromNMSHeaders(message, nm);
Modified: servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/CxfSeEndpoint.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/CxfSeEndpoint.java?rev=654031&r1=654030&r2=654031&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/CxfSeEndpoint.java (original)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/CxfSeEndpoint.java Wed May 7 01:29:10 2008
@@ -49,6 +49,7 @@
import org.apache.cxf.wsdl11.ServiceWSDLBuilder;
import org.apache.servicemix.common.endpoints.ProviderEndpoint;
import org.apache.servicemix.cxfse.interceptors.AttachmentInInterceptor;
+import org.apache.servicemix.cxfse.interceptors.AttachmentOutInterceptor;
import org.apache.servicemix.cxfse.support.ReflectionUtils;
import org.apache.servicemix.id.IdGenerator;
import org.springframework.util.ReflectionUtils.FieldCallback;
@@ -163,6 +164,7 @@
endpoint.setOutFaultInterceptors(getOutFaultInterceptors());
if (isMtomEnabled()) {
endpoint.getInInterceptors().add(new AttachmentInInterceptor());
+ endpoint.getOutInterceptors().add(new AttachmentOutInterceptor());
}
JaxWsImplementorInfo implInfo = new JaxWsImplementorInfo(getPojo()
.getClass());
@@ -214,6 +216,7 @@
super.start();
address = "jbi://" + ID_GENERATOR.generateSanitizedId();
endpoint.publish(address);
+
setService(endpoint.getServer().getEndpoint().getService().getName());
setEndpoint(endpoint.getServer().getEndpoint().getEndpointInfo()
.getName().getLocalPart());
Modified: servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/interceptors/AttachmentInInterceptor.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/interceptors/AttachmentInInterceptor.java?rev=654031&r1=654030&r2=654031&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/interceptors/AttachmentInInterceptor.java (original)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/interceptors/AttachmentInInterceptor.java Wed May 7 01:29:10 2008
@@ -19,13 +19,12 @@
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
-import java.util.logging.Logger;
import javax.activation.DataHandler;
import javax.jbi.messaging.MessageExchange;
import org.apache.cxf.attachment.AttachmentImpl;
-import org.apache.cxf.common.logging.LogUtils;
+
import org.apache.cxf.message.Attachment;
import org.apache.cxf.message.Message;
import org.apache.cxf.phase.AbstractPhaseInterceptor;
@@ -33,8 +32,7 @@
import org.apache.servicemix.jbi.messaging.NormalizedMessageImpl;
public class AttachmentInInterceptor extends AbstractPhaseInterceptor<Message> {
- private static final Logger LOG = LogUtils.getL7dLogger(AttachmentInInterceptor.class);
-
+
public AttachmentInInterceptor() {
super(Phase.RECEIVE);
@@ -52,7 +50,6 @@
attachmentList.add(new AttachmentImpl(id, dh));
}
- LOG.info("the attachment size is " + attachmentList.size());
message.setAttachments(attachmentList);
}
Added: servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/interceptors/AttachmentOutInterceptor.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/interceptors/AttachmentOutInterceptor.java?rev=654031&view=auto
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/interceptors/AttachmentOutInterceptor.java (added)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/interceptors/AttachmentOutInterceptor.java Wed May 7 01:29:10 2008
@@ -0,0 +1,36 @@
+/*
+ * 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.servicemix.cxfse.interceptors;
+
+import org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor;
+import org.apache.cxf.interceptor.BareOutInterceptor;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.phase.Phase;
+
+public class AttachmentOutInterceptor extends AbstractOutDatabindingInterceptor {
+
+ public AttachmentOutInterceptor() {
+ super(Phase.MARSHAL);
+ addBefore(BareOutInterceptor.class.getName());
+ }
+
+ public void handleMessage(Message message) {
+ message.put(org.apache.cxf.message.Message.MTOM_ENABLED, true);
+ message.put("write.attachments", true);
+ }
+}
+
Propchange: servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/interceptors/AttachmentOutInterceptor.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/interceptors/AttachmentOutInterceptor.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: servicemix/smx3/branches/servicemix-3.2/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/pom.xml?rev=654031&r1=654030&r2=654031&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/pom.xml (original)
+++ servicemix/smx3/branches/servicemix-3.2/pom.xml Wed May 7 01:29:10 2008
@@ -220,7 +220,7 @@
<oro-version>2.0.8</oro-version>
<sitemesh-version>2.2.1</sitemesh-version>
<woden-version>1.0.0M6</woden-version>
- <cxf-version>2.0.6-incubator-SNAPSHOT</cxf-version>
+ <cxf-version>2.0.7-SNAPSHOT</cxf-version>
<jaxb.version>2.0</jaxb.version>
<jaxb.impl.version>2.0.1</jaxb.impl.version>
<derby-version>10.2.2.0</derby-version>