Coverage Report - org.mule.api.transport.ReceiveException
 
Classes in this File Line Coverage Branch Coverage Complexity
ReceiveException
0%
0/12
N/A
1
 
 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.api.transport;
 8  
 
 9  
 import org.mule.api.MuleException;
 10  
 import org.mule.api.endpoint.ImmutableEndpoint;
 11  
 import org.mule.config.i18n.CoreMessages;
 12  
 import org.mule.config.i18n.Message;
 13  
 import org.mule.util.ObjectUtils;
 14  
 
 15  
 /**
 16  
  * <code>ReceiveException</code> is specifically thrown by the Provider receive
 17  
  * method if something fails in the underlying transport
 18  
  */
 19  
 public class ReceiveException extends MuleException
 20  
 {
 21  
     /**
 22  
      * Serial version
 23  
      */
 24  
     private static final long serialVersionUID = 1960304517882133951L;
 25  
 
 26  
     private ImmutableEndpoint endpoint;
 27  
 
 28  
     /**
 29  
      * @param message the exception message
 30  
      */
 31  
     public ReceiveException(Message message, ImmutableEndpoint endpoint, long timeout)
 32  
     {
 33  0
         super(message);
 34  0
         this.endpoint = endpoint;
 35  0
         addInfo("Endpoint", ObjectUtils.toString(this.endpoint, "null"));
 36  0
         addInfo("Timeout", String.valueOf(timeout));
 37  0
     }
 38  
 
 39  
     /**
 40  
      * @param message the exception message
 41  
      * @param cause the exception that cause this exception to be thrown
 42  
      */
 43  
     public ReceiveException(Message message, ImmutableEndpoint endpoint, long timeout, Throwable cause)
 44  
     {
 45  0
         super(message, cause);
 46  0
         this.endpoint = endpoint;
 47  0
         addInfo("Endpoint", ObjectUtils.toString(this.endpoint, "null"));
 48  0
         addInfo("Timeout", String.valueOf(timeout));
 49  0
     }
 50  
 
 51  
     public ReceiveException(ImmutableEndpoint endpoint, long timeout, Throwable cause)
 52  
     {
 53  0
         this(CoreMessages.failedToRecevieWithTimeout(endpoint, timeout),
 54  
             endpoint, timeout, cause);
 55  0
     }
 56  
 }