Enable checkstyle on main sources
Closes gh-1479
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright 2005-2025 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
|
||||
*
|
||||
* https://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.gradle.conventions;
|
||||
|
||||
import io.spring.javaformat.gradle.SpringJavaFormatPlugin;
|
||||
import org.gradle.api.Plugin;
|
||||
import org.gradle.api.Project;
|
||||
import org.gradle.api.artifacts.DependencySet;
|
||||
import org.gradle.api.plugins.JavaPlugin;
|
||||
import org.gradle.api.plugins.quality.Checkstyle;
|
||||
import org.gradle.api.plugins.quality.CheckstyleExtension;
|
||||
import org.gradle.api.plugins.quality.CheckstylePlugin;
|
||||
|
||||
/**
|
||||
* {@link Plugin} that applies conventions for checkstyle.
|
||||
*
|
||||
* @author Brian Clozel
|
||||
* @author Stephane Nicoll
|
||||
*/
|
||||
public class CheckstyleConventions {
|
||||
|
||||
/**
|
||||
* Applies the Spring Java Format and Checkstyle plugins with the project conventions.
|
||||
* @param project the current project
|
||||
*/
|
||||
public void apply(Project project) {
|
||||
project.getPlugins().withType(JavaPlugin.class, (java) -> {
|
||||
project.getPlugins().apply(CheckstylePlugin.class);
|
||||
project.getTasks().withType(Checkstyle.class).forEach(checkstyle -> checkstyle.getMaxHeapSize().set("1g"));
|
||||
project.getTasks().named("checkstyleTest").configure(task -> task.setEnabled(false));
|
||||
CheckstyleExtension checkstyle = project.getExtensions().getByType(CheckstyleExtension.class);
|
||||
checkstyle.setToolVersion("10.21.1");
|
||||
checkstyle.getConfigDirectory().set(project.getRootProject().file("src/checkstyle"));
|
||||
String version = SpringJavaFormatPlugin.class.getPackage().getImplementationVersion();
|
||||
DependencySet checkstyleDependencies = project.getConfigurations()
|
||||
.getByName("checkstyle")
|
||||
.getDependencies();
|
||||
checkstyleDependencies.add(
|
||||
project.getDependencies().create("com.puppycrawl.tools:checkstyle:" + checkstyle.getToolVersion()));
|
||||
checkstyleDependencies
|
||||
.add(project.getDependencies().create("io.spring.javaformat:spring-javaformat-checkstyle:" + version));
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -33,9 +33,10 @@ public class ConventionsPlugin implements Plugin<Project> {
|
||||
@Override
|
||||
public void apply(Project project) {
|
||||
project.setGroup("org.springframework.ws");
|
||||
project.getPlugins()
|
||||
.withType(JavaBasePlugin.class)
|
||||
.all((plugin) -> new JavaBasePluginConventions().apply(project));
|
||||
project.getPlugins().withType(JavaBasePlugin.class).all((plugin) -> {
|
||||
new JavaBasePluginConventions().apply(project);
|
||||
new CheckstyleConventions().apply(project);
|
||||
});
|
||||
project.getPlugins().withType(JavaPlugin.class).all((plugin) -> new JavaPluginConventions().apply(project));
|
||||
project.getPlugins()
|
||||
.withType(MavenPublishPlugin.class)
|
||||
|
||||
@@ -24,8 +24,8 @@ import javax.xml.namespace.QName;
|
||||
* often require different processing rules.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @see org.springframework.ws.soap.SoapMessage
|
||||
* @since 1.0.0
|
||||
* @see org.springframework.ws.soap.SoapMessage
|
||||
*/
|
||||
public interface FaultAwareWebServiceMessage extends WebServiceMessage {
|
||||
|
||||
|
||||
@@ -28,9 +28,9 @@ import javax.xml.transform.Source;
|
||||
* Contains methods that provide access to the payload of the message.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @since 1.0.0
|
||||
* @see org.springframework.ws.soap.SoapMessage
|
||||
* @see WebServiceMessageFactory
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public interface WebServiceMessage {
|
||||
|
||||
|
||||
@@ -26,8 +26,8 @@ import java.io.InputStream;
|
||||
* Allows the creation of empty messages, or messages based on {@code InputStream}s.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @see org.springframework.ws.WebServiceMessage
|
||||
* @since 1.0.0
|
||||
* @see org.springframework.ws.WebServiceMessage
|
||||
*/
|
||||
public interface WebServiceMessageFactory {
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ public class WebServiceFaultException extends WebServiceClientException {
|
||||
/** Create a new instance of the {@code WebServiceFaultException} class. */
|
||||
public WebServiceFaultException(String msg) {
|
||||
super(msg);
|
||||
faultMessage = null;
|
||||
this.faultMessage = null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -46,7 +46,7 @@ public class WebServiceFaultException extends WebServiceClientException {
|
||||
|
||||
/** Returns the fault message. */
|
||||
public FaultAwareWebServiceMessage getWebServiceMessage() {
|
||||
return faultMessage;
|
||||
return this.faultMessage;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -25,8 +25,8 @@ import org.springframework.ws.client.WebServiceFaultException;
|
||||
* fault occurs.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @see WebServiceFaultException
|
||||
* @since 1.0.0
|
||||
* @see WebServiceFaultException
|
||||
*/
|
||||
public class SimpleFaultMessageResolver implements FaultMessageResolver {
|
||||
|
||||
|
||||
@@ -34,9 +34,10 @@ import javax.xml.transform.TransformerException;
|
||||
* Implementations of this interface perform the actual work of extracting results, but
|
||||
* don't need to worry about exception handling, or resource handling.
|
||||
*
|
||||
* @param <T> the type of the source
|
||||
* @author Arjen Poutsma
|
||||
* @see org.springframework.ws.client.core.WebServiceTemplate
|
||||
* @since 1.0.0
|
||||
* @see org.springframework.ws.client.core.WebServiceTemplate
|
||||
*/
|
||||
public interface SourceExtractor<T> {
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@ import org.springframework.ws.WebServiceMessage;
|
||||
* Implementations of this interface perform the actual work of extracting results, but
|
||||
* don't need to worry about exception handling, or resource handling.
|
||||
*
|
||||
* @param <T> the type of the result object
|
||||
* @author Arjen Poutsma
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
@@ -28,8 +28,8 @@ import org.springframework.ws.client.WebServiceClientException;
|
||||
* testability, as it can easily be mocked or stubbed.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @see WebServiceTemplate
|
||||
* @since 1.0.0
|
||||
* @see WebServiceTemplate
|
||||
*/
|
||||
public interface WebServiceOperations {
|
||||
|
||||
|
||||
@@ -206,9 +206,9 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
|
||||
* Returns the default URI to be used on operations that do not have a URI parameter.
|
||||
*/
|
||||
public String getDefaultUri() {
|
||||
if (destinationProvider != null) {
|
||||
URI uri = destinationProvider.getDestination();
|
||||
return uri != null ? uri.toString() : null;
|
||||
if (this.destinationProvider != null) {
|
||||
URI uri = this.destinationProvider.getDestination();
|
||||
return (uri != null) ? uri.toString() : null;
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
@@ -229,7 +229,7 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
|
||||
* @see #sendAndReceive(WebServiceMessageCallback,WebServiceMessageCallback)
|
||||
*/
|
||||
public void setDefaultUri(final String uri) {
|
||||
destinationProvider = new DestinationProvider() {
|
||||
this.destinationProvider = new DestinationProvider() {
|
||||
|
||||
public URI getDestination() {
|
||||
return URI.create(uri);
|
||||
@@ -242,7 +242,7 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
|
||||
* parameter.
|
||||
*/
|
||||
public DestinationProvider getDestinationProvider() {
|
||||
return destinationProvider;
|
||||
return this.destinationProvider;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -265,7 +265,7 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
|
||||
|
||||
/** Returns the marshaller for this template. */
|
||||
public Marshaller getMarshaller() {
|
||||
return marshaller;
|
||||
return this.marshaller;
|
||||
}
|
||||
|
||||
/** Sets the marshaller for this template. */
|
||||
@@ -275,7 +275,7 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
|
||||
|
||||
/** Returns the unmarshaller for this template. */
|
||||
public Unmarshaller getUnmarshaller() {
|
||||
return unmarshaller;
|
||||
return this.unmarshaller;
|
||||
}
|
||||
|
||||
/** Sets the unmarshaller for this template. */
|
||||
@@ -285,7 +285,7 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
|
||||
|
||||
/** Returns the fault message resolver for this template. */
|
||||
public FaultMessageResolver getFaultMessageResolver() {
|
||||
return faultMessageResolver;
|
||||
return this.faultMessageResolver;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -347,7 +347,7 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
|
||||
* @return array of endpoint interceptors, or {@code null} if none
|
||||
*/
|
||||
public ClientInterceptor[] getInterceptors() {
|
||||
return interceptors;
|
||||
return this.interceptors;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -613,10 +613,10 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
|
||||
}
|
||||
// Apply handleRequest of registered interceptors
|
||||
boolean intercepted = false;
|
||||
if (interceptors != null) {
|
||||
for (int i = 0; i < interceptors.length; i++) {
|
||||
if (this.interceptors != null) {
|
||||
for (int i = 0; i < this.interceptors.length; i++) {
|
||||
interceptorIndex = i;
|
||||
if (!interceptors[i].handleRequest(messageContext)) {
|
||||
if (!this.interceptors[i].handleRequest(messageContext)) {
|
||||
intercepted = true;
|
||||
break;
|
||||
}
|
||||
@@ -687,9 +687,9 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
|
||||
* @throws IOException in case of I/O errors
|
||||
*/
|
||||
protected boolean hasError(WebServiceConnection connection, WebServiceMessage request) throws IOException {
|
||||
if (checkConnectionForError && connection.hasError()) {
|
||||
if (this.checkConnectionForError && connection.hasError()) {
|
||||
// could be a fault
|
||||
if (checkConnectionForFault && connection instanceof FaultAwareWebServiceConnection faultConnection) {
|
||||
if (this.checkConnectionForFault && connection instanceof FaultAwareWebServiceConnection faultConnection) {
|
||||
return !(faultConnection.hasFault() && request instanceof FaultAwareWebServiceMessage);
|
||||
}
|
||||
else {
|
||||
@@ -709,8 +709,8 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
|
||||
* if any
|
||||
*/
|
||||
protected Object handleError(WebServiceConnection connection, WebServiceMessage request) throws IOException {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Received error for request [" + request + "]");
|
||||
if (this.logger.isDebugEnabled()) {
|
||||
this.logger.debug("Received error for request [" + request + "]");
|
||||
}
|
||||
throw new WebServiceTransportException(connection.getErrorMessage());
|
||||
}
|
||||
@@ -754,7 +754,7 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
|
||||
* @throws IOException in case of I/O errors
|
||||
*/
|
||||
protected boolean hasFault(WebServiceConnection connection, WebServiceMessage response) throws IOException {
|
||||
if (checkConnectionForFault && connection instanceof FaultAwareWebServiceConnection faultConnection) {
|
||||
if (this.checkConnectionForFault && connection instanceof FaultAwareWebServiceConnection faultConnection) {
|
||||
// check whether the connection has a fault (i.e. status code 500 in HTTP)
|
||||
if (!faultConnection.hasFault()) {
|
||||
return false;
|
||||
@@ -778,9 +778,9 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
|
||||
* @see ClientInterceptor#handleFault(MessageContext)
|
||||
*/
|
||||
private void triggerHandleResponse(int interceptorIndex, MessageContext messageContext) {
|
||||
if (messageContext.hasResponse() && interceptors != null) {
|
||||
if (messageContext.hasResponse() && this.interceptors != null) {
|
||||
for (int i = interceptorIndex; i >= 0; i--) {
|
||||
if (!interceptors[i].handleResponse(messageContext)) {
|
||||
if (!this.interceptors[i].handleResponse(messageContext)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -797,9 +797,9 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
|
||||
* @see ClientInterceptor#handleFault(MessageContext)
|
||||
*/
|
||||
private void triggerHandleFault(int interceptorIndex, MessageContext messageContext) {
|
||||
if (messageContext.hasResponse() && interceptors != null) {
|
||||
if (messageContext.hasResponse() && this.interceptors != null) {
|
||||
for (int i = interceptorIndex; i >= 0; i--) {
|
||||
if (!interceptors[i].handleFault(messageContext)) {
|
||||
if (!this.interceptors[i].handleFault(messageContext)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -813,14 +813,14 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
|
||||
* returned {@code false}.
|
||||
* @param interceptorIndex index of last interceptor that successfully completed
|
||||
* @param messageContext the message context
|
||||
* @param ex Exception thrown on handler execution, or {@code null} if none
|
||||
* @param ex exception thrown on handler execution, or {@code null} if none
|
||||
* @see ClientInterceptor#afterCompletion
|
||||
*/
|
||||
private void triggerAfterCompletion(int interceptorIndex, MessageContext messageContext, Exception ex)
|
||||
throws WebServiceClientException {
|
||||
if (interceptors != null) {
|
||||
if (this.interceptors != null) {
|
||||
for (int i = interceptorIndex; i >= 0; i--) {
|
||||
interceptors[i].afterCompletion(messageContext, ex);
|
||||
this.interceptors[i].afterCompletion(messageContext, ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -836,8 +836,8 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
|
||||
* if any
|
||||
*/
|
||||
protected Object handleFault(WebServiceConnection connection, MessageContext messageContext) throws IOException {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Received Fault message for request [" + messageContext.getRequest() + "]");
|
||||
if (this.logger.isDebugEnabled()) {
|
||||
this.logger.debug("Received Fault message for request [" + messageContext.getRequest() + "]");
|
||||
}
|
||||
if (getFaultMessageResolver() != null) {
|
||||
getFaultMessageResolver().resolveFault(messageContext.getResponse());
|
||||
@@ -852,7 +852,8 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
|
||||
* Adapter to enable use of a WebServiceMessageCallback inside a
|
||||
* WebServiceMessageExtractor.
|
||||
*/
|
||||
private static class WebServiceMessageCallbackMessageExtractor implements WebServiceMessageExtractor<Boolean> {
|
||||
private static final class WebServiceMessageCallbackMessageExtractor
|
||||
implements WebServiceMessageExtractor<Boolean> {
|
||||
|
||||
private final WebServiceMessageCallback callback;
|
||||
|
||||
@@ -862,14 +863,14 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
|
||||
|
||||
@Override
|
||||
public Boolean extractData(WebServiceMessage message) throws IOException, TransformerException {
|
||||
callback.doWithMessage(message);
|
||||
this.callback.doWithMessage(message);
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/** Adapter to enable use of a SourceExtractor inside a WebServiceMessageExtractor. */
|
||||
private static class SourceExtractorMessageExtractor<T> implements WebServiceMessageExtractor<T> {
|
||||
private static final class SourceExtractorMessageExtractor<T> implements WebServiceMessageExtractor<T> {
|
||||
|
||||
private final SourceExtractor<T> sourceExtractor;
|
||||
|
||||
@@ -879,7 +880,7 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
|
||||
|
||||
@Override
|
||||
public T extractData(WebServiceMessage message) throws IOException, TransformerException {
|
||||
return sourceExtractor.extractData(message.getPayloadSource());
|
||||
return this.sourceExtractor.extractData(message.getPayloadSource());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -50,10 +50,10 @@ import org.springframework.ws.transport.WebServiceMessageSender;
|
||||
* directly.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @since 1.0.0
|
||||
* @see #setMessageFactory(WebServiceMessageFactory)
|
||||
* @see WebServiceTemplate
|
||||
* @see #setMarshaller(Marshaller)
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public abstract class WebServiceGatewaySupport implements InitializingBean {
|
||||
|
||||
@@ -67,7 +67,7 @@ public abstract class WebServiceGatewaySupport implements InitializingBean {
|
||||
* default {@code WebServiceTemplate}.
|
||||
*/
|
||||
protected WebServiceGatewaySupport() {
|
||||
webServiceTemplate = new WebServiceTemplate();
|
||||
this.webServiceTemplate = new WebServiceTemplate();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -76,57 +76,57 @@ public abstract class WebServiceGatewaySupport implements InitializingBean {
|
||||
* @param messageFactory the message factory to use
|
||||
*/
|
||||
protected WebServiceGatewaySupport(WebServiceMessageFactory messageFactory) {
|
||||
webServiceTemplate = new WebServiceTemplate(messageFactory);
|
||||
this.webServiceTemplate = new WebServiceTemplate(messageFactory);
|
||||
}
|
||||
|
||||
/** Returns the {@code WebServiceMessageFactory} used by the gateway. */
|
||||
public final WebServiceMessageFactory getMessageFactory() {
|
||||
return webServiceTemplate.getMessageFactory();
|
||||
return this.webServiceTemplate.getMessageFactory();
|
||||
}
|
||||
|
||||
/** Set the {@code WebServiceMessageFactory} to be used by the gateway. */
|
||||
public final void setMessageFactory(WebServiceMessageFactory messageFactory) {
|
||||
webServiceTemplate.setMessageFactory(messageFactory);
|
||||
this.webServiceTemplate.setMessageFactory(messageFactory);
|
||||
}
|
||||
|
||||
/** Returns the default URI used by the gateway. */
|
||||
public final String getDefaultUri() {
|
||||
return webServiceTemplate.getDefaultUri();
|
||||
return this.webServiceTemplate.getDefaultUri();
|
||||
}
|
||||
|
||||
/** Sets the default URI used by the gateway. */
|
||||
public final void setDefaultUri(String uri) {
|
||||
webServiceTemplate.setDefaultUri(uri);
|
||||
this.webServiceTemplate.setDefaultUri(uri);
|
||||
}
|
||||
|
||||
/** Returns the destination provider used by the gateway. */
|
||||
public final DestinationProvider getDestinationProvider() {
|
||||
return webServiceTemplate.getDestinationProvider();
|
||||
return this.webServiceTemplate.getDestinationProvider();
|
||||
}
|
||||
|
||||
/** Set the destination provider URI used by the gateway. */
|
||||
public final void setDestinationProvider(DestinationProvider destinationProvider) {
|
||||
webServiceTemplate.setDestinationProvider(destinationProvider);
|
||||
this.webServiceTemplate.setDestinationProvider(destinationProvider);
|
||||
}
|
||||
|
||||
/** Sets a single {@code WebServiceMessageSender} to be used by the gateway. */
|
||||
public final void setMessageSender(WebServiceMessageSender messageSender) {
|
||||
webServiceTemplate.setMessageSender(messageSender);
|
||||
this.webServiceTemplate.setMessageSender(messageSender);
|
||||
}
|
||||
|
||||
/** Returns the {@code WebServiceMessageSender}s used by the gateway. */
|
||||
public final WebServiceMessageSender[] getMessageSenders() {
|
||||
return webServiceTemplate.getMessageSenders();
|
||||
return this.webServiceTemplate.getMessageSenders();
|
||||
}
|
||||
|
||||
/** Sets multiple {@code WebServiceMessageSender} to be used by the gateway. */
|
||||
public final void setMessageSenders(WebServiceMessageSender[] messageSenders) {
|
||||
webServiceTemplate.setMessageSenders(messageSenders);
|
||||
this.webServiceTemplate.setMessageSenders(messageSenders);
|
||||
}
|
||||
|
||||
/** Returns the {@code WebServiceTemplate} for the gateway. */
|
||||
public final WebServiceTemplate getWebServiceTemplate() {
|
||||
return webServiceTemplate;
|
||||
return this.webServiceTemplate;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -146,7 +146,7 @@ public abstract class WebServiceGatewaySupport implements InitializingBean {
|
||||
|
||||
/** Returns the {@code Marshaller} used by the gateway. */
|
||||
public final Marshaller getMarshaller() {
|
||||
return webServiceTemplate.getMarshaller();
|
||||
return this.webServiceTemplate.getMarshaller();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -156,12 +156,12 @@ public abstract class WebServiceGatewaySupport implements InitializingBean {
|
||||
* @see WebServiceTemplate#marshalSendAndReceive
|
||||
*/
|
||||
public final void setMarshaller(Marshaller marshaller) {
|
||||
webServiceTemplate.setMarshaller(marshaller);
|
||||
this.webServiceTemplate.setMarshaller(marshaller);
|
||||
}
|
||||
|
||||
/** Returns the {@code Unmarshaller} used by the gateway. */
|
||||
public final Unmarshaller getUnmarshaller() {
|
||||
return webServiceTemplate.getUnmarshaller();
|
||||
return this.webServiceTemplate.getUnmarshaller();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -171,22 +171,22 @@ public abstract class WebServiceGatewaySupport implements InitializingBean {
|
||||
* @see WebServiceTemplate#marshalSendAndReceive
|
||||
*/
|
||||
public final void setUnmarshaller(Unmarshaller unmarshaller) {
|
||||
webServiceTemplate.setUnmarshaller(unmarshaller);
|
||||
this.webServiceTemplate.setUnmarshaller(unmarshaller);
|
||||
}
|
||||
|
||||
/** Returns the {@code ClientInterceptors} used by the template. */
|
||||
public final ClientInterceptor[] getInterceptors() {
|
||||
return webServiceTemplate.getInterceptors();
|
||||
return this.webServiceTemplate.getInterceptors();
|
||||
}
|
||||
|
||||
/** Sets the {@code ClientInterceptors} used by the gateway. */
|
||||
public final void setInterceptors(ClientInterceptor[] interceptors) {
|
||||
webServiceTemplate.setInterceptors(interceptors);
|
||||
this.webServiceTemplate.setInterceptors(interceptors);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void afterPropertiesSet() throws Exception {
|
||||
webServiceTemplate.afterPropertiesSet();
|
||||
this.webServiceTemplate.afterPropertiesSet();
|
||||
initGateway();
|
||||
}
|
||||
|
||||
|
||||
@@ -36,8 +36,8 @@ import org.springframework.xml.transform.TransformerObjectSupport;
|
||||
* {@link org.springframework.ws.client.core.WebServiceTemplate}.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @see org.springframework.ws.client.core.WebServiceTemplate
|
||||
* @since 1.0.0
|
||||
* @see org.springframework.ws.client.core.WebServiceTemplate
|
||||
*/
|
||||
public abstract class WebServiceAccessor extends TransformerObjectSupport implements InitializingBean {
|
||||
|
||||
@@ -47,7 +47,7 @@ public abstract class WebServiceAccessor extends TransformerObjectSupport implem
|
||||
|
||||
/** Returns the message factory used for creating messages. */
|
||||
public WebServiceMessageFactory getMessageFactory() {
|
||||
return messageFactory;
|
||||
return this.messageFactory;
|
||||
}
|
||||
|
||||
/** Sets the message factory used for creating messages. */
|
||||
@@ -57,7 +57,7 @@ public abstract class WebServiceAccessor extends TransformerObjectSupport implem
|
||||
|
||||
/** Returns the message senders used for sending messages. */
|
||||
public WebServiceMessageSender[] getMessageSenders() {
|
||||
return messageSenders;
|
||||
return this.messageSenders;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -69,7 +69,7 @@ public abstract class WebServiceAccessor extends TransformerObjectSupport implem
|
||||
*/
|
||||
public void setMessageSender(WebServiceMessageSender messageSender) {
|
||||
Assert.notNull(messageSender, "'messageSender' must not be null");
|
||||
messageSenders = new WebServiceMessageSender[] { messageSender };
|
||||
this.messageSenders = new WebServiceMessageSender[] { messageSender };
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -109,11 +109,11 @@ public abstract class WebServiceAccessor extends TransformerObjectSupport implem
|
||||
for (WebServiceMessageSender messageSender : messageSenders) {
|
||||
if (messageSender.supports(uri)) {
|
||||
WebServiceConnection connection = messageSender.createConnection(uri);
|
||||
if (logger.isDebugEnabled()) {
|
||||
if (this.logger.isDebugEnabled()) {
|
||||
try {
|
||||
logger.debug("Opening [" + connection + "] to [" + connection.getUri() + "]");
|
||||
this.logger.debug("Opening [" + connection + "] to [" + connection.getUri() + "]");
|
||||
}
|
||||
catch (URISyntaxException e) {
|
||||
catch (URISyntaxException ex) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,11 +51,11 @@ public abstract class AbstractCachingDestinationProvider implements DestinationP
|
||||
|
||||
@Override
|
||||
public final URI getDestination() {
|
||||
if (cache) {
|
||||
if (cachedUri == null) {
|
||||
cachedUri = lookupDestination();
|
||||
if (this.cache) {
|
||||
if (this.cachedUri == null) {
|
||||
this.cachedUri = lookupDestination();
|
||||
}
|
||||
return cachedUri;
|
||||
return this.cachedUri;
|
||||
}
|
||||
else {
|
||||
return lookupDestination();
|
||||
|
||||
@@ -27,8 +27,8 @@ import java.net.URI;
|
||||
* to determine the destination URI.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @see org.springframework.ws.client.core.WebServiceTemplate#setDestinationProvider(DestinationProvider)
|
||||
* @since 1.5.4
|
||||
* @see org.springframework.ws.client.core.WebServiceTemplate#setDestinationProvider(DestinationProvider)
|
||||
*/
|
||||
public interface DestinationProvider {
|
||||
|
||||
|
||||
@@ -67,12 +67,12 @@ public class Wsdl11DestinationProvider extends AbstractCachingDestinationProvide
|
||||
private Resource wsdlResource;
|
||||
|
||||
public Wsdl11DestinationProvider() {
|
||||
expressionNamespaces.put("wsdl", "http://schemas.xmlsoap.org/wsdl/");
|
||||
expressionNamespaces.put("soap", "http://schemas.xmlsoap.org/wsdl/soap/");
|
||||
expressionNamespaces.put("soap12", "http://schemas.xmlsoap.org/wsdl/soap12/");
|
||||
this.expressionNamespaces.put("wsdl", "http://schemas.xmlsoap.org/wsdl/");
|
||||
this.expressionNamespaces.put("soap", "http://schemas.xmlsoap.org/wsdl/soap/");
|
||||
this.expressionNamespaces.put("soap12", "http://schemas.xmlsoap.org/wsdl/soap12/");
|
||||
|
||||
locationXPathExpression = XPathExpressionFactory.createXPathExpression(DEFAULT_WSDL_LOCATION_EXPRESSION,
|
||||
expressionNamespaces);
|
||||
this.locationXPathExpression = XPathExpressionFactory.createXPathExpression(DEFAULT_WSDL_LOCATION_EXPRESSION,
|
||||
this.expressionNamespaces);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -115,7 +115,8 @@ public class Wsdl11DestinationProvider extends AbstractCachingDestinationProvide
|
||||
*/
|
||||
public void setLocationExpression(String expression) {
|
||||
Assert.hasText(expression, "'expression' must not be empty");
|
||||
locationXPathExpression = XPathExpressionFactory.createXPathExpression(expression, expressionNamespaces);
|
||||
this.locationXPathExpression = XPathExpressionFactory.createXPathExpression(expression,
|
||||
this.expressionNamespaces);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -123,19 +124,20 @@ public class Wsdl11DestinationProvider extends AbstractCachingDestinationProvide
|
||||
try {
|
||||
DOMResult result = new DOMResult();
|
||||
Transformer transformer = transformerFactory.newTransformer();
|
||||
transformer.transform(new ResourceSource(wsdlResource), result);
|
||||
transformer.transform(new ResourceSource(this.wsdlResource), result);
|
||||
Document definitionDocument = (Document) result.getNode();
|
||||
String location = locationXPathExpression.evaluateAsString(definitionDocument);
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Found location [" + location + "] in " + wsdlResource);
|
||||
String location = this.locationXPathExpression.evaluateAsString(definitionDocument);
|
||||
if (this.logger.isDebugEnabled()) {
|
||||
this.logger.debug("Found location [" + location + "] in " + this.wsdlResource);
|
||||
}
|
||||
return location != null ? URI.create(location) : null;
|
||||
return (location != null) ? URI.create(location) : null;
|
||||
}
|
||||
catch (IOException ex) {
|
||||
throw new WebServiceIOException("Error extracting location from WSDL [" + wsdlResource + "]", ex);
|
||||
throw new WebServiceIOException("Error extracting location from WSDL [" + this.wsdlResource + "]", ex);
|
||||
}
|
||||
catch (TransformerException ex) {
|
||||
throw new WebServiceTransformerException("Error extracting location from WSDL [" + wsdlResource + "]", ex);
|
||||
throw new WebServiceTransformerException("Error extracting location from WSDL [" + this.wsdlResource + "]",
|
||||
ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -47,9 +47,9 @@ import org.springframework.xml.xsd.XsdSchemaCollection;
|
||||
* using the {@code validateRequest} and {@code validateResponse} properties.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @since 1.5.4
|
||||
* @see #getValidationRequestSource(WebServiceMessage)
|
||||
* @see #getValidationResponseSource(WebServiceMessage)
|
||||
* @since 1.5.4
|
||||
*/
|
||||
public abstract class AbstractValidatingInterceptor extends TransformerObjectSupport
|
||||
implements ClientInterceptor, InitializingBean {
|
||||
@@ -65,7 +65,7 @@ public abstract class AbstractValidatingInterceptor extends TransformerObjectSup
|
||||
private XmlValidator validator;
|
||||
|
||||
public String getSchemaLanguage() {
|
||||
return schemaLanguage;
|
||||
return this.schemaLanguage;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -82,7 +82,7 @@ public abstract class AbstractValidatingInterceptor extends TransformerObjectSup
|
||||
* Returns the schema resources to use for validation.
|
||||
*/
|
||||
public Resource[] getSchemas() {
|
||||
return schemas;
|
||||
return this.schemas;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -151,17 +151,18 @@ public abstract class AbstractValidatingInterceptor extends TransformerObjectSup
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() throws Exception {
|
||||
if (validator == null && !ObjectUtils.isEmpty(schemas)) {
|
||||
Assert.hasLength(schemaLanguage, "schemaLanguage is required");
|
||||
for (Resource schema : schemas) {
|
||||
if (this.validator == null && !ObjectUtils.isEmpty(this.schemas)) {
|
||||
Assert.hasLength(this.schemaLanguage, "schemaLanguage is required");
|
||||
for (Resource schema : this.schemas) {
|
||||
Assert.isTrue(schema.exists(), "schema [" + schema + "] does not exist");
|
||||
}
|
||||
if (logger.isInfoEnabled()) {
|
||||
logger.info("Validating using " + StringUtils.arrayToCommaDelimitedString(schemas));
|
||||
if (this.logger.isInfoEnabled()) {
|
||||
this.logger.info("Validating using " + StringUtils.arrayToCommaDelimitedString(this.schemas));
|
||||
}
|
||||
validator = XmlValidatorFactory.createValidator(schemas, schemaLanguage);
|
||||
this.validator = XmlValidatorFactory.createValidator(this.schemas, this.schemaLanguage);
|
||||
}
|
||||
Assert.notNull(validator, "Setting 'schema', 'schemas', 'xsdSchema', or 'xsdSchemaCollection' is required");
|
||||
Assert.notNull(this.validator,
|
||||
"Setting 'schema', 'schemas', 'xsdSchema', or 'xsdSchemaCollection' is required");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -176,21 +177,21 @@ public abstract class AbstractValidatingInterceptor extends TransformerObjectSup
|
||||
*/
|
||||
@Override
|
||||
public boolean handleRequest(MessageContext messageContext) throws WebServiceClientException {
|
||||
if (validateRequest) {
|
||||
if (this.validateRequest) {
|
||||
Source requestSource = getValidationRequestSource(messageContext.getRequest());
|
||||
if (requestSource != null) {
|
||||
SAXParseException[] errors;
|
||||
try {
|
||||
errors = validator.validate(requestSource);
|
||||
errors = this.validator.validate(requestSource);
|
||||
}
|
||||
catch (IOException e) {
|
||||
throw new WebServiceIOException("Could not validate response: " + e.getMessage(), e);
|
||||
catch (IOException ex) {
|
||||
throw new WebServiceIOException("Could not validate response: " + ex.getMessage(), ex);
|
||||
}
|
||||
if (!ObjectUtils.isEmpty(errors)) {
|
||||
return handleRequestValidationErrors(messageContext, errors);
|
||||
}
|
||||
else if (logger.isDebugEnabled()) {
|
||||
logger.debug("Request message validated");
|
||||
else if (this.logger.isDebugEnabled()) {
|
||||
this.logger.debug("Request message validated");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -209,7 +210,7 @@ public abstract class AbstractValidatingInterceptor extends TransformerObjectSup
|
||||
*/
|
||||
protected boolean handleRequestValidationErrors(MessageContext messageContext, SAXParseException[] errors) {
|
||||
for (SAXParseException error : errors) {
|
||||
logger.error("XML validation error on request: " + error.getMessage());
|
||||
this.logger.error("XML validation error on request: " + error.getMessage());
|
||||
}
|
||||
throw new WebServiceValidationException(errors);
|
||||
}
|
||||
@@ -226,21 +227,21 @@ public abstract class AbstractValidatingInterceptor extends TransformerObjectSup
|
||||
*/
|
||||
@Override
|
||||
public boolean handleResponse(MessageContext messageContext) throws WebServiceClientException {
|
||||
if (validateResponse) {
|
||||
if (this.validateResponse) {
|
||||
Source responseSource = getValidationResponseSource(messageContext.getResponse());
|
||||
if (responseSource != null) {
|
||||
SAXParseException[] errors;
|
||||
try {
|
||||
errors = validator.validate(responseSource);
|
||||
errors = this.validator.validate(responseSource);
|
||||
}
|
||||
catch (IOException e) {
|
||||
throw new WebServiceIOException("Could not validate response: " + e.getMessage(), e);
|
||||
catch (IOException ex) {
|
||||
throw new WebServiceIOException("Could not validate response: " + ex.getMessage(), ex);
|
||||
}
|
||||
if (!ObjectUtils.isEmpty(errors)) {
|
||||
return handleResponseValidationErrors(messageContext, errors);
|
||||
}
|
||||
else if (logger.isDebugEnabled()) {
|
||||
logger.debug("Response message validated");
|
||||
else if (this.logger.isDebugEnabled()) {
|
||||
this.logger.debug("Response message validated");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -261,7 +262,7 @@ public abstract class AbstractValidatingInterceptor extends TransformerObjectSup
|
||||
protected boolean handleResponseValidationErrors(MessageContext messageContext, SAXParseException[] errors)
|
||||
throws WebServiceValidationException {
|
||||
for (SAXParseException error : errors) {
|
||||
logger.warn("XML validation error on response: " + error.getMessage());
|
||||
this.logger.warn("XML validation error on response: " + error.getMessage());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -43,8 +43,8 @@ import org.springframework.ws.transport.WebServiceConnection;
|
||||
*
|
||||
* @author Giovanni Cuccu
|
||||
* @author Arjen Poutsma
|
||||
* @see org.springframework.ws.client.core.WebServiceTemplate#setInterceptors(ClientInterceptor[])
|
||||
* @since 1.5.0
|
||||
* @see org.springframework.ws.client.core.WebServiceTemplate#setInterceptors(ClientInterceptor[])
|
||||
*/
|
||||
public interface ClientInterceptor {
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.ws.client.support.interceptor;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
@@ -31,7 +32,7 @@ import org.springframework.ws.context.MessageContext;
|
||||
public abstract class ClientInterceptorAdapter implements ClientInterceptor {
|
||||
|
||||
/**
|
||||
* Logger available to subclasses
|
||||
* Logger available to subclasses.
|
||||
*/
|
||||
protected final Log logger = LogFactory.getLog(getClass());
|
||||
|
||||
|
||||
@@ -34,11 +34,11 @@ import org.springframework.ws.WebServiceMessage;
|
||||
*
|
||||
* @author Stefan Schmidt
|
||||
* @author Arjen Poutsma
|
||||
* @since 1.5.4
|
||||
* @see #setSchema(org.springframework.core.io.Resource)
|
||||
* @see #setSchemas(org.springframework.core.io.Resource[])
|
||||
* @see #setValidateRequest(boolean)
|
||||
* @see #setValidateResponse(boolean)
|
||||
* @since 1.5.4
|
||||
*/
|
||||
public class PayloadValidatingInterceptor extends AbstractValidatingInterceptor {
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ import org.springframework.ws.client.WebServiceClientException;
|
||||
@SuppressWarnings("serial")
|
||||
public class WebServiceValidationException extends WebServiceClientException {
|
||||
|
||||
private SAXParseException[] validationErrors;
|
||||
private final SAXParseException[] validationErrors;
|
||||
|
||||
/**
|
||||
* Create a new instance of the {@code WebServiceValidationException} class.
|
||||
@@ -51,7 +51,7 @@ public class WebServiceValidationException extends WebServiceClientException {
|
||||
|
||||
/** Returns the validation errors. */
|
||||
public SAXParseException[] getValidationErrors() {
|
||||
return validationErrors;
|
||||
return this.validationErrors;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ public class DelegatingWsConfiguration extends WsConfigurationSupport {
|
||||
this.configurers.addReturnValueHandlers(returnValueHandlers);
|
||||
}
|
||||
|
||||
private static class WsConfigurers implements WsConfigurer {
|
||||
private static final class WsConfigurers implements WsConfigurer {
|
||||
|
||||
private final Supplier<Stream<WsConfigurer>> delegates;
|
||||
|
||||
|
||||
@@ -83,11 +83,11 @@ import org.springframework.context.annotation.Import;
|
||||
* }
|
||||
* }</code></pre>
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @since 2.2
|
||||
* @see WsConfigurer
|
||||
* @see WsConfigurerAdapter
|
||||
* @see WsConfigurationSupport
|
||||
* @author Arjen Poutsma
|
||||
* @since 2.2
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.TYPE)
|
||||
|
||||
@@ -71,11 +71,11 @@ import org.springframework.ws.soap.server.endpoint.mapping.SoapActionAnnotationM
|
||||
* <li>{@link SimpleSoapExceptionResolver} for creating default exceptions.
|
||||
* </ul>
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @since 2.2
|
||||
* @see EnableWs
|
||||
* @see WsConfigurer
|
||||
* @see WsConfigurerAdapter
|
||||
* @author Arjen Poutsma
|
||||
* @since 2.2
|
||||
*/
|
||||
public class WsConfigurationSupport {
|
||||
|
||||
@@ -123,11 +123,11 @@ public class WsConfigurationSupport {
|
||||
* {@link #addInterceptors(List)} instead.
|
||||
*/
|
||||
protected final EndpointInterceptor[] getInterceptors() {
|
||||
if (interceptors == null) {
|
||||
interceptors = new ArrayList<>();
|
||||
addInterceptors(interceptors);
|
||||
if (this.interceptors == null) {
|
||||
this.interceptors = new ArrayList<>();
|
||||
addInterceptors(this.interceptors);
|
||||
}
|
||||
return interceptors.toArray(new EndpointInterceptor[0]);
|
||||
return this.interceptors.toArray(new EndpointInterceptor[0]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -44,21 +44,21 @@ public class WsConfigurerComposite implements WsConfigurer {
|
||||
|
||||
@Override
|
||||
public void addInterceptors(List<EndpointInterceptor> interceptors) {
|
||||
for (WsConfigurer delegate : delegates) {
|
||||
for (WsConfigurer delegate : this.delegates) {
|
||||
delegate.addInterceptors(interceptors);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addArgumentResolvers(List<MethodArgumentResolver> argumentResolvers) {
|
||||
for (WsConfigurer delegate : delegates) {
|
||||
for (WsConfigurer delegate : this.delegates) {
|
||||
delegate.addArgumentResolvers(argumentResolvers);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addReturnValueHandlers(List<MethodReturnValueHandler> returnValueHandlers) {
|
||||
for (WsConfigurer delegate : delegates) {
|
||||
for (WsConfigurer delegate : this.delegates) {
|
||||
delegate.addReturnValueHandlers(returnValueHandlers);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,4 +17,4 @@
|
||||
/**
|
||||
* Annotations and supporting classes for declarative configuration.
|
||||
*/
|
||||
package org.springframework.ws.config.annotation;
|
||||
package org.springframework.ws.config.annotation;
|
||||
|
||||
@@ -61,10 +61,10 @@ public abstract class AbstractMessageContext implements MessageContext {
|
||||
}
|
||||
|
||||
private Map<String, Object> getProperties() {
|
||||
if (properties == null) {
|
||||
properties = new HashMap<>();
|
||||
if (this.properties == null) {
|
||||
this.properties = new HashMap<>();
|
||||
}
|
||||
return properties;
|
||||
return this.properties;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -58,20 +58,20 @@ public class DefaultMessageContext extends AbstractMessageContext {
|
||||
|
||||
@Override
|
||||
public WebServiceMessage getRequest() {
|
||||
return request;
|
||||
return this.request;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasResponse() {
|
||||
return response != null;
|
||||
return this.response != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WebServiceMessage getResponse() {
|
||||
if (response == null) {
|
||||
response = messageFactory.createWebServiceMessage();
|
||||
if (this.response == null) {
|
||||
this.response = this.messageFactory.createWebServiceMessage();
|
||||
}
|
||||
return response;
|
||||
return this.response;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -82,21 +82,21 @@ public class DefaultMessageContext extends AbstractMessageContext {
|
||||
|
||||
@Override
|
||||
public void clearResponse() {
|
||||
response = null;
|
||||
this.response = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readResponse(InputStream inputStream) throws IOException {
|
||||
checkForResponse();
|
||||
response = messageFactory.createWebServiceMessage(inputStream);
|
||||
this.response = this.messageFactory.createWebServiceMessage(inputStream);
|
||||
}
|
||||
|
||||
public WebServiceMessageFactory getMessageFactory() {
|
||||
return messageFactory;
|
||||
return this.messageFactory;
|
||||
}
|
||||
|
||||
private void checkForResponse() throws IllegalStateException {
|
||||
if (response != null) {
|
||||
if (this.response != null) {
|
||||
throw new IllegalStateException("Response message already created");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,6 @@ public interface MessageContext {
|
||||
|
||||
/**
|
||||
* Removes the response message, if any.
|
||||
*
|
||||
* @since 1.5.0
|
||||
*/
|
||||
void clearResponse();
|
||||
|
||||
@@ -65,20 +65,20 @@ public abstract class AbstractMimeMessage implements MimeMessage {
|
||||
* @author Arjen Poutsma
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private static class InputStreamSourceDataSource implements DataSource {
|
||||
private static final class InputStreamSourceDataSource implements DataSource {
|
||||
|
||||
private final InputStreamSource inputStreamSource;
|
||||
|
||||
private final String contentType;
|
||||
|
||||
public InputStreamSourceDataSource(InputStreamSource inputStreamSource, String contentType) {
|
||||
InputStreamSourceDataSource(InputStreamSource inputStreamSource, String contentType) {
|
||||
this.inputStreamSource = inputStreamSource;
|
||||
this.contentType = contentType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public InputStream getInputStream() throws IOException {
|
||||
return inputStreamSource.getInputStream();
|
||||
return this.inputStreamSource.getInputStream();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -88,12 +88,12 @@ public abstract class AbstractMimeMessage implements MimeMessage {
|
||||
|
||||
@Override
|
||||
public String getContentType() {
|
||||
return contentType;
|
||||
return this.contentType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
if (inputStreamSource instanceof Resource resource) {
|
||||
if (this.inputStreamSource instanceof Resource resource) {
|
||||
return resource.getFilename();
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -22,12 +22,12 @@ import java.io.InputStream;
|
||||
import jakarta.activation.DataHandler;
|
||||
|
||||
/**
|
||||
* Represents an attachment to a {@link org.springframework.ws.mime.MimeMessage}
|
||||
* Represents an attachment to a {@link org.springframework.ws.mime.MimeMessage}.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @since 1.0.0
|
||||
* @see MimeMessage#getAttachments()
|
||||
* @see MimeMessage#addAttachment
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public interface Attachment {
|
||||
|
||||
|
||||
@@ -22,8 +22,8 @@ import org.springframework.ws.WebServiceMessageException;
|
||||
* Exception thrown when a MIME attachment could not be accessed.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @see Attachment
|
||||
* @since 1.0.0
|
||||
* @see Attachment
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class AttachmentException extends WebServiceMessageException {
|
||||
|
||||
@@ -29,8 +29,8 @@ import org.springframework.ws.WebServiceMessage;
|
||||
* file, an {@link InputStreamSource}, or a {@link DataHandler}.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @see Attachment
|
||||
* @since 1.0.0
|
||||
* @see Attachment
|
||||
*/
|
||||
public interface MimeMessage extends WebServiceMessage {
|
||||
|
||||
|
||||
@@ -41,8 +41,8 @@ import org.springframework.xml.namespace.QNameUtils;
|
||||
* Implementation of the {@code PoxMessage} interface that is based on a DOM Document.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @see Document
|
||||
* @since 1.0.0
|
||||
* @see Document
|
||||
*/
|
||||
public class DomPoxMessage implements PoxMessage {
|
||||
|
||||
@@ -67,21 +67,21 @@ public class DomPoxMessage implements PoxMessage {
|
||||
|
||||
/** Returns the document underlying this message. */
|
||||
public Document getDocument() {
|
||||
return document;
|
||||
return this.document;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result getPayloadResult() {
|
||||
NodeList children = document.getChildNodes();
|
||||
NodeList children = this.document.getChildNodes();
|
||||
for (int i = 0; i < children.getLength(); i++) {
|
||||
document.removeChild(children.item(i));
|
||||
this.document.removeChild(children.item(i));
|
||||
}
|
||||
return new DOMResult(document);
|
||||
return new DOMResult(this.document);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Source getPayloadSource() {
|
||||
return new DOMSource(document);
|
||||
return new DOMSource(this.document);
|
||||
}
|
||||
|
||||
public boolean hasFault() {
|
||||
@@ -94,7 +94,7 @@ public class DomPoxMessage implements PoxMessage {
|
||||
|
||||
public String toString() {
|
||||
StringBuilder builder = new StringBuilder("DomPoxMessage ");
|
||||
Element root = document.getDocumentElement();
|
||||
Element root = this.document.getDocumentElement();
|
||||
if (root != null) {
|
||||
builder.append(' ');
|
||||
builder.append(QNameUtils.getQNameForNode(root));
|
||||
@@ -106,9 +106,9 @@ public class DomPoxMessage implements PoxMessage {
|
||||
public void writeTo(OutputStream outputStream) throws IOException {
|
||||
try {
|
||||
if (outputStream instanceof TransportOutputStream transportOutputStream) {
|
||||
transportOutputStream.addHeader(TransportConstants.HEADER_CONTENT_TYPE, contentType);
|
||||
transportOutputStream.addHeader(TransportConstants.HEADER_CONTENT_TYPE, this.contentType);
|
||||
}
|
||||
transformer.transform(getPayloadSource(), new StreamResult(outputStream));
|
||||
this.transformer.transform(getPayloadSource(), new StreamResult(outputStream));
|
||||
}
|
||||
catch (TransformerException ex) {
|
||||
throw new DomPoxMessageException("Could write document: " + ex.getMessage(), ex);
|
||||
|
||||
@@ -37,8 +37,8 @@ import org.springframework.xml.transform.TransformerObjectSupport;
|
||||
* {@link DomPoxMessage}.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @see org.springframework.ws.pox.dom.DomPoxMessage
|
||||
* @since 1.0.0
|
||||
* @see org.springframework.ws.pox.dom.DomPoxMessage
|
||||
*/
|
||||
public class DomPoxMessageFactory extends TransformerObjectSupport implements WebServiceMessageFactory {
|
||||
|
||||
@@ -79,12 +79,12 @@ public class DomPoxMessageFactory extends TransformerObjectSupport implements We
|
||||
* {@code true}.
|
||||
*/
|
||||
public void setNamespaceAware(boolean namespaceAware) {
|
||||
documentBuilderFactory.setNamespaceAware(namespaceAware);
|
||||
this.documentBuilderFactory.setNamespaceAware(namespaceAware);
|
||||
}
|
||||
|
||||
/** Set if the XML parser should validate the document. Default is {@code false}. */
|
||||
public void setValidating(boolean validating) {
|
||||
documentBuilderFactory.setValidating(validating);
|
||||
this.documentBuilderFactory.setValidating(validating);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -92,15 +92,15 @@ public class DomPoxMessageFactory extends TransformerObjectSupport implements We
|
||||
* {@code false}.
|
||||
*/
|
||||
public void setExpandEntityReferences(boolean expandEntityRef) {
|
||||
documentBuilderFactory.setExpandEntityReferences(expandEntityRef);
|
||||
this.documentBuilderFactory.setExpandEntityReferences(expandEntityRef);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DomPoxMessage createWebServiceMessage() {
|
||||
try {
|
||||
DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
|
||||
DocumentBuilder documentBuilder = this.documentBuilderFactory.newDocumentBuilder();
|
||||
Document request = documentBuilder.newDocument();
|
||||
return new DomPoxMessage(request, createTransformer(), contentType);
|
||||
return new DomPoxMessage(request, createTransformer(), this.contentType);
|
||||
}
|
||||
catch (ParserConfigurationException ex) {
|
||||
throw new DomPoxMessageException("Could not create message context", ex);
|
||||
@@ -113,9 +113,9 @@ public class DomPoxMessageFactory extends TransformerObjectSupport implements We
|
||||
@Override
|
||||
public DomPoxMessage createWebServiceMessage(InputStream inputStream) throws IOException {
|
||||
try {
|
||||
DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
|
||||
DocumentBuilder documentBuilder = this.documentBuilderFactory.newDocumentBuilder();
|
||||
Document request = documentBuilder.parse(inputStream);
|
||||
return new DomPoxMessage(request, createTransformer(), contentType);
|
||||
return new DomPoxMessage(request, createTransformer(), this.contentType);
|
||||
}
|
||||
catch (ParserConfigurationException ex) {
|
||||
throw new DomPoxMessageException("Could not create message context", ex);
|
||||
|
||||
@@ -28,8 +28,8 @@ import org.springframework.ws.context.MessageContext;
|
||||
* who want to develop their own message flow.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @see MessageDispatcher
|
||||
* @since 1.0.0
|
||||
* @see MessageDispatcher
|
||||
*/
|
||||
public interface EndpointAdapter {
|
||||
|
||||
|
||||
@@ -38,10 +38,10 @@ import org.springframework.ws.context.MessageContext;
|
||||
* <list> of <ref>).
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @since 1.0.0
|
||||
* @see EndpointInvocationChain#getInterceptors()
|
||||
* @see org.springframework.ws.server.endpoint.interceptor.EndpointInterceptorAdapter
|
||||
* @see org.springframework.ws.server.endpoint.mapping.AbstractEndpointMapping#setInterceptors(EndpointInterceptor[])
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public interface EndpointInterceptor {
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@ package org.springframework.ws.server;
|
||||
* interceptors.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @see EndpointInterceptor
|
||||
* @since 1.0.0
|
||||
* @see EndpointInterceptor
|
||||
*/
|
||||
public class EndpointInvocationChain {
|
||||
|
||||
@@ -53,7 +53,7 @@ public class EndpointInvocationChain {
|
||||
* @return the endpoint object
|
||||
*/
|
||||
public Object getEndpoint() {
|
||||
return endpoint;
|
||||
return this.endpoint;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -61,7 +61,7 @@ public class EndpointInvocationChain {
|
||||
* @return the array of interceptors
|
||||
*/
|
||||
public EndpointInterceptor[] getInterceptors() {
|
||||
return interceptors;
|
||||
return this.interceptors;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -33,10 +33,10 @@ import org.springframework.ws.context.MessageContext;
|
||||
* if all {@code handlerRequest} methods have returned {@code true}.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @since 1.0.0
|
||||
* @see org.springframework.ws.server.endpoint.mapping.AbstractEndpointMapping
|
||||
* @see org.springframework.ws.server.endpoint.mapping.PayloadRootQNameEndpointMapping
|
||||
* @see org.springframework.ws.soap.server.endpoint.mapping.SoapActionEndpointMapping
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public interface EndpointMapping {
|
||||
|
||||
|
||||
@@ -75,11 +75,11 @@ import org.springframework.ws.transport.WebServiceMessageReceiver;
|
||||
* </ul>
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @since 1.0.0
|
||||
* @see EndpointMapping
|
||||
* @see EndpointAdapter
|
||||
* @see EndpointExceptionResolver
|
||||
* @see org.springframework.web.servlet.DispatcherServlet
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public class MessageDispatcher implements WebServiceMessageReceiver, BeanNameAware, ApplicationContextAware {
|
||||
|
||||
@@ -120,12 +120,12 @@ public class MessageDispatcher implements WebServiceMessageReceiver, BeanNameAwa
|
||||
|
||||
/** Initializes a new instance of the {@code MessageDispatcher}. */
|
||||
public MessageDispatcher() {
|
||||
defaultStrategiesHelper = new DefaultStrategiesHelper(getClass());
|
||||
this.defaultStrategiesHelper = new DefaultStrategiesHelper(getClass());
|
||||
}
|
||||
|
||||
/** Returns the {@code EndpointAdapter}s to use by this {@code MessageDispatcher}. */
|
||||
public List<EndpointAdapter> getEndpointAdapters() {
|
||||
return endpointAdapters;
|
||||
return this.endpointAdapters;
|
||||
}
|
||||
|
||||
/** Sets the {@code EndpointAdapter}s to use by this {@code MessageDispatcher}. */
|
||||
@@ -138,7 +138,7 @@ public class MessageDispatcher implements WebServiceMessageReceiver, BeanNameAwa
|
||||
* {@code MessageDispatcher}.
|
||||
*/
|
||||
public List<EndpointExceptionResolver> getEndpointExceptionResolvers() {
|
||||
return endpointExceptionResolvers;
|
||||
return this.endpointExceptionResolvers;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -151,7 +151,7 @@ public class MessageDispatcher implements WebServiceMessageReceiver, BeanNameAwa
|
||||
|
||||
/** Returns the {@code EndpointMapping}s to use by this {@code MessageDispatcher}. */
|
||||
public List<EndpointMapping> getEndpointMappings() {
|
||||
return endpointMappings;
|
||||
return this.endpointMappings;
|
||||
}
|
||||
|
||||
/** Sets the {@code EndpointMapping}s to use by this {@code MessageDispatcher}. */
|
||||
@@ -199,7 +199,7 @@ public class MessageDispatcher implements WebServiceMessageReceiver, BeanNameAwa
|
||||
}
|
||||
}
|
||||
else if (sentMessageTracingLogger.isDebugEnabled()) {
|
||||
sentMessageTracingLogger.debug("MessageDispatcher with name '" + beanName
|
||||
sentMessageTracingLogger.debug("MessageDispatcher with name '" + this.beanName
|
||||
+ "' sends no response for request [" + messageContext.getRequest() + "]");
|
||||
}
|
||||
}
|
||||
@@ -256,7 +256,7 @@ public class MessageDispatcher implements WebServiceMessageReceiver, BeanNameAwa
|
||||
throw ex;
|
||||
}
|
||||
catch (Exception ex) {
|
||||
Object endpoint = mappedEndpoint != null ? mappedEndpoint.getEndpoint() : null;
|
||||
Object endpoint = (mappedEndpoint != null) ? mappedEndpoint.getEndpoint() : null;
|
||||
processEndpointException(messageContext, endpoint, ex);
|
||||
triggerHandleResponse(mappedEndpoint, interceptorIndex, messageContext);
|
||||
}
|
||||
@@ -281,14 +281,14 @@ public class MessageDispatcher implements WebServiceMessageReceiver, BeanNameAwa
|
||||
for (EndpointMapping endpointMapping : getEndpointMappings()) {
|
||||
EndpointInvocationChain endpoint = endpointMapping.getEndpoint(messageContext);
|
||||
if (endpoint != null) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Endpoint mapping [" + endpointMapping + "] maps request to endpoint ["
|
||||
if (this.logger.isDebugEnabled()) {
|
||||
this.logger.debug("Endpoint mapping [" + endpointMapping + "] maps request to endpoint ["
|
||||
+ endpoint.getEndpoint() + "]");
|
||||
}
|
||||
return endpoint;
|
||||
}
|
||||
else if (logger.isDebugEnabled()) {
|
||||
logger.debug("Endpoint mapping [" + endpointMapping + "] has no mapping for request");
|
||||
else if (this.logger.isDebugEnabled()) {
|
||||
this.logger.debug("Endpoint mapping [" + endpointMapping + "] has no mapping for request");
|
||||
}
|
||||
}
|
||||
return null;
|
||||
@@ -301,8 +301,8 @@ public class MessageDispatcher implements WebServiceMessageReceiver, BeanNameAwa
|
||||
*/
|
||||
protected EndpointAdapter getEndpointAdapter(Object endpoint) {
|
||||
for (EndpointAdapter endpointAdapter : getEndpointAdapters()) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Testing endpoint adapter [" + endpointAdapter + "]");
|
||||
if (this.logger.isDebugEnabled()) {
|
||||
this.logger.debug("Testing endpoint adapter [" + endpointAdapter + "]");
|
||||
}
|
||||
if (endpointAdapter.supports(endpoint)) {
|
||||
return endpointAdapter;
|
||||
@@ -340,8 +340,8 @@ public class MessageDispatcher implements WebServiceMessageReceiver, BeanNameAwa
|
||||
if (!CollectionUtils.isEmpty(getEndpointExceptionResolvers())) {
|
||||
for (EndpointExceptionResolver resolver : getEndpointExceptionResolvers()) {
|
||||
if (resolver.resolveException(messageContext, endpoint, ex)) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Endpoint invocation resulted in exception - responding with Fault", ex);
|
||||
if (this.logger.isDebugEnabled()) {
|
||||
this.logger.debug("Endpoint invocation resulted in exception - responding with Fault", ex);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -390,7 +390,7 @@ public class MessageDispatcher implements WebServiceMessageReceiver, BeanNameAwa
|
||||
* returned {@code false}.
|
||||
* @param mappedEndpoint the mapped EndpointInvocationChain
|
||||
* @param interceptorIndex index of last interceptor that successfully completed
|
||||
* @param ex Exception thrown on handler execution, or {@code null} if none
|
||||
* @param ex exception thrown on handler execution, or {@code null} if none
|
||||
* @see EndpointInterceptor#afterCompletion
|
||||
*/
|
||||
private void triggerAfterCompletion(EndpointInvocationChain mappedEndpoint, int interceptorIndex,
|
||||
@@ -406,7 +406,7 @@ public class MessageDispatcher implements WebServiceMessageReceiver, BeanNameAwa
|
||||
interceptor.afterCompletion(messageContext, mappedEndpoint.getEndpoint(), ex);
|
||||
}
|
||||
catch (Throwable ex2) {
|
||||
logger.error("EndpointInterceptor.afterCompletion threw exception", ex2);
|
||||
this.logger.error("EndpointInterceptor.afterCompletion threw exception", ex2);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -420,18 +420,18 @@ public class MessageDispatcher implements WebServiceMessageReceiver, BeanNameAwa
|
||||
* @see #setEndpointAdapters(java.util.List)
|
||||
*/
|
||||
private void initEndpointAdapters(ApplicationContext applicationContext) throws BeansException {
|
||||
if (endpointAdapters == null) {
|
||||
if (this.endpointAdapters == null) {
|
||||
Map<String, EndpointAdapter> matchingBeans = BeanFactoryUtils
|
||||
.beansOfTypeIncludingAncestors(applicationContext, EndpointAdapter.class, true, false);
|
||||
if (!matchingBeans.isEmpty()) {
|
||||
endpointAdapters = new ArrayList<>(matchingBeans.values());
|
||||
endpointAdapters.sort(new OrderComparator());
|
||||
this.endpointAdapters = new ArrayList<>(matchingBeans.values());
|
||||
this.endpointAdapters.sort(new OrderComparator());
|
||||
}
|
||||
else {
|
||||
endpointAdapters = defaultStrategiesHelper.getDefaultStrategies(EndpointAdapter.class,
|
||||
this.endpointAdapters = this.defaultStrategiesHelper.getDefaultStrategies(EndpointAdapter.class,
|
||||
applicationContext);
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("No EndpointAdapters found, using defaults");
|
||||
if (this.logger.isDebugEnabled()) {
|
||||
this.logger.debug("No EndpointAdapters found, using defaults");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -444,18 +444,18 @@ public class MessageDispatcher implements WebServiceMessageReceiver, BeanNameAwa
|
||||
* @see #setEndpointExceptionResolvers(java.util.List)
|
||||
*/
|
||||
private void initEndpointExceptionResolvers(ApplicationContext applicationContext) throws BeansException {
|
||||
if (endpointExceptionResolvers == null) {
|
||||
if (this.endpointExceptionResolvers == null) {
|
||||
Map<String, EndpointExceptionResolver> matchingBeans = BeanFactoryUtils
|
||||
.beansOfTypeIncludingAncestors(applicationContext, EndpointExceptionResolver.class, true, false);
|
||||
if (!matchingBeans.isEmpty()) {
|
||||
endpointExceptionResolvers = new ArrayList<>(matchingBeans.values());
|
||||
endpointExceptionResolvers.sort(new OrderComparator());
|
||||
this.endpointExceptionResolvers = new ArrayList<>(matchingBeans.values());
|
||||
this.endpointExceptionResolvers.sort(new OrderComparator());
|
||||
}
|
||||
else {
|
||||
endpointExceptionResolvers = defaultStrategiesHelper
|
||||
this.endpointExceptionResolvers = this.defaultStrategiesHelper
|
||||
.getDefaultStrategies(EndpointExceptionResolver.class, applicationContext);
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("No EndpointExceptionResolvers found, using defaults");
|
||||
if (this.logger.isDebugEnabled()) {
|
||||
this.logger.debug("No EndpointExceptionResolvers found, using defaults");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -468,18 +468,18 @@ public class MessageDispatcher implements WebServiceMessageReceiver, BeanNameAwa
|
||||
* @see #setEndpointMappings(java.util.List)
|
||||
*/
|
||||
private void initEndpointMappings(ApplicationContext applicationContext) throws BeansException {
|
||||
if (endpointMappings == null) {
|
||||
if (this.endpointMappings == null) {
|
||||
Map<String, EndpointMapping> matchingBeans = BeanFactoryUtils
|
||||
.beansOfTypeIncludingAncestors(applicationContext, EndpointMapping.class, true, false);
|
||||
if (!matchingBeans.isEmpty()) {
|
||||
endpointMappings = new ArrayList<>(matchingBeans.values());
|
||||
endpointMappings.sort(new OrderComparator());
|
||||
this.endpointMappings = new ArrayList<>(matchingBeans.values());
|
||||
this.endpointMappings.sort(new OrderComparator());
|
||||
}
|
||||
else {
|
||||
endpointMappings = defaultStrategiesHelper.getDefaultStrategies(EndpointMapping.class,
|
||||
this.endpointMappings = this.defaultStrategiesHelper.getDefaultStrategies(EndpointMapping.class,
|
||||
applicationContext);
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("No EndpointMappings found, using defaults");
|
||||
if (this.logger.isDebugEnabled()) {
|
||||
this.logger.debug("No EndpointMappings found, using defaults");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,8 +39,8 @@ import org.springframework.xml.transform.TransformerObjectSupport;
|
||||
* payload elements are not in accordance with WS-I.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @see org.dom4j.Element
|
||||
* @since 1.0.0
|
||||
* @see org.dom4j.Element
|
||||
* @deprecated as of Spring Web Services 2.0, in favor of annotated endpoints
|
||||
*/
|
||||
@Deprecated
|
||||
@@ -68,7 +68,7 @@ public abstract class AbstractDom4jPayloadEndpoint extends TransformerObjectSupp
|
||||
}
|
||||
Document responseDocument = DocumentHelper.createDocument();
|
||||
Element responseElement = invokeInternal(requestElement, responseDocument);
|
||||
return responseElement != null ? new DocumentSource(responseElement) : null;
|
||||
return (responseElement != null) ? new DocumentSource(responseElement) : null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -89,7 +89,7 @@ public abstract class AbstractDom4jPayloadEndpoint extends TransformerObjectSupp
|
||||
if (source == null) {
|
||||
return null;
|
||||
}
|
||||
if (!alwaysTransform && source instanceof DOMSource) {
|
||||
if (!this.alwaysTransform && source instanceof DOMSource) {
|
||||
Node node = ((DOMSource) source).getNode();
|
||||
if (node.getNodeType() == Node.DOCUMENT_NODE) {
|
||||
DOMReader domReader = new DOMReader();
|
||||
|
||||
@@ -42,8 +42,8 @@ import org.springframework.xml.transform.TransformerObjectSupport;
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @author Alef Arendsen
|
||||
* @see #invokeInternal(org.w3c.dom.Element,org.w3c.dom.Document)
|
||||
* @since 1.0.0
|
||||
* @see #invokeInternal(org.w3c.dom.Element,org.w3c.dom.Document)
|
||||
* @deprecated as of Spring Web Services 2.0, in favor of annotated endpoints
|
||||
*/
|
||||
@Deprecated
|
||||
@@ -77,7 +77,7 @@ public abstract class AbstractDomPayloadEndpoint extends TransformerObjectSuppor
|
||||
* {@code false}.
|
||||
*/
|
||||
public void setExpandEntityReferences(boolean expandEntityRef) {
|
||||
documentBuilderFactory.setExpandEntityReferences(expandEntityRef);
|
||||
this.documentBuilderFactory.setExpandEntityReferences(expandEntityRef);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -92,14 +92,14 @@ public abstract class AbstractDomPayloadEndpoint extends TransformerObjectSuppor
|
||||
|
||||
@Override
|
||||
public final Source invoke(Source request) throws Exception {
|
||||
if (documentBuilderFactory == null) {
|
||||
documentBuilderFactory = createDocumentBuilderFactory();
|
||||
if (this.documentBuilderFactory == null) {
|
||||
this.documentBuilderFactory = createDocumentBuilderFactory();
|
||||
}
|
||||
DocumentBuilder documentBuilder = createDocumentBuilder(documentBuilderFactory);
|
||||
DocumentBuilder documentBuilder = createDocumentBuilder(this.documentBuilderFactory);
|
||||
Element requestElement = getDocumentElement(request, documentBuilder);
|
||||
Document responseDocument = documentBuilder.newDocument();
|
||||
Element responseElement = invokeInternal(requestElement, responseDocument);
|
||||
return responseElement != null ? new DOMSource(responseElement) : null;
|
||||
return (responseElement != null) ? new DOMSource(responseElement) : null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -126,9 +126,9 @@ public abstract class AbstractDomPayloadEndpoint extends TransformerObjectSuppor
|
||||
*/
|
||||
protected DocumentBuilderFactory createDocumentBuilderFactory() throws ParserConfigurationException {
|
||||
DocumentBuilderFactory factory = DocumentBuilderFactoryUtils.newInstance();
|
||||
factory.setValidating(validating);
|
||||
factory.setNamespaceAware(namespaceAware);
|
||||
factory.setExpandEntityReferences(expandEntityReferences);
|
||||
factory.setValidating(this.validating);
|
||||
factory.setNamespaceAware(this.namespaceAware);
|
||||
factory.setExpandEntityReferences(this.expandEntityReferences);
|
||||
return factory;
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ public abstract class AbstractDomPayloadEndpoint extends TransformerObjectSuppor
|
||||
if (source == null) {
|
||||
return null;
|
||||
}
|
||||
if (!alwaysTransform && source instanceof DOMSource) {
|
||||
if (!this.alwaysTransform && source instanceof DOMSource) {
|
||||
Node node = ((DOMSource) source).getNode();
|
||||
if (node.getNodeType() == Node.ELEMENT_NODE) {
|
||||
return (Element) node;
|
||||
|
||||
@@ -85,23 +85,24 @@ public abstract class AbstractEndpointExceptionResolver implements EndpointExcep
|
||||
|
||||
@Override
|
||||
public final int getOrder() {
|
||||
return order;
|
||||
return this.order;
|
||||
}
|
||||
|
||||
/**
|
||||
* Default implementation that checks whether the given {@code endpoint} is in the set
|
||||
* of {@link #setMappedEndpoints mapped endpoints}.
|
||||
* @see #resolveExceptionInternal(MessageContext,Object,Exception)
|
||||
* @see #resolveExceptionInternal(MessageContext, Object, Exception)
|
||||
*/
|
||||
@Override
|
||||
public final boolean resolveException(MessageContext messageContext, Object endpoint, Exception ex) {
|
||||
Object mappedEndpoint = endpoint instanceof MethodEndpoint ? ((MethodEndpoint) endpoint).getBean() : endpoint;
|
||||
if (mappedEndpoints != null && !mappedEndpoints.contains(mappedEndpoint)) {
|
||||
Object mappedEndpoint = (endpoint instanceof MethodEndpoint methodEndpoint) ? methodEndpoint.getBean()
|
||||
: endpoint;
|
||||
if (this.mappedEndpoints != null && !this.mappedEndpoints.contains(mappedEndpoint)) {
|
||||
return false;
|
||||
}
|
||||
// Log exception, both at debug log level and at warn level, if desired.
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Resolving exception from endpoint [" + endpoint + "]: " + ex);
|
||||
if (this.logger.isDebugEnabled()) {
|
||||
this.logger.debug("Resolving exception from endpoint [" + endpoint + "]: " + ex);
|
||||
}
|
||||
logException(ex, messageContext);
|
||||
return resolveExceptionInternal(messageContext, endpoint, ex);
|
||||
@@ -144,7 +145,7 @@ public abstract class AbstractEndpointExceptionResolver implements EndpointExcep
|
||||
* of the exception
|
||||
* @param ex the exception that got thrown during endpoint execution
|
||||
* @return {@code true} if resolved; {@code false} otherwise
|
||||
* @see #resolveException(MessageContext,Object,Exception)
|
||||
* @see #resolveException(MessageContext, Object, Exception)
|
||||
*/
|
||||
protected abstract boolean resolveExceptionInternal(MessageContext messageContext, Object endpoint, Exception ex);
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ public abstract class AbstractJDomPayloadEndpoint extends TransformerObjectSuppo
|
||||
public final Source invoke(Source request) throws Exception {
|
||||
Element requestElement = getDocumentElement(request);
|
||||
Element responseElement = invokeInternal(requestElement);
|
||||
return responseElement != null ? new JDOMSource(responseElement) : null;
|
||||
return (responseElement != null) ? new JDOMSource(responseElement) : null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -79,7 +79,7 @@ public abstract class AbstractJDomPayloadEndpoint extends TransformerObjectSuppo
|
||||
if (source == null) {
|
||||
return null;
|
||||
}
|
||||
if (!alwaysTransform && source instanceof DOMSource) {
|
||||
if (!this.alwaysTransform && source instanceof DOMSource) {
|
||||
Node node = ((DOMSource) source).getNode();
|
||||
DOMBuilder domBuilder = new DOMBuilder();
|
||||
if (node.getNodeType() == Node.ELEMENT_NODE) {
|
||||
|
||||
@@ -85,7 +85,7 @@ public abstract class AbstractLoggingInterceptor extends TransformerObjectSuppor
|
||||
*/
|
||||
@Override
|
||||
public boolean handleRequest(MessageContext messageContext, Object endpoint) throws TransformerException {
|
||||
if (logRequest && isLogEnabled()) {
|
||||
if (this.logRequest && isLogEnabled()) {
|
||||
logMessageSource("Request: ", getSource(messageContext.getRequest()));
|
||||
}
|
||||
return true;
|
||||
@@ -100,7 +100,7 @@ public abstract class AbstractLoggingInterceptor extends TransformerObjectSuppor
|
||||
*/
|
||||
@Override
|
||||
public boolean handleResponse(MessageContext messageContext, Object endpoint) throws Exception {
|
||||
if (logResponse && isLogEnabled()) {
|
||||
if (this.logResponse && isLogEnabled()) {
|
||||
logMessageSource("Response: ", getSource(messageContext.getResponse()));
|
||||
}
|
||||
return true;
|
||||
@@ -112,7 +112,9 @@ public abstract class AbstractLoggingInterceptor extends TransformerObjectSuppor
|
||||
return true;
|
||||
}
|
||||
|
||||
/** Does nothing by default */
|
||||
/**
|
||||
* Does nothing by default.
|
||||
*/
|
||||
@Override
|
||||
public void afterCompletion(MessageContext messageContext, Object endpoint, Exception ex) {
|
||||
}
|
||||
@@ -124,7 +126,7 @@ public abstract class AbstractLoggingInterceptor extends TransformerObjectSuppor
|
||||
* this to change the level under which logging occurs.
|
||||
*/
|
||||
protected boolean isLogEnabled() {
|
||||
return logger.isDebugEnabled();
|
||||
return this.logger.isDebugEnabled();
|
||||
}
|
||||
|
||||
private Transformer createNonIndentingTransformer() throws TransformerConfigurationException {
|
||||
@@ -162,7 +164,7 @@ public abstract class AbstractLoggingInterceptor extends TransformerObjectSuppor
|
||||
* @param message the message
|
||||
*/
|
||||
protected void logMessage(String message) {
|
||||
logger.debug(message);
|
||||
this.logger.debug(message);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -36,12 +36,12 @@ import org.springframework.ws.support.MarshallingUtils;
|
||||
* parameter, and allows for a response object to be returned.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @since 1.0.0
|
||||
* @see #setMarshaller(org.springframework.oxm.Marshaller)
|
||||
* @see Marshaller
|
||||
* @see #setUnmarshaller(org.springframework.oxm.Unmarshaller)
|
||||
* @see Unmarshaller
|
||||
* @see #invokeInternal(Object)
|
||||
* @since 1.0.0
|
||||
* @deprecated as of Spring Web Services 2.0, in favor of annotated endpoints
|
||||
*/
|
||||
@Deprecated
|
||||
@@ -104,7 +104,7 @@ public abstract class AbstractMarshallingPayloadEndpoint implements MessageEndpo
|
||||
|
||||
/** Returns the marshaller used for transforming objects into XML. */
|
||||
public Marshaller getMarshaller() {
|
||||
return marshaller;
|
||||
return this.marshaller;
|
||||
}
|
||||
|
||||
/** Sets the marshaller used for transforming objects into XML. */
|
||||
@@ -114,7 +114,7 @@ public abstract class AbstractMarshallingPayloadEndpoint implements MessageEndpo
|
||||
|
||||
/** Returns the unmarshaller used for transforming XML into objects. */
|
||||
public Unmarshaller getUnmarshaller() {
|
||||
return unmarshaller;
|
||||
return this.unmarshaller;
|
||||
}
|
||||
|
||||
/** Sets the unmarshaller used for transforming XML into objects. */
|
||||
@@ -145,8 +145,8 @@ public abstract class AbstractMarshallingPayloadEndpoint implements MessageEndpo
|
||||
Unmarshaller unmarshaller = getUnmarshaller();
|
||||
Assert.notNull(unmarshaller, "No unmarshaller registered. Check configuration of endpoint.");
|
||||
Object requestObject = MarshallingUtils.unmarshal(unmarshaller, request);
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Unmarshalled payload request to [" + requestObject + "]");
|
||||
if (this.logger.isDebugEnabled()) {
|
||||
this.logger.debug("Unmarshalled payload request to [" + requestObject + "]");
|
||||
}
|
||||
return requestObject;
|
||||
}
|
||||
@@ -169,8 +169,8 @@ public abstract class AbstractMarshallingPayloadEndpoint implements MessageEndpo
|
||||
private void marshalResponse(Object responseObject, WebServiceMessage response) throws IOException {
|
||||
Marshaller marshaller = getMarshaller();
|
||||
Assert.notNull(marshaller, "No marshaller registered. Check configuration of endpoint.");
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Marshalling [" + responseObject + "] to response payload");
|
||||
if (this.logger.isDebugEnabled()) {
|
||||
this.logger.debug("Marshalling [" + responseObject + "] to response payload");
|
||||
}
|
||||
MarshallingUtils.marshal(marshaller, responseObject, response);
|
||||
}
|
||||
|
||||
@@ -33,9 +33,9 @@ import org.springframework.xml.transform.TransformerObjectSupport;
|
||||
* to {@code createResponse}, so it can be used for holding request-specific state.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @since 1.0.0
|
||||
* @see #createContentHandler()
|
||||
* @see #getResponse(org.xml.sax.ContentHandler)
|
||||
* @since 1.0.0
|
||||
* @deprecated as of Spring Web Services 2.0, in favor of annotated endpoints
|
||||
*/
|
||||
@Deprecated
|
||||
|
||||
@@ -43,11 +43,11 @@ import org.springframework.ws.context.MessageContext;
|
||||
* create a response using a {@code XMLEventWriter}.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @since 1.0.0
|
||||
* @see #invokeInternal(javax.xml.stream.XMLEventReader,javax.xml.stream.util.XMLEventConsumer,
|
||||
* javax.xml.stream.XMLEventFactory)
|
||||
* @see XMLEventReader
|
||||
* @see XMLEventWriter
|
||||
* @since 1.0.0
|
||||
* @deprecated as of Spring Web Services 2.0, in favor of annotated endpoints
|
||||
*/
|
||||
@Deprecated
|
||||
@@ -76,10 +76,10 @@ public abstract class AbstractStaxEventPayloadEndpoint extends AbstractStaxPaylo
|
||||
|
||||
/** Returns an {@code XMLEventFactory} to read XML from. */
|
||||
private XMLEventFactory getEventFactory() {
|
||||
if (eventFactory == null) {
|
||||
eventFactory = createXmlEventFactory();
|
||||
if (this.eventFactory == null) {
|
||||
this.eventFactory = createXmlEventFactory();
|
||||
}
|
||||
return eventFactory;
|
||||
return this.eventFactory;
|
||||
}
|
||||
|
||||
private XMLEventReader getEventReader(Source source) throws XMLStreamException, TransformerException {
|
||||
@@ -151,7 +151,7 @@ public abstract class AbstractStaxEventPayloadEndpoint extends AbstractStaxPaylo
|
||||
* {@code WebServiceMessage} as soon as any method is called, thus lazily creating the
|
||||
* response.
|
||||
*/
|
||||
private class ResponseCreatingEventWriter implements XMLEventWriter {
|
||||
private final class ResponseCreatingEventWriter implements XMLEventWriter {
|
||||
|
||||
private XMLEventWriter eventWriter;
|
||||
|
||||
@@ -159,19 +159,19 @@ public abstract class AbstractStaxEventPayloadEndpoint extends AbstractStaxPaylo
|
||||
|
||||
private ByteArrayOutputStream os;
|
||||
|
||||
public ResponseCreatingEventWriter(MessageContext messageContext) {
|
||||
ResponseCreatingEventWriter(MessageContext messageContext) {
|
||||
this.messageContext = messageContext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NamespaceContext getNamespaceContext() {
|
||||
return eventWriter.getNamespaceContext();
|
||||
return this.eventWriter.getNamespaceContext();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setNamespaceContext(NamespaceContext context) throws XMLStreamException {
|
||||
createEventWriter();
|
||||
eventWriter.setNamespaceContext(context);
|
||||
this.eventWriter.setNamespaceContext(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -185,15 +185,15 @@ public abstract class AbstractStaxEventPayloadEndpoint extends AbstractStaxPaylo
|
||||
@Override
|
||||
public void add(XMLEvent event) throws XMLStreamException {
|
||||
createEventWriter();
|
||||
eventWriter.add(event);
|
||||
this.eventWriter.add(event);
|
||||
if (event.isEndDocument()) {
|
||||
if (os != null) {
|
||||
eventWriter.flush();
|
||||
if (this.os != null) {
|
||||
this.eventWriter.flush();
|
||||
// if we used an output stream cache, we have to transform it to the
|
||||
// response again
|
||||
try {
|
||||
ByteArrayInputStream is = new ByteArrayInputStream(os.toByteArray());
|
||||
transform(new StreamSource(is), messageContext.getResponse().getPayloadResult());
|
||||
ByteArrayInputStream is = new ByteArrayInputStream(this.os.toByteArray());
|
||||
transform(new StreamSource(is), this.messageContext.getResponse().getPayloadResult());
|
||||
}
|
||||
catch (TransformerException ex) {
|
||||
throw new XMLStreamException(ex);
|
||||
@@ -204,45 +204,45 @@ public abstract class AbstractStaxEventPayloadEndpoint extends AbstractStaxPaylo
|
||||
|
||||
@Override
|
||||
public void close() throws XMLStreamException {
|
||||
if (eventWriter != null) {
|
||||
eventWriter.close();
|
||||
if (this.eventWriter != null) {
|
||||
this.eventWriter.close();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void flush() throws XMLStreamException {
|
||||
if (eventWriter != null) {
|
||||
eventWriter.flush();
|
||||
if (this.eventWriter != null) {
|
||||
this.eventWriter.flush();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPrefix(String uri) throws XMLStreamException {
|
||||
createEventWriter();
|
||||
return eventWriter.getPrefix(uri);
|
||||
return this.eventWriter.getPrefix(uri);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDefaultNamespace(String uri) throws XMLStreamException {
|
||||
createEventWriter();
|
||||
eventWriter.setDefaultNamespace(uri);
|
||||
this.eventWriter.setDefaultNamespace(uri);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPrefix(String prefix, String uri) throws XMLStreamException {
|
||||
createEventWriter();
|
||||
eventWriter.setPrefix(prefix, uri);
|
||||
this.eventWriter.setPrefix(prefix, uri);
|
||||
}
|
||||
|
||||
private void createEventWriter() throws XMLStreamException {
|
||||
if (eventWriter == null) {
|
||||
WebServiceMessage response = messageContext.getResponse();
|
||||
eventWriter = getEventWriter(response.getPayloadResult());
|
||||
if (eventWriter == null) {
|
||||
if (this.eventWriter == null) {
|
||||
WebServiceMessage response = this.messageContext.getResponse();
|
||||
this.eventWriter = getEventWriter(response.getPayloadResult());
|
||||
if (this.eventWriter == null) {
|
||||
// as a final resort, use a stream, and transform that at
|
||||
// endDocument()
|
||||
os = new ByteArrayOutputStream();
|
||||
eventWriter = getOutputFactory().createXMLEventWriter(os);
|
||||
this.os = new ByteArrayOutputStream();
|
||||
this.eventWriter = getOutputFactory().createXMLEventWriter(this.os);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,9 +27,9 @@ import org.springframework.xml.transform.TransformerObjectSupport;
|
||||
* {@code XMLOutputFactory}.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @since 1.0.0
|
||||
* @see XMLInputFactory
|
||||
* @see XMLOutputFactory
|
||||
* @since 1.0.0
|
||||
* @deprecated as of Spring Web Services 2.0, in favor of annotated endpoints
|
||||
*/
|
||||
@Deprecated
|
||||
@@ -42,18 +42,18 @@ public abstract class AbstractStaxPayloadEndpoint extends TransformerObjectSuppo
|
||||
|
||||
/** Returns an {@code XMLInputFactory} to read XML from. */
|
||||
protected final XMLInputFactory getInputFactory() {
|
||||
if (inputFactory == null) {
|
||||
inputFactory = createXmlInputFactory();
|
||||
if (this.inputFactory == null) {
|
||||
this.inputFactory = createXmlInputFactory();
|
||||
}
|
||||
return inputFactory;
|
||||
return this.inputFactory;
|
||||
}
|
||||
|
||||
/** Returns an {@code XMLOutputFactory} to write XML to. */
|
||||
protected final XMLOutputFactory getOutputFactory() {
|
||||
if (outputFactory == null) {
|
||||
outputFactory = createXmlOutputFactory();
|
||||
if (this.outputFactory == null) {
|
||||
this.outputFactory = createXmlOutputFactory();
|
||||
}
|
||||
return outputFactory;
|
||||
return this.outputFactory;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -40,10 +40,10 @@ import org.springframework.ws.context.MessageContext;
|
||||
* response using a {@code XMLStreamWriter}.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @since 1.0.0
|
||||
* @see #invokeInternal(javax.xml.stream.XMLStreamReader,javax.xml.stream.XMLStreamWriter)
|
||||
* @see XMLStreamReader
|
||||
* @see XMLStreamWriter
|
||||
* @since 1.0.0
|
||||
* @deprecated as of Spring Web Services 2.0, in favor of annotated endpoints
|
||||
*/
|
||||
@Deprecated
|
||||
@@ -126,7 +126,7 @@ public abstract class AbstractStaxStreamPayloadEndpoint extends AbstractStaxPayl
|
||||
* {@code WebServiceMessage} as soon as any method is called, thus lazily creating the
|
||||
* response.
|
||||
*/
|
||||
private class ResponseCreatingStreamWriter implements XMLStreamWriter {
|
||||
private final class ResponseCreatingStreamWriter implements XMLStreamWriter {
|
||||
|
||||
private MessageContext messageContext;
|
||||
|
||||
@@ -140,221 +140,221 @@ public abstract class AbstractStaxStreamPayloadEndpoint extends AbstractStaxPayl
|
||||
|
||||
@Override
|
||||
public NamespaceContext getNamespaceContext() {
|
||||
return streamWriter.getNamespaceContext();
|
||||
return this.streamWriter.getNamespaceContext();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setNamespaceContext(NamespaceContext context) throws XMLStreamException {
|
||||
createStreamWriter();
|
||||
streamWriter.setNamespaceContext(context);
|
||||
this.streamWriter.setNamespaceContext(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() throws XMLStreamException {
|
||||
if (streamWriter != null) {
|
||||
streamWriter.close();
|
||||
if (os != null) {
|
||||
streamWriter.flush();
|
||||
if (this.streamWriter != null) {
|
||||
this.streamWriter.close();
|
||||
if (this.os != null) {
|
||||
this.streamWriter.flush();
|
||||
// if we used an output stream cache, we have to transform it to the
|
||||
// response again
|
||||
try {
|
||||
ByteArrayInputStream is = new ByteArrayInputStream(os.toByteArray());
|
||||
transform(new StreamSource(is), messageContext.getResponse().getPayloadResult());
|
||||
os = null;
|
||||
ByteArrayInputStream is = new ByteArrayInputStream(this.os.toByteArray());
|
||||
transform(new StreamSource(is), this.messageContext.getResponse().getPayloadResult());
|
||||
this.os = null;
|
||||
}
|
||||
catch (TransformerException ex) {
|
||||
throw new XMLStreamException(ex);
|
||||
}
|
||||
}
|
||||
streamWriter = null;
|
||||
this.streamWriter = null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void flush() throws XMLStreamException {
|
||||
if (streamWriter != null) {
|
||||
streamWriter.flush();
|
||||
if (this.streamWriter != null) {
|
||||
this.streamWriter.flush();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPrefix(String uri) throws XMLStreamException {
|
||||
createStreamWriter();
|
||||
return streamWriter.getPrefix(uri);
|
||||
return this.streamWriter.getPrefix(uri);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getProperty(String name) throws IllegalArgumentException {
|
||||
return streamWriter.getProperty(name);
|
||||
return this.streamWriter.getProperty(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDefaultNamespace(String uri) throws XMLStreamException {
|
||||
createStreamWriter();
|
||||
streamWriter.setDefaultNamespace(uri);
|
||||
this.streamWriter.setDefaultNamespace(uri);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPrefix(String prefix, String uri) throws XMLStreamException {
|
||||
createStreamWriter();
|
||||
streamWriter.setPrefix(prefix, uri);
|
||||
this.streamWriter.setPrefix(prefix, uri);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeAttribute(String localName, String value) throws XMLStreamException {
|
||||
createStreamWriter();
|
||||
streamWriter.writeAttribute(localName, value);
|
||||
this.streamWriter.writeAttribute(localName, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeAttribute(String namespaceURI, String localName, String value) throws XMLStreamException {
|
||||
createStreamWriter();
|
||||
streamWriter.writeAttribute(namespaceURI, localName, value);
|
||||
this.streamWriter.writeAttribute(namespaceURI, localName, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeAttribute(String prefix, String namespaceURI, String localName, String value)
|
||||
throws XMLStreamException {
|
||||
createStreamWriter();
|
||||
streamWriter.writeAttribute(prefix, namespaceURI, localName, value);
|
||||
this.streamWriter.writeAttribute(prefix, namespaceURI, localName, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeCData(String data) throws XMLStreamException {
|
||||
createStreamWriter();
|
||||
streamWriter.writeCData(data);
|
||||
this.streamWriter.writeCData(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeCharacters(String text) throws XMLStreamException {
|
||||
createStreamWriter();
|
||||
streamWriter.writeCharacters(text);
|
||||
this.streamWriter.writeCharacters(text);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeCharacters(char[] text, int start, int len) throws XMLStreamException {
|
||||
createStreamWriter();
|
||||
streamWriter.writeCharacters(text, start, len);
|
||||
this.streamWriter.writeCharacters(text, start, len);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeComment(String data) throws XMLStreamException {
|
||||
createStreamWriter();
|
||||
streamWriter.writeComment(data);
|
||||
this.streamWriter.writeComment(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeDTD(String dtd) throws XMLStreamException {
|
||||
createStreamWriter();
|
||||
streamWriter.writeDTD(dtd);
|
||||
this.streamWriter.writeDTD(dtd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeDefaultNamespace(String namespaceURI) throws XMLStreamException {
|
||||
createStreamWriter();
|
||||
streamWriter.writeDefaultNamespace(namespaceURI);
|
||||
this.streamWriter.writeDefaultNamespace(namespaceURI);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeEmptyElement(String localName) throws XMLStreamException {
|
||||
createStreamWriter();
|
||||
streamWriter.writeEmptyElement(localName);
|
||||
this.streamWriter.writeEmptyElement(localName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeEmptyElement(String namespaceURI, String localName) throws XMLStreamException {
|
||||
createStreamWriter();
|
||||
streamWriter.writeEmptyElement(namespaceURI, localName);
|
||||
this.streamWriter.writeEmptyElement(namespaceURI, localName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeEmptyElement(String prefix, String localName, String namespaceURI) throws XMLStreamException {
|
||||
createStreamWriter();
|
||||
streamWriter.writeEmptyElement(prefix, localName, namespaceURI);
|
||||
this.streamWriter.writeEmptyElement(prefix, localName, namespaceURI);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeEndDocument() throws XMLStreamException {
|
||||
createStreamWriter();
|
||||
streamWriter.writeEndDocument();
|
||||
this.streamWriter.writeEndDocument();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeEndElement() throws XMLStreamException {
|
||||
createStreamWriter();
|
||||
streamWriter.writeEndElement();
|
||||
this.streamWriter.writeEndElement();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeEntityRef(String name) throws XMLStreamException {
|
||||
createStreamWriter();
|
||||
streamWriter.writeEntityRef(name);
|
||||
this.streamWriter.writeEntityRef(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeNamespace(String prefix, String namespaceURI) throws XMLStreamException {
|
||||
createStreamWriter();
|
||||
streamWriter.writeNamespace(prefix, namespaceURI);
|
||||
this.streamWriter.writeNamespace(prefix, namespaceURI);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeProcessingInstruction(String target) throws XMLStreamException {
|
||||
createStreamWriter();
|
||||
streamWriter.writeProcessingInstruction(target);
|
||||
this.streamWriter.writeProcessingInstruction(target);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeProcessingInstruction(String target, String data) throws XMLStreamException {
|
||||
createStreamWriter();
|
||||
streamWriter.writeProcessingInstruction(target, data);
|
||||
this.streamWriter.writeProcessingInstruction(target, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeStartDocument() throws XMLStreamException {
|
||||
createStreamWriter();
|
||||
streamWriter.writeStartDocument();
|
||||
this.streamWriter.writeStartDocument();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeStartDocument(String version) throws XMLStreamException {
|
||||
createStreamWriter();
|
||||
streamWriter.writeStartDocument(version);
|
||||
this.streamWriter.writeStartDocument(version);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeStartDocument(String encoding, String version) throws XMLStreamException {
|
||||
createStreamWriter();
|
||||
streamWriter.writeStartDocument(encoding, version);
|
||||
this.streamWriter.writeStartDocument(encoding, version);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeStartElement(String localName) throws XMLStreamException {
|
||||
createStreamWriter();
|
||||
streamWriter.writeStartElement(localName);
|
||||
this.streamWriter.writeStartElement(localName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeStartElement(String namespaceURI, String localName) throws XMLStreamException {
|
||||
createStreamWriter();
|
||||
streamWriter.writeStartElement(namespaceURI, localName);
|
||||
this.streamWriter.writeStartElement(namespaceURI, localName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeStartElement(String prefix, String localName, String namespaceURI) throws XMLStreamException {
|
||||
createStreamWriter();
|
||||
streamWriter.writeStartElement(prefix, localName, namespaceURI);
|
||||
this.streamWriter.writeStartElement(prefix, localName, namespaceURI);
|
||||
}
|
||||
|
||||
private void createStreamWriter() throws XMLStreamException {
|
||||
if (streamWriter == null) {
|
||||
WebServiceMessage response = messageContext.getResponse();
|
||||
streamWriter = getStreamWriter(response.getPayloadResult());
|
||||
if (streamWriter == null) {
|
||||
if (this.streamWriter == null) {
|
||||
WebServiceMessage response = this.messageContext.getResponse();
|
||||
this.streamWriter = getStreamWriter(response.getPayloadResult());
|
||||
if (this.streamWriter == null) {
|
||||
// as a final resort, use a stream, and transform that at
|
||||
// endDocument()
|
||||
os = new ByteArrayOutputStream();
|
||||
streamWriter = getOutputFactory().createXMLStreamWriter(os);
|
||||
this.os = new ByteArrayOutputStream();
|
||||
this.streamWriter = getOutputFactory().createXMLStreamWriter(this.os);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ public abstract class AbstractValidatingMarshallingPayloadEndpoint extends Abstr
|
||||
|
||||
/** Return the name of the request object for validation error codes. */
|
||||
public String getRequestName() {
|
||||
return requestName;
|
||||
return this.requestName;
|
||||
}
|
||||
|
||||
/** Set the name of the request object user for validation errors. */
|
||||
@@ -54,7 +54,7 @@ public abstract class AbstractValidatingMarshallingPayloadEndpoint extends Abstr
|
||||
/** Return the primary Validator for this controller. */
|
||||
public Validator getValidator() {
|
||||
Validator[] validators = getValidators();
|
||||
return (validators != null && validators.length > 0 ? validators[0] : null);
|
||||
return (validators != null && validators.length > 0) ? validators[0] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -69,7 +69,7 @@ public abstract class AbstractValidatingMarshallingPayloadEndpoint extends Abstr
|
||||
|
||||
/** Return the Validators for this controller. */
|
||||
public Validator[] getValidators() {
|
||||
return validators;
|
||||
return this.validators;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -59,8 +59,8 @@ import org.springframework.xml.transform.TraxUtils;
|
||||
* elements are not in accordance with WS-I.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @see Element
|
||||
* @since 1.0.0
|
||||
* @see Element
|
||||
* @deprecated as of Spring Web Services 2.0, in favor of annotated endpoints
|
||||
*/
|
||||
@Deprecated
|
||||
@@ -81,7 +81,7 @@ public abstract class AbstractXomPayloadEndpoint extends TransformerObjectSuppor
|
||||
requestElement = sourceCallback.element;
|
||||
}
|
||||
Element responseElement = invokeInternal(requestElement);
|
||||
return responseElement != null ? convertResponse(responseElement) : null;
|
||||
return (responseElement != null) ? convertResponse(responseElement) : null;
|
||||
}
|
||||
|
||||
private Source convertResponse(Element responseElement) throws IOException {
|
||||
@@ -116,18 +116,18 @@ public abstract class AbstractXomPayloadEndpoint extends TransformerObjectSuppor
|
||||
*/
|
||||
protected abstract Element invokeInternal(Element requestElement) throws Exception;
|
||||
|
||||
private static class XomSourceCallback implements TraxUtils.SourceCallback {
|
||||
private static final class XomSourceCallback implements TraxUtils.SourceCallback {
|
||||
|
||||
private Element element;
|
||||
|
||||
@Override
|
||||
public void domSource(Node node) {
|
||||
if (node.getNodeType() == Node.ELEMENT_NODE) {
|
||||
element = DOMConverter.convert((org.w3c.dom.Element) node);
|
||||
this.element = DOMConverter.convert((org.w3c.dom.Element) node);
|
||||
}
|
||||
else if (node.getNodeType() == Node.DOCUMENT_NODE) {
|
||||
Document document = DOMConverter.convert((org.w3c.dom.Document) node);
|
||||
element = document.getRootElement();
|
||||
this.element = document.getRootElement();
|
||||
}
|
||||
else {
|
||||
throw new IllegalArgumentException("DOMSource contains neither Document nor Element");
|
||||
@@ -149,10 +149,10 @@ public abstract class AbstractXomPayloadEndpoint extends TransformerObjectSuppor
|
||||
throw new IllegalArgumentException(
|
||||
"InputSource in SAXSource contains neither byte stream nor character stream");
|
||||
}
|
||||
element = document.getRootElement();
|
||||
this.element = document.getRootElement();
|
||||
}
|
||||
catch (ParsingException e) {
|
||||
throw new XomParsingException(e);
|
||||
catch (ParsingException ex) {
|
||||
throw new XomParsingException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,7 +164,7 @@ public abstract class AbstractXomPayloadEndpoint extends TransformerObjectSuppor
|
||||
@Override
|
||||
public void staxSource(XMLStreamReader streamReader) throws XMLStreamException {
|
||||
Document document = StaxStreamConverter.convert(streamReader);
|
||||
element = document.getRootElement();
|
||||
this.element = document.getRootElement();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -172,7 +172,7 @@ public abstract class AbstractXomPayloadEndpoint extends TransformerObjectSuppor
|
||||
try {
|
||||
Builder builder = new Builder();
|
||||
Document document = builder.build(inputStream);
|
||||
element = document.getRootElement();
|
||||
this.element = document.getRootElement();
|
||||
}
|
||||
catch (ParsingException ex) {
|
||||
throw new XomParsingException(ex);
|
||||
@@ -184,7 +184,7 @@ public abstract class AbstractXomPayloadEndpoint extends TransformerObjectSuppor
|
||||
try {
|
||||
Builder builder = new Builder();
|
||||
Document document = builder.build(reader);
|
||||
element = document.getRootElement();
|
||||
this.element = document.getRootElement();
|
||||
}
|
||||
catch (ParsingException ex) {
|
||||
throw new XomParsingException(ex);
|
||||
@@ -196,7 +196,7 @@ public abstract class AbstractXomPayloadEndpoint extends TransformerObjectSuppor
|
||||
try {
|
||||
Builder builder = new Builder();
|
||||
Document document = builder.build(systemId);
|
||||
element = document.getRootElement();
|
||||
this.element = document.getRootElement();
|
||||
}
|
||||
catch (ParsingException ex) {
|
||||
throw new XomParsingException(ex);
|
||||
@@ -206,7 +206,7 @@ public abstract class AbstractXomPayloadEndpoint extends TransformerObjectSuppor
|
||||
}
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
private static class XomParsingException extends NestedRuntimeException {
|
||||
private static final class XomParsingException extends NestedRuntimeException {
|
||||
|
||||
private XomParsingException(ParsingException ex) {
|
||||
super(ex.getMessage(), ex);
|
||||
@@ -214,7 +214,7 @@ public abstract class AbstractXomPayloadEndpoint extends TransformerObjectSuppor
|
||||
|
||||
}
|
||||
|
||||
private static class StaxStreamConverter {
|
||||
private static final class StaxStreamConverter {
|
||||
|
||||
private static Document convert(XMLStreamReader streamReader) throws XMLStreamException {
|
||||
NodeFactory nodeFactory = new NodeFactory();
|
||||
|
||||
@@ -26,8 +26,8 @@ import org.springframework.ws.context.MessageContext;
|
||||
* and can be used to create a response.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @see org.springframework.ws.server.endpoint.PayloadEndpoint
|
||||
* @since 1.0.0
|
||||
* @see org.springframework.ws.server.endpoint.PayloadEndpoint
|
||||
*/
|
||||
public interface MessageEndpoint {
|
||||
|
||||
|
||||
@@ -89,11 +89,11 @@ public final class MethodEndpoint {
|
||||
|
||||
/** Returns the object bean for this method endpoint. */
|
||||
public Object getBean() {
|
||||
if (beanFactory != null && bean instanceof String beanName) {
|
||||
return beanFactory.getBean(beanName);
|
||||
if (this.beanFactory != null && this.bean instanceof String beanName) {
|
||||
return this.beanFactory.getBean(beanName);
|
||||
}
|
||||
else {
|
||||
return bean;
|
||||
return this.bean;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ public final class MethodEndpoint {
|
||||
|
||||
/** Returns the method return type, as {@code MethodParameter}. */
|
||||
public MethodParameter getReturnType() {
|
||||
return new MethodParameter(method, -1);
|
||||
return new MethodParameter(this.method, -1);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -125,9 +125,9 @@ public final class MethodEndpoint {
|
||||
*/
|
||||
public Object invoke(Object... args) throws Exception {
|
||||
Object endpoint = getBean();
|
||||
ReflectionUtils.makeAccessible(method);
|
||||
ReflectionUtils.makeAccessible(this.method);
|
||||
try {
|
||||
return method.invoke(endpoint, args);
|
||||
return this.method.invoke(endpoint, args);
|
||||
}
|
||||
catch (InvocationTargetException ex) {
|
||||
handleInvocationTargetException(ex);
|
||||
@@ -165,7 +165,7 @@ public final class MethodEndpoint {
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return method.toGenericString();
|
||||
return this.method.toGenericString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ public class DefaultMethodEndpointAdapter extends AbstractMethodEndpointAdapter
|
||||
* Returns the list of {@code MethodArgumentResolver}s to use.
|
||||
*/
|
||||
public List<MethodArgumentResolver> getMethodArgumentResolvers() {
|
||||
return methodArgumentResolvers;
|
||||
return this.methodArgumentResolvers;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -94,7 +94,7 @@ public class DefaultMethodEndpointAdapter extends AbstractMethodEndpointAdapter
|
||||
* Returns the custom argument resolvers.
|
||||
*/
|
||||
public List<MethodArgumentResolver> getCustomMethodArgumentResolvers() {
|
||||
return customMethodArgumentResolvers;
|
||||
return this.customMethodArgumentResolvers;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -110,7 +110,7 @@ public class DefaultMethodEndpointAdapter extends AbstractMethodEndpointAdapter
|
||||
* Returns the list of {@code MethodReturnValueHandler}s to use.
|
||||
*/
|
||||
public List<MethodReturnValueHandler> getMethodReturnValueHandlers() {
|
||||
return methodReturnValueHandlers;
|
||||
return this.methodReturnValueHandlers;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -124,7 +124,7 @@ public class DefaultMethodEndpointAdapter extends AbstractMethodEndpointAdapter
|
||||
* Returns the custom return value handlers.
|
||||
*/
|
||||
public List<MethodReturnValueHandler> getCustomMethodReturnValueHandlers() {
|
||||
return customMethodReturnValueHandlers;
|
||||
return this.customMethodReturnValueHandlers;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -137,7 +137,7 @@ public class DefaultMethodEndpointAdapter extends AbstractMethodEndpointAdapter
|
||||
}
|
||||
|
||||
private ClassLoader getClassLoader() {
|
||||
return this.classLoader != null ? this.classLoader : DefaultMethodEndpointAdapter.class.getClassLoader();
|
||||
return (this.classLoader != null) ? this.classLoader : DefaultMethodEndpointAdapter.class.getClassLoader();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -157,7 +157,7 @@ public class DefaultMethodEndpointAdapter extends AbstractMethodEndpointAdapter
|
||||
}
|
||||
|
||||
private void initMethodArgumentResolvers() {
|
||||
if (CollectionUtils.isEmpty(methodArgumentResolvers)) {
|
||||
if (CollectionUtils.isEmpty(this.methodArgumentResolvers)) {
|
||||
List<MethodArgumentResolver> methodArgumentResolvers = new ArrayList<>();
|
||||
methodArgumentResolvers.add(new DomPayloadMethodProcessor());
|
||||
methodArgumentResolvers.add(new MessageContextMethodArgumentResolver());
|
||||
@@ -181,8 +181,8 @@ public class DefaultMethodEndpointAdapter extends AbstractMethodEndpointAdapter
|
||||
if (isPresent(XOM_CLASS_NAME)) {
|
||||
methodArgumentResolvers.add(new XomPayloadMethodProcessor());
|
||||
}
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("No MethodArgumentResolvers set, using defaults: " + methodArgumentResolvers);
|
||||
if (this.logger.isDebugEnabled()) {
|
||||
this.logger.debug("No MethodArgumentResolvers set, using defaults: " + methodArgumentResolvers);
|
||||
}
|
||||
if (getCustomMethodArgumentResolvers() != null) {
|
||||
methodArgumentResolvers.addAll(getCustomMethodArgumentResolvers());
|
||||
@@ -202,13 +202,13 @@ public class DefaultMethodEndpointAdapter extends AbstractMethodEndpointAdapter
|
||||
.forName(className, getClassLoader());
|
||||
methodArgumentResolvers.add(BeanUtils.instantiateClass(methodArgumentResolverClass));
|
||||
}
|
||||
catch (ClassNotFoundException e) {
|
||||
logger.warn("Could not find \"" + className + "\" on the classpath");
|
||||
catch (ClassNotFoundException ex) {
|
||||
this.logger.warn("Could not find \"" + className + "\" on the classpath");
|
||||
}
|
||||
}
|
||||
|
||||
private void initMethodReturnValueHandlers() {
|
||||
if (CollectionUtils.isEmpty(methodReturnValueHandlers)) {
|
||||
if (CollectionUtils.isEmpty(this.methodReturnValueHandlers)) {
|
||||
List<MethodReturnValueHandler> methodReturnValueHandlers = new ArrayList<>();
|
||||
methodReturnValueHandlers.add(new DomPayloadMethodProcessor());
|
||||
methodReturnValueHandlers.add(new SourcePayloadMethodProcessor());
|
||||
@@ -225,8 +225,8 @@ public class DefaultMethodEndpointAdapter extends AbstractMethodEndpointAdapter
|
||||
if (isPresent(XOM_CLASS_NAME)) {
|
||||
methodReturnValueHandlers.add(new XomPayloadMethodProcessor());
|
||||
}
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("No MethodReturnValueHandlers set, using defaults: " + methodReturnValueHandlers);
|
||||
if (this.logger.isDebugEnabled()) {
|
||||
this.logger.debug("No MethodReturnValueHandlers set, using defaults: " + methodReturnValueHandlers);
|
||||
}
|
||||
if (getCustomMethodReturnValueHandlers() != null) {
|
||||
methodReturnValueHandlers.addAll(getCustomMethodReturnValueHandlers());
|
||||
@@ -248,9 +248,9 @@ public class DefaultMethodEndpointAdapter extends AbstractMethodEndpointAdapter
|
||||
private boolean supportsParameters(MethodParameter[] methodParameters) {
|
||||
for (MethodParameter methodParameter : methodParameters) {
|
||||
boolean supported = false;
|
||||
for (MethodArgumentResolver methodArgumentResolver : methodArgumentResolvers) {
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("Testing if argument resolver [" + methodArgumentResolver + "] supports ["
|
||||
for (MethodArgumentResolver methodArgumentResolver : this.methodArgumentResolvers) {
|
||||
if (this.logger.isTraceEnabled()) {
|
||||
this.logger.trace("Testing if argument resolver [" + methodArgumentResolver + "] supports ["
|
||||
+ methodParameter.getGenericParameterType() + "]");
|
||||
}
|
||||
if (methodArgumentResolver.supportsParameter(methodParameter)) {
|
||||
@@ -269,7 +269,7 @@ public class DefaultMethodEndpointAdapter extends AbstractMethodEndpointAdapter
|
||||
if (Void.TYPE.equals(methodReturnType.getParameterType())) {
|
||||
return true;
|
||||
}
|
||||
for (MethodReturnValueHandler methodReturnValueHandler : methodReturnValueHandlers) {
|
||||
for (MethodReturnValueHandler methodReturnValueHandler : this.methodReturnValueHandlers) {
|
||||
if (methodReturnValueHandler.supportsReturnType(methodReturnType)) {
|
||||
return true;
|
||||
}
|
||||
@@ -281,14 +281,14 @@ public class DefaultMethodEndpointAdapter extends AbstractMethodEndpointAdapter
|
||||
protected final void invokeInternal(MessageContext messageContext, MethodEndpoint methodEndpoint) throws Exception {
|
||||
Object[] args = getMethodArguments(messageContext, methodEndpoint);
|
||||
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("Invoking [" + methodEndpoint + "] with arguments " + Arrays.asList(args));
|
||||
if (this.logger.isTraceEnabled()) {
|
||||
this.logger.trace("Invoking [" + methodEndpoint + "] with arguments " + Arrays.asList(args));
|
||||
}
|
||||
|
||||
Object returnValue = methodEndpoint.invoke(args);
|
||||
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("Method [" + methodEndpoint + "] returned [" + returnValue + "]");
|
||||
if (this.logger.isTraceEnabled()) {
|
||||
this.logger.trace("Method [" + methodEndpoint + "] returned [" + returnValue + "]");
|
||||
}
|
||||
|
||||
Class<?> returnType = methodEndpoint.getMethod().getReturnType();
|
||||
@@ -313,7 +313,7 @@ public class DefaultMethodEndpointAdapter extends AbstractMethodEndpointAdapter
|
||||
MethodParameter[] parameters = methodEndpoint.getMethodParameters();
|
||||
Object[] args = new Object[parameters.length];
|
||||
for (int i = 0; i < parameters.length; i++) {
|
||||
for (MethodArgumentResolver methodArgumentResolver : methodArgumentResolvers) {
|
||||
for (MethodArgumentResolver methodArgumentResolver : this.methodArgumentResolvers) {
|
||||
if (methodArgumentResolver.supportsParameter(parameters[i])) {
|
||||
args[i] = methodArgumentResolver.resolveArgument(messageContext, parameters[i]);
|
||||
break;
|
||||
@@ -337,7 +337,7 @@ public class DefaultMethodEndpointAdapter extends AbstractMethodEndpointAdapter
|
||||
protected void handleMethodReturnValue(MessageContext messageContext, Object returnValue,
|
||||
MethodEndpoint methodEndpoint) throws Exception {
|
||||
MethodParameter returnType = methodEndpoint.getReturnType();
|
||||
for (MethodReturnValueHandler methodReturnValueHandler : methodReturnValueHandlers) {
|
||||
for (MethodReturnValueHandler methodReturnValueHandler : this.methodReturnValueHandlers) {
|
||||
if (methodReturnValueHandler.supportsReturnType(returnType)) {
|
||||
methodReturnValueHandler.handleReturnValue(messageContext, returnType, returnValue);
|
||||
return;
|
||||
|
||||
@@ -47,9 +47,9 @@ import org.springframework.ws.support.MarshallingUtils;
|
||||
* set using properties.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @since 1.0.0
|
||||
* @see #setMarshaller(org.springframework.oxm.Marshaller)
|
||||
* @see #setUnmarshaller(org.springframework.oxm.Unmarshaller)
|
||||
* @since 1.0.0
|
||||
* @deprecated as of Spring Web Services 2.0, in favor of
|
||||
* {@link DefaultMethodEndpointAdapter} and
|
||||
* {@link org.springframework.ws.server.endpoint.adapter.method.MarshallingPayloadMethodProcessor
|
||||
@@ -111,7 +111,7 @@ public class MarshallingMethodEndpointAdapter extends AbstractMethodEndpointAdap
|
||||
|
||||
/** Returns the marshaller used for transforming objects into XML. */
|
||||
public Marshaller getMarshaller() {
|
||||
return marshaller;
|
||||
return this.marshaller;
|
||||
}
|
||||
|
||||
/** Sets the marshaller used for transforming objects into XML. */
|
||||
@@ -121,7 +121,7 @@ public class MarshallingMethodEndpointAdapter extends AbstractMethodEndpointAdap
|
||||
|
||||
/** Returns the unmarshaller used for transforming XML into objects. */
|
||||
public Unmarshaller getUnmarshaller() {
|
||||
return unmarshaller;
|
||||
return this.unmarshaller;
|
||||
}
|
||||
|
||||
/** Sets the unmarshaller used for transforming XML into objects. */
|
||||
@@ -148,15 +148,15 @@ public class MarshallingMethodEndpointAdapter extends AbstractMethodEndpointAdap
|
||||
|
||||
private Object unmarshalRequest(WebServiceMessage request) throws IOException {
|
||||
Object requestObject = MarshallingUtils.unmarshal(getUnmarshaller(), request);
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Unmarshalled payload request to [" + requestObject + "]");
|
||||
if (this.logger.isDebugEnabled()) {
|
||||
this.logger.debug("Unmarshalled payload request to [" + requestObject + "]");
|
||||
}
|
||||
return requestObject;
|
||||
}
|
||||
|
||||
private void marshalResponse(Object responseObject, WebServiceMessage response) throws IOException {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Marshalling [" + responseObject + "] to response payload");
|
||||
if (this.logger.isDebugEnabled()) {
|
||||
this.logger.debug("Marshalling [" + responseObject + "] to response payload");
|
||||
}
|
||||
MarshallingUtils.marshal(getMarshaller(), responseObject, response);
|
||||
}
|
||||
|
||||
@@ -30,8 +30,8 @@ import org.springframework.ws.soap.server.SoapMessageDispatcher;
|
||||
* {@link SoapMessageDispatcher}.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @see org.springframework.ws.server.EndpointInvocationChain
|
||||
* @since 1.0.0
|
||||
* @see org.springframework.ws.server.EndpointInvocationChain
|
||||
*/
|
||||
public class MessageEndpointAdapter implements EndpointAdapter {
|
||||
|
||||
|
||||
@@ -34,9 +34,9 @@ import org.springframework.xml.transform.TransformerObjectSupport;
|
||||
* {@link SoapMessageDispatcher}.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @since 1.0.0
|
||||
* @see org.springframework.ws.server.endpoint.PayloadEndpoint
|
||||
* @see org.springframework.ws.server.EndpointInvocationChain
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public class PayloadEndpointAdapter extends TransformerObjectSupport implements EndpointAdapter {
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ public class XPathParamAnnotationMethodEndpointAdapter extends AbstractMethodEnd
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() throws Exception {
|
||||
xpathFactory = XPathFactory.newInstance();
|
||||
this.xpathFactory = XPathFactory.newInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -166,10 +166,10 @@ public class XPathParamAnnotationMethodEndpointAdapter extends AbstractMethodEnd
|
||||
}
|
||||
|
||||
private synchronized XPath createXPath() {
|
||||
XPath xpath = xpathFactory.newXPath();
|
||||
if (namespaces != null) {
|
||||
XPath xpath = this.xpathFactory.newXPath();
|
||||
if (this.namespaces != null) {
|
||||
SimpleNamespaceContext namespaceContext = new SimpleNamespaceContext();
|
||||
namespaceContext.setBindings(namespaces);
|
||||
namespaceContext.setBindings(this.namespaces);
|
||||
xpath.setNamespaceContext(namespaceContext);
|
||||
}
|
||||
return xpath;
|
||||
|
||||
@@ -37,13 +37,13 @@ public abstract class AbstractPayloadSourceMethodProcessor extends AbstractPaylo
|
||||
@Override
|
||||
public final Object resolveArgument(MessageContext messageContext, MethodParameter parameter) throws Exception {
|
||||
Source requestPayload = getRequestPayload(messageContext);
|
||||
return requestPayload != null ? resolveRequestPayloadArgument(parameter, requestPayload) : null;
|
||||
return (requestPayload != null) ? resolveRequestPayloadArgument(parameter, requestPayload) : null;
|
||||
}
|
||||
|
||||
/** Returns the request payload as {@code Source}. */
|
||||
private Source getRequestPayload(MessageContext messageContext) {
|
||||
WebServiceMessage request = messageContext.getRequest();
|
||||
return request != null ? request.getPayloadSource() : null;
|
||||
return (request != null) ? request.getPayloadSource() : null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -84,7 +84,7 @@ public class MarshallingPayloadMethodProcessor extends AbstractPayloadMethodProc
|
||||
* Returns the marshaller used for transforming objects into XML.
|
||||
*/
|
||||
public Marshaller getMarshaller() {
|
||||
return marshaller;
|
||||
return this.marshaller;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -98,7 +98,7 @@ public class MarshallingPayloadMethodProcessor extends AbstractPayloadMethodProc
|
||||
* Returns the unmarshaller used for transforming XML into objects.
|
||||
*/
|
||||
public Unmarshaller getUnmarshaller() {
|
||||
return unmarshaller;
|
||||
return this.unmarshaller;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -129,8 +129,8 @@ public class MarshallingPayloadMethodProcessor extends AbstractPayloadMethodProc
|
||||
|
||||
WebServiceMessage request = messageContext.getRequest();
|
||||
Object argument = MarshallingUtils.unmarshal(unmarshaller, request);
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Unmarshalled payload request to [" + argument + "]");
|
||||
if (this.logger.isDebugEnabled()) {
|
||||
this.logger.debug("Unmarshalled payload request to [" + argument + "]");
|
||||
}
|
||||
return argument;
|
||||
}
|
||||
@@ -158,8 +158,8 @@ public class MarshallingPayloadMethodProcessor extends AbstractPayloadMethodProc
|
||||
Marshaller marshaller = getMarshaller();
|
||||
Assert.state(marshaller != null, "marshaller must not be null");
|
||||
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Marshalling [" + returnValue + "] to response payload");
|
||||
if (this.logger.isDebugEnabled()) {
|
||||
this.logger.debug("Marshalling [" + returnValue + "] to response payload");
|
||||
}
|
||||
WebServiceMessage response = messageContext.getResponse();
|
||||
MarshallingUtils.marshal(marshaller, returnValue, response);
|
||||
|
||||
@@ -85,14 +85,14 @@ public class SourcePayloadMethodProcessor extends AbstractPayloadSourceMethodPro
|
||||
else if (JaxpVersion.isAtLeastJaxp14() && Jaxp14StaxHandler.isStaxSource(parameterType)) {
|
||||
XMLStreamReader streamReader;
|
||||
try {
|
||||
streamReader = inputFactory.createXMLStreamReader(requestPayload);
|
||||
streamReader = this.inputFactory.createXMLStreamReader(requestPayload);
|
||||
}
|
||||
catch (UnsupportedOperationException | XMLStreamException ignored) {
|
||||
streamReader = null;
|
||||
}
|
||||
if (streamReader == null) {
|
||||
ByteArrayInputStream bis = convertToByteArrayInputStream(requestPayload);
|
||||
streamReader = inputFactory.createXMLStreamReader(bis);
|
||||
streamReader = this.inputFactory.createXMLStreamReader(bis);
|
||||
}
|
||||
return Jaxp14StaxHandler.createStaxSource(streamReader, requestPayload.getSystemId());
|
||||
}
|
||||
@@ -129,7 +129,7 @@ public class SourcePayloadMethodProcessor extends AbstractPayloadSourceMethodPro
|
||||
}
|
||||
|
||||
/** Inner class to avoid a static JAXP 1.4 dependency. */
|
||||
private static class Jaxp14StaxHandler {
|
||||
private static final class Jaxp14StaxHandler {
|
||||
|
||||
private static boolean isStaxSource(Class<?> clazz) {
|
||||
return StAXSource.class.isAssignableFrom(clazz);
|
||||
@@ -141,7 +141,7 @@ public class SourcePayloadMethodProcessor extends AbstractPayloadSourceMethodPro
|
||||
|
||||
}
|
||||
|
||||
private static class SystemIdStreamReaderDelegate extends StreamReaderDelegate {
|
||||
private static final class SystemIdStreamReaderDelegate extends StreamReaderDelegate {
|
||||
|
||||
private final String systemId;
|
||||
|
||||
@@ -155,23 +155,23 @@ public class SourcePayloadMethodProcessor extends AbstractPayloadSourceMethodPro
|
||||
final Location parentLocation = getParent().getLocation();
|
||||
return new Location() {
|
||||
public int getLineNumber() {
|
||||
return parentLocation != null ? parentLocation.getLineNumber() : -1;
|
||||
return (parentLocation != null) ? parentLocation.getLineNumber() : -1;
|
||||
}
|
||||
|
||||
public int getColumnNumber() {
|
||||
return parentLocation != null ? parentLocation.getColumnNumber() : -1;
|
||||
return (parentLocation != null) ? parentLocation.getColumnNumber() : -1;
|
||||
}
|
||||
|
||||
public int getCharacterOffset() {
|
||||
return parentLocation != null ? parentLocation.getLineNumber() : -1;
|
||||
return (parentLocation != null) ? parentLocation.getLineNumber() : -1;
|
||||
}
|
||||
|
||||
public String getPublicId() {
|
||||
return parentLocation != null ? parentLocation.getPublicId() : null;
|
||||
return (parentLocation != null) ? parentLocation.getPublicId() : null;
|
||||
}
|
||||
|
||||
public String getSystemId() {
|
||||
return systemId;
|
||||
return SystemIdStreamReaderDelegate.this.systemId;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ public class StaxPayloadMethodArgumentResolver extends TransformerObjectSupport
|
||||
}
|
||||
if (streamReader == null) {
|
||||
try {
|
||||
streamReader = inputFactory.createXMLStreamReader(requestSource);
|
||||
streamReader = this.inputFactory.createXMLStreamReader(requestSource);
|
||||
}
|
||||
catch (XMLStreamException | UnsupportedOperationException ex) {
|
||||
streamReader = null;
|
||||
@@ -100,7 +100,7 @@ public class StaxPayloadMethodArgumentResolver extends TransformerObjectSupport
|
||||
if (streamReader == null) {
|
||||
// as a final resort, transform the source to a stream, and read from that
|
||||
ByteArrayInputStream bis = convertToByteArrayInputStream(requestSource);
|
||||
streamReader = inputFactory.createXMLStreamReader(bis);
|
||||
streamReader = this.inputFactory.createXMLStreamReader(bis);
|
||||
}
|
||||
return streamReader;
|
||||
}
|
||||
@@ -113,7 +113,7 @@ public class StaxPayloadMethodArgumentResolver extends TransformerObjectSupport
|
||||
XMLStreamReader streamReader = StaxUtils.getXMLStreamReader(requestSource);
|
||||
if (streamReader != null) {
|
||||
try {
|
||||
eventReader = inputFactory.createXMLEventReader(streamReader);
|
||||
eventReader = this.inputFactory.createXMLEventReader(streamReader);
|
||||
}
|
||||
catch (XMLStreamException ex) {
|
||||
eventReader = null;
|
||||
@@ -124,7 +124,7 @@ public class StaxPayloadMethodArgumentResolver extends TransformerObjectSupport
|
||||
}
|
||||
if (eventReader == null) {
|
||||
try {
|
||||
eventReader = inputFactory.createXMLEventReader(requestSource);
|
||||
eventReader = this.inputFactory.createXMLEventReader(requestSource);
|
||||
}
|
||||
catch (XMLStreamException | UnsupportedOperationException ex) {
|
||||
eventReader = null;
|
||||
@@ -133,7 +133,7 @@ public class StaxPayloadMethodArgumentResolver extends TransformerObjectSupport
|
||||
if (eventReader == null) {
|
||||
// as a final resort, transform the source to a stream, and read from that
|
||||
ByteArrayInputStream bis = convertToByteArrayInputStream(requestSource);
|
||||
eventReader = inputFactory.createXMLEventReader(bis);
|
||||
eventReader = this.inputFactory.createXMLEventReader(bis);
|
||||
}
|
||||
return eventReader;
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ public class XPathParamMethodArgumentResolver implements MethodArgumentResolver
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return conversionService.canConvert(String.class, parameterType);
|
||||
return this.conversionService.canConvert(String.class, parameterType);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ public class XPathParamMethodArgumentResolver implements MethodArgumentResolver
|
||||
Element rootElement = getRootElement(messageContext.getRequest().getPayloadSource());
|
||||
String expression = parameter.getParameterAnnotation(XPathParam.class).value();
|
||||
Object result = xpath.evaluate(expression, rootElement, evaluationReturnType);
|
||||
return useConversionService ? conversionService.convert(result, parameterType) : result;
|
||||
return (useConversionService) ? this.conversionService.convert(result, parameterType) : result;
|
||||
}
|
||||
|
||||
private QName getReturnType(Class<?> parameterType) {
|
||||
@@ -132,14 +132,14 @@ public class XPathParamMethodArgumentResolver implements MethodArgumentResolver
|
||||
}
|
||||
|
||||
private XPath createXPath() {
|
||||
synchronized (xpathFactory) {
|
||||
return xpathFactory.newXPath();
|
||||
synchronized (this.xpathFactory) {
|
||||
return this.xpathFactory.newXPath();
|
||||
}
|
||||
}
|
||||
|
||||
private Element getRootElement(Source source) throws TransformerException {
|
||||
DOMResult domResult = new DOMResult();
|
||||
transformerHelper.transform(source, domResult);
|
||||
this.transformerHelper.transform(source, domResult);
|
||||
Document document = (Document) domResult.getNode();
|
||||
return document.getDocumentElement();
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ public class XomPayloadMethodProcessor extends AbstractPayloadSourceMethodProces
|
||||
if (document == null) {
|
||||
document = new Document(returnedElement);
|
||||
}
|
||||
DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
|
||||
DocumentBuilder documentBuilder = this.documentBuilderFactory.newDocumentBuilder();
|
||||
DOMImplementation domImplementation = documentBuilder.getDOMImplementation();
|
||||
org.w3c.dom.Document w3cDocument = DOMConverter.convert(document, domImplementation);
|
||||
return new DOMSource(w3cDocument);
|
||||
|
||||
@@ -102,8 +102,8 @@ public abstract class AbstractJaxb2PayloadMethodProcessor extends AbstractPayloa
|
||||
Assert.notNull(messageContext, "'messageContext' must not be null");
|
||||
Assert.notNull(clazz, "'clazz' must not be null");
|
||||
Assert.notNull(jaxbElement, "'jaxbElement' must not be null");
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Marshalling [" + jaxbElement + "] to response payload");
|
||||
if (this.logger.isDebugEnabled()) {
|
||||
this.logger.debug("Marshalling [" + jaxbElement + "] to response payload");
|
||||
}
|
||||
WebServiceMessage response = messageContext.getResponse();
|
||||
if (response instanceof StreamingWebServiceMessage streamingResponse) {
|
||||
@@ -139,8 +139,8 @@ public abstract class AbstractJaxb2PayloadMethodProcessor extends AbstractPayloa
|
||||
try {
|
||||
Jaxb2SourceCallback callback = new Jaxb2SourceCallback(clazz);
|
||||
TraxUtils.doWithSource(requestPayload, callback);
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Unmarshalled payload request to [" + callback.result + "]");
|
||||
if (this.logger.isDebugEnabled()) {
|
||||
this.logger.debug("Unmarshalled payload request to [" + callback.result + "]");
|
||||
}
|
||||
return callback.result;
|
||||
}
|
||||
@@ -165,8 +165,8 @@ public abstract class AbstractJaxb2PayloadMethodProcessor extends AbstractPayloa
|
||||
try {
|
||||
JaxbElementSourceCallback<T> callback = new JaxbElementSourceCallback<>(clazz);
|
||||
TraxUtils.doWithSource(requestPayload, callback);
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Unmarshalled payload request to [" + callback.result + "]");
|
||||
if (this.logger.isDebugEnabled()) {
|
||||
this.logger.debug("Unmarshalled payload request to [" + callback.result + "]");
|
||||
}
|
||||
return callback.result;
|
||||
}
|
||||
@@ -177,7 +177,7 @@ public abstract class AbstractJaxb2PayloadMethodProcessor extends AbstractPayloa
|
||||
|
||||
private Source getRequestPayload(MessageContext messageContext) {
|
||||
WebServiceMessage request = messageContext.getRequest();
|
||||
return request != null ? request.getPayloadSource() : null;
|
||||
return (request != null) ? request.getPayloadSource() : null;
|
||||
}
|
||||
|
||||
private JAXBException convertToJaxbException(Exception ex) {
|
||||
@@ -223,29 +223,29 @@ public abstract class AbstractJaxb2PayloadMethodProcessor extends AbstractPayloa
|
||||
|
||||
private JAXBContext getJaxbContext(Class<?> clazz) throws JAXBException {
|
||||
Assert.notNull(clazz, "'clazz' must not be null");
|
||||
JAXBContext jaxbContext = jaxbContexts.get(clazz);
|
||||
JAXBContext jaxbContext = this.jaxbContexts.get(clazz);
|
||||
if (jaxbContext == null) {
|
||||
jaxbContext = JAXBContext.newInstance(clazz);
|
||||
jaxbContexts.putIfAbsent(clazz, jaxbContext);
|
||||
this.jaxbContexts.putIfAbsent(clazz, jaxbContext);
|
||||
}
|
||||
return jaxbContext;
|
||||
}
|
||||
|
||||
// Callbacks
|
||||
|
||||
private class Jaxb2SourceCallback implements TraxUtils.SourceCallback {
|
||||
private final class Jaxb2SourceCallback implements TraxUtils.SourceCallback {
|
||||
|
||||
private final Unmarshaller unmarshaller;
|
||||
|
||||
private Object result;
|
||||
|
||||
public Jaxb2SourceCallback(Class<?> clazz) throws JAXBException {
|
||||
Jaxb2SourceCallback(Class<?> clazz) throws JAXBException {
|
||||
this.unmarshaller = createUnmarshaller(clazz);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void domSource(Node node) throws JAXBException {
|
||||
result = unmarshaller.unmarshal(node);
|
||||
this.result = this.unmarshaller.unmarshal(node);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -260,48 +260,48 @@ public abstract class AbstractJaxb2PayloadMethodProcessor extends AbstractPayloa
|
||||
// In this case, we need to use a ContentHandler to feed the SAX events
|
||||
// into
|
||||
// the unmarshaller.
|
||||
UnmarshallerHandler handler = unmarshaller.getUnmarshallerHandler();
|
||||
UnmarshallerHandler handler = this.unmarshaller.getUnmarshallerHandler();
|
||||
reader.setContentHandler(handler);
|
||||
reader.parse(inputSource);
|
||||
result = handler.getResult();
|
||||
this.result = handler.getResult();
|
||||
}
|
||||
else {
|
||||
// If a stream or system ID is set, we assume that the SAXSource is backed
|
||||
// by a SAX parser and we only pass the InputSource to the unmarshaller.
|
||||
// This effectively ignores the SAX parser and lets the unmarshaller take
|
||||
// care of the parsing (in a potentially more efficient way).
|
||||
result = unmarshaller.unmarshal(inputSource);
|
||||
this.result = this.unmarshaller.unmarshal(inputSource);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void staxSource(XMLEventReader eventReader) throws JAXBException {
|
||||
result = unmarshaller.unmarshal(eventReader);
|
||||
this.result = this.unmarshaller.unmarshal(eventReader);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void staxSource(XMLStreamReader streamReader) throws JAXBException {
|
||||
result = unmarshaller.unmarshal(streamReader);
|
||||
this.result = this.unmarshaller.unmarshal(streamReader);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void streamSource(InputStream inputStream) throws IOException, JAXBException {
|
||||
result = unmarshaller.unmarshal(inputStream);
|
||||
this.result = this.unmarshaller.unmarshal(inputStream);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void streamSource(Reader reader) throws IOException, JAXBException {
|
||||
result = unmarshaller.unmarshal(reader);
|
||||
this.result = this.unmarshaller.unmarshal(reader);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void source(String systemId) throws Exception {
|
||||
result = unmarshaller.unmarshal(new URL(systemId));
|
||||
this.result = this.unmarshaller.unmarshal(new URL(systemId));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private class JaxbElementSourceCallback<T> implements TraxUtils.SourceCallback {
|
||||
private final class JaxbElementSourceCallback<T> implements TraxUtils.SourceCallback {
|
||||
|
||||
private final Unmarshaller unmarshaller;
|
||||
|
||||
@@ -309,49 +309,49 @@ public abstract class AbstractJaxb2PayloadMethodProcessor extends AbstractPayloa
|
||||
|
||||
private JAXBElement<T> result;
|
||||
|
||||
public JaxbElementSourceCallback(Class<T> declaredType) throws JAXBException {
|
||||
JaxbElementSourceCallback(Class<T> declaredType) throws JAXBException {
|
||||
this.unmarshaller = createUnmarshaller(declaredType);
|
||||
this.declaredType = declaredType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void domSource(Node node) throws JAXBException {
|
||||
result = unmarshaller.unmarshal(node, declaredType);
|
||||
this.result = this.unmarshaller.unmarshal(node, this.declaredType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saxSource(XMLReader reader, InputSource inputSource) throws JAXBException {
|
||||
result = unmarshaller.unmarshal(new SAXSource(reader, inputSource), declaredType);
|
||||
this.result = this.unmarshaller.unmarshal(new SAXSource(reader, inputSource), this.declaredType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void staxSource(XMLEventReader eventReader) throws JAXBException {
|
||||
result = unmarshaller.unmarshal(eventReader, declaredType);
|
||||
this.result = this.unmarshaller.unmarshal(eventReader, this.declaredType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void staxSource(XMLStreamReader streamReader) throws JAXBException {
|
||||
result = unmarshaller.unmarshal(streamReader, declaredType);
|
||||
this.result = this.unmarshaller.unmarshal(streamReader, this.declaredType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void streamSource(InputStream inputStream) throws IOException, JAXBException {
|
||||
result = unmarshaller.unmarshal(new StreamSource(inputStream), declaredType);
|
||||
this.result = this.unmarshaller.unmarshal(new StreamSource(inputStream), this.declaredType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void streamSource(Reader reader) throws IOException, JAXBException {
|
||||
result = unmarshaller.unmarshal(new StreamSource(reader), declaredType);
|
||||
this.result = this.unmarshaller.unmarshal(new StreamSource(reader), this.declaredType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void source(String systemId) throws Exception {
|
||||
result = unmarshaller.unmarshal(new StreamSource(systemId), declaredType);
|
||||
this.result = this.unmarshaller.unmarshal(new StreamSource(systemId), this.declaredType);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private class Jaxb2ResultCallback implements TraxUtils.ResultCallback {
|
||||
private final class Jaxb2ResultCallback implements TraxUtils.ResultCallback {
|
||||
|
||||
private final Marshaller marshaller;
|
||||
|
||||
@@ -364,42 +364,42 @@ public abstract class AbstractJaxb2PayloadMethodProcessor extends AbstractPayloa
|
||||
|
||||
@Override
|
||||
public void domResult(Node node) throws JAXBException {
|
||||
marshaller.marshal(jaxbElement, node);
|
||||
this.marshaller.marshal(this.jaxbElement, node);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saxResult(ContentHandler contentHandler, LexicalHandler lexicalHandler) throws JAXBException {
|
||||
marshaller.marshal(jaxbElement, contentHandler);
|
||||
this.marshaller.marshal(this.jaxbElement, contentHandler);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void staxResult(XMLEventWriter eventWriter) throws JAXBException {
|
||||
marshaller.marshal(jaxbElement, eventWriter);
|
||||
this.marshaller.marshal(this.jaxbElement, eventWriter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void staxResult(XMLStreamWriter streamWriter) throws JAXBException {
|
||||
marshaller.marshal(jaxbElement, streamWriter);
|
||||
this.marshaller.marshal(this.jaxbElement, streamWriter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void streamResult(OutputStream outputStream) throws JAXBException {
|
||||
marshaller.marshal(jaxbElement, outputStream);
|
||||
this.marshaller.marshal(this.jaxbElement, outputStream);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void streamResult(Writer writer) throws JAXBException {
|
||||
marshaller.marshal(jaxbElement, writer);
|
||||
this.marshaller.marshal(this.jaxbElement, writer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void result(String systemId) throws Exception {
|
||||
marshaller.marshal(jaxbElement, new StreamResult(systemId));
|
||||
this.marshaller.marshal(this.jaxbElement, new StreamResult(systemId));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private class JaxbStreamingPayload implements StreamingPayload {
|
||||
private final class JaxbStreamingPayload implements StreamingPayload {
|
||||
|
||||
private final Object jaxbElement;
|
||||
|
||||
@@ -418,16 +418,16 @@ public abstract class AbstractJaxb2PayloadMethodProcessor extends AbstractPayloa
|
||||
|
||||
@Override
|
||||
public QName getName() {
|
||||
return name;
|
||||
return this.name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeTo(XMLStreamWriter streamWriter) throws XMLStreamException {
|
||||
try {
|
||||
marshaller.marshal(jaxbElement, streamWriter);
|
||||
this.marshaller.marshal(this.jaxbElement, streamWriter);
|
||||
}
|
||||
catch (JAXBException ex) {
|
||||
throw new XMLStreamException("Could not marshal [" + jaxbElement + "]: " + ex.getMessage(), ex);
|
||||
throw new XMLStreamException("Could not marshal [" + this.jaxbElement + "]: " + ex.getMessage(), ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ public class XmlRootElementPayloadMethodProcessor extends AbstractJaxb2PayloadMe
|
||||
}
|
||||
else {
|
||||
JAXBElement<?> element = unmarshalElementFromRequestPayload(messageContext, parameterType);
|
||||
return element != null ? element.getValue() : null;
|
||||
return (element != null) ? element.getValue() : null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -36,8 +36,8 @@ import org.springframework.ws.soap.server.endpoint.mapping.SoapActionAnnotationM
|
||||
* {@link SoapActionAnnotationMethodEndpointMapping}.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @see org.springframework.context.annotation.ClassPathBeanDefinitionScanner
|
||||
* @since 1.0.0
|
||||
* @see org.springframework.context.annotation.ClassPathBeanDefinitionScanner
|
||||
*/
|
||||
@Target(ElementType.TYPE)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
|
||||
@@ -32,9 +32,9 @@ import javax.xml.XMLConstants;
|
||||
* {@link PayloadRoot @PayloadRoot}.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @since 2.0
|
||||
* @see XPathParam
|
||||
* @see PayloadRoot
|
||||
* @since 2.0
|
||||
*/
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
|
||||
@@ -27,8 +27,8 @@ import java.lang.annotation.Target;
|
||||
* package.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @see Namespace
|
||||
* @since 2.0
|
||||
* @see Namespace
|
||||
*/
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
|
||||
@@ -28,8 +28,8 @@ import java.lang.annotation.Target;
|
||||
* signify the request payload root element that is handled by the method.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @see org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping
|
||||
* @since 1.0.0
|
||||
* @see org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping
|
||||
*/
|
||||
@Target(ElementType.METHOD)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
|
||||
@@ -26,8 +26,8 @@ import java.lang.annotation.Target;
|
||||
* Marks an endpoint method as containing multiple {@link PayloadRoot PayloadRoots}.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @see org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping
|
||||
* @since 2.2
|
||||
* @see org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping
|
||||
*/
|
||||
@Target(ElementType.METHOD)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
|
||||
@@ -28,8 +28,8 @@ import java.lang.annotation.Target;
|
||||
* payload}. Supported for annotated endpoint methods.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @see ResponsePayload
|
||||
* @since 2.0
|
||||
* @see ResponsePayload
|
||||
*/
|
||||
@Target(ElementType.PARAMETER)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
|
||||
@@ -28,8 +28,8 @@ import java.lang.annotation.Target;
|
||||
* payload}. Supported for annotated endpoint methods.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @see RequestPayload
|
||||
* @since 2.0
|
||||
* @see RequestPayload
|
||||
*/
|
||||
@Target(ElementType.METHOD)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
|
||||
@@ -35,8 +35,8 @@ import java.lang.annotation.Target;
|
||||
* </ul>
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @see org.springframework.ws.server.endpoint.adapter.method.XPathParamMethodArgumentResolver
|
||||
* @since 1.0.0
|
||||
* @see org.springframework.ws.server.endpoint.adapter.method.XPathParamMethodArgumentResolver
|
||||
*/
|
||||
@Target(ElementType.PARAMETER)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
|
||||
@@ -51,9 +51,9 @@ import org.springframework.xml.xsd.XsdSchemaCollection;
|
||||
* using the {@code validateRequest} and {@code validateResponse} properties.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @since 1.0.0
|
||||
* @see #getValidationRequestSource(org.springframework.ws.WebServiceMessage)
|
||||
* @see #getValidationResponseSource(org.springframework.ws.WebServiceMessage)
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public abstract class AbstractValidatingInterceptor extends TransformerObjectSupport
|
||||
implements EndpointInterceptor, InitializingBean {
|
||||
@@ -71,7 +71,7 @@ public abstract class AbstractValidatingInterceptor extends TransformerObjectSup
|
||||
private ValidationErrorHandler errorHandler;
|
||||
|
||||
public String getSchemaLanguage() {
|
||||
return schemaLanguage;
|
||||
return this.schemaLanguage;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -88,7 +88,7 @@ public abstract class AbstractValidatingInterceptor extends TransformerObjectSup
|
||||
* Returns the schema resources to use for validation.
|
||||
*/
|
||||
public Resource[] getSchemas() {
|
||||
return schemas;
|
||||
return this.schemas;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -164,17 +164,18 @@ public abstract class AbstractValidatingInterceptor extends TransformerObjectSup
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() throws Exception {
|
||||
if (validator == null && !ObjectUtils.isEmpty(schemas)) {
|
||||
Assert.hasLength(schemaLanguage, "schemaLanguage is required");
|
||||
for (Resource schema : schemas) {
|
||||
if (this.validator == null && !ObjectUtils.isEmpty(this.schemas)) {
|
||||
Assert.hasLength(this.schemaLanguage, "schemaLanguage is required");
|
||||
for (Resource schema : this.schemas) {
|
||||
Assert.isTrue(schema.exists(), "schema [" + schema + "] does not exist");
|
||||
}
|
||||
if (logger.isInfoEnabled()) {
|
||||
logger.info("Validating using " + StringUtils.arrayToCommaDelimitedString(schemas));
|
||||
if (this.logger.isInfoEnabled()) {
|
||||
this.logger.info("Validating using " + StringUtils.arrayToCommaDelimitedString(this.schemas));
|
||||
}
|
||||
validator = XmlValidatorFactory.createValidator(schemas, schemaLanguage);
|
||||
this.validator = XmlValidatorFactory.createValidator(this.schemas, this.schemaLanguage);
|
||||
}
|
||||
Assert.notNull(validator, "Setting 'schema', 'schemas', 'xsdSchema', or 'xsdSchemaCollection' is required");
|
||||
Assert.notNull(this.validator,
|
||||
"Setting 'schema', 'schemas', 'xsdSchema', or 'xsdSchemaCollection' is required");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -191,15 +192,15 @@ public abstract class AbstractValidatingInterceptor extends TransformerObjectSup
|
||||
@Override
|
||||
public boolean handleRequest(MessageContext messageContext, Object endpoint)
|
||||
throws IOException, SAXException, TransformerException {
|
||||
if (validateRequest) {
|
||||
if (this.validateRequest) {
|
||||
Source requestSource = getValidationRequestSource(messageContext.getRequest());
|
||||
if (requestSource != null) {
|
||||
SAXParseException[] errors = validator.validate(requestSource, errorHandler);
|
||||
SAXParseException[] errors = this.validator.validate(requestSource, this.errorHandler);
|
||||
if (!ObjectUtils.isEmpty(errors)) {
|
||||
return handleRequestValidationErrors(messageContext, errors);
|
||||
}
|
||||
else if (logger.isDebugEnabled()) {
|
||||
logger.debug("Request message validated");
|
||||
else if (this.logger.isDebugEnabled()) {
|
||||
this.logger.debug("Request message validated");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -218,7 +219,7 @@ public abstract class AbstractValidatingInterceptor extends TransformerObjectSup
|
||||
protected boolean handleRequestValidationErrors(MessageContext messageContext, SAXParseException[] errors)
|
||||
throws TransformerException {
|
||||
for (SAXParseException error : errors) {
|
||||
logger.warn("XML validation error on request: " + error.getMessage());
|
||||
this.logger.warn("XML validation error on request: " + error.getMessage());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -235,15 +236,15 @@ public abstract class AbstractValidatingInterceptor extends TransformerObjectSup
|
||||
*/
|
||||
@Override
|
||||
public boolean handleResponse(MessageContext messageContext, Object endpoint) throws IOException, SAXException {
|
||||
if (validateResponse) {
|
||||
if (this.validateResponse) {
|
||||
Source responseSource = getValidationResponseSource(messageContext.getResponse());
|
||||
if (responseSource != null) {
|
||||
SAXParseException[] errors = validator.validate(responseSource, errorHandler);
|
||||
SAXParseException[] errors = this.validator.validate(responseSource, this.errorHandler);
|
||||
if (!ObjectUtils.isEmpty(errors)) {
|
||||
return handleResponseValidationErrors(messageContext, errors);
|
||||
}
|
||||
else if (logger.isDebugEnabled()) {
|
||||
logger.debug("Response message validated");
|
||||
else if (this.logger.isDebugEnabled()) {
|
||||
this.logger.debug("Response message validated");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -261,7 +262,7 @@ public abstract class AbstractValidatingInterceptor extends TransformerObjectSup
|
||||
*/
|
||||
protected boolean handleResponseValidationErrors(MessageContext messageContext, SAXParseException[] errors) {
|
||||
for (SAXParseException error : errors) {
|
||||
logger.error("XML validation error on response: " + error.getMessage());
|
||||
this.logger.error("XML validation error on response: " + error.getMessage());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ public class DelegatingSmartEndpointInterceptor implements SmartEndpointIntercep
|
||||
* @return the delegate
|
||||
*/
|
||||
public EndpointInterceptor getDelegate() {
|
||||
return delegate;
|
||||
return this.delegate;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -32,10 +32,14 @@ import org.springframework.ws.server.EndpointInterceptor;
|
||||
*/
|
||||
public class EndpointInterceptorAdapter implements EndpointInterceptor {
|
||||
|
||||
/** Logger available to subclasses */
|
||||
/**
|
||||
* Logger available to subclasses.
|
||||
*/
|
||||
protected final Log logger = LogFactory.getLog(getClass());
|
||||
|
||||
/** Returns {@code false}. */
|
||||
/**
|
||||
* Returns {@code false}.
|
||||
*/
|
||||
public boolean understands(Element header) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -30,9 +30,9 @@ import org.springframework.ws.server.endpoint.AbstractLoggingInterceptor;
|
||||
* {@link #setLogResponse(boolean) logResponse} properties.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @since 1.0.0
|
||||
* @see #setLogRequest(boolean)
|
||||
* @see #setLogResponse(boolean)
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public class PayloadLoggingInterceptor extends AbstractLoggingInterceptor {
|
||||
|
||||
|
||||
@@ -52,9 +52,9 @@ import org.springframework.xml.transform.TransformerObjectSupport;
|
||||
* simply not transformed. Setting one of the two is required, though.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @since 1.0.0
|
||||
* @see #setRequestXslt(org.springframework.core.io.Resource)
|
||||
* @see #setResponseXslt(org.springframework.core.io.Resource)
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public class PayloadTransformingInterceptor extends TransformerObjectSupport
|
||||
implements EndpointInterceptor, InitializingBean {
|
||||
@@ -88,9 +88,9 @@ public class PayloadTransformingInterceptor extends TransformerObjectSupport
|
||||
*/
|
||||
@Override
|
||||
public boolean handleRequest(MessageContext messageContext, Object endpoint) throws Exception {
|
||||
if (requestTemplates != null) {
|
||||
if (this.requestTemplates != null) {
|
||||
WebServiceMessage request = messageContext.getRequest();
|
||||
Transformer transformer = requestTemplates.newTransformer();
|
||||
Transformer transformer = this.requestTemplates.newTransformer();
|
||||
transformMessage(request, transformer);
|
||||
logger.debug("Request message transformed");
|
||||
}
|
||||
@@ -106,9 +106,9 @@ public class PayloadTransformingInterceptor extends TransformerObjectSupport
|
||||
*/
|
||||
@Override
|
||||
public boolean handleResponse(MessageContext messageContext, Object endpoint) throws Exception {
|
||||
if (responseTemplates != null) {
|
||||
if (this.responseTemplates != null) {
|
||||
WebServiceMessage response = messageContext.getResponse();
|
||||
Transformer transformer = responseTemplates.newTransformer();
|
||||
Transformer transformer = this.responseTemplates.newTransformer();
|
||||
transformMessage(response, transformer);
|
||||
logger.debug("Response message transformed");
|
||||
}
|
||||
@@ -135,7 +135,7 @@ public class PayloadTransformingInterceptor extends TransformerObjectSupport
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() throws Exception {
|
||||
if (requestXslt == null && responseXslt == null) {
|
||||
if (this.requestXslt == null && this.responseXslt == null) {
|
||||
throw new IllegalArgumentException("Setting either 'requestXslt' or 'responseXslt' is required");
|
||||
}
|
||||
TransformerFactory transformerFactory = getTransformerFactory();
|
||||
@@ -143,21 +143,21 @@ public class PayloadTransformingInterceptor extends TransformerObjectSupport
|
||||
parserFactory.setNamespaceAware(true);
|
||||
XMLReader xmlReader = parserFactory.newSAXParser().getXMLReader();
|
||||
xmlReader.setFeature("http://xml.org/sax/features/namespace-prefixes", true);
|
||||
if (requestXslt != null) {
|
||||
Assert.isTrue(requestXslt.exists(), "requestXslt \"" + requestXslt + "\" does not exit");
|
||||
if (this.requestXslt != null) {
|
||||
Assert.isTrue(this.requestXslt.exists(), "requestXslt \"" + this.requestXslt + "\" does not exit");
|
||||
if (logger.isInfoEnabled()) {
|
||||
logger.info("Transforming request using " + requestXslt);
|
||||
logger.info("Transforming request using " + this.requestXslt);
|
||||
}
|
||||
Source requestSource = new ResourceSource(xmlReader, requestXslt);
|
||||
requestTemplates = transformerFactory.newTemplates(requestSource);
|
||||
Source requestSource = new ResourceSource(xmlReader, this.requestXslt);
|
||||
this.requestTemplates = transformerFactory.newTemplates(requestSource);
|
||||
}
|
||||
if (responseXslt != null) {
|
||||
Assert.isTrue(responseXslt.exists(), "responseXslt \"" + responseXslt + "\" does not exit");
|
||||
if (this.responseXslt != null) {
|
||||
Assert.isTrue(this.responseXslt.exists(), "responseXslt \"" + this.responseXslt + "\" does not exit");
|
||||
if (logger.isInfoEnabled()) {
|
||||
logger.info("Transforming response using " + responseXslt);
|
||||
logger.info("Transforming response using " + this.responseXslt);
|
||||
}
|
||||
Source responseSource = new ResourceSource(xmlReader, responseXslt);
|
||||
responseTemplates = transformerFactory.newTemplates(responseSource);
|
||||
Source responseSource = new ResourceSource(xmlReader, this.responseXslt);
|
||||
this.responseTemplates = transformerFactory.newTemplates(responseSource);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ import org.springframework.ws.server.endpoint.annotation.Endpoint;
|
||||
* The methods of each bean carrying @Endpoint will be registered using
|
||||
* {@link #registerMethods(String)}.
|
||||
*
|
||||
* @param <T> the type of the key
|
||||
* @author Arjen Poutsma
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@@ -60,8 +61,8 @@ public abstract class AbstractAnnotationMethodEndpointMapping<T> extends Abstrac
|
||||
@Override
|
||||
protected void initApplicationContext() throws BeansException {
|
||||
super.initApplicationContext();
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Looking for endpoints in application context: " + getApplicationContext());
|
||||
if (this.logger.isDebugEnabled()) {
|
||||
this.logger.debug("Looking for endpoints in application context: " + getApplicationContext());
|
||||
}
|
||||
String[] beanNames = (this.detectEndpointsInAncestorContexts
|
||||
? BeanFactoryUtils.beanNamesForTypeIncludingAncestors(getApplicationContext(), Object.class)
|
||||
|
||||
@@ -36,9 +36,9 @@ import org.springframework.ws.server.SmartEndpointInterceptor;
|
||||
* and endpoint interceptors.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @since 1.0.0
|
||||
* @see #getEndpointInternal(org.springframework.ws.context.MessageContext)
|
||||
* @see org.springframework.ws.server.EndpointInterceptor
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public abstract class AbstractEndpointMapping extends ApplicationObjectSupport implements EndpointMapping, Ordered {
|
||||
|
||||
@@ -56,7 +56,7 @@ public abstract class AbstractEndpointMapping extends ApplicationObjectSupport i
|
||||
* @return array of endpoint interceptors, or {@code null} if none
|
||||
*/
|
||||
public EndpointInterceptor[] getInterceptors() {
|
||||
return interceptors;
|
||||
return this.interceptors;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -70,7 +70,7 @@ public abstract class AbstractEndpointMapping extends ApplicationObjectSupport i
|
||||
|
||||
@Override
|
||||
public final int getOrder() {
|
||||
return order;
|
||||
return this.order;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -114,7 +114,7 @@ public abstract class AbstractEndpointMapping extends ApplicationObjectSupport i
|
||||
public final EndpointInvocationChain getEndpoint(MessageContext messageContext) throws Exception {
|
||||
Object endpoint = getEndpointInternal(messageContext);
|
||||
if (endpoint == null) {
|
||||
endpoint = defaultEndpoint;
|
||||
endpoint = this.defaultEndpoint;
|
||||
}
|
||||
if (endpoint == null) {
|
||||
return null;
|
||||
@@ -132,7 +132,7 @@ public abstract class AbstractEndpointMapping extends ApplicationObjectSupport i
|
||||
}
|
||||
|
||||
if (this.smartInterceptors != null) {
|
||||
for (SmartEndpointInterceptor smartInterceptor : smartInterceptors) {
|
||||
for (SmartEndpointInterceptor smartInterceptor : this.smartInterceptors) {
|
||||
if (smartInterceptor.shouldIntercept(messageContext, endpoint)) {
|
||||
interceptors.add(smartInterceptor);
|
||||
}
|
||||
@@ -162,7 +162,7 @@ public abstract class AbstractEndpointMapping extends ApplicationObjectSupport i
|
||||
* @return the default endpoint mapping, or null if none
|
||||
*/
|
||||
protected final Object getDefaultEndpoint() {
|
||||
return defaultEndpoint;
|
||||
return this.defaultEndpoint;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -77,7 +77,7 @@ public abstract class AbstractMapBasedEndpointMapping extends AbstractEndpointMa
|
||||
* @throws IllegalArgumentException if the endpoint is invalid
|
||||
*/
|
||||
public final void setEndpointMap(Map<String, Object> endpointMap) {
|
||||
temporaryEndpointMap.putAll(endpointMap);
|
||||
this.temporaryEndpointMap.putAll(endpointMap);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -87,7 +87,7 @@ public abstract class AbstractMapBasedEndpointMapping extends AbstractEndpointMa
|
||||
public void setMappings(Properties mappings) {
|
||||
for (Map.Entry<Object, Object> entry : mappings.entrySet()) {
|
||||
if (entry.getKey() instanceof String) {
|
||||
temporaryEndpointMap.put((String) entry.getKey(), entry.getValue());
|
||||
this.temporaryEndpointMap.put((String) entry.getKey(), entry.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -116,8 +116,8 @@ public abstract class AbstractMapBasedEndpointMapping extends AbstractEndpointMa
|
||||
if (!StringUtils.hasLength(key)) {
|
||||
return null;
|
||||
}
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Looking up endpoint for [" + key + "]");
|
||||
if (this.logger.isDebugEnabled()) {
|
||||
this.logger.debug("Looking up endpoint for [" + key + "]");
|
||||
}
|
||||
return lookupEndpoint(key);
|
||||
}
|
||||
@@ -128,7 +128,7 @@ public abstract class AbstractMapBasedEndpointMapping extends AbstractEndpointMa
|
||||
* @return the associated endpoint instance, or {@code null} if not found
|
||||
*/
|
||||
protected Object lookupEndpoint(String key) {
|
||||
return endpointMap.get(key);
|
||||
return this.endpointMap.get(key);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -139,20 +139,20 @@ public abstract class AbstractMapBasedEndpointMapping extends AbstractEndpointMa
|
||||
* registered
|
||||
*/
|
||||
protected void registerEndpoint(String key, Object endpoint) throws BeansException {
|
||||
Object mappedEndpoint = endpointMap.get(key);
|
||||
Object mappedEndpoint = this.endpointMap.get(key);
|
||||
if (mappedEndpoint != null) {
|
||||
throw new ApplicationContextException("Cannot map endpoint [" + endpoint + "] on registration key [" + key
|
||||
+ "]: there's already endpoint [" + mappedEndpoint + "] mapped");
|
||||
}
|
||||
if (!lazyInitEndpoints && endpoint instanceof String endpointName) {
|
||||
if (!this.lazyInitEndpoints && endpoint instanceof String endpointName) {
|
||||
endpoint = resolveStringEndpoint(endpointName);
|
||||
}
|
||||
if (endpoint == null) {
|
||||
throw new ApplicationContextException("Could not find endpoint for key [" + key + "]");
|
||||
}
|
||||
endpointMap.put(key, endpoint);
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Mapped key [" + key + "] onto endpoint [" + endpoint + "]");
|
||||
this.endpointMap.put(key, endpoint);
|
||||
if (this.logger.isDebugEnabled()) {
|
||||
this.logger.debug("Mapped key [" + key + "] onto endpoint [" + endpoint + "]");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -169,17 +169,18 @@ public abstract class AbstractMapBasedEndpointMapping extends AbstractEndpointMa
|
||||
@Override
|
||||
protected final void initApplicationContext() throws BeansException {
|
||||
super.initApplicationContext();
|
||||
for (String key : temporaryEndpointMap.keySet()) {
|
||||
Object endpoint = temporaryEndpointMap.get(key);
|
||||
for (String key : this.temporaryEndpointMap.keySet()) {
|
||||
Object endpoint = this.temporaryEndpointMap.get(key);
|
||||
if (!validateLookupKey(key)) {
|
||||
throw new ApplicationContextException("Invalid key [" + key + "] for endpoint [" + endpoint + "]");
|
||||
}
|
||||
registerEndpoint(key, endpoint);
|
||||
}
|
||||
temporaryEndpointMap = null;
|
||||
if (registerBeanNames) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Looking for endpoint mappings in application context: [" + getApplicationContext() + "]");
|
||||
this.temporaryEndpointMap = null;
|
||||
if (this.registerBeanNames) {
|
||||
if (this.logger.isDebugEnabled()) {
|
||||
this.logger
|
||||
.debug("Looking for endpoint mappings in application context: [" + getApplicationContext() + "]");
|
||||
}
|
||||
String[] beanNames = getApplicationContext().getBeanDefinitionNames();
|
||||
for (String beanName : beanNames) {
|
||||
|
||||
@@ -44,6 +44,7 @@ import org.springframework.ws.server.endpoint.MethodEndpoint;
|
||||
* that qualify as endpoint. The methods of this bean are then registered under a specific
|
||||
* key with {@link #registerEndpoint(Object, MethodEndpoint)}.
|
||||
*
|
||||
* @param <T> the type of the key
|
||||
* @author Arjen Poutsma
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@@ -63,8 +64,8 @@ public abstract class AbstractMethodEndpointMapping<T> extends AbstractEndpointM
|
||||
if (key == null) {
|
||||
return null;
|
||||
}
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Looking up endpoint for [" + key + "]");
|
||||
if (this.logger.isDebugEnabled()) {
|
||||
this.logger.debug("Looking up endpoint for [" + key + "]");
|
||||
}
|
||||
return lookupEndpoint(key);
|
||||
}
|
||||
@@ -81,7 +82,7 @@ public abstract class AbstractMethodEndpointMapping<T> extends AbstractEndpointM
|
||||
* @return the associated endpoint instance, or {@code null} if not found
|
||||
*/
|
||||
protected MethodEndpoint lookupEndpoint(T key) {
|
||||
return endpointMap.get(key);
|
||||
return this.endpointMap.get(key);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -91,7 +92,7 @@ public abstract class AbstractMethodEndpointMapping<T> extends AbstractEndpointM
|
||||
* @throws BeansException if the endpoint could not be registered
|
||||
*/
|
||||
protected void registerEndpoint(T key, MethodEndpoint endpoint) throws BeansException {
|
||||
Object mappedEndpoint = endpointMap.get(key);
|
||||
Object mappedEndpoint = this.endpointMap.get(key);
|
||||
if (mappedEndpoint != null) {
|
||||
throw new ApplicationContextException("Cannot map endpoint [" + endpoint + "] on registration key [" + key
|
||||
+ "]: there's already endpoint [" + mappedEndpoint + "] mapped");
|
||||
@@ -99,9 +100,9 @@ public abstract class AbstractMethodEndpointMapping<T> extends AbstractEndpointM
|
||||
if (endpoint == null) {
|
||||
throw new ApplicationContextException("Could not find endpoint for key [" + key + "]");
|
||||
}
|
||||
endpointMap.put(key, endpoint);
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Mapped [" + key + "] onto endpoint [" + endpoint + "]");
|
||||
this.endpointMap.put(key, endpoint);
|
||||
if (this.logger.isDebugEnabled()) {
|
||||
this.logger.debug("Mapped [" + key + "] onto endpoint [" + endpoint + "]");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,7 +166,7 @@ public abstract class AbstractMethodEndpointMapping<T> extends AbstractEndpointM
|
||||
}
|
||||
endpointTypes.addAll(Arrays.asList(endpointType.getInterfaces()));
|
||||
for (Class<?> currentEndpointType : endpointTypes) {
|
||||
final Class<?> targetClass = (specificEndpointType != null ? specificEndpointType : currentEndpointType);
|
||||
final Class<?> targetClass = (specificEndpointType != null) ? specificEndpointType : currentEndpointType;
|
||||
ReflectionUtils.doWithMethods(currentEndpointType, new ReflectionUtils.MethodCallback() {
|
||||
public void doWith(Method method) {
|
||||
Method specificMethod = ClassUtils.getMostSpecificMethod(method, targetClass);
|
||||
@@ -201,7 +202,7 @@ public abstract class AbstractMethodEndpointMapping<T> extends AbstractEndpointM
|
||||
*/
|
||||
protected List<T> getLookupKeysForMethod(Method method) {
|
||||
T key = getLookupKeyForMethod(method);
|
||||
return key != null ? Collections.singletonList(key) : Collections.emptyList();
|
||||
return (key != null) ? Collections.singletonList(key) : Collections.emptyList();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -33,7 +33,7 @@ public abstract class AbstractQNameEndpointMapping extends AbstractMapBasedEndpo
|
||||
@Override
|
||||
protected final String getLookupKeyForMessage(MessageContext messageContext) throws Exception {
|
||||
QName qName = resolveQName(messageContext);
|
||||
return qName != null ? qName.toString() : null;
|
||||
return (qName != null) ? qName.toString() : null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -44,8 +44,8 @@ import org.springframework.xml.transform.TransformerFactoryUtils;
|
||||
* described in {@code QNameEditor}.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @see org.springframework.xml.namespace.QNameEditor
|
||||
* @since 1.0.0
|
||||
* @see org.springframework.xml.namespace.QNameEditor
|
||||
*/
|
||||
public class PayloadRootQNameEndpointMapping extends AbstractQNameEndpointMapping {
|
||||
|
||||
|
||||
@@ -50,8 +50,8 @@ import org.springframework.xml.transform.TransformerFactoryUtils;
|
||||
* local name.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @see #setEndpoints(Object[])
|
||||
* @since 1.0.0
|
||||
* @see #setEndpoints(Object[])
|
||||
*/
|
||||
public class SimpleMethodEndpointMapping extends AbstractMethodEndpointMapping<String> implements InitializingBean {
|
||||
|
||||
@@ -70,7 +70,7 @@ public class SimpleMethodEndpointMapping extends AbstractMethodEndpointMapping<S
|
||||
private TransformerFactory transformerFactory;
|
||||
|
||||
public Object[] getEndpoints() {
|
||||
return endpoints;
|
||||
return this.endpoints;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -83,7 +83,7 @@ public class SimpleMethodEndpointMapping extends AbstractMethodEndpointMapping<S
|
||||
|
||||
/** Returns the method prefix. */
|
||||
public String getMethodPrefix() {
|
||||
return methodPrefix;
|
||||
return this.methodPrefix;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -97,7 +97,7 @@ public class SimpleMethodEndpointMapping extends AbstractMethodEndpointMapping<S
|
||||
|
||||
/** Returns the method suffix. */
|
||||
public String getMethodSuffix() {
|
||||
return methodSuffix;
|
||||
return this.methodSuffix;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -112,7 +112,7 @@ public class SimpleMethodEndpointMapping extends AbstractMethodEndpointMapping<S
|
||||
@Override
|
||||
public final void afterPropertiesSet() throws Exception {
|
||||
Assert.notEmpty(getEndpoints(), "'endpoints' is required");
|
||||
transformerFactory = TransformerFactoryUtils.newInstance();
|
||||
this.transformerFactory = TransformerFactoryUtils.newInstance();
|
||||
for (int i = 0; i < getEndpoints().length; i++) {
|
||||
registerMethods(getEndpoints()[i]);
|
||||
}
|
||||
@@ -136,7 +136,7 @@ public class SimpleMethodEndpointMapping extends AbstractMethodEndpointMapping<S
|
||||
@Override
|
||||
protected String getLookupKeyForMessage(MessageContext messageContext) throws TransformerException {
|
||||
WebServiceMessage request = messageContext.getRequest();
|
||||
QName rootQName = PayloadRootUtils.getPayloadRootQName(request.getPayloadSource(), transformerFactory);
|
||||
QName rootQName = PayloadRootUtils.getPayloadRootQName(request.getPayloadSource(), this.transformerFactory);
|
||||
return rootQName.getLocalPart();
|
||||
}
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ public class UriEndpointMapping extends AbstractMapBasedEndpointMapping {
|
||||
new URI(key);
|
||||
return true;
|
||||
}
|
||||
catch (URISyntaxException e) {
|
||||
catch (URISyntaxException ex) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -93,7 +93,7 @@ public class UriEndpointMapping extends AbstractMapBasedEndpointMapping {
|
||||
WebServiceConnection connection = transportContext.getConnection();
|
||||
if (connection != null) {
|
||||
URI connectionUri = connection.getUri();
|
||||
if (usePath) {
|
||||
if (this.usePath) {
|
||||
return connectionUri.getPath();
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -58,9 +58,9 @@ import org.springframework.xml.xpath.XPathExpressionFactory;
|
||||
* XPath expression for the incoming message, the value is the name of the endpoint.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @since 1.0.0
|
||||
* @see #setExpression(String)
|
||||
* @see #setNamespaces(java.util.Map)
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public class XPathPayloadEndpointMapping extends AbstractMapBasedEndpointMapping implements InitializingBean {
|
||||
|
||||
@@ -74,7 +74,7 @@ public class XPathPayloadEndpointMapping extends AbstractMapBasedEndpointMapping
|
||||
|
||||
/** Sets the XPath expression to be used. */
|
||||
public void setExpression(String expression) {
|
||||
expressionString = expression;
|
||||
this.expressionString = expression;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -87,24 +87,24 @@ public class XPathPayloadEndpointMapping extends AbstractMapBasedEndpointMapping
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() throws Exception {
|
||||
Assert.notNull(expressionString, "expression is required");
|
||||
if (namespaces == null) {
|
||||
expression = XPathExpressionFactory.createXPathExpression(expressionString);
|
||||
Assert.notNull(this.expressionString, "expression is required");
|
||||
if (this.namespaces == null) {
|
||||
this.expression = XPathExpressionFactory.createXPathExpression(this.expressionString);
|
||||
}
|
||||
else {
|
||||
expression = XPathExpressionFactory.createXPathExpression(expressionString, namespaces);
|
||||
this.expression = XPathExpressionFactory.createXPathExpression(this.expressionString, this.namespaces);
|
||||
}
|
||||
transformerFactory = TransformerFactoryUtils.newInstance();
|
||||
this.transformerFactory = TransformerFactoryUtils.newInstance();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getLookupKeyForMessage(MessageContext messageContext) throws Exception {
|
||||
Element payloadElement = getMessagePayloadElement(messageContext.getRequest());
|
||||
return expression.evaluateAsString(payloadElement);
|
||||
return this.expression.evaluateAsString(payloadElement);
|
||||
}
|
||||
|
||||
private Element getMessagePayloadElement(WebServiceMessage message) throws TransformerException {
|
||||
Transformer transformer = transformerFactory.newTransformer();
|
||||
Transformer transformer = this.transformerFactory.newTransformer();
|
||||
DOMResult domResult = new DOMResult();
|
||||
transformer.transform(message.getPayloadSource(), domResult);
|
||||
return (Element) domResult.getNode().getFirstChild();
|
||||
|
||||
@@ -88,7 +88,7 @@ public class XmlRootElementEndpointMapping extends AbstractAnnotationMethodEndpo
|
||||
return result;
|
||||
}
|
||||
}
|
||||
catch (InvocationTargetException | NoSuchMethodException | InstantiationException | IllegalAccessException e) {
|
||||
catch (InvocationTargetException | NoSuchMethodException | InstantiationException | IllegalAccessException ex) {
|
||||
// ignore
|
||||
}
|
||||
return null;
|
||||
@@ -107,7 +107,8 @@ public class XmlRootElementEndpointMapping extends AbstractAnnotationMethodEndpo
|
||||
|
||||
@Override
|
||||
protected QName getLookupKeyForMessage(MessageContext messageContext) throws Exception {
|
||||
return PayloadRootUtils.getPayloadRootQName(messageContext.getRequest().getPayloadSource(), transformerHelper);
|
||||
return PayloadRootUtils.getPayloadRootQName(messageContext.getRequest().getPayloadSource(),
|
||||
this.transformerHelper);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -89,18 +89,18 @@ public abstract class PayloadRootUtils {
|
||||
}
|
||||
}
|
||||
|
||||
private static class PayloadRootSourceCallback implements TraxUtils.SourceCallback {
|
||||
private static final class PayloadRootSourceCallback implements TraxUtils.SourceCallback {
|
||||
|
||||
private QName result;
|
||||
|
||||
@Override
|
||||
public void domSource(Node node) throws Exception {
|
||||
if (node.getNodeType() == Node.ELEMENT_NODE) {
|
||||
result = QNameUtils.getQNameForNode(node);
|
||||
this.result = QNameUtils.getQNameForNode(node);
|
||||
}
|
||||
else if (node.getNodeType() == Node.DOCUMENT_NODE) {
|
||||
Document document = (Document) node;
|
||||
result = QNameUtils.getQNameForNode(document.getDocumentElement());
|
||||
this.result = QNameUtils.getQNameForNode(document.getDocumentElement());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,10 +112,10 @@ public abstract class PayloadRootUtils {
|
||||
}
|
||||
if (event != null) {
|
||||
if (event.isStartElement()) {
|
||||
result = event.asStartElement().getName();
|
||||
this.result = event.asStartElement().getName();
|
||||
}
|
||||
else if (event.isEndElement()) {
|
||||
result = event.asEndElement().getName();
|
||||
this.result = event.asEndElement().getName();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -132,7 +132,7 @@ public abstract class PayloadRootUtils {
|
||||
}
|
||||
if (streamReader.getEventType() == XMLStreamConstants.START_ELEMENT
|
||||
|| streamReader.getEventType() == XMLStreamConstants.END_ELEMENT) {
|
||||
result = streamReader.getName();
|
||||
this.result = streamReader.getName();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -87,20 +87,20 @@ public abstract class AbstractSoapMessage extends AbstractMimeMessage implements
|
||||
|
||||
@Override
|
||||
public SoapVersion getVersion() {
|
||||
if (version == null) {
|
||||
if (this.version == null) {
|
||||
String envelopeNamespace = getEnvelope().getName().getNamespaceURI();
|
||||
if (SoapVersion.SOAP_11.getEnvelopeNamespaceUri().equals(envelopeNamespace)) {
|
||||
version = SoapVersion.SOAP_11;
|
||||
this.version = SoapVersion.SOAP_11;
|
||||
}
|
||||
else if (SoapVersion.SOAP_12.getEnvelopeNamespaceUri().equals(envelopeNamespace)) {
|
||||
version = SoapVersion.SOAP_12;
|
||||
this.version = SoapVersion.SOAP_12;
|
||||
}
|
||||
else {
|
||||
throw new IllegalStateException(
|
||||
"Unknown Envelope namespace uri '" + envelopeNamespace + "'. " + "Cannot deduce SoapVersion.");
|
||||
}
|
||||
}
|
||||
return version;
|
||||
return this.version;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -32,11 +32,11 @@ import org.springframework.ws.WebServiceMessage;
|
||||
* itself. For the contents of the body, use {@code getPayloadSource()}.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @since 1.0.0
|
||||
* @see SoapEnvelope#getBody()
|
||||
* @see #getPayloadSource()
|
||||
* @see #getPayloadResult()
|
||||
* @see SoapFault
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public interface SoapBody extends SoapElement {
|
||||
|
||||
|
||||
@@ -25,8 +25,8 @@ import javax.xml.transform.Source;
|
||||
* The base interface for all elements that are contained in a SOAP message.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @see SoapMessage
|
||||
* @since 1.0.0
|
||||
* @see SoapMessage
|
||||
*/
|
||||
public interface SoapElement {
|
||||
|
||||
|
||||
@@ -26,8 +26,8 @@ import javax.xml.transform.Result;
|
||||
* {@code SoapFaultDetailElement}s, which represent the individual details.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @see SoapFaultDetailElement
|
||||
* @since 1.0.0
|
||||
* @see SoapFaultDetailElement
|
||||
*/
|
||||
public interface SoapFaultDetail extends SoapElement {
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@ import javax.xml.transform.Result;
|
||||
* {@code SoapFaultDetailElement}s are contained in a {@code SoapDetail}.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @see SoapFaultDetail
|
||||
* @since 1.0.0
|
||||
* @see SoapFaultDetail
|
||||
*/
|
||||
public interface SoapFaultDetailElement extends SoapElement {
|
||||
|
||||
|
||||
@@ -26,9 +26,9 @@ import javax.xml.transform.Result;
|
||||
* {@code SoapHeaderElement}s, which represent the individual headers.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @since 1.0.0
|
||||
* @see SoapHeaderElement
|
||||
* @see SoapEnvelope#getHeader()
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public interface SoapHeader extends SoapElement {
|
||||
|
||||
@@ -86,8 +86,8 @@ public interface SoapHeader extends SoapElement {
|
||||
* @param name the qualified name for which to search
|
||||
* @return an iterator over all the header elements
|
||||
* @throws SoapHeaderException if the header cannot be returned
|
||||
* @see SoapHeaderElement
|
||||
* @since 2.0.3
|
||||
* @see SoapHeaderElement
|
||||
*/
|
||||
Iterator<SoapHeaderElement> examineHeaderElements(QName name) throws SoapHeaderException;
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@ import javax.xml.transform.Result;
|
||||
* {@code SoapHeaderElement}s are contained in a {@code SoapHeader}.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @see SoapHeader
|
||||
* @since 1.0.0
|
||||
* @see SoapHeader
|
||||
*/
|
||||
public interface SoapHeaderElement extends SoapElement {
|
||||
|
||||
|
||||
@@ -28,10 +28,10 @@ import org.springframework.ws.mime.MimeMessage;
|
||||
* {@code WebServiceMessage}, the super-interface of this interface.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @since 1.0.0
|
||||
* @see #getPayloadSource()
|
||||
* @see #getPayloadResult()
|
||||
* @see #getEnvelope()
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public interface SoapMessage extends MimeMessage, FaultAwareWebServiceMessage {
|
||||
|
||||
|
||||
@@ -23,9 +23,9 @@ import javax.xml.namespace.QName;
|
||||
* properties for elements that make up a soap envelope.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @since 1.0.0
|
||||
* @see #SOAP_11
|
||||
* @see #SOAP_12
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public interface SoapVersion {
|
||||
|
||||
@@ -63,11 +63,11 @@ public interface SoapVersion {
|
||||
private QName VERSION_MISMATCH_FAULT_NAME = new QName(ENVELOPE_NAMESPACE_URI, "VersionMismatch");
|
||||
|
||||
public QName getBodyName() {
|
||||
return BODY_NAME;
|
||||
return this.BODY_NAME;
|
||||
}
|
||||
|
||||
public QName getEnvelopeName() {
|
||||
return ENVELOPE_NAME;
|
||||
return this.ENVELOPE_NAME;
|
||||
}
|
||||
|
||||
public String getEnvelopeNamespaceUri() {
|
||||
@@ -75,11 +75,11 @@ public interface SoapVersion {
|
||||
}
|
||||
|
||||
public QName getFaultName() {
|
||||
return FAULT_NAME;
|
||||
return this.FAULT_NAME;
|
||||
}
|
||||
|
||||
public QName getHeaderName() {
|
||||
return HEADER_NAME;
|
||||
return this.HEADER_NAME;
|
||||
}
|
||||
|
||||
public String getNextActorOrRoleUri() {
|
||||
@@ -91,7 +91,7 @@ public interface SoapVersion {
|
||||
}
|
||||
|
||||
public QName getServerOrReceiverFaultName() {
|
||||
return SERVER_FAULT_NAME;
|
||||
return this.SERVER_FAULT_NAME;
|
||||
}
|
||||
|
||||
public String getUltimateReceiverRoleUri() {
|
||||
@@ -99,11 +99,11 @@ public interface SoapVersion {
|
||||
}
|
||||
|
||||
public QName getActorOrRoleName() {
|
||||
return ACTOR_NAME;
|
||||
return this.ACTOR_NAME;
|
||||
}
|
||||
|
||||
public QName getClientOrSenderFaultName() {
|
||||
return CLIENT_FAULT_NAME;
|
||||
return this.CLIENT_FAULT_NAME;
|
||||
}
|
||||
|
||||
public String getContentType() {
|
||||
@@ -111,15 +111,15 @@ public interface SoapVersion {
|
||||
}
|
||||
|
||||
public QName getMustUnderstandAttributeName() {
|
||||
return MUST_UNDERSTAND_ATTRIBUTE_NAME;
|
||||
return this.MUST_UNDERSTAND_ATTRIBUTE_NAME;
|
||||
}
|
||||
|
||||
public QName getMustUnderstandFaultName() {
|
||||
return MUST_UNDERSTAND_FAULT_NAME;
|
||||
return this.MUST_UNDERSTAND_FAULT_NAME;
|
||||
}
|
||||
|
||||
public QName getVersionMismatchFaultName() {
|
||||
return VERSION_MISMATCH_FAULT_NAME;
|
||||
return this.VERSION_MISMATCH_FAULT_NAME;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
@@ -164,11 +164,11 @@ public interface SoapVersion {
|
||||
private QName VERSION_MISMATCH_FAULT_NAME = new QName(ENVELOPE_NAMESPACE_URI, "VersionMismatch");
|
||||
|
||||
public QName getBodyName() {
|
||||
return BODY_NAME;
|
||||
return this.BODY_NAME;
|
||||
}
|
||||
|
||||
public QName getEnvelopeName() {
|
||||
return ENVELOPE_NAME;
|
||||
return this.ENVELOPE_NAME;
|
||||
}
|
||||
|
||||
public String getEnvelopeNamespaceUri() {
|
||||
@@ -176,11 +176,11 @@ public interface SoapVersion {
|
||||
}
|
||||
|
||||
public QName getFaultName() {
|
||||
return FAULT_NAME;
|
||||
return this.FAULT_NAME;
|
||||
}
|
||||
|
||||
public QName getHeaderName() {
|
||||
return HEADER_NAME;
|
||||
return this.HEADER_NAME;
|
||||
}
|
||||
|
||||
public String getNextActorOrRoleUri() {
|
||||
@@ -192,7 +192,7 @@ public interface SoapVersion {
|
||||
}
|
||||
|
||||
public QName getServerOrReceiverFaultName() {
|
||||
return RECEIVER_FAULT_NAME;
|
||||
return this.RECEIVER_FAULT_NAME;
|
||||
}
|
||||
|
||||
public String getUltimateReceiverRoleUri() {
|
||||
@@ -200,11 +200,11 @@ public interface SoapVersion {
|
||||
}
|
||||
|
||||
public QName getActorOrRoleName() {
|
||||
return ROLE_NAME;
|
||||
return this.ROLE_NAME;
|
||||
}
|
||||
|
||||
public QName getClientOrSenderFaultName() {
|
||||
return SENDER_FAULT_NAME;
|
||||
return this.SENDER_FAULT_NAME;
|
||||
}
|
||||
|
||||
public String getContentType() {
|
||||
@@ -212,15 +212,15 @@ public interface SoapVersion {
|
||||
}
|
||||
|
||||
public QName getMustUnderstandAttributeName() {
|
||||
return MUST_UNDERSTAND_ATTRIBUTE_NAME;
|
||||
return this.MUST_UNDERSTAND_ATTRIBUTE_NAME;
|
||||
}
|
||||
|
||||
public QName getMustUnderstandFaultName() {
|
||||
return MUST_UNDERSTAND_FAULT_NAME;
|
||||
return this.MUST_UNDERSTAND_FAULT_NAME;
|
||||
}
|
||||
|
||||
public QName getVersionMismatchFaultName() {
|
||||
return VERSION_MISMATCH_FAULT_NAME;
|
||||
return this.VERSION_MISMATCH_FAULT_NAME;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user