Polishing
This commit is contained in:
parent
b6cfa2db0b
commit
9f4968ed05
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2020 the original author or authors.
|
* Copyright 2002-2024 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.
|
||||||
|
@ -56,9 +56,9 @@ public interface Advised extends TargetClassAware {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine whether the given interface is proxied.
|
* Determine whether the given interface is proxied.
|
||||||
* @param intf the interface to check
|
* @param ifc the interface to check
|
||||||
*/
|
*/
|
||||||
boolean isInterfaceProxied(Class<?> intf);
|
boolean isInterfaceProxied(Class<?> ifc);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Change the {@code TargetSource} used by this {@code Advised} object.
|
* Change the {@code TargetSource} used by this {@code Advised} object.
|
||||||
|
|
|
@ -222,15 +222,15 @@ public class AdvisedSupport extends ProxyConfig implements Advised {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a new proxied interface.
|
* Add a new proxied interface.
|
||||||
* @param intf the additional interface to proxy
|
* @param ifc the additional interface to proxy
|
||||||
*/
|
*/
|
||||||
public void addInterface(Class<?> intf) {
|
public void addInterface(Class<?> ifc) {
|
||||||
Assert.notNull(intf, "Interface must not be null");
|
Assert.notNull(ifc, "Interface must not be null");
|
||||||
if (!intf.isInterface()) {
|
if (!ifc.isInterface()) {
|
||||||
throw new IllegalArgumentException("[" + intf.getName() + "] is not an interface");
|
throw new IllegalArgumentException("[" + ifc.getName() + "] is not an interface");
|
||||||
}
|
}
|
||||||
if (!this.interfaces.contains(intf)) {
|
if (!this.interfaces.contains(ifc)) {
|
||||||
this.interfaces.add(intf);
|
this.interfaces.add(ifc);
|
||||||
adviceChanged();
|
adviceChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -238,12 +238,12 @@ public class AdvisedSupport extends ProxyConfig implements Advised {
|
||||||
/**
|
/**
|
||||||
* Remove a proxied interface.
|
* Remove a proxied interface.
|
||||||
* <p>Does nothing if the given interface isn't proxied.
|
* <p>Does nothing if the given interface isn't proxied.
|
||||||
* @param intf the interface to remove from the proxy
|
* @param ifc the interface to remove from the proxy
|
||||||
* @return {@code true} if the interface was removed; {@code false}
|
* @return {@code true} if the interface was removed; {@code false}
|
||||||
* if the interface was not found and hence could not be removed
|
* if the interface was not found and hence could not be removed
|
||||||
*/
|
*/
|
||||||
public boolean removeInterface(Class<?> intf) {
|
public boolean removeInterface(Class<?> ifc) {
|
||||||
return this.interfaces.remove(intf);
|
return this.interfaces.remove(ifc);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -252,9 +252,9 @@ public class AdvisedSupport extends ProxyConfig implements Advised {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isInterfaceProxied(Class<?> intf) {
|
public boolean isInterfaceProxied(Class<?> ifc) {
|
||||||
for (Class<?> proxyIntf : this.interfaces) {
|
for (Class<?> proxyIntf : this.interfaces) {
|
||||||
if (intf.isAssignableFrom(proxyIntf)) {
|
if (ifc.isAssignableFrom(proxyIntf)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,8 +47,7 @@ import org.springframework.util.FileSystemUtils;
|
||||||
public abstract class AbstractAotProcessor<T> {
|
public abstract class AbstractAotProcessor<T> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The name of a system property that is made available when the processor
|
* The name of a system property that is made available when the processor runs.
|
||||||
* runs.
|
|
||||||
* @see #doProcess()
|
* @see #doProcess()
|
||||||
*/
|
*/
|
||||||
private static final String AOT_PROCESSING = "spring.aot.processing";
|
private static final String AOT_PROCESSING = "spring.aot.processing";
|
||||||
|
@ -125,6 +124,7 @@ public abstract class AbstractAotProcessor<T> {
|
||||||
writer.write(hints);
|
writer.write(hints);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Common settings for AOT processors.
|
* Common settings for AOT processors.
|
||||||
*/
|
*/
|
||||||
|
@ -140,7 +140,6 @@ public abstract class AbstractAotProcessor<T> {
|
||||||
|
|
||||||
private final String artifactId;
|
private final String artifactId;
|
||||||
|
|
||||||
|
|
||||||
private Settings(Path sourceOutput, Path resourceOutput, Path classOutput, String groupId, String artifactId) {
|
private Settings(Path sourceOutput, Path resourceOutput, Path classOutput, String groupId, String artifactId) {
|
||||||
this.sourceOutput = sourceOutput;
|
this.sourceOutput = sourceOutput;
|
||||||
this.resourceOutput = resourceOutput;
|
this.resourceOutput = resourceOutput;
|
||||||
|
@ -149,7 +148,6 @@ public abstract class AbstractAotProcessor<T> {
|
||||||
this.artifactId = artifactId;
|
this.artifactId = artifactId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new {@link Builder} for {@link Settings}.
|
* Create a new {@link Builder} for {@link Settings}.
|
||||||
*/
|
*/
|
||||||
|
@ -157,7 +155,6 @@ public abstract class AbstractAotProcessor<T> {
|
||||||
return new Builder();
|
return new Builder();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the output directory for generated sources.
|
* Get the output directory for generated sources.
|
||||||
*/
|
*/
|
||||||
|
@ -214,12 +211,10 @@ public abstract class AbstractAotProcessor<T> {
|
||||||
@Nullable
|
@Nullable
|
||||||
private String artifactId;
|
private String artifactId;
|
||||||
|
|
||||||
|
|
||||||
private Builder() {
|
private Builder() {
|
||||||
// internal constructor
|
// internal constructor
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the output directory for generated sources.
|
* Set the output directory for generated sources.
|
||||||
* @param sourceOutput the location of generated sources
|
* @param sourceOutput the location of generated sources
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
</description>
|
</description>
|
||||||
|
|
||||||
<bean id="aapc" class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator">
|
<bean id="aapc" class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator">
|
||||||
<!-- This common interceptor will be applied always, before custom lockable advisor -->
|
<!-- This common interceptor will be applied before the custom lockable advisor -->
|
||||||
<property name="interceptorNames">
|
<property name="interceptorNames">
|
||||||
<value>nopInterceptor</value>
|
<value>nopInterceptor</value>
|
||||||
</property>
|
</property>
|
||||||
|
@ -44,4 +44,3 @@
|
||||||
<bean id="packageVisibleMethod" class="org.springframework.aop.framework.autoproxy.PackageVisibleMethod"/>
|
<bean id="packageVisibleMethod" class="org.springframework.aop.framework.autoproxy.PackageVisibleMethod"/>
|
||||||
|
|
||||||
</beans>
|
</beans>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue