Author: alessio.soldano(a)jboss.com
Date: 2010-10-04 06:24:07 -0400 (Mon, 04 Oct 2010)
New Revision: 13052
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/saaj/SOAPConnectionImpl.java
Log:
[JBWS-3084] Fixing implementation of close() method on added SOAPConnection impl
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/saaj/SOAPConnectionImpl.java
===================================================================
---
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/saaj/SOAPConnectionImpl.java 2010-10-01
14:07:20 UTC (rev 13051)
+++
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/saaj/SOAPConnectionImpl.java 2010-10-04
10:24:07 UTC (rev 13052)
@@ -55,11 +55,16 @@
public class SOAPConnectionImpl extends SOAPConnection
{
+ private boolean closed = false;
@SuppressWarnings("unchecked")
@Override
public SOAPMessage call(SOAPMessage msgOut, Object addressObject) throws
SOAPException
{
+ if (closed) {
+ throw new SOAPException("Cannot send messages using a previously closed
connection!");
+ }
+
String address = getAddress(addressObject);
ConduitInitiator ci = getConduitInitiator(address);
@@ -175,7 +180,11 @@
@Override
public void close() throws SOAPException
{
- // complete
+ if (this.closed)
+ {
+ throw new SOAPException("Connection already closed!");
+ }
+ this.closed = true;
}
private String getAddress(Object addressObject) throws SOAPException
Show replies by date