1 18 package org.apache.activemq; 19 20 import java.io.IOException ; 21 22 import javax.jms.JMSException ; 23 24 30 public class ConnectionFailedException extends JMSException { 31 32 private static final long serialVersionUID = 2288453203492073973L; 33 34 public ConnectionFailedException(IOException cause) { 35 super("The JMS connection has failed: "+extractMessage(cause)); 36 initCause(cause); 37 setLinkedException(cause); 38 } 39 40 public ConnectionFailedException() { 41 super("The JMS connection has failed due to a Transport problem"); 42 } 43 44 static private String extractMessage(IOException cause) { 45 String m = cause.getMessage(); 46 if( m==null || m.length()==0 ) 47 m = cause.toString(); 48 return m; 49 } 50 51 } 52 | Popular Tags |