This commit is contained in:
Arjen Poutsma
2008-02-19 12:32:38 +00:00
parent bfe9a255e0
commit 9cd5b19b8b
2 changed files with 13 additions and 1 deletions

View File

@@ -16,6 +16,7 @@
package org.springframework.ws.transport.context;
import org.springframework.util.Assert;
import org.springframework.ws.transport.WebServiceConnection;
/**
@@ -30,6 +31,7 @@ public class DefaultTransportContext implements TransportContext {
/** Creates a new <code>DefaultTransportContext</code> that exposes the given connection. */
public DefaultTransportContext(WebServiceConnection connection) {
Assert.notNull(connection, "'connection' must not be null");
this.connection = connection;
}
@@ -37,4 +39,7 @@ public class DefaultTransportContext implements TransportContext {
return connection;
}
public String toString() {
return connection.toString();
}
}

View File

@@ -25,7 +25,7 @@ package org.springframework.ws.transport.context;
*/
public abstract class TransportContextHolder {
private static final ThreadLocal transportContextHolder = new ThreadLocal();
private static final ThreadLocal transportContextHolder = new TransportThreadLocal();
/**
* Associate the given <code>TransportContext</code> with the current thread.
@@ -44,4 +44,11 @@ public abstract class TransportContextHolder {
public static TransportContext getTransportContext() {
return (TransportContext) transportContextHolder.get();
}
private static class TransportThreadLocal extends ThreadLocal {
public String toString() {
return "Transport State";
}
}
}