|
|
|
@ -160,7 +160,7 @@ public class AdvisedSupport extends ProxyConfig implements Advised { |
|
|
|
* @see #setTargetSource |
|
|
|
* @see #setTargetSource |
|
|
|
* @see #setTarget |
|
|
|
* @see #setTarget |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void setTargetClass(Class targetClass) { |
|
|
|
public void setTargetClass(Class<?> targetClass) { |
|
|
|
this.targetSource = EmptyTargetSource.forClass(targetClass); |
|
|
|
this.targetSource = EmptyTargetSource.forClass(targetClass); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -199,7 +199,7 @@ public class AdvisedSupport extends ProxyConfig implements Advised { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* Set the interfaces to be proxied. |
|
|
|
* Set the interfaces to be proxied. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void setInterfaces(Class[] interfaces) { |
|
|
|
public void setInterfaces(Class<?>... interfaces) { |
|
|
|
Assert.notNull(interfaces, "Interfaces must not be null"); |
|
|
|
Assert.notNull(interfaces, "Interfaces must not be null"); |
|
|
|
this.interfaces.clear(); |
|
|
|
this.interfaces.clear(); |
|
|
|
for (Class ifc : interfaces) { |
|
|
|
for (Class ifc : interfaces) { |
|
|
|
@ -211,7 +211,7 @@ 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 intf the additional interface to proxy |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void addInterface(Class intf) { |
|
|
|
public void addInterface(Class<?> intf) { |
|
|
|
Assert.notNull(intf, "Interface must not be null"); |
|
|
|
Assert.notNull(intf, "Interface must not be null"); |
|
|
|
if (!intf.isInterface()) { |
|
|
|
if (!intf.isInterface()) { |
|
|
|
throw new IllegalArgumentException("[" + intf.getName() + "] is not an interface"); |
|
|
|
throw new IllegalArgumentException("[" + intf.getName() + "] is not an interface"); |
|
|
|
@ -229,17 +229,17 @@ public class AdvisedSupport extends ProxyConfig implements Advised { |
|
|
|
* @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<?> intf) { |
|
|
|
return this.interfaces.remove(intf); |
|
|
|
return this.interfaces.remove(intf); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public Class[] getProxiedInterfaces() { |
|
|
|
public Class<?>[] getProxiedInterfaces() { |
|
|
|
return this.interfaces.toArray(new Class[this.interfaces.size()]); |
|
|
|
return this.interfaces.toArray(new Class[this.interfaces.size()]); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public boolean isInterfaceProxied(Class intf) { |
|
|
|
public boolean isInterfaceProxied(Class<?> intf) { |
|
|
|
for (Class proxyIntf : this.interfaces) { |
|
|
|
for (Class proxyIntf : this.interfaces) { |
|
|
|
if (intf.isAssignableFrom(proxyIntf)) { |
|
|
|
if (intf.isAssignableFrom(proxyIntf)) { |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
|