Made TransportException a subclass of IOException

This commit is contained in:
Arjen Poutsma
2007-01-10 11:16:48 +00:00
parent e667b6c957
commit 02a9c4b907
6 changed files with 55 additions and 21 deletions

View File

@@ -0,0 +1,39 @@
/*
* Copyright 2007 the original author or authors.
*
* Licensed 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.springframework.ws.transport.jms;
import javax.jms.JMSException;
import org.springframework.ws.transport.TransportException;
/**
* @author Arjen Poutsma
*/
public class JmsTransportException extends TransportException {
public JmsTransportException(String msg) {
super(msg);
}
public JmsTransportException(String msg, JMSException ex) {
super(msg + ": " + ex.getMessage());
}
public JmsTransportException(JMSException ex) {
super(ex.getMessage());
}
}

View File

@@ -66,7 +66,7 @@ public class JmsTransportInputStream extends TransportInputStream {
return new EnumerationIterator(message.getPropertyNames());
}
catch (JMSException ex) {
throw new IOException("Could not get property names: " + ex.getMessage());
throw new JmsTransportException("Could not get property names", ex);
}
}
@@ -76,7 +76,7 @@ public class JmsTransportInputStream extends TransportInputStream {
return Collections.singletonList(value).iterator();
}
catch (JMSException ex) {
throw new IOException("Could not get property value: " + ex.getMessage());
throw new JmsTransportException("Could not get property value", ex);
}
}
@@ -90,7 +90,7 @@ public class JmsTransportInputStream extends TransportInputStream {
return message.readBytes(b);
}
catch (JMSException ex) {
throw new IOException(ex.getMessage());
throw new JmsTransportException(ex);
}
}
@@ -100,7 +100,7 @@ public class JmsTransportInputStream extends TransportInputStream {
return message.readBytes(b, len);
}
catch (JMSException ex) {
throw new IOException(ex.getMessage());
throw new JmsTransportException(ex);
}
}
else {
@@ -116,7 +116,7 @@ public class JmsTransportInputStream extends TransportInputStream {
return -1;
}
catch (JMSException ex) {
throw new IOException(ex.getMessage());
throw new JmsTransportException(ex);
}
}
}

View File

@@ -84,7 +84,7 @@ public class JmsTransportOutputStream extends TransportOutputStream {
}
}
catch (JMSException ex) {
throw new IOException("Could not create message: " + ex.getMessage());
throw new JmsTransportException("Could not create message", ex);
}
}
return message;
@@ -99,7 +99,7 @@ public class JmsTransportOutputStream extends TransportOutputStream {
getMessage().setStringProperty(name, value);
}
catch (JMSException ex) {
throw new IOException("Could not set property " + ex.getMessage());
throw new JmsTransportException("Could not set property", ex);
}
}
@@ -113,7 +113,7 @@ public class JmsTransportOutputStream extends TransportOutputStream {
getMessage().writeBytes(b);
}
catch (JMSException ex) {
throw new IOException(ex.getMessage());
throw new JmsTransportException(ex);
}
}
@@ -122,7 +122,7 @@ public class JmsTransportOutputStream extends TransportOutputStream {
getMessage().writeBytes(b, off, len);
}
catch (JMSException ex) {
throw new IOException(ex.getMessage());
throw new JmsTransportException(ex);
}
}
@@ -131,7 +131,7 @@ public class JmsTransportOutputStream extends TransportOutputStream {
getMessage().writeByte((byte) b);
}
catch (JMSException ex) {
throw new IOException(ex.getMessage());
throw new JmsTransportException(ex);
}
}
}