View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.module.cxf.builder;
8   
9   import org.mule.module.cxf.support.StreamClosingInterceptor;
10  
11  import org.apache.cxf.endpoint.Client;
12  
13  /**
14   * An abstract builder for non proxy clients.
15   */
16  public abstract class AbstractClientMessageProcessorBuilder extends AbstractOutboundMessageProcessorBuilder
17  {
18      protected Class<?> serviceClass;
19      
20      @Override
21      protected void configureClient(Client client)
22      {
23          // EE-1806/MULE-4404
24          client.getInInterceptors().add(new StreamClosingInterceptor());
25          client.getInFaultInterceptors().add(new StreamClosingInterceptor());
26      }
27      
28      public void setServiceClass(Class<?> serviceClass)
29      {
30          this.serviceClass = serviceClass;
31      }
32  
33      public Class<?> getServiceClass()
34      {
35          return serviceClass;
36      }
37  }