Add 'this.' for field access

See gh-1479
This commit is contained in:
Stéphane Nicoll
2025-03-07 11:33:29 +01:00
parent b70e291906
commit 60ec66ce79
383 changed files with 4466 additions and 4384 deletions

View File

@@ -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;
}
}

View File

@@ -206,8 +206,8 @@ 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();
if (this.destinationProvider != null) {
URI uri = this.destinationProvider.getDestination();
return uri != null ? uri.toString() : null;
}
else {
@@ -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;
}
}
@@ -818,9 +818,9 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
*/
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());
@@ -862,7 +862,7 @@ 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;
}
@@ -879,7 +879,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());
}
}

View File

@@ -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();
}

View File

@@ -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,9 +109,9 @@ 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) {
// ignore

View File

@@ -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();

View File

@@ -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;
}
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);
}
}

View File

@@ -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,12 +177,12 @@ 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);
@@ -189,8 +190,8 @@ public abstract class AbstractValidatingInterceptor extends TransformerObjectSup
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,12 +227,12 @@ 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);
@@ -239,8 +240,8 @@ public abstract class AbstractValidatingInterceptor extends TransformerObjectSup
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;
}

View File

@@ -51,7 +51,7 @@ public class WebServiceValidationException extends WebServiceClientException {
/** Returns the validation errors. */
public SAXParseException[] getValidationErrors() {
return validationErrors;
return this.validationErrors;
}
}

View File

