master
Juergen Hoeller 7 years ago
parent 0f740527c1
commit 578c078082
  1. 8
      spring-aop/src/main/java/org/springframework/aop/support/IntroductionInfoSupport.java
  2. 18
      spring-context-support/src/main/java/org/springframework/cache/jcache/interceptor/KeyGeneratorAdapter.java
  3. 14
      spring-orm/src/main/java/org/springframework/orm/jpa/AbstractEntityManagerFactoryBean.java
  4. 4
      spring-web/src/main/java/org/springframework/http/server/reactive/ReactorServerHttpRequest.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2016 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -53,10 +53,10 @@ public class IntroductionInfoSupport implements IntroductionInfo, Serializable {
* due to the delegate implementing it. Call this method to exclude * due to the delegate implementing it. Call this method to exclude
* internal interfaces from being visible at the proxy level. * internal interfaces from being visible at the proxy level.
* <p>Does nothing if the interface is not implemented by the delegate. * <p>Does nothing if the interface is not implemented by the delegate.
* @param intf the interface to suppress * @param ifc the interface to suppress
*/ */
public void suppressInterface(Class<?> intf) { public void suppressInterface(Class<?> ifc) {
this.publishedInterfaces.remove(intf); this.publishedInterfaces.remove(ifc);
} }
@Override @Override

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2016 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -29,10 +29,9 @@ import org.springframework.util.Assert;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
/** /**
* Spring's {@link KeyGenerator} implementation that either delegates to a * Spring's {@link KeyGenerator} implementation that either delegates to a standard JSR-107
* standard JSR-107 {@link javax.cache.annotation.CacheKeyGenerator}, or * {@link javax.cache.annotation.CacheKeyGenerator}, or wrap a standard {@link KeyGenerator}
* wrap a standard {@link KeyGenerator} so that only relevant parameters * so that only relevant parameters are handled.
* are handled.
* *
* @author Stephane Nicoll * @author Stephane Nicoll
* @since 4.1 * @since 4.1
@ -45,12 +44,13 @@ class KeyGeneratorAdapter implements KeyGenerator {
private CacheKeyGenerator cacheKeyGenerator; private CacheKeyGenerator cacheKeyGenerator;
/** /**
* Create an instance with the given {@link KeyGenerator} so that {@link javax.cache.annotation.CacheKey} * Create an instance with the given {@link KeyGenerator} so that {@link javax.cache.annotation.CacheKey}
* and {@link javax.cache.annotation.CacheValue} are handled according to the spec. * and {@link javax.cache.annotation.CacheValue} are handled according to the spec.
*/ */
public KeyGeneratorAdapter(JCacheOperationSource cacheOperationSource, KeyGenerator target) { public KeyGeneratorAdapter(JCacheOperationSource cacheOperationSource, KeyGenerator target) {
Assert.notNull(cacheOperationSource, "cacheOperationSource must not be null."); Assert.notNull(cacheOperationSource, "JCacheOperationSource must not be null");
Assert.notNull(target, "KeyGenerator must not be null"); Assert.notNull(target, "KeyGenerator must not be null");
this.cacheOperationSource = cacheOperationSource; this.cacheOperationSource = cacheOperationSource;
this.keyGenerator = target; this.keyGenerator = target;
@ -60,12 +60,13 @@ class KeyGeneratorAdapter implements KeyGenerator {
* Create an instance used to wrap the specified {@link javax.cache.annotation.CacheKeyGenerator}. * Create an instance used to wrap the specified {@link javax.cache.annotation.CacheKeyGenerator}.
*/ */
public KeyGeneratorAdapter(JCacheOperationSource cacheOperationSource, CacheKeyGenerator target) { public KeyGeneratorAdapter(JCacheOperationSource cacheOperationSource, CacheKeyGenerator target) {
Assert.notNull(cacheOperationSource, "cacheOperationSource must not be null."); Assert.notNull(cacheOperationSource, "JCacheOperationSource must not be null");
Assert.notNull(target, "KeyGenerator must not be null"); Assert.notNull(target, "CacheKeyGenerator must not be null");
this.cacheOperationSource = cacheOperationSource; this.cacheOperationSource = cacheOperationSource;
this.cacheKeyGenerator = target; this.cacheKeyGenerator = target;
} }
/** /**
* Return the target key generator to use in the form of either a {@link KeyGenerator} * Return the target key generator to use in the form of either a {@link KeyGenerator}
* or a {@link CacheKeyGenerator}. * or a {@link CacheKeyGenerator}.
@ -74,7 +75,6 @@ class KeyGeneratorAdapter implements KeyGenerator {
return (this.keyGenerator != null ? this.keyGenerator : this.cacheKeyGenerator); return (this.keyGenerator != null ? this.keyGenerator : this.cacheKeyGenerator);
} }
@Override @Override
public Object generate(Object target, Method method, Object... params) { public Object generate(Object target, Method method, Object... params) {
JCacheOperation<?> operation = this.cacheOperationSource.getCacheOperation(method, target.getClass()); JCacheOperation<?> operation = this.cacheOperationSource.getCacheOperation(method, target.getClass());

@ -397,12 +397,11 @@ public abstract class AbstractEntityManagerFactoryBean implements
} }
/** /**
* Create a proxy of the given EntityManagerFactory. We do this to be able * Create a proxy for the given {@link EntityManagerFactory}. We do this to be able to
* to return transaction-aware proxies for application-managed * return a transaction-aware proxy for an application-managed {@link EntityManager}.
* EntityManagers, and to introduce the NamedEntityManagerFactory interface * @param emf the EntityManagerFactory as returned by the persistence provider,
* @param emf EntityManagerFactory as returned by the persistence provider,
* if initialized already * if initialized already
* @return proxy entity manager * @return the EntityManagerFactory proxy
*/ */
protected EntityManagerFactory createEntityManagerFactoryProxy(@Nullable EntityManagerFactory emf) { protected EntityManagerFactory createEntityManagerFactoryProxy(@Nullable EntityManagerFactory emf) {
Set<Class<?>> ifcs = new LinkedHashSet<>(); Set<Class<?>> ifcs = new LinkedHashSet<>();
@ -617,9 +616,8 @@ public abstract class AbstractEntityManagerFactoryBean implements
/** /**
* Dynamic proxy invocation handler proxying an EntityManagerFactory to * Dynamic proxy invocation handler for an {@link EntityManagerFactory}, returning a
* return a proxy EntityManager if necessary from createEntityManager() * proxy {@link EntityManager} (if necessary) from {@code createEntityManager} methods.
* methods.
*/ */
@SuppressWarnings("serial") @SuppressWarnings("serial")
private static class ManagedEntityManagerFactoryInvocationHandler implements InvocationHandler, Serializable { private static class ManagedEntityManagerFactoryInvocationHandler implements InvocationHandler, Serializable {

@ -55,13 +55,13 @@ class ReactorServerHttpRequest extends AbstractServerHttpRequest {
throws URISyntaxException { throws URISyntaxException {
super(initUri(request), "", initHeaders(request)); super(initUri(request), "", initHeaders(request));
Assert.notNull(bufferFactory, "'bufferFactory' must not be null"); Assert.notNull(bufferFactory, "DataBufferFactory must not be null");
this.request = request; this.request = request;
this.bufferFactory = bufferFactory; this.bufferFactory = bufferFactory;
} }
private static URI initUri(HttpServerRequest request) throws URISyntaxException { private static URI initUri(HttpServerRequest request) throws URISyntaxException {
Assert.notNull(request, "'request' must not be null"); Assert.notNull(request, "HttpServerRequest must not be null");
return new URI(resolveBaseUrl(request).toString() + resolveRequestUri(request)); return new URI(resolveBaseUrl(request).toString() + resolveRequestUri(request));
} }

Loading…
Cancel
Save