All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.exacttarget.fuelsdk.ClearAttachmentsOutInterceptor Maven / Gradle / Ivy

There is a newer version: 1.6.0
Show newest version
package com.exacttarget.fuelsdk;

import org.apache.cxf.attachment.AttachmentSerializer;
import org.apache.cxf.binding.soap.SoapMessage;
import org.apache.cxf.binding.soap.interceptor.AbstractSoapInterceptor;
import org.apache.cxf.interceptor.Fault;
import org.apache.cxf.phase.Phase;

/**
 * This interceptor clears {@link AttachmentSerializer} reference
 * to ease garbage collection.
 */
public class ClearAttachmentsOutInterceptor extends AbstractSoapInterceptor {
    /** 
    * Class constructor.
    */
    public ClearAttachmentsOutInterceptor() {
        super(Phase.SETUP_ENDING);
    }

    /** 
    * @param message     The SOAP message to handle.
    */
    public void handleMessage(SoapMessage message) throws Fault {
        message.getExchange()
               .getOutMessage()
               .setContent(org.apache.cxf.attachment.AttachmentSerializer.class, null);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy