Skip to content

Commit ce6f562

Browse files
committed
Minor changes, due to code review by Juergen.
1 parent dbd9128 commit ce6f562

File tree

6 files changed

+20
-23
lines changed

6 files changed

+20
-23
lines changed

core/src/main/java/org/springframework/ws/WebServiceMessageFactory.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
public interface WebServiceMessageFactory {
3030

3131
/**
32-
* Creates a new, empty {@link WebServiceMessage}.
32+
* Creates a new, empty <code>WebServiceMessage</code>.
3333
*
3434
* @return the empty message
3535
*/
@@ -38,8 +38,8 @@ public interface WebServiceMessageFactory {
3838
/**
3939
* Reads {@link WebServiceMessage} from the given input stream.
4040
* <p/>
41-
* If the given stream is an instance of {@link org.springframework.ws.transport.TransportOutputStream
42-
* TransportOutputStream}, the headers will be read from the request.
41+
* If the given stream is an instance of {@link org.springframework.ws.transport.TransportInputStream
42+
* TransportInputStream}, the headers will be read from the request.
4343
*
4444
* @param inputStream the inputstream to read the message from
4545
* @return the created message

core/src/main/java/org/springframework/ws/endpoint/TransformerObjectSupport.java

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ public abstract class TransformerObjectSupport {
4242

4343
private static TransformerFactory transformerFactory;
4444

45+
static {
46+
transformerFactory = TransformerFactory.newInstance();
47+
}
48+
4549
/**
4650
* Creates a new <code>Transformer</code>. Must be called per request, as transformer is not thread-safe.
4751
*
@@ -50,23 +54,7 @@ public abstract class TransformerObjectSupport {
5054
* if thrown by JAXP methods
5155
*/
5256
protected final Transformer createTransformer() throws TransformerConfigurationException {
53-
if (transformerFactory == null) {
54-
transformerFactory = createTransformerFactory();
55-
}
5657
return transformerFactory.newTransformer();
5758
}
5859

59-
/**
60-
* Create a <code>TransformerFactory</code> that this endpoint will use to create <code>Transformer</code>s. Can be
61-
* overridden in subclasses, adding further initialization of the factory. The resulting
62-
* <code>TransformerFactory</code> is cached, so this method will only be called once.
63-
*
64-
* @return the created <code>TransformerFactory</code>
65-
* @throws TransformerFactoryConfigurationError
66-
* if thrown by JAXP methods
67-
*/
68-
protected TransformerFactory createTransformerFactory() throws TransformerFactoryConfigurationError {
69-
return TransformerFactory.newInstance();
70-
}
71-
7260
}

core/src/main/java/org/springframework/ws/transport/TransportContextHolder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
*/
2525
public abstract class TransportContextHolder {
2626

27-
private static final ThreadLocal transportContextHolder = new InheritableThreadLocal();
27+
private static final ThreadLocal transportContextHolder = new ThreadLocal();
2828

2929
/**
3030
* Associate the given <code>TransportContext</code> with the current thread.

sandbox/pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
<groupId>org.springframework.ws</groupId>
1616
<artifactId>spring-ws-core</artifactId>
1717
</dependency>
18+
<dependency>
19+
<groupId>org.springframework.ws</groupId>
20+
<artifactId>spring-oxm</artifactId>
21+
</dependency>
1822
<!-- Spring dependencies -->
1923
<dependency>
2024
<groupId>org.springframework</groupId>

sandbox/src/main/java/org/springframework/ws/transport/http/SimpleHttpWebServiceMessageSender.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,15 @@
2020
import org.springframework.ws.transport.WebServiceMessageSender;
2121

2222
/**
23+
* <code>WebServiceMessageSender</code> implementation that uses standard J2SE facilities to execute POST requests,
24+
* without support for HTTP authentication or advanced configuration options.
25+
*
2326
* @author Arjen Poutsma
2427
*/
2528
public class SimpleHttpWebServiceMessageSender implements WebServiceMessageSender {
2629

27-
public final WebServiceMessage send(WebServiceMessage message) {
30+
public WebServiceMessage send(WebServiceMessage message) {
31+
2832
//TODO implement
2933
throw new UnsupportedOperationException("Not implemented");
3034
}

sandbox/src/main/java/org/springframework/ws/transport/jms/JmsTransportMessageListener.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
* @author Arjen Poutsma
4343
*/
4444
public class JmsTransportMessageListener implements MessageListener, InitializingBean {
45+
// TODO: implemement SessionAwareMessageListener
4546

4647
private static final Log logger = LogFactory.getLog(JmsTransportMessageListener.class);
4748

@@ -65,10 +66,10 @@ public void onMessage(Message message) {
6566
handleTextMessage(textMessage);
6667
}
6768
catch (IOException ex) {
68-
throw new JmsTransportException("Could not create message: " + ex.getMessage(), ex);
69+
logger.error("Could not create message: " + ex.getMessage(), ex);
6970
}
7071
catch (Exception ex) {
71-
throw new JmsTransportException("Could not handle message: " + ex.getMessage(), ex);
72+
logger.error("Could not handle message: " + ex.getMessage(), ex);
7273
}
7374
}
7475
else {

0 commit comments

Comments
 (0)