Polishing
This commit is contained in:
parent
0f740527c1
commit
578c078082
|
@ -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");
|
||||
* 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
|
||||
* internal interfaces from being visible at the proxy level.
|
||||
* <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) {
|
||||
this.publishedInterfaces.remove(intf);
|
||||
public void suppressInterface(Class<?> ifc) {
|
||||
this.publishedInterfaces.remove(ifc);
|
||||
}
|
||||
|
||||
@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");
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* Spring's {@link KeyGenerator} implementation that either delegates to a
|
||||
* standard JSR-107 {@link javax.cache.annotation.CacheKeyGenerator}, or
|
||||
* wrap a standard {@link KeyGenerator} so that only relevant parameters
|
||||
* are handled.
|
||||
* Spring's {@link KeyGenerator} implementation that either delegates to a standard JSR-107
|
||||
* {@link javax.cache.annotation.CacheKeyGenerator}, or wrap a standard {@link KeyGenerator}
|
||||
* so that only relevant parameters are handled.
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
* @since 4.1
|
||||
|
@ -45,12 +44,13 @@ class KeyGeneratorAdapter implements KeyGenerator {
|
|||
|
||||
private CacheKeyGenerator cacheKeyGenerator;
|
||||
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
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");
|
||||
this.cacheOperationSource = cacheOperationSource;
|
||||
this.keyGenerator = target;
|
||||
|
@ -60,12 +60,13 @@ class KeyGeneratorAdapter implements KeyGenerator {
|
|||
* Create an instance used to wrap the specified {@link javax.cache.annotation.CacheKeyGenerator}.
|
||||
*/
|
||||
public KeyGeneratorAdapter(JCacheOperationSource cacheOperationSource, CacheKeyGenerator target) {
|
||||
Assert.notNull(cacheOperationSource, "cacheOperationSource must not be null.");
|
||||
Assert.notNull(target, "KeyGenerator must not be null");
|
||||
Assert.notNull(cacheOperationSource, "JCacheOperationSource must not be null");
|
||||
Assert.notNull(target, "CacheKeyGenerator must not be null");
|
||||
this.cacheOperationSource = cacheOperationSource;
|
||||
this.cacheKeyGenerator = target;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return the target key generator to use in the form of either a {@link KeyGenerator}
|
||||
* or a {@link CacheKeyGenerator}.
|
||||
|
@ -74,7 +75,6 @@ class KeyGeneratorAdapter implements KeyGenerator {
|
|||
return (this.keyGenerator != null ? this.keyGenerator : this.cacheKeyGenerator);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Object generate(Object target, Method method, Object... params) {
|
||||
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
|
||||
* to return transaction-aware proxies for application-managed
|
||||
* EntityManagers, and to introduce the NamedEntityManagerFactory interface
|
||||
* @param emf EntityManagerFactory as returned by the persistence provider,
|
||||
* Create a proxy for the given {@link EntityManagerFactory}. We do this to be able to
|
||||
* return a transaction-aware proxy for an application-managed {@link EntityManager}.
|
||||
* @param emf the EntityManagerFactory as returned by the persistence provider,
|
||||
* if initialized already
|
||||
* @return proxy entity manager
|
||||
* @return the EntityManagerFactory proxy
|
||||
*/
|
||||
protected EntityManagerFactory createEntityManagerFactoryProxy(@Nullable EntityManagerFactory emf) {
|
||||
Set<Class<?>> ifcs = new LinkedHashSet<>();
|
||||
|
@ -617,9 +616,8 @@ public abstract class AbstractEntityManagerFactoryBean implements
|
|||
|
||||
|
||||
/**
|
||||
* Dynamic proxy invocation handler proxying an EntityManagerFactory to
|
||||
* return a proxy EntityManager if necessary from createEntityManager()
|
||||
* methods.
|
||||
* Dynamic proxy invocation handler for an {@link EntityManagerFactory}, returning a
|
||||
* proxy {@link EntityManager} (if necessary) from {@code createEntityManager} methods.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
private static class ManagedEntityManagerFactoryInvocationHandler implements InvocationHandler, Serializable {
|
||||
|
|
|
@ -55,13 +55,13 @@ class ReactorServerHttpRequest extends AbstractServerHttpRequest {
|
|||
throws URISyntaxException {
|
||||
|
||||
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.bufferFactory = bufferFactory;
|
||||
}
|
||||
|
||||
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));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue