Browse Source

Polishing

pull/1425/head
Juergen Hoeller 8 years ago
parent
commit
f985f71daf
  1. 20
      spring-beans/src/main/java/org/springframework/beans/factory/xml/BeanDefinitionParserDelegate.java
  2. 12
      spring-web/src/main/java/org/springframework/http/client/reactive/AbstractClientHttpRequest.java
  3. 17
      spring-web/src/main/java/org/springframework/http/server/reactive/AbstractServerHttpResponse.java

20
spring-beans/src/main/java/org/springframework/beans/factory/xml/BeanDefinitionParserDelegate.java

@ -223,8 +223,6 @@ public class BeanDefinitionParserDelegate { @@ -223,8 +223,6 @@ public class BeanDefinitionParserDelegate {
public static final String DEFAULT_AUTOWIRE_ATTRIBUTE = "default-autowire";
public static final String DEFAULT_DEPENDENCY_CHECK_ATTRIBUTE = "default-dependency-check";
public static final String DEFAULT_AUTOWIRE_CANDIDATES_ATTRIBUTE = "default-autowire-candidates";
public static final String DEFAULT_INIT_METHOD_ATTRIBUTE = "default-init-method";
@ -385,7 +383,7 @@ public class BeanDefinitionParserDelegate { @@ -385,7 +383,7 @@ public class BeanDefinitionParserDelegate {
public BeanDefinitionDefaults getBeanDefinitionDefaults() {
BeanDefinitionDefaults bdd = new BeanDefinitionDefaults();
bdd.setLazyInit("TRUE".equalsIgnoreCase(this.defaults.getLazyInit()));
bdd.setAutowireMode(this.getAutowireMode(DEFAULT_VALUE));
bdd.setAutowireMode(getAutowireMode(DEFAULT_VALUE));
bdd.setInitMethodName(this.defaults.getInitMethod());
bdd.setDestroyMethodName(this.defaults.getDestroyMethod());
return bdd;
@ -610,22 +608,18 @@ public class BeanDefinitionParserDelegate { @@ -610,22 +608,18 @@ public class BeanDefinitionParserDelegate {
bd.setInitMethodName(initMethodName);
}
}
else {
if (this.defaults.getInitMethod() != null) {
bd.setInitMethodName(this.defaults.getInitMethod());
bd.setEnforceInitMethod(false);
}
else if (this.defaults.getInitMethod() != null) {
bd.setInitMethodName(this.defaults.getInitMethod());
bd.setEnforceInitMethod(false);
}
if (ele.hasAttribute(DESTROY_METHOD_ATTRIBUTE)) {
String destroyMethodName = ele.getAttribute(DESTROY_METHOD_ATTRIBUTE);
bd.setDestroyMethodName(destroyMethodName);
}
else {
if (this.defaults.getDestroyMethod() != null) {
bd.setDestroyMethodName(this.defaults.getDestroyMethod());
bd.setEnforceDestroyMethod(false);
}
else if (this.defaults.getDestroyMethod() != null) {
bd.setDestroyMethodName(this.defaults.getDestroyMethod());
bd.setEnforceDestroyMethod(false);
}
if (ele.hasAttribute(FACTORY_METHOD_ATTRIBUTE)) {

12
spring-web/src/main/java/org/springframework/http/client/reactive/AbstractClientHttpRequest.java

@ -108,11 +108,10 @@ public abstract class AbstractClientHttpRequest implements ClientHttpRequest { @@ -108,11 +108,10 @@ public abstract class AbstractClientHttpRequest implements ClientHttpRequest {
/**
* Apply {@link #beforeCommit(Supplier) beforeCommit} actions, apply the
* request headers/cookies, and write the request body.
* @param writeAction the action to write the request body or {@code null}
* @param writeAction the action to write the request body (may be {@code null})
* @return a completion publisher
*/
protected Mono<Void> doCommit(Supplier<? extends Mono<Void>> writeAction) {
if (!this.state.compareAndSet(State.NEW, State.COMMITTING)) {
return Mono.empty();
}
@ -134,15 +133,16 @@ public abstract class AbstractClientHttpRequest implements ClientHttpRequest { @@ -134,15 +133,16 @@ public abstract class AbstractClientHttpRequest implements ClientHttpRequest {
return Flux.concat(actions).next();
}
/**
* Implement this method to apply header changes from {@link #getHeaders()}
* to the underlying response. This method is called once only.
* Apply header changes from {@link #getHeaders()} to the underlying response.
* This method is called once only.
*/
protected abstract void applyHeaders();
/**
* Implement this method to add cookies from {@link #getHeaders()} to the
* underlying response. This method is called once only.
* Add cookies from {@link #getHeaders()} to the underlying response.
* This method is called once only.
*/
protected abstract void applyCookies();

17
spring-web/src/main/java/org/springframework/http/server/reactive/AbstractServerHttpResponse.java

@ -183,7 +183,7 @@ public abstract class AbstractServerHttpResponse implements ServerHttpResponse { @@ -183,7 +183,7 @@ public abstract class AbstractServerHttpResponse implements ServerHttpResponse {
/**
* Apply {@link #beforeCommit(Supplier) beforeCommit} actions, apply the
* response status and headers/cookies, and write the response body.
* @param writeAction the action to write the response body or {@code null}
* @param writeAction the action to write the response body (may be {@code null})
* @return a completion publisher
*/
protected Mono<Void> doCommit(Supplier<? extends Mono<Void>> writeAction) {
@ -214,33 +214,32 @@ public abstract class AbstractServerHttpResponse implements ServerHttpResponse { @@ -214,33 +214,32 @@ public abstract class AbstractServerHttpResponse implements ServerHttpResponse {
/**
* Implement this method to write to the underlying the response.
* Write to the underlying the response.
* @param body the publisher to write with
*/
protected abstract Mono<Void> writeWithInternal(Publisher<? extends DataBuffer> body);
/**
* Implement this method to write to the underlying the response, and flush after
* each {@code Publisher<DataBuffer>}.
* Write to the underlying the response, and flush after each {@code Publisher<DataBuffer>}.
* @param body the publisher to write and flush with
*/
protected abstract Mono<Void> writeAndFlushWithInternal(Publisher<? extends Publisher<? extends DataBuffer>> body);
/**
* Implement this method to write the status code to the underlying response.
* Write the status code to the underlying response.
* This method is called once only.
*/
protected abstract void applyStatusCode();
/**
* Implement this method to apply header changes from {@link #getHeaders()}
* to the underlying response. This method is called once only.
* Apply header changes from {@link #getHeaders()} to the underlying response.
* This method is called once only.
*/
protected abstract void applyHeaders();
/**
* Implement this method to add cookies from {@link #getHeaders()} to the
* underlying response. This method is called once only.
* Add cookies from {@link #getHeaders()} to the underlying response.
* This method is called once only.
*/
protected abstract void applyCookies();

Loading…
Cancel
Save