@@ -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]);
}
/**

View File

@@ -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);
}
}

View File

@@ -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;
}
}

View File

@@ -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");
}
}

View File

@@ -78,7 +78,7 @@ public abstract class AbstractMimeMessage implements MimeMessage {
@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 {

View File

@@ -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);

View File

@@ -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);

View File

@@ -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;
}
}

View File

@@ -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() + "]");
}
}
@@ -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;
}
@@ -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");
}
}
}

View File

@@ -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();

View File

@@ -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,10 +92,10 @@ 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);
@@ -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;

View File

@@ -85,7 +85,7 @@ public abstract class AbstractEndpointExceptionResolver implements EndpointExcep
@Override
public final int getOrder() {
return order;
return this.order;
}
/**
@@ -96,12 +96,12 @@ public abstract class AbstractEndpointExceptionResolver implements EndpointExcep
@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)) {
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);

View File

@@ -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) {

View File

@@ -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;
@@ -124,7 +124,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 +162,7 @@ public abstract class AbstractLoggingInterceptor extends TransformerObjectSuppor
* @param message the message
*/
protected void logMessage(String message) {
logger.debug(message);
this.logger.debug(message);
}
/**

View File

@@ -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);
}

View File

@@ -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 {
@@ -165,13 +165,13 @@ public abstract class AbstractStaxEventPayloadEndpoint extends AbstractStaxPaylo
@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);
}
}
}

View File

@@ -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;
}
/**

View File

@@ -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);
}
}
}

View File

@@ -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. */
@@ -69,7 +69,7 @@ public abstract class AbstractValidatingMarshallingPayloadEndpoint extends Abstr
/** Return the Validators for this controller. */
public Validator[] getValidators() {
return validators;
return this.validators;
}
/**

View File

@@ -123,11 +123,11 @@ public abstract class AbstractXomPayloadEndpoint extends TransformerObjectSuppor
@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,7 +149,7 @@ 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);
@@ -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);

View File

@@ -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();
}
}

View File

@@ -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;
}
/**
@@ -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());
@@ -203,12 +203,12 @@ public class DefaultMethodEndpointAdapter extends AbstractMethodEndpointAdapter
methodArgumentResolvers.add(BeanUtils.instantiateClass(methodArgumentResolverClass));
}
catch (ClassNotFoundException e) {
logger.warn("Could not find \"" + className + "\" on the classpath");
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;

View File

@@ -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);
}

View File

@@ -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;

View File

@@ -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);

View File

@@ -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());
}
@@ -171,7 +171,7 @@ public class SourcePayloadMethodProcessor extends AbstractPayloadSourceMethodPro
}
public String getSystemId() {
return systemId;
return SystemIdStreamReaderDelegate.this.systemId;
}
};
}

View File

@@ -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;
}

View File

@@ -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();
}

View File

@@ -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);

View File

@@ -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;
}
@@ -223,10 +223,10 @@ 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;
}
@@ -245,7 +245,7 @@ public abstract class AbstractJaxb2PayloadMethodProcessor extends AbstractPayloa
@Override
public void domSource(Node node) throws JAXBException {
result = unmarshaller.unmarshal(node);
this.result = this.unmarshaller.unmarshal(node);
}
@Override
@@ -260,43 +260,43 @@ 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));
}
}
@@ -316,37 +316,37 @@ public abstract class AbstractJaxb2PayloadMethodProcessor extends AbstractPayloa
@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);
}
}
@@ -364,37 +364,37 @@ 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));
}
}
@@ -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);
}
}

View File

@@ -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;
}

View File

@@ -48,7 +48,7 @@ public class DelegatingSmartEndpointInterceptor implements SmartEndpointIntercep
* @return the delegate
*/
public EndpointInterceptor getDelegate() {
return delegate;
return this.delegate;
}
/**

View File

@@ -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);
}
}

View File

@@ -60,8 +60,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)

View File

@@ -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;
}
/**

View File

@@ -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) {

View File

@@ -63,8 +63,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 +81,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 +91,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 +99,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 + "]");
}
}

View File

@@ -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();
}

View File

@@ -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 {

View File

@@ -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();

View File

@@ -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);
}
}

View File

@@ -96,11 +96,11 @@ public abstract class PayloadRootUtils {
@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();
}
}

View File

@@ -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;
}
}

View File

@@ -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() {

View File

@@ -124,14 +124,14 @@ public class ActionCallback implements WebServiceMessageCallback {
this.action = action;
this.version = version;
this.to = to;
messageIdStrategy = new UuidMessageIdStrategy();
this.messageIdStrategy = new UuidMessageIdStrategy();
}
/**
* Returns the WS-Addressing version
*/
public AddressingVersion getVersion() {
return version;
return this.version;
}
/**
@@ -140,7 +140,7 @@ public class ActionCallback implements WebServiceMessageCallback {
* By default, the {@link UuidMessageIdStrategy} is used.
*/
public MessageIdStrategy getMessageIdStrategy() {
return messageIdStrategy;
return this.messageIdStrategy;
}
/**
@@ -158,7 +158,7 @@ public class ActionCallback implements WebServiceMessageCallback {
* @see org.springframework.ws.soap.addressing.core.MessageAddressingProperties#getAction()
*/
public URI getAction() {
return action;
return this.action;
}
/**
@@ -166,7 +166,7 @@ public class ActionCallback implements WebServiceMessageCallback {
* @see org.springframework.ws.soap.addressing.core.MessageAddressingProperties#getFrom()
*/
public EndpointReference getFrom() {
return from;
return this.from;
}
/**
@@ -182,7 +182,7 @@ public class ActionCallback implements WebServiceMessageCallback {
* @see org.springframework.ws.soap.addressing.core.MessageAddressingProperties#getReplyTo()
*/
public EndpointReference getReplyTo() {
return replyTo;
return this.replyTo;
}
/**
@@ -198,7 +198,7 @@ public class ActionCallback implements WebServiceMessageCallback {
* @see org.springframework.ws.soap.addressing.core.MessageAddressingProperties#getFaultTo()
*/
public EndpointReference getFaultTo() {
return faultTo;
return this.faultTo;
}
/**
@@ -217,7 +217,7 @@ public class ActionCallback implements WebServiceMessageCallback {
* URI} if no destination was set.
*/
protected URI getTo() {
if (to == null && (isToHeaderRequired() || shouldInitializeTo)) {
if (this.to == null && (isToHeaderRequired() || this.shouldInitializeTo)) {
TransportContext transportContext = TransportContextHolder.getTransportContext();
if (transportContext != null && transportContext.getConnection() != null) {
try {
@@ -230,7 +230,7 @@ public class ActionCallback implements WebServiceMessageCallback {
throw new IllegalStateException("Could not obtain connection URI from Transport Context");
}
else {
return to;
return this.to;
}
}
@@ -253,7 +253,7 @@ public class ActionCallback implements WebServiceMessageCallback {
URI messageId = getMessageIdStrategy().newMessageId(soapMessage);
MessageAddressingProperties map = new MessageAddressingProperties(getTo(), getFrom(), getReplyTo(),
getFaultTo(), getAction(), messageId);
version.addAddressingHeaders(soapMessage, map);
this.version.addAddressingHeaders(soapMessage, map);
}
}

View File

@@ -74,7 +74,7 @@ public final class EndpointReference implements Serializable {
/** Returns the address of the endpoint. */
public URI getAddress() {
return address;
return this.address;
}
/**
@@ -82,7 +82,7 @@ public final class EndpointReference implements Serializable {
* objects.
*/
public List<Node> getReferenceProperties() {
return referenceProperties;
return this.referenceProperties;
}
/**
@@ -90,7 +90,7 @@ public final class EndpointReference implements Serializable {
* objects.
*/
public List<Node> getReferenceParameters() {
return referenceParameters;
return this.referenceParameters;
}
public boolean equals(Object o) {
@@ -98,17 +98,17 @@ public final class EndpointReference implements Serializable {
return true;
}
if (o instanceof EndpointReference other) {
return address.equals(other.address);
return this.address.equals(other.address);
}
return false;
}
public int hashCode() {
return address.hashCode();
return this.address.hashCode();
}
public String toString() {
return address.toString();
return this.address.toString();
}
}

View File

@@ -103,47 +103,47 @@ public final class MessageAddressingProperties implements Serializable {
/** Returns the value of the destination property. */
public URI getTo() {
return to;
return this.to;
}
/** Returns the value of the source endpoint property. */
public EndpointReference getFrom() {
return from;
return this.from;
}
/** Returns the value of the reply endpoint property. */
public EndpointReference getReplyTo() {
return replyTo;
return this.replyTo;
}
/** Returns the value of the fault endpoint property. */
public EndpointReference getFaultTo() {
return faultTo;
return this.faultTo;
}
/** Returns the value of the action property. */
public URI getAction() {
return action;
return this.action;
}
/** Returns the value of the message id property. */
public URI getMessageId() {
return messageId;
return this.messageId;
}
/** Returns the value of the relationship property. */
public URI getRelatesTo() {
return relatesTo;
return this.relatesTo;
}
/** Returns the endpoint properties. Returns an empty list of none are set. */
public List<Node> getReferenceProperties() {
return Collections.unmodifiableList(referenceProperties);
return Collections.unmodifiableList(this.referenceProperties);
}
/** Returns the endpoint parameters. Returns an empty list of none are set. */
public List<Node> getReferenceParameters() {
return Collections.unmodifiableList(referenceParameters);
return Collections.unmodifiableList(this.referenceParameters);
}
/**

View File

@@ -54,7 +54,7 @@ public abstract class AbstractActionEndpointMapping extends AbstractAddressingEn
/** Returns the suffix to add to request {@code Action}s for reply messages. */
public String getOutputActionSuffix() {
return outputActionSuffix;
return this.outputActionSuffix;
}
/**
@@ -68,7 +68,7 @@ public abstract class AbstractActionEndpointMapping extends AbstractAddressingEn
/** Returns the suffix to add to request {@code Action}s for reply fault messages. */
public String getFaultActionSuffix() {
return faultActionSuffix;
return this.faultActionSuffix;
}
/**
@@ -83,8 +83,8 @@ public abstract class AbstractActionEndpointMapping extends AbstractAddressingEn
@Override
protected final Object getEndpointInternal(MessageAddressingProperties map) {
URI action = map.getAction();
if (logger.isDebugEnabled()) {
logger.debug("Looking up endpoint for action [" + action + "]");
if (this.logger.isDebugEnabled()) {
this.logger.debug("Looking up endpoint for action [" + action + "]");
}
Object endpoint = lookupEndpoint(action);
if (endpoint != null) {
@@ -111,7 +111,7 @@ public abstract class AbstractActionEndpointMapping extends AbstractAddressingEn
* @return the associated endpoint instance, or {@code null} if not found
*/
protected Object lookupEndpoint(URI action) {
return endpointMap.get(action);
return this.endpointMap.get(action);
}
/**
@@ -142,8 +142,8 @@ public abstract class AbstractActionEndpointMapping extends AbstractAddressingEn
}
else {
this.endpointMap.put(action, resolvedEndpoint);
if (logger.isDebugEnabled()) {
logger.debug("Mapped Action [" + action + "] onto endpoint [" + resolvedEndpoint + "]");
if (this.logger.isDebugEnabled()) {
this.logger.debug("Mapped Action [" + action + "] onto endpoint [" + resolvedEndpoint + "]");
}
}
}

View File

@@ -117,13 +117,13 @@ public abstract class AbstractAddressingEndpointMapping extends TransformerObjec
*/
protected void initDefaultStrategies() {
this.versions = new AddressingVersion[] { new Addressing200408(), new Addressing10() };
messageIdStrategy = new UuidMessageIdStrategy();
this.messageIdStrategy = new UuidMessageIdStrategy();
}
@Override
public final void setActorOrRole(String actorOrRole) {
Assert.notNull(actorOrRole, "actorOrRole must not be null");
actorsOrRoles = new String[] { actorOrRole };
this.actorsOrRoles = new String[] { actorOrRole };
}
@Override
@@ -138,7 +138,7 @@ public abstract class AbstractAddressingEndpointMapping extends TransformerObjec
}
public ApplicationContext getApplicationContext() {
return applicationContext;
return this.applicationContext;
}
@Override
@@ -148,7 +148,7 @@ public abstract class AbstractAddressingEndpointMapping extends TransformerObjec
@Override
public final int getOrder() {
return order;
return this.order;
}
/**
@@ -193,7 +193,7 @@ public abstract class AbstractAddressingEndpointMapping extends TransformerObjec
* Returns the message id strategy used for creating WS-Addressing MessageIds.
*/
public MessageIdStrategy getMessageIdStrategy() {
return messageIdStrategy;
return this.messageIdStrategy;
}
/**
@@ -240,8 +240,8 @@ public abstract class AbstractAddressingEndpointMapping extends TransformerObjec
@Override
public void afterPropertiesSet() throws Exception {
if (logger.isInfoEnabled()) {
logger.info("Supporting " + Arrays.asList(versions));
if (this.logger.isInfoEnabled()) {
this.logger.info("Supporting " + Arrays.asList(this.versions));
}
if (getApplicationContext() != null) {
Map<String, SmartEndpointInterceptor> smartInterceptors = BeanFactoryUtils
@@ -256,10 +256,10 @@ public abstract class AbstractAddressingEndpointMapping extends TransformerObjec
public final EndpointInvocationChain getEndpoint(MessageContext messageContext) throws TransformerException {
Assert.isInstanceOf(SoapMessage.class, messageContext.getRequest());
SoapMessage request = (SoapMessage) messageContext.getRequest();
for (AddressingVersion version : versions) {
for (AddressingVersion version : this.versions) {
if (supports(version, request)) {
if (logger.isDebugEnabled()) {
logger.debug("Request [" + request + "] uses [" + version + "]");
if (this.logger.isDebugEnabled()) {
this.logger.debug("Request [" + request + "] uses [" + version + "]");
}
MessageAddressingProperties requestMap = version.getMessageAddressingProperties(request);
if (requestMap == null) {
@@ -287,15 +287,15 @@ public abstract class AbstractAddressingEndpointMapping extends TransformerObjec
WebServiceMessageSender[] messageSenders = getMessageSenders(endpoint);
MessageIdStrategy messageIdStrategy = getMessageIdStrategy(endpoint);
List<EndpointInterceptor> interceptors = new ArrayList<>(Arrays.asList(preInterceptors));
List<EndpointInterceptor> interceptors = new ArrayList<>(Arrays.asList(this.preInterceptors));
AddressingEndpointInterceptor addressingInterceptor = new AddressingEndpointInterceptor(version,
messageIdStrategy, messageSenders, responseAction, faultAction);
interceptors.add(addressingInterceptor);
interceptors.addAll(Arrays.asList(postInterceptors));
interceptors.addAll(Arrays.asList(this.postInterceptors));
if (this.smartInterceptors != null) {
for (SmartEndpointInterceptor smartInterceptor : smartInterceptors) {
for (SmartEndpointInterceptor smartInterceptor : this.smartInterceptors) {
if (smartInterceptor.shouldIntercept(messageContext, endpoint)) {
interceptors.add(smartInterceptor);
}
@@ -303,7 +303,7 @@ public abstract class AbstractAddressingEndpointMapping extends TransformerObjec
}
return new SoapEndpointInvocationChain(endpoint, interceptors.toArray(new EndpointInterceptor[0]),
actorsOrRoles, isUltimateReceiver);
this.actorsOrRoles, this.isUltimateReceiver);
}
private boolean supports(AddressingVersion version, SoapMessage request) {

View File

@@ -71,13 +71,13 @@ class AddressingEndpointInterceptor implements SoapEndpointInterceptor {
public final boolean handleRequest(MessageContext messageContext, Object endpoint) throws Exception {
Assert.isInstanceOf(SoapMessage.class, messageContext.getRequest());
SoapMessage request = (SoapMessage) messageContext.getRequest();
MessageAddressingProperties requestMap = version.getMessageAddressingProperties(request);
if (!version.hasRequiredProperties(requestMap)) {
version.addMessageAddressingHeaderRequiredFault((SoapMessage) messageContext.getResponse());
MessageAddressingProperties requestMap = this.version.getMessageAddressingProperties(request);
if (!this.version.hasRequiredProperties(requestMap)) {
this.version.addMessageAddressingHeaderRequiredFault((SoapMessage) messageContext.getResponse());
return false;
}
if (messageIdStrategy.isDuplicate(requestMap.getMessageId())) {
version.addInvalidAddressingHeaderFault((SoapMessage) messageContext.getResponse());
if (this.messageIdStrategy.isDuplicate(requestMap.getMessageId())) {
this.version.addInvalidAddressingHeaderFault((SoapMessage) messageContext.getResponse());
return false;
}
return true;
@@ -96,7 +96,7 @@ class AddressingEndpointInterceptor implements SoapEndpointInterceptor {
private boolean handleResponseOrFault(MessageContext messageContext, boolean isFault) throws Exception {
Assert.isInstanceOf(SoapMessage.class, messageContext.getRequest());
Assert.isInstanceOf(SoapMessage.class, messageContext.getResponse());
MessageAddressingProperties requestMap = version
MessageAddressingProperties requestMap = this.version
.getMessageAddressingProperties((SoapMessage) messageContext.getRequest());
EndpointReference replyEpr = !isFault ? requestMap.getReplyTo() : requestMap.getFaultTo();
if (handleNoneAddress(messageContext, replyEpr)) {
@@ -104,9 +104,9 @@ class AddressingEndpointInterceptor implements SoapEndpointInterceptor {
}
SoapMessage reply = (SoapMessage) messageContext.getResponse();
URI replyMessageId = getMessageId(reply);
URI action = isFault ? faultAction : replyAction;
URI action = isFault ? this.faultAction : this.replyAction;
MessageAddressingProperties replyMap = requestMap.getReplyProperties(replyEpr, action, replyMessageId);
version.addAddressingHeaders(reply, replyMap);
this.version.addAddressingHeaders(reply, replyMap);
if (handleAnonymousAddress(messageContext, replyEpr)) {
return true;
}
@@ -117,7 +117,7 @@ class AddressingEndpointInterceptor implements SoapEndpointInterceptor {
}
private boolean handleNoneAddress(MessageContext messageContext, EndpointReference replyEpr) {
if (replyEpr == null || version.hasNoneAddress(replyEpr)) {
if (replyEpr == null || this.version.hasNoneAddress(replyEpr)) {
if (logger.isDebugEnabled()) {
logger.debug("Request [" + messageContext.getRequest() + "] has [" + replyEpr
+ "] reply address; reply [" + messageContext.getResponse() + "] discarded");
@@ -129,7 +129,7 @@ class AddressingEndpointInterceptor implements SoapEndpointInterceptor {
}
private boolean handleAnonymousAddress(MessageContext messageContext, EndpointReference replyEpr) {
if (version.hasAnonymousAddress(replyEpr)) {
if (this.version.hasAnonymousAddress(replyEpr)) {
if (logger.isDebugEnabled()) {
logger.debug("Request [" + messageContext.getRequest() + "] has [" + replyEpr
+ "] reply address; sending in-band reply [" + messageContext.getResponse() + "]");
@@ -146,7 +146,7 @@ class AddressingEndpointInterceptor implements SoapEndpointInterceptor {
}
boolean supported = false;
for (WebServiceMessageSender messageSender : messageSenders) {
for (WebServiceMessageSender messageSender : this.messageSenders) {
if (messageSender.supports(replyEpr.getAddress())) {
supported = true;
try (WebServiceConnection connection = messageSender.createConnection(replyEpr.getAddress())) {
@@ -165,7 +165,7 @@ class AddressingEndpointInterceptor implements SoapEndpointInterceptor {
}
private URI getMessageId(SoapMessage response) {
URI responseMessageId = messageIdStrategy.newMessageId(response);
URI responseMessageId = this.messageIdStrategy.newMessageId(response);
if (logger.isTraceEnabled()) {
logger.trace("Generated reply MessageID [" + responseMessageId + "] for [" + response + "]");
}
@@ -178,7 +178,7 @@ class AddressingEndpointInterceptor implements SoapEndpointInterceptor {
@Override
public boolean understands(SoapHeaderElement header) {
return version.understands(header);
return this.version.understands(header);
}
}

View File

@@ -104,7 +104,7 @@ public class SimpleActionEndpointMapping extends AbstractActionEndpointMapping {
@Override
public void afterPropertiesSet() throws Exception {
super.afterPropertiesSet();
registerEndpoints(actionMap);
registerEndpoints(this.actionMap);
}
/**
@@ -116,7 +116,7 @@ public class SimpleActionEndpointMapping extends AbstractActionEndpointMapping {
*/
protected void registerEndpoints(Map<URI, Object> actionMap) throws BeansException {
if (actionMap.isEmpty()) {
logger.warn("Neither 'actionMap' nor 'mappings' set on SimpleActionEndpointMapping");
this.logger.warn("Neither 'actionMap' nor 'mappings' set on SimpleActionEndpointMapping");
}
else {
for (Map.Entry<URI, Object> entry : actionMap.entrySet()) {
@@ -133,7 +133,7 @@ public class SimpleActionEndpointMapping extends AbstractActionEndpointMapping {
@Override
protected URI getEndpointAddress(Object endpoint) {
return address;
return this.address;
}
}

View File

@@ -87,24 +87,24 @@ public abstract class AbstractAddressingVersion extends TransformerObjectSupport
protected AbstractAddressingVersion() {
Map<String, String> namespaces = new HashMap<>();
namespaces.put(getNamespacePrefix(), getNamespaceUri());
toExpression = createNormalizedExpression(getToName(), namespaces);
actionExpression = createNormalizedExpression(getActionName(), namespaces);
messageIdExpression = createNormalizedExpression(getMessageIdName(), namespaces);
fromExpression = createExpression(getFromName(), namespaces);
replyToExpression = createExpression(getReplyToName(), namespaces);
faultToExpression = createExpression(getFaultToName(), namespaces);
addressExpression = createNormalizedExpression(getAddressName(), namespaces);
this.toExpression = createNormalizedExpression(getToName(), namespaces);
this.actionExpression = createNormalizedExpression(getActionName(), namespaces);
this.messageIdExpression = createNormalizedExpression(getMessageIdName(), namespaces);
this.fromExpression = createExpression(getFromName(), namespaces);
this.replyToExpression = createExpression(getReplyToName(), namespaces);
this.faultToExpression = createExpression(getFaultToName(), namespaces);
this.addressExpression = createNormalizedExpression(getAddressName(), namespaces);
if (getReferencePropertiesName() != null) {
referencePropertiesExpression = createChildrenExpression(getReferencePropertiesName(), namespaces);
this.referencePropertiesExpression = createChildrenExpression(getReferencePropertiesName(), namespaces);
}
else {
referencePropertiesExpression = null;
this.referencePropertiesExpression = null;
}
if (getReferenceParametersName() != null) {
referenceParametersExpression = createChildrenExpression(getReferenceParametersName(), namespaces);
this.referenceParametersExpression = createChildrenExpression(getReferenceParametersName(), namespaces);
}
else {
referenceParametersExpression = null;
this.referenceParametersExpression = null;
}
}
@@ -126,21 +126,21 @@ public abstract class AbstractAddressingVersion extends TransformerObjectSupport
@Override
public MessageAddressingProperties getMessageAddressingProperties(SoapMessage message) {
Element headerElement = getSoapHeaderElement(message);
URI to = getUri(headerElement, toExpression);
URI to = getUri(headerElement, this.toExpression);
if (to == null) {
to = getDefaultTo();
}
EndpointReference from = getEndpointReference(fromExpression.evaluateAsNode(headerElement));
EndpointReference replyTo = getEndpointReference(replyToExpression.evaluateAsNode(headerElement));
EndpointReference from = getEndpointReference(this.fromExpression.evaluateAsNode(headerElement));
EndpointReference replyTo = getEndpointReference(this.replyToExpression.evaluateAsNode(headerElement));
if (replyTo == null) {
replyTo = getDefaultReplyTo(from);
}
EndpointReference faultTo = getEndpointReference(faultToExpression.evaluateAsNode(headerElement));
EndpointReference faultTo = getEndpointReference(this.faultToExpression.evaluateAsNode(headerElement));
if (faultTo == null) {
faultTo = replyTo;
}
URI action = getUri(headerElement, actionExpression);
URI messageId = getUri(headerElement, messageIdExpression);
URI action = getUri(headerElement, this.actionExpression);
URI messageId = getUri(headerElement, this.messageIdExpression);
return new MessageAddressingProperties(to, from, replyTo, faultTo, action, messageId);
}
@@ -180,14 +180,14 @@ public abstract class AbstractAddressingVersion extends TransformerObjectSupport
if (node == null) {
return null;
}
URI address = getUri(node, addressExpression);
URI address = getUri(node, this.addressExpression);
if (address == null) {
return null;
}
List<Node> referenceProperties = referencePropertiesExpression != null
? referencePropertiesExpression.evaluateAsNodeList(node) : Collections.emptyList();
List<Node> referenceParameters = referenceParametersExpression != null
? referenceParametersExpression.evaluateAsNodeList(node) : Collections.emptyList();
List<Node> referenceProperties = this.referencePropertiesExpression != null
? this.referencePropertiesExpression.evaluateAsNodeList(node) : Collections.emptyList();
List<Node> referenceParameters = this.referenceParametersExpression != null
? this.referenceParametersExpression.evaluateAsNodeList(node) : Collections.emptyList();
return new EndpointReference(address, referenceProperties, referenceParameters);
}

View File

@@ -41,17 +41,17 @@ public class SoapFaultClientException extends WebServiceFaultException {
public SoapFaultClientException(SoapMessage faultMessage) {
super(faultMessage);
SoapBody body = faultMessage.getSoapBody();
soapFault = body != null ? body.getFault() : null;
this.soapFault = body != null ? body.getFault() : null;
}
/** Returns the {@link SoapFault}. */
public SoapFault getSoapFault() {
return soapFault;
return this.soapFault;
}
/** Returns the fault code. */
public QName getFaultCode() {
return soapFault != null ? soapFault.getFaultCode() : null;
return this.soapFault != null ? this.soapFault.getFaultCode() : null;
}
/**
@@ -61,7 +61,7 @@ public class SoapFaultClientException extends WebServiceFaultException {
* Note that this message returns the same as {@link #getMessage()}.
*/
public String getFaultStringOrReason() {
return soapFault != null ? soapFault.getFaultStringOrReason() : null;
return this.soapFault != null ? this.soapFault.getFaultStringOrReason() : null;
}
}

View File

@@ -54,7 +54,7 @@ public class SoapActionCallback implements WebServiceMessageCallback {
public void doWithMessage(WebServiceMessage message) throws IOException {
Assert.isInstanceOf(SoapMessage.class, message);
SoapMessage soapMessage = (SoapMessage) message;
soapMessage.setSoapAction(soapAction);
soapMessage.setSoapAction(this.soapAction);
}
}

View File

@@ -44,18 +44,18 @@ class SaajAttachment implements Attachment {
@Override
public String getContentId() {
return saajAttachment.getContentId();
return this.saajAttachment.getContentId();
}
@Override
public String getContentType() {
return saajAttachment.getContentType();
return this.saajAttachment.getContentType();
}
@Override
public InputStream getInputStream() throws IOException {
try {
return saajAttachment.getDataHandler().getInputStream();
return this.saajAttachment.getDataHandler().getInputStream();
}
catch (SOAPException ex) {
throw new SaajAttachmentException(ex);
@@ -65,7 +65,7 @@ class SaajAttachment implements Attachment {
@Override
public long getSize() {
try {
return saajAttachment.getSize();
return this.saajAttachment.getSize();
}
catch (SOAPException ex) {
throw new SaajAttachmentException(ex);
@@ -75,7 +75,7 @@ class SaajAttachment implements Attachment {
@Override
public DataHandler getDataHandler() {
try {
return saajAttachment.getDataHandler();
return this.saajAttachment.getDataHandler();
}
catch (SOAPException ex) {
throw new SaajAttachmentException(ex);

View File

@@ -57,7 +57,7 @@ class SaajSoap11Body extends SaajSoapBody implements Soap11Body {
Assert.hasLength(faultString, "faultString cannot be empty");
Assert.hasLength(faultCode.getLocalPart(), "faultCode's localPart cannot be empty");
Assert.hasLength(faultCode.getNamespaceURI(), "faultCode's namespaceUri cannot be empty");
if (!langAttributeOnSoap11FaultString) {
if (!this.langAttributeOnSoap11FaultString) {
faultStringLocale = null;
}
try {

View File

@@ -46,18 +46,18 @@ class SaajSoapElement<T extends SOAPElement> implements SoapElement {
@Override
public Source getSource() {
return new DOMSource(element);
return new DOMSource(this.element);
}
@Override
public QName getName() {
return element.getElementQName();
return this.element.getElementQName();
}
@Override
public void addAttribute(QName name, String value) {
try {
element.addAttribute(name, value);
this.element.addAttribute(name, value);
}
catch (SOAPException ex) {
throw new SaajSoapElementException(ex);
@@ -66,24 +66,24 @@ class SaajSoapElement<T extends SOAPElement> implements SoapElement {
@Override
public void removeAttribute(QName name) {
element.removeAttribute(name);
this.element.removeAttribute(name);
}
@Override
public String getAttributeValue(QName name) {
return element.getAttributeValue(name);
return this.element.getAttributeValue(name);
}
@Override
@SuppressWarnings("unchecked")
public Iterator<QName> getAllAttributes() {
return element.getAllAttributesAsQNames();
return this.element.getAllAttributesAsQNames();
}
@Override
public void addNamespaceDeclaration(String prefix, String namespaceUri) {
try {
element.addNamespaceDeclaration(prefix, namespaceUri);
this.element.addNamespaceDeclaration(prefix, namespaceUri);
}
catch (SOAPException ex) {
throw new SaajSoapElementException(ex);
@@ -91,7 +91,7 @@ class SaajSoapElement<T extends SOAPElement> implements SoapElement {
}
protected final T getSaajElement() {
return element;
return this.element;
}
}

View File

@@ -48,7 +48,7 @@ class SaajSoapEnvelope extends SaajSoapElement<SOAPEnvelope> implements SoapEnve
@Override
public SoapBody getBody() {
if (body == null) {
if (this.body == null) {
try {
SOAPBody saajBody = getSaajEnvelope().getBody();
if (saajBody == null) {
@@ -57,43 +57,43 @@ class SaajSoapEnvelope extends SaajSoapElement<SOAPEnvelope> implements SoapEnve
if (saajBody.getElementQName()
.getNamespaceURI()
.equals(SoapVersion.SOAP_11.getEnvelopeNamespaceUri())) {
body = new SaajSoap11Body(saajBody, langAttributeOnSoap11FaultString);
this.body = new SaajSoap11Body(saajBody, this.langAttributeOnSoap11FaultString);
}
else {
body = new SaajSoap12Body(saajBody);
this.body = new SaajSoap12Body(saajBody);
}
}
catch (SOAPException ex) {
throw new SaajSoapBodyException(ex);
}
}
return body;
return this.body;
}
@Override
public SoapHeader getHeader() {
if (header == null) {
if (this.header == null) {
try {
SOAPHeader saajHeader = getSaajEnvelope().getHeader();
if (saajHeader != null) {
if (saajHeader.getElementQName()
.getNamespaceURI()
.equals(SoapVersion.SOAP_11.getEnvelopeNamespaceUri())) {
header = new SaajSoap11Header(saajHeader);
this.header = new SaajSoap11Header(saajHeader);
}
else {
header = new SaajSoap12Header(saajHeader);
this.header = new SaajSoap12Header(saajHeader);
}
}
else {
header = null;
this.header = null;
}
}
catch (SOAPException ex) {
throw new SaajSoapHeaderException(ex);
}
}
return header;
return this.header;
}
protected SOAPEnvelope getSaajEnvelope() {

View File

@@ -82,18 +82,18 @@ class SaajSoapFaultDetail extends SaajSoapElement<SOAPFaultElement> implements S
@Override
public boolean hasNext() {
return iterator.hasNext();
return this.iterator.hasNext();
}
@Override
public SoapFaultDetailElement next() {
DetailEntry saajDetailEntry = iterator.next();
DetailEntry saajDetailEntry = this.iterator.next();
return new SaajSoapFaultDetailElement(saajDetailEntry);
}
@Override
public void remove() {
iterator.remove();
this.iterator.remove();
}
}

View File

@@ -108,12 +108,12 @@ abstract class SaajSoapHeader extends SaajSoapElement<SOAPHeader> implements Soa
@Override
public boolean hasNext() {
return iterator.hasNext();
return this.iterator.hasNext();
}
@Override
public SoapHeaderElement next() {
Node saajHeaderElement = iterator.next();
Node saajHeaderElement = this.iterator.next();
if (saajHeaderElement instanceof SOAPHeaderElement) {
return new SaajSoapHeaderElement((SOAPHeaderElement) saajHeaderElement);
}
@@ -124,7 +124,7 @@ abstract class SaajSoapHeader extends SaajSoapElement<SOAPHeader> implements Soa
@Override
public void remove() {
iterator.remove();
this.iterator.remove();
}
}

View File

@@ -110,7 +110,7 @@ public class SaajSoapMessage extends AbstractSoapMessage {
public SaajSoapMessage(SOAPMessage soapMessage, boolean langAttributeOnSoap11FaultString,
MessageFactory messageFactory) {
Assert.notNull(soapMessage, "soapMessage must not be null");
saajMessage = soapMessage;
this.saajMessage = soapMessage;
this.langAttributeOnSoap11FaultString = langAttributeOnSoap11FaultString;
this.messageFactory = messageFactory;
}
@@ -119,7 +119,7 @@ public class SaajSoapMessage extends AbstractSoapMessage {
* Return the SAAJ {@code SOAPMessage} that this {@code SaajSoapMessage} is based on.
*/
public SOAPMessage getSaajMessage() {
return saajMessage;
return this.saajMessage;
}
/**
@@ -127,22 +127,22 @@ public class SaajSoapMessage extends AbstractSoapMessage {
*/
public void setSaajMessage(SOAPMessage soapMessage) {
Assert.notNull(soapMessage, "soapMessage must not be null");
saajMessage = soapMessage;
envelope = null;
this.saajMessage = soapMessage;
this.envelope = null;
}
@Override
public SoapEnvelope getEnvelope() {
if (envelope == null) {
if (this.envelope == null) {
try {
SOAPEnvelope saajEnvelope = getSaajMessage().getSOAPPart().getEnvelope();
envelope = new SaajSoapEnvelope(saajEnvelope, langAttributeOnSoap11FaultString);
this.envelope = new SaajSoapEnvelope(saajEnvelope, this.langAttributeOnSoap11FaultString);
}
catch (SOAPException ex) {
throw new SaajSoapEnvelopeException(ex);
}
}
return envelope;
return this.envelope;
}
@Override
@@ -172,7 +172,7 @@ public class SaajSoapMessage extends AbstractSoapMessage {
else if (SoapVersion.SOAP_12 == getVersion()) {
// force save of Content Type header
try {
saajMessage.saveChanges();
this.saajMessage.saveChanges();
}
catch (SOAPException ex) {
throw new SaajSoapMessageException("Could not save message", ex);
@@ -191,14 +191,14 @@ public class SaajSoapMessage extends AbstractSoapMessage {
@Override
public Document getDocument() {
Assert.state(messageFactory != null, "Could find message factory to use");
Assert.state(this.messageFactory != null, "Could find message factory to use");
// return saajSoapMessage.getSaajMessage().getSOAPPart(); // does not work, see
// SWS-345
try {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
getSaajMessage().writeTo(bos);
ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
SOAPMessage saajMessage = messageFactory.createMessage(getSaajMessage().getMimeHeaders(), bis);
SOAPMessage saajMessage = this.messageFactory.createMessage(getSaajMessage().getMimeHeaders(), bis);
setSaajMessage(saajMessage);
return saajMessage.getSOAPPart();
}
@@ -209,8 +209,8 @@ public class SaajSoapMessage extends AbstractSoapMessage {
@Override
public void setDocument(Document document) {
if (saajMessage.getSOAPPart() != document) {
Assert.state(messageFactory != null, "Could find message factory to use");
if (this.saajMessage.getSOAPPart() != document) {
Assert.state(this.messageFactory != null, "Could find message factory to use");
try {
DOMImplementation implementation = document.getImplementation();
Assert.isInstanceOf(DOMImplementationLS.class, implementation);
@@ -225,7 +225,7 @@ public class SaajSoapMessage extends AbstractSoapMessage {
ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
this.saajMessage = messageFactory.createMessage(saajMessage.getMimeHeaders(), bis);
this.saajMessage = this.messageFactory.createMessage(this.saajMessage.getMimeHeaders(), bis);
}
catch (SOAPException | IOException ex) {
@@ -275,7 +275,7 @@ public class SaajSoapMessage extends AbstractSoapMessage {
@Override
public boolean isXopPackage() {
SOAPPart saajPart = saajMessage.getSOAPPart();
SOAPPart saajPart = this.saajMessage.getSOAPPart();
String[] contentTypes = saajPart.getMimeHeader(TransportConstants.HEADER_CONTENT_TYPE);
for (String contentType : contentTypes) {
if (contentType.contains(CONTENT_TYPE_XOP)) {
@@ -293,7 +293,7 @@ public class SaajSoapMessage extends AbstractSoapMessage {
}
private void convertMessageToXop() {
MimeHeaders mimeHeaders = saajMessage.getMimeHeaders();
MimeHeaders mimeHeaders = this.saajMessage.getMimeHeaders();
String[] oldContentTypes = mimeHeaders.getHeader(TransportConstants.HEADER_CONTENT_TYPE);
String oldContentType = !ObjectUtils.isEmpty(oldContentTypes) ? oldContentTypes[0]
: getVersion().getContentType();
@@ -302,7 +302,7 @@ public class SaajSoapMessage extends AbstractSoapMessage {
}
private void convertPartToXop() {
SOAPPart saajPart = saajMessage.getSOAPPart();
SOAPPart saajPart = this.saajMessage.getSOAPPart();
String[] oldContentTypes = saajPart.getMimeHeader(TransportConstants.HEADER_CONTENT_TYPE);
String oldContentType = !ObjectUtils.isEmpty(oldContentTypes) ? oldContentTypes[0]
: getVersion().getContentType();
@@ -346,7 +346,7 @@ public class SaajSoapMessage extends AbstractSoapMessage {
public String toString() {
StringBuilder builder = new StringBuilder("SaajSoapMessage");
try {
SOAPEnvelope envelope = saajMessage.getSOAPPart().getEnvelope();
SOAPEnvelope envelope = this.saajMessage.getSOAPPart().getEnvelope();
if (envelope != null) {
SOAPBody body = envelope.getBody();
if (body != null) {
@@ -374,18 +374,18 @@ public class SaajSoapMessage extends AbstractSoapMessage {
@Override
public boolean hasNext() {
return saajIterator.hasNext();
return this.saajIterator.hasNext();
}
@Override
public Attachment next() {
AttachmentPart saajAttachment = saajIterator.next();
AttachmentPart saajAttachment = this.saajIterator.next();
return new SaajAttachment(saajAttachment);
}
@Override
public void remove() {
saajIterator.remove();
this.saajIterator.remove();
}
}

View File

@@ -86,7 +86,7 @@ public class SaajSoapMessageFactory implements SoapMessageFactory, InitializingB
/** Returns the SAAJ {@code MessageFactory} used. */
public MessageFactory getMessageFactory() {
return messageFactory;
return this.messageFactory;
}
/** Sets the SAAJ {@code MessageFactory}. */
@@ -120,10 +120,10 @@ public class SaajSoapMessageFactory implements SoapMessageFactory, InitializingB
public void setSoapVersion(SoapVersion version) {
if (SaajUtils.getSaajVersion() >= SaajUtils.SAAJ_13) {
if (SoapVersion.SOAP_11 == version) {
messageFactoryProtocol = SOAPConstants.SOAP_1_1_PROTOCOL;
this.messageFactoryProtocol = SOAPConstants.SOAP_1_1_PROTOCOL;
}
else if (SoapVersion.SOAP_12 == version) {
messageFactoryProtocol = SOAPConstants.SOAP_1_2_PROTOCOL;
this.messageFactoryProtocol = SOAPConstants.SOAP_1_2_PROTOCOL;
}
else {
throw new IllegalArgumentException(
@@ -137,24 +137,24 @@ public class SaajSoapMessageFactory implements SoapMessageFactory, InitializingB
@Override
public void afterPropertiesSet() {
if (messageFactory == null) {
if (this.messageFactory == null) {
try {
if (SaajUtils.getSaajVersion() >= SaajUtils.SAAJ_13) {
if (!StringUtils.hasLength(messageFactoryProtocol)) {
messageFactoryProtocol = SOAPConstants.SOAP_1_1_PROTOCOL;
if (!StringUtils.hasLength(this.messageFactoryProtocol)) {
this.messageFactoryProtocol = SOAPConstants.SOAP_1_1_PROTOCOL;
}
if (logger.isInfoEnabled()) {
logger.info("Creating SAAJ 1.3 MessageFactory with " + messageFactoryProtocol);
logger.info("Creating SAAJ 1.3 MessageFactory with " + this.messageFactoryProtocol);
}
messageFactory = MessageFactory.newInstance(messageFactoryProtocol);
this.messageFactory = MessageFactory.newInstance(this.messageFactoryProtocol);
}
else if (SaajUtils.getSaajVersion() == SaajUtils.SAAJ_12) {
logger.info("Creating SAAJ 1.2 MessageFactory");
messageFactory = MessageFactory.newInstance();
this.messageFactory = MessageFactory.newInstance();
}
else if (SaajUtils.getSaajVersion() == SaajUtils.SAAJ_11) {
logger.info("Creating SAAJ 1.1 MessageFactory");
messageFactory = MessageFactory.newInstance();
this.messageFactory = MessageFactory.newInstance();
}
else {
throw new IllegalStateException(
@@ -173,16 +173,16 @@ public class SaajSoapMessageFactory implements SoapMessageFactory, InitializingB
}
}
if (logger.isDebugEnabled()) {
logger.debug("Using MessageFactory class [" + messageFactory.getClass().getName() + "]");
logger.debug("Using MessageFactory class [" + this.messageFactory.getClass().getName() + "]");
}
}
@Override
public SaajSoapMessage createWebServiceMessage() {
try {
SOAPMessage saajMessage = messageFactory.createMessage();
SOAPMessage saajMessage = this.messageFactory.createMessage();
postProcess(saajMessage);
return new SaajSoapMessage(saajMessage, langAttributeOnSoap11FaultString, messageFactory);
return new SaajSoapMessage(saajMessage, this.langAttributeOnSoap11FaultString, this.messageFactory);
}
catch (SOAPException ex) {
throw new SoapMessageCreationException("Could not create empty message: " + ex.getMessage(), ex);
@@ -194,10 +194,10 @@ public class SaajSoapMessageFactory implements SoapMessageFactory, InitializingB
MimeHeaders mimeHeaders = parseMimeHeaders(inputStream);
try {
inputStream = checkForUtf8ByteOrderMark(inputStream);
SOAPMessage saajMessage = messageFactory.createMessage(mimeHeaders, inputStream);
SOAPMessage saajMessage = this.messageFactory.createMessage(mimeHeaders, inputStream);
saajMessage.getSOAPPart().getEnvelope();
postProcess(saajMessage);
return new SaajSoapMessage(saajMessage, langAttributeOnSoap11FaultString, messageFactory);
return new SaajSoapMessage(saajMessage, this.langAttributeOnSoap11FaultString, this.messageFactory);
}
catch (SOAPException ex) {
// SAAJ 1.3 RI has a issue with handling multipart XOP content types which
@@ -209,9 +209,9 @@ public class SaajSoapMessageFactory implements SoapMessageFactory, InitializingB
contentType = contentType.replace("startinfo", "start-info");
mimeHeaders.setHeader(TransportConstants.HEADER_CONTENT_TYPE, contentType);
try {
SOAPMessage saajMessage = messageFactory.createMessage(mimeHeaders, inputStream);
SOAPMessage saajMessage = this.messageFactory.createMessage(mimeHeaders, inputStream);
postProcess(saajMessage);
return new SaajSoapMessage(saajMessage, langAttributeOnSoap11FaultString);
return new SaajSoapMessage(saajMessage, this.langAttributeOnSoap11FaultString);
}
catch (SOAPException e) {
// fall-through
@@ -309,8 +309,8 @@ public class SaajSoapMessageFactory implements SoapMessageFactory, InitializingB
* @see #setMessageProperties(java.util.Map)
*/
protected void postProcess(SOAPMessage soapMessage) throws SOAPException {
if (!CollectionUtils.isEmpty(messageProperties)) {
for (Map.Entry<String, ?> entry : messageProperties.entrySet()) {
if (!CollectionUtils.isEmpty(this.messageProperties)) {
for (Map.Entry<String, ?> entry : this.messageProperties.entrySet()) {
soapMessage.setProperty(entry.getKey(), entry.getValue());
}
}
@@ -328,7 +328,7 @@ public class SaajSoapMessageFactory implements SoapMessageFactory, InitializingB
builder.append(SaajUtils.getSaajVersionString());
if (SaajUtils.getSaajVersion() >= SaajUtils.SAAJ_13) {
builder.append(',');
builder.append(messageFactoryProtocol);
builder.append(this.messageFactoryProtocol);
}
builder.append(']');
return builder.toString();

View File

@@ -56,10 +56,10 @@ public class SaajContentHandler implements ContentHandler {
public SaajContentHandler(SOAPElement element) {
Assert.notNull(element, "element must not be null");
if (element instanceof SOAPEnvelope) {
envelope = (SOAPEnvelope) element;
this.envelope = (SOAPEnvelope) element;
}
else {
envelope = SaajUtils.getEnvelope(element);
this.envelope = SaajUtils.getEnvelope(element);
}
this.element = element;
}
@@ -68,7 +68,7 @@ public class SaajContentHandler implements ContentHandler {
public void characters(char[] ch, int start, int length) throws SAXException {
try {
String text = new String(ch, start, length);
element.addTextNode(text);
this.element.addTextNode(text);
}
catch (SOAPException ex) {
throw new SAXException(ex);
@@ -79,23 +79,24 @@ public class SaajContentHandler implements ContentHandler {
public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException {
try {
String childPrefix = getPrefix(qName);
SOAPElement child = element.addChildElement(localName, childPrefix, uri);
SOAPElement child = this.element.addChildElement(localName, childPrefix, uri);
for (int i = 0; i < atts.getLength(); i++) {
if (StringUtils.hasLength(atts.getLocalName(i))) {
String attributePrefix = getPrefix(atts.getQName(i));
if (!"xmlns".equals(atts.getLocalName(i)) && !"xmlns".equals(attributePrefix)) {
Name attributeName = envelope.createName(atts.getLocalName(i), attributePrefix, atts.getURI(i));
Name attributeName = this.envelope.createName(atts.getLocalName(i), attributePrefix,
atts.getURI(i));
child.addAttribute(attributeName, atts.getValue(i));
}
}
}
for (String namespacePrefix : namespaces.keySet()) {
String namespaceUri = namespaces.get(namespacePrefix);
for (String namespacePrefix : this.namespaces.keySet()) {
String namespaceUri = this.namespaces.get(namespacePrefix);
if (!findParentNamespaceDeclaration(child, namespacePrefix, namespaceUri)) {
child.addNamespaceDeclaration(namespacePrefix, namespaceUri);
}
}
element = child;
this.element = child;
}
catch (SOAPException ex) {
throw new SAXException(ex);
@@ -123,19 +124,19 @@ public class SaajContentHandler implements ContentHandler {
@Override
public void endElement(String uri, String localName, String qName) throws SAXException {
Assert.isTrue(localName.equals(element.getElementName().getLocalName()), "Invalid element on stack");
Assert.isTrue(uri.equals(element.getElementName().getURI()), "Invalid element on stack");
element = element.getParentElement();
Assert.isTrue(localName.equals(this.element.getElementName().getLocalName()), "Invalid element on stack");
Assert.isTrue(uri.equals(this.element.getElementName().getURI()), "Invalid element on stack");
this.element = this.element.getParentElement();
}
@Override
public void startPrefixMapping(String prefix, String uri) throws SAXException {
namespaces.put(prefix, uri);
this.namespaces.put(prefix, uri);
}
@Override
public void endPrefixMapping(String prefix) throws SAXException {
namespaces.remove(prefix);
this.namespaces.remove(prefix);
}
@Override

View File

@@ -66,10 +66,10 @@ public class SaajXmlReader extends AbstractXmlReader {
@Override
public boolean getFeature(String name) throws SAXNotRecognizedException, SAXNotSupportedException {
if (NAMESPACES_FEATURE_NAME.equals(name)) {
return namespacesFeature;
return this.namespacesFeature;
}
else if (NAMESPACE_PREFIXES_FEATURE_NAME.equals(name)) {
return namespacePrefixesFeature;
return this.namespacePrefixesFeature;
}
else {
return super.getFeature(name);
@@ -119,7 +119,7 @@ public class SaajXmlReader extends AbstractXmlReader {
if (getContentHandler() != null) {
getContentHandler().startDocument();
}
handleNode(startNode);
handleNode(this.startNode);
if (getContentHandler() != null) {
getContentHandler().endDocument();
}
@@ -137,7 +137,7 @@ public class SaajXmlReader extends AbstractXmlReader {
private void handleElement(SOAPElement element) throws SAXException {
Name elementName = element.getElementName();
if (getContentHandler() != null) {
if (namespacesFeature) {
if (this.namespacesFeature) {
for (Iterator<?> iterator = element.getNamespacePrefixes(); iterator.hasNext();) {
String prefix = (String) iterator.next();
String namespaceUri = element.getNamespaceURI(prefix);
@@ -155,7 +155,7 @@ public class SaajXmlReader extends AbstractXmlReader {
handleNode(child);
}
if (getContentHandler() != null) {
if (namespacesFeature) {
if (this.namespacesFeature) {
getContentHandler().endElement(elementName.getURI(), elementName.getLocalName(),
elementName.getQualifiedName());
for (Iterator<?> iterator = element.getNamespacePrefixes(); iterator.hasNext();) {
@@ -182,14 +182,14 @@ public class SaajXmlReader extends AbstractXmlReader {
for (Iterator<?> iterator = element.getAllAttributes(); iterator.hasNext();) {
Name attributeName = (Name) iterator.next();
String namespace = attributeName.getURI();
if (namespace == null || !namespacesFeature) {
if (namespace == null || !this.namespacesFeature) {
namespace = "";
}
String attributeValue = element.getAttributeValue(attributeName);
attributes.addAttribute(namespace, attributeName.getLocalName(), attributeName.getQualifiedName(), "CDATA",
attributeValue);
}
if (namespacePrefixesFeature) {
if (this.namespacePrefixesFeature) {
for (Iterator<?> iterator = element.getNamespacePrefixes(); iterator.hasNext();) {
String prefix = (String) iterator.next();
String namespaceUri = element.getNamespaceURI(prefix);

View File

@@ -73,7 +73,7 @@ public class SoapEndpointInvocationChain extends EndpointInvocationChain {
* @return a string array of URIs for SOAP actors/roles
*/
public String[] getActorsOrRoles() {
return actorsOrRoles;
return this.actorsOrRoles;
}
/**
@@ -81,7 +81,7 @@ public class SoapEndpointInvocationChain extends EndpointInvocationChain {
* is {@code true}.
*/
public boolean isUltimateReceiver() {
return isUltimateReceiver;
return this.isUltimateReceiver;
}
}

View File

@@ -118,8 +118,8 @@ public class SoapMessageDispatcher extends MessageDispatcher {
while (headerIterator.hasNext()) {
SoapHeaderElement headerElement = headerIterator.next();
QName headerName = headerElement.getName();
if (headerElement.getMustUnderstand() && logger.isDebugEnabled()) {
logger.debug("Handling MustUnderstand header " + headerName);
if (headerElement.getMustUnderstand() && this.logger.isDebugEnabled()) {
this.logger.debug("Handling MustUnderstand header " + headerName);
}
if (headerElement.getMustUnderstand() && !headerUnderstood(mappedEndpoint, headerElement)) {
notUnderstoodHeaderNames.add(headerName);
@@ -159,13 +159,13 @@ public class SoapMessageDispatcher extends MessageDispatcher {
private void createMustUnderstandFault(SoapMessage soapResponse, List<QName> notUnderstoodHeaderNames,
String[] actorsOrRoles) {
if (logger.isWarnEnabled()) {
logger.warn("Could not handle mustUnderstand headers: "
if (this.logger.isWarnEnabled()) {
this.logger.warn("Could not handle mustUnderstand headers: "
+ StringUtils.collectionToCommaDelimitedString(notUnderstoodHeaderNames) + ". Returning fault");
}
SoapBody responseBody = soapResponse.getSoapBody();
SoapFault fault = responseBody.addMustUnderstandFault(mustUnderstandFaultString,
mustUnderstandFaultStringLocale);
SoapFault fault = responseBody.addMustUnderstandFault(this.mustUnderstandFaultString,
this.mustUnderstandFaultStringLocale);
if (!ObjectUtils.isEmpty(actorsOrRoles)) {
fault.setFaultActorOrRole(actorsOrRoles[0]);
}

View File

@@ -86,7 +86,7 @@ public abstract class AbstractFaultCreatingValidatingMarshallingPayloadEndpoint
* @see org.springframework.ws.soap.SoapFault#addFaultDetail()
*/
public boolean getAddValidationErrorDetail() {
return addValidationErrorDetail;
return this.addValidationErrorDetail;
}
/**
@@ -104,7 +104,7 @@ public abstract class AbstractFaultCreatingValidatingMarshallingPayloadEndpoint
* Returns the fault detail element name when validation errors occur on the request.
*/
public QName getDetailElementName() {
return detailElementName;
return this.detailElementName;
}
/**
@@ -121,7 +121,7 @@ public abstract class AbstractFaultCreatingValidatingMarshallingPayloadEndpoint
* occur on the request.
*/
public String getFaultStringOrReason() {
return faultStringOrReason;
return this.faultStringOrReason;
}
/**
@@ -136,7 +136,7 @@ public abstract class AbstractFaultCreatingValidatingMarshallingPayloadEndpoint
/** Returns the locale for SOAP fault reason and validation message resolution. */
public Locale getFaultLocale() {
return faultStringOrReasonLocale;
return this.faultStringOrReasonLocale;
}
/**
@@ -167,8 +167,8 @@ public abstract class AbstractFaultCreatingValidatingMarshallingPayloadEndpoint
@Override
protected final boolean onValidationErrors(MessageContext messageContext, Object requestObject, Errors errors) {
for (ObjectError objectError : errors.getAllErrors()) {
String msg = messageSource.getMessage(objectError, getFaultLocale());
logger.warn("Validation error on request object[" + requestObject + "]: " + msg);
String msg = this.messageSource.getMessage(objectError, getFaultLocale());
this.logger.warn("Validation error on request object[" + requestObject + "]: " + msg);
}
if (messageContext.getResponse() instanceof SoapMessage response) {
SoapBody body = response.getSoapBody();
@@ -176,7 +176,7 @@ public abstract class AbstractFaultCreatingValidatingMarshallingPayloadEndpoint
if (getAddValidationErrorDetail()) {
SoapFaultDetail detail = fault.addFaultDetail();
for (ObjectError objectError : errors.getAllErrors()) {
String msg = messageSource.getMessage(objectError, getFaultLocale());
String msg = this.messageSource.getMessage(objectError, getFaultLocale());
SoapFaultDetailElement detailElement = detail.addFaultDetailElement(getDetailElementName());
detailElement.addText(msg);
}

View File

@@ -67,7 +67,7 @@ public abstract class AbstractSoapFaultDefinitionExceptionResolver extends Abstr
SoapFaultDefinition definition = getFaultDefinition(endpoint, ex);
if (definition == null) {
definition = defaultFault;
definition = this.defaultFault;
}
if (definition == null) {
return false;

View File

@@ -46,7 +46,7 @@ public class SimpleSoapExceptionResolver extends AbstractEndpointExceptionResolv
* Defaults to {@link Locale#ENGLISH}.
*/
public Locale getLocale() {
return locale;
return this.locale;
}
/**

View File

@@ -67,7 +67,7 @@ public class SoapFaultDefinition {
/** Returns the fault code. */
public QName getFaultCode() {
return faultCode;
return this.faultCode;
}
/** Sets the fault code. */
@@ -80,7 +80,7 @@ public class SoapFaultDefinition {
* message.
*/
public String getFaultStringOrReason() {
return faultStringOrReason;
return this.faultStringOrReason;
}
/**
@@ -96,7 +96,7 @@ public class SoapFaultDefinition {
* @see Locale#ENGLISH
*/
public Locale getLocale() {
return locale;
return this.locale;
}
/**

View File

@@ -49,17 +49,17 @@ public class SoapFaultMappingExceptionResolver extends AbstractSoapFaultDefiniti
public void setExceptionMappings(Properties mappings) {
for (Map.Entry<Object, Object> entry : mappings.entrySet()) {
if (entry.getKey() instanceof String && entry.getValue() instanceof String) {
exceptionMappings.put((String) entry.getKey(), (String) entry.getValue());
this.exceptionMappings.put((String) entry.getKey(), (String) entry.getValue());
}
}
}
@Override
protected SoapFaultDefinition getFaultDefinition(Object endpoint, Exception ex) {
if (!CollectionUtils.isEmpty(exceptionMappings)) {
if (!CollectionUtils.isEmpty(this.exceptionMappings)) {
String definitionText = null;
int deepest = Integer.MAX_VALUE;
for (Map.Entry<String, String> exceptionMapping : exceptionMappings.entrySet()) {
for (Map.Entry<String, String> exceptionMapping : this.exceptionMappings.entrySet()) {
int depth = getDepth(exceptionMapping.getKey(), ex);
if (depth >= 0 && depth < deepest) {
deepest = depth;

View File

@@ -75,7 +75,7 @@ public enum FaultCode {
}
public QName value() {
return value;
return this.value;
}
}

View File

@@ -78,7 +78,7 @@ public abstract class AbstractFaultCreatingValidatingInterceptor extends Abstrac
* @see org.springframework.ws.soap.SoapFault#addFaultDetail()
*/
public boolean getAddValidationErrorDetail() {
return addValidationErrorDetail;
return this.addValidationErrorDetail;
}
/**
@@ -96,7 +96,7 @@ public abstract class AbstractFaultCreatingValidatingInterceptor extends Abstrac
* Returns the fault detail element name when validation errors occur on the request.
*/
public QName getDetailElementName() {
return detailElementName;
return this.detailElementName;
}
/**
@@ -113,7 +113,7 @@ public abstract class AbstractFaultCreatingValidatingInterceptor extends Abstrac
* occur on the request.
*/
public String getFaultStringOrReason() {
return faultStringOrReason;
return this.faultStringOrReason;
}
/**
@@ -131,7 +131,7 @@ public abstract class AbstractFaultCreatingValidatingInterceptor extends Abstrac
* request.
*/
public Locale getFaultStringOrReasonLocale() {
return faultStringOrReasonLocale;
return this.faultStringOrReasonLocale;
}
/**
@@ -159,7 +159,7 @@ public abstract class AbstractFaultCreatingValidatingInterceptor extends Abstrac
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());
}
if (messageContext.getResponse() instanceof SoapMessage response) {
SoapBody body = response.getSoapBody();

View File

@@ -58,11 +58,12 @@ public class PayloadRootSmartSoapEndpointInterceptor extends DelegatingSmartSoap
@Override
protected boolean shouldIntercept(WebServiceMessage request, Object endpoint) {
try {
QName payloadRootName = PayloadRootUtils.getPayloadRootQName(request.getPayloadSource(), transformerHelper);
if (payloadRootName == null || !namespaceUri.equals(payloadRootName.getNamespaceURI())) {
QName payloadRootName = PayloadRootUtils.getPayloadRootQName(request.getPayloadSource(),
this.transformerHelper);
if (payloadRootName == null || !this.namespaceUri.equals(payloadRootName.getNamespaceURI())) {
return false;
}
return !StringUtils.hasLength(localPart) || localPart.equals(payloadRootName.getLocalPart());
return !StringUtils.hasLength(this.localPart) || this.localPart.equals(payloadRootName.getLocalPart());
}
catch (TransformerException e) {

View File

@@ -48,7 +48,7 @@ public class SoapEnvelopeLoggingInterceptor extends AbstractLoggingInterceptor i
@Override
public boolean handleFault(MessageContext messageContext, Object endpoint) throws Exception {
if (logFault && isLogEnabled()) {
if (this.logFault && isLogEnabled()) {
logMessageSource("Fault: ", getSource(messageContext.getResponse()));
}
return true;

View File

@@ -58,7 +58,7 @@ public class DelegatingSoapEndpointMapping implements InitializingBean, SoapEndp
@Override
public final void setActorOrRole(String actorOrRole) {
Assert.notNull(actorOrRole, "actorOrRole must not be null");
actorsOrRoles = new String[] { actorOrRole };
this.actorsOrRoles = new String[] { actorOrRole };
}
@Override
@@ -69,7 +69,7 @@ public class DelegatingSoapEndpointMapping implements InitializingBean, SoapEndp
@Override
public final void setUltimateReceiver(boolean ultimateReceiver) {
isUltimateReceiver = ultimateReceiver;
this.isUltimateReceiver = ultimateReceiver;
}
/**
@@ -79,10 +79,10 @@ public class DelegatingSoapEndpointMapping implements InitializingBean, SoapEndp
*/
@Override
public EndpointInvocationChain getEndpoint(MessageContext messageContext) throws Exception {
EndpointInvocationChain delegateChain = delegate.getEndpoint(messageContext);
EndpointInvocationChain delegateChain = this.delegate.getEndpoint(messageContext);
if (delegateChain != null) {
return new SoapEndpointInvocationChain(delegateChain.getEndpoint(), delegateChain.getInterceptors(),
actorsOrRoles, isUltimateReceiver);
this.actorsOrRoles, this.isUltimateReceiver);
}
else {
return null;
@@ -91,7 +91,7 @@ public class DelegatingSoapEndpointMapping implements InitializingBean, SoapEndp
@Override
public void afterPropertiesSet() throws Exception {
Assert.notNull(delegate, "delegate is required");
Assert.notNull(this.delegate, "delegate is required");
}
}

View File

@@ -62,7 +62,7 @@ public class SoapActionAnnotationMethodEndpointMapping extends AbstractAnnotatio
@Override
public final void setActorOrRole(String actorOrRole) {
Assert.notNull(actorOrRole, "actorOrRole must not be null");
actorsOrRoles = new String[] { actorOrRole };
this.actorsOrRoles = new String[] { actorOrRole };
}
@Override
@@ -73,7 +73,7 @@ public class SoapActionAnnotationMethodEndpointMapping extends AbstractAnnotatio
@Override
public final void setUltimateReceiver(boolean ultimateReceiver) {
isUltimateReceiver = ultimateReceiver;
this.isUltimateReceiver = ultimateReceiver;
}
/**
@@ -88,7 +88,7 @@ public class SoapActionAnnotationMethodEndpointMapping extends AbstractAnnotatio
@Override
protected final EndpointInvocationChain createEndpointInvocationChain(MessageContext messageContext,
Object endpoint, EndpointInterceptor[] interceptors) {
return new SoapEndpointInvocationChain(endpoint, interceptors, actorsOrRoles, isUltimateReceiver);
return new SoapEndpointInvocationChain(endpoint, interceptors, this.actorsOrRoles, this.isUltimateReceiver);
}
@Override

View File

@@ -61,7 +61,7 @@ public class SoapActionEndpointMapping extends AbstractMapBasedEndpointMapping i
@Override
public final void setActorOrRole(String actorOrRole) {
Assert.notNull(actorOrRole, "actorOrRole must not be null");
actorsOrRoles = new String[] { actorOrRole };
this.actorsOrRoles = new String[] { actorOrRole };
}
@Override
@@ -72,7 +72,7 @@ public class SoapActionEndpointMapping extends AbstractMapBasedEndpointMapping i
@Override
public final void setUltimateReceiver(boolean ultimateReceiver) {
isUltimateReceiver = ultimateReceiver;
this.isUltimateReceiver = ultimateReceiver;
}
/**
@@ -87,7 +87,7 @@ public class SoapActionEndpointMapping extends AbstractMapBasedEndpointMapping i
@Override
protected final EndpointInvocationChain createEndpointInvocationChain(MessageContext messageContext,
Object endpoint, EndpointInterceptor[] interceptors) {
return new SoapEndpointInvocationChain(endpoint, interceptors, actorsOrRoles, isUltimateReceiver);
return new SoapEndpointInvocationChain(endpoint, interceptors, this.actorsOrRoles, this.isUltimateReceiver);
}
@Override

View File

@@ -80,7 +80,7 @@ public class DefaultStrategiesHelper {
*/
public DefaultStrategiesHelper(Resource resource) throws IllegalStateException {
try {
defaultStrategies = PropertiesLoaderUtils.loadProperties(resource);
this.defaultStrategies = PropertiesLoaderUtils.loadProperties(resource);
}
catch (IOException ex) {
throw new IllegalStateException("Could not load '" + resource + "': " + ex.getMessage());
@@ -125,7 +125,7 @@ public class DefaultStrategiesHelper {
throws BeanInitializationException {
String key = strategyInterface.getName();
try {
String value = defaultStrategies.getProperty(key);
String value = this.defaultStrategies.getProperty(key);
if (value == null) {
return Collections.emptyList();
}

View File

@@ -96,22 +96,22 @@ public abstract class MarshallingUtils {
@Override
public boolean isXopPackage() {
return mimeMessage.isXopPackage();
return this.mimeMessage.isXopPackage();
}
@Override
public boolean convertToXopPackage() {
return mimeMessage.convertToXopPackage();
return this.mimeMessage.convertToXopPackage();
}
@Override
public void addAttachment(String contentId, DataHandler dataHandler) {
mimeMessage.addAttachment(contentId, dataHandler);
this.mimeMessage.addAttachment(contentId, dataHandler);
}
@Override
public DataHandler getAttachment(String contentId) {
Attachment attachment = mimeMessage.getAttachment(contentId);
Attachment attachment = this.mimeMessage.getAttachment(contentId);
return attachment != null ? attachment.getDataHandler() : null;
}

View File

@@ -38,18 +38,18 @@ public abstract class AbstractReceiverConnection extends AbstractWebServiceConne
@Override
protected final TransportInputStream createTransportInputStream() throws IOException {
if (requestInputStream == null) {
requestInputStream = new RequestTransportInputStream();
if (this.requestInputStream == null) {
this.requestInputStream = new RequestTransportInputStream();
}
return requestInputStream;
return this.requestInputStream;
}
@Override
protected final TransportOutputStream createTransportOutputStream() throws IOException {
if (responseOutputStream == null) {
responseOutputStream = new ResponseTransportOutputStream();
if (this.responseOutputStream == null) {
this.responseOutputStream = new ResponseTransportOutputStream();
}
return responseOutputStream;
return this.responseOutputStream;
}
/**

View File

@@ -38,19 +38,19 @@ public abstract class AbstractSenderConnection extends AbstractWebServiceConnect
@Override
protected final TransportOutputStream createTransportOutputStream() throws IOException {
if (requestOutputStream == null) {
requestOutputStream = new RequestTransportOutputStream();
if (this.requestOutputStream == null) {
this.requestOutputStream = new RequestTransportOutputStream();
}
return requestOutputStream;
return this.requestOutputStream;
}
@Override
protected final TransportInputStream createTransportInputStream() throws IOException {
if (hasResponse()) {
if (responseInputStream == null) {
responseInputStream = new ResponseTransportInputStream();
if (this.responseInputStream == null) {
this.responseInputStream = new ResponseTransportInputStream();
}
return responseInputStream;
return this.responseInputStream;
}
else {
return null;

View File

@@ -39,12 +39,12 @@ public abstract class AbstractWebServiceConnection implements WebServiceConnecti
public final void send(WebServiceMessage message) throws IOException {
checkClosed();
onSendBeforeWrite(message);
tos = createTransportOutputStream();
if (tos == null) {
this.tos = createTransportOutputStream();
if (this.tos == null) {
return;
}
message.writeTo(tos);
tos.flush();
message.writeTo(this.tos);
this.tos.flush();
onSendAfterWrite(message);
}
@@ -82,11 +82,11 @@ public abstract class AbstractWebServiceConnection implements WebServiceConnecti
public final WebServiceMessage receive(WebServiceMessageFactory messageFactory) throws IOException {
checkClosed();
onReceiveBeforeRead();
tis = createTransportInputStream();
if (tis == null) {
this.tis = createTransportInputStream();
if (this.tis == null) {
return null;
}
WebServiceMessage message = messageFactory.createWebServiceMessage(tis);
WebServiceMessage message = messageFactory.createWebServiceMessage(this.tis);
onReceiveAfterRead(message);
return message;
}
@@ -123,31 +123,31 @@ public abstract class AbstractWebServiceConnection implements WebServiceConnecti
@Override
public final void close() throws IOException {
IOException ioex = null;
if (tis != null) {
if (this.tis != null) {
try {
tis.close();
this.tis.close();
}
catch (IOException ex) {
ioex = ex;
}
}
if (tos != null) {
if (this.tos != null) {
try {
tos.close();
this.tos.close();
}
catch (IOException ex) {
ioex = ex;
}
}
onClose();
closed = true;
this.closed = true;
if (ioex != null) {
throw ioex;
}
}
private void checkClosed() {
if (closed) {
if (this.closed) {
throw new IllegalStateException("Connection has been closed and cannot be reused.");
}
}

View File

@@ -40,16 +40,16 @@ public abstract class TransportInputStream extends InputStream {
}
private InputStream getInputStream() throws IOException {
if (inputStream == null) {
inputStream = createInputStream();
Assert.notNull(inputStream, "inputStream must not be null");
if (this.inputStream == null) {
this.inputStream = createInputStream();
Assert.notNull(this.inputStream, "inputStream must not be null");
}
return inputStream;
return this.inputStream;
}
@Override
public void close() throws IOException {
if (inputStream != null) {
if (this.inputStream != null) {
getInputStream().close();
}
}

View File

@@ -38,23 +38,23 @@ public abstract class TransportOutputStream extends OutputStream {
}
private OutputStream getOutputStream() throws IOException {
if (outputStream == null) {
outputStream = createOutputStream();
Assert.notNull(outputStream, "outputStream must not be null");
if (this.outputStream == null) {
this.outputStream = createOutputStream();
Assert.notNull(this.outputStream, "outputStream must not be null");
}
return outputStream;
return this.outputStream;
}
@Override
public void close() throws IOException {
if (outputStream != null) {
if (this.outputStream != null) {
getOutputStream().close();
}
}
@Override
public void flush() throws IOException {
if (outputStream != null) {
if (this.outputStream != null) {
getOutputStream().flush();
}
}

View File

@@ -39,11 +39,11 @@ public class DefaultTransportContext implements TransportContext {
@Override
public WebServiceConnection getConnection() {
return connection;
return this.connection;
}
public String toString() {
return connection.toString();
return this.connection.toString();
}
}

View File

@@ -79,30 +79,30 @@ public abstract class AbstractHttpSenderConnection extends AbstractSenderConnect
|| HttpTransportConstants.STATUS_NO_CONTENT == responseCode) {
return false;
}
if (hasResponse != null) {
return hasResponse;
if (this.hasResponse != null) {
return this.hasResponse;
}
long contentLength = getResponseContentLength();
if (contentLength < 0) {
rawResponseInputStream = new PushbackInputStream(getRawResponseInputStream());
int b = rawResponseInputStream.read();
this.rawResponseInputStream = new PushbackInputStream(getRawResponseInputStream());
int b = this.rawResponseInputStream.read();
if (b == -1) {
hasResponse = Boolean.FALSE;
this.hasResponse = Boolean.FALSE;
}
else {
hasResponse = Boolean.TRUE;
rawResponseInputStream.unread(b);
this.hasResponse = Boolean.TRUE;
this.rawResponseInputStream.unread(b);
}
}
else {
hasResponse = contentLength > 0;
this.hasResponse = contentLength > 0;
}
return hasResponse;
return this.hasResponse;
}
@Override
protected final InputStream getResponseInputStream() throws IOException {
InputStream inputStream = rawResponseInputStream;
InputStream inputStream = this.rawResponseInputStream;
if (inputStream == null) {
inputStream = getRawResponseInputStream();
}

View File

@@ -45,7 +45,7 @@ public abstract class AbstractHttpWebServiceMessageSender implements WebServiceM
* {@code Accept-Encoding} header with {@code gzip} as value.
*/
public boolean isAcceptGzipEncoding() {
return acceptGzipEncoding;
return this.acceptGzipEncoding;
}
/**

View File

@@ -52,74 +52,74 @@ public class ClientHttpRequestConnection extends AbstractHttpSenderConnection {
}
public ClientHttpRequest getClientHttpRequest() {
return request;
return this.request;
}
public ClientHttpResponse getClientHttpResponse() {
return response;
return this.response;
}
// URI
@Override
public URI getUri() throws URISyntaxException {
return request.getURI();
return this.request.getURI();
}
// Sending request
@Override
public void addRequestHeader(String name, String value) throws IOException {
request.getHeaders().add(name, value);
this.request.getHeaders().add(name, value);
}
@Override
protected OutputStream getRequestOutputStream() throws IOException {
return request.getBody();
return this.request.getBody();
}
@Override
protected void onSendAfterWrite(WebServiceMessage message) throws IOException {
response = request.execute();
this.response = this.request.execute();
}
// Receiving response
@Override
protected long getResponseContentLength() throws IOException {
return response.getHeaders().getContentLength();
return this.response.getHeaders().getContentLength();
}
@Override
public Iterator<String> getResponseHeaderNames() throws IOException {
return response.getHeaders().keySet().iterator();
return this.response.getHeaders().keySet().iterator();
}
@Override
public Iterator<String> getResponseHeaders(String name) throws IOException {
List<String> headers = response.getHeaders().get(name);
List<String> headers = this.response.getHeaders().get(name);
return headers != null ? headers.iterator() : Collections.emptyIterator();
}
@Override
protected int getResponseCode() throws IOException {
return response.getStatusCode().value();
return this.response.getStatusCode().value();
}
@Override
protected String getResponseMessage() throws IOException {
return response.getStatusText();
return this.response.getStatusText();
}
@Override
protected InputStream getRawResponseInputStream() throws IOException {
return response.getBody();
return this.response.getBody();
}
@Override
protected void onClose() throws IOException {
if (response != null) {
response.close();
if (this.response != null) {
this.response.close();
}
}

View File

@@ -47,7 +47,7 @@ public class ClientHttpRequestMessageSender extends AbstractHttpWebServiceMessag
}
public ClientHttpRequestFactory getRequestFactory() {
return requestFactory;
return this.requestFactory;
}
public void setRequestFactory(ClientHttpRequestFactory requestFactory) {
@@ -57,7 +57,7 @@ public class ClientHttpRequestMessageSender extends AbstractHttpWebServiceMessag
@Override
public WebServiceConnection createConnection(URI uri) throws IOException {
ClientHttpRequest request = requestFactory.createRequest(uri, HttpMethod.POST);
ClientHttpRequest request = this.requestFactory.createRequest(uri, HttpMethod.POST);
if (isAcceptGzipEncoding()) {
request.getHeaders()
.add(HttpTransportConstants.HEADER_ACCEPT_ENCODING, HttpTransportConstants.CONTENT_ENCODING_GZIP);

View File

@@ -64,14 +64,14 @@ public class CommonsHttpConnection extends AbstractHttpSenderConnection {
}
public PostMethod getPostMethod() {
return postMethod;
return this.postMethod;
}
@Override
public void onClose() throws IOException {
postMethod.releaseConnection();
if (connectionManager != null) {
connectionManager.shutdown();
this.postMethod.releaseConnection();
if (this.connectionManager != null) {
this.connectionManager.shutdown();
}
}
@@ -82,7 +82,7 @@ public class CommonsHttpConnection extends AbstractHttpSenderConnection {
@Override
public URI getUri() throws URISyntaxException {
try {
return new URI(postMethod.getURI().toString());
return new URI(this.postMethod.getURI().toString());
}
catch (URIException ex) {
throw new URISyntaxException("", ex.getMessage());
@@ -95,34 +95,34 @@ public class CommonsHttpConnection extends AbstractHttpSenderConnection {
@Override
protected void onSendBeforeWrite(WebServiceMessage message) throws IOException {
requestBuffer = new ByteArrayOutputStream();
this.requestBuffer = new ByteArrayOutputStream();
}
@Override
public void addRequestHeader(String name, String value) throws IOException {
postMethod.addRequestHeader(name, value);
this.postMethod.addRequestHeader(name, value);
}
@Override
protected OutputStream getRequestOutputStream() throws IOException {
return requestBuffer;
return this.requestBuffer;
}
@Override
protected void onSendAfterWrite(WebServiceMessage message) throws IOException {
postMethod.setRequestEntity(new ByteArrayRequestEntity(requestBuffer.toByteArray()));
requestBuffer = null;
this.postMethod.setRequestEntity(new ByteArrayRequestEntity(this.requestBuffer.toByteArray()));
this.requestBuffer = null;
try {
httpClient.executeMethod(postMethod);
this.httpClient.executeMethod(this.postMethod);
}
catch (IllegalStateException ex) {
if ("Connection factory has been shutdown.".equals(ex.getMessage())) {
// The application context has been closed, resulting in a connection
// factory shutdown and an ISE.
// Let's create a new connection factory for this connection only.
connectionManager = new MultiThreadedHttpConnectionManager();
httpClient.setHttpConnectionManager(connectionManager);
httpClient.executeMethod(postMethod);
this.connectionManager = new MultiThreadedHttpConnectionManager();
this.httpClient.setHttpConnectionManager(this.connectionManager);
this.httpClient.executeMethod(this.postMethod);
}
else {
throw ex;
@@ -136,27 +136,27 @@ public class CommonsHttpConnection extends AbstractHttpSenderConnection {
@Override
protected int getResponseCode() throws IOException {
return postMethod.getStatusCode();
return this.postMethod.getStatusCode();
}
@Override
protected String getResponseMessage() throws IOException {
return postMethod.getStatusText();
return this.postMethod.getStatusText();
}
@Override
protected long getResponseContentLength() throws IOException {
return postMethod.getResponseContentLength();
return this.postMethod.getResponseContentLength();
}
@Override
protected InputStream getRawResponseInputStream() throws IOException {
return postMethod.getResponseBodyAsStream();
return this.postMethod.getResponseBodyAsStream();
}
@Override
public Iterator<String> getResponseHeaderNames() throws IOException {
Header[] headers = postMethod.getResponseHeaders();
Header[] headers = this.postMethod.getResponseHeaders();
String[] names = new String[headers.length];
for (int i = 0; i < headers.length; i++) {
names[i] = headers[i].getName();
@@ -166,7 +166,7 @@ public class CommonsHttpConnection extends AbstractHttpSenderConnection {
@Override
public Iterator<String> getResponseHeaders(String name) throws IOException {
Header[] headers = postMethod.getResponseHeaders(name);
Header[] headers = this.postMethod.getResponseHeaders(name);
String[] values = new String[headers.length];
for (int i = 0; i < headers.length; i++) {
values[i] = headers[i].getValue();

View File

@@ -73,7 +73,7 @@ public class CommonsHttpMessageSender extends AbstractHttpWebServiceMessageSende
* {@link HttpClient} that uses a default {@link MultiThreadedHttpConnectionManager}.
*/
public CommonsHttpMessageSender() {
httpClient = new HttpClient(new MultiThreadedHttpConnectionManager());
this.httpClient = new HttpClient(new MultiThreadedHttpConnectionManager());
setConnectionTimeout(DEFAULT_CONNECTION_TIMEOUT_MILLISECONDS);
setReadTimeout(DEFAULT_READ_TIMEOUT_MILLISECONDS);
}
@@ -90,7 +90,7 @@ public class CommonsHttpMessageSender extends AbstractHttpWebServiceMessageSende
/** Returns the {@code HttpClient} used by this message sender. */
public HttpClient getHttpClient() {
return httpClient;
return this.httpClient;
}
/** Set the {@code HttpClient} used by this message sender. */
@@ -100,7 +100,7 @@ public class CommonsHttpMessageSender extends AbstractHttpWebServiceMessageSende
/** Returns the credentials to be used. */
public Credentials getCredentials() {
return credentials;
return this.credentials;
}
/**
@@ -201,7 +201,7 @@ public class CommonsHttpMessageSender extends AbstractHttpWebServiceMessageSende
* By default, the {@link AuthScope#ANY} is returned.
*/
public AuthScope getAuthScope() {
return authScope != null ? authScope : AuthScope.ANY;
return this.authScope != null ? this.authScope : AuthScope.ANY;
}
/**

Some files were not shown because too many files have changed in this diff Show More