Minor changes, due to code review by Juergen.
This commit is contained in:
@@ -29,7 +29,7 @@ import java.io.InputStream;
|
||||
public interface WebServiceMessageFactory {
|
||||
|
||||
/**
|
||||
* Creates a new, empty {@link WebServiceMessage}.
|
||||
* Creates a new, empty <code>WebServiceMessage</code>.
|
||||
*
|
||||
* @return the empty message
|
||||
*/
|
||||
@@ -38,8 +38,8 @@ public interface WebServiceMessageFactory {
|
||||
/**
|
||||
* Reads {@link WebServiceMessage} from the given input stream.
|
||||
* <p/>
|
||||
* If the given stream is an instance of {@link org.springframework.ws.transport.TransportOutputStream
|
||||
* TransportOutputStream}, the headers will be read from the request.
|
||||
* If the given stream is an instance of {@link org.springframework.ws.transport.TransportInputStream
|
||||
* TransportInputStream}, the headers will be read from the request.
|
||||
*
|
||||
* @param inputStream the inputstream to read the message from
|
||||
* @return the created message
|
||||
|
||||
@@ -42,6 +42,10 @@ public abstract class TransformerObjectSupport {
|
||||
|
||||
private static TransformerFactory transformerFactory;
|
||||
|
||||
static {
|
||||
transformerFactory = TransformerFactory.newInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new <code>Transformer</code>. Must be called per request, as transformer is not thread-safe.
|
||||
*
|
||||
@@ -50,23 +54,7 @@ public abstract class TransformerObjectSupport {
|
||||
* if thrown by JAXP methods
|
||||
*/
|
||||
protected final Transformer createTransformer() throws TransformerConfigurationException {
|
||||
if (transformerFactory == null) {
|
||||
transformerFactory = createTransformerFactory();
|
||||
}
|
||||
return transformerFactory.newTransformer();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a <code>TransformerFactory</code> that this endpoint will use to create <code>Transformer</code>s. Can be
|
||||
* overridden in subclasses, adding further initialization of the factory. The resulting
|
||||
* <code>TransformerFactory</code> is cached, so this method will only be called once.
|
||||
*
|
||||
* @return the created <code>TransformerFactory</code>
|
||||
* @throws TransformerFactoryConfigurationError
|
||||
* if thrown by JAXP methods
|
||||
*/
|
||||
protected TransformerFactory createTransformerFactory() throws TransformerFactoryConfigurationError {
|
||||
return TransformerFactory.newInstance();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ package org.springframework.ws.transport;
|
||||
*/
|
||||
public abstract class TransportContextHolder {
|
||||
|
||||
private static final ThreadLocal transportContextHolder = new InheritableThreadLocal();
|
||||
private static final ThreadLocal transportContextHolder = new ThreadLocal();
|
||||
|
||||
/**
|
||||
* Associate the given <code>TransportContext</code> with the current thread.
|
||||
|
||||
@@ -15,6 +15,10 @@
|
||||
<groupId>org.springframework.ws</groupId>
|
||||
<artifactId>spring-ws-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.ws</groupId>
|
||||
<artifactId>spring-oxm</artifactId>
|
||||
</dependency>
|
||||
<!-- Spring dependencies -->
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
|
||||
@@ -20,11 +20,15 @@ import org.springframework.ws.WebServiceMessage;
|
||||
import org.springframework.ws.transport.WebServiceMessageSender;
|
||||
|
||||
/**
|
||||
* <code>WebServiceMessageSender</code> implementation that uses standard J2SE facilities to execute POST requests,
|
||||
* without support for HTTP authentication or advanced configuration options.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
*/
|
||||
public class SimpleHttpWebServiceMessageSender implements WebServiceMessageSender {
|
||||
|
||||
public final WebServiceMessage send(WebServiceMessage message) {
|
||||
public WebServiceMessage send(WebServiceMessage message) {
|
||||
|
||||
//TODO implement
|
||||
throw new UnsupportedOperationException("Not implemented");
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@ import org.springframework.ws.transport.TransportOutputStream;
|
||||
* @author Arjen Poutsma
|
||||
*/
|
||||
public class JmsTransportMessageListener implements MessageListener, InitializingBean {
|
||||
// TODO: implemement SessionAwareMessageListener
|
||||
|
||||
private static final Log logger = LogFactory.getLog(JmsTransportMessageListener.class);
|
||||
|
||||
@@ -65,10 +66,10 @@ public class JmsTransportMessageListener implements MessageListener, Initializin
|
||||
handleTextMessage(textMessage);
|
||||
}
|
||||
catch (IOException ex) {
|
||||
throw new JmsTransportException("Could not create message: " + ex.getMessage(), ex);
|
||||
logger.error("Could not create message: " + ex.getMessage(), ex);
|
||||
}
|
||||
catch (Exception ex) {
|
||||
throw new JmsTransportException("Could not handle message: " + ex.getMessage(), ex);
|
||||
logger.error("Could not handle message: " + ex.getMessage(), ex);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user