Java Code Examples for org.springframework.aop.target.EmptyTargetSource#forClass()

The following examples show how to use org.springframework.aop.target.EmptyTargetSource#forClass() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: spring-analysis-note   File: AdvisedSupport.java    License: MIT License 5 votes vote down vote up
/**
 * Build a configuration-only copy of this AdvisedSupport,
 * replacing the TargetSource.
 */
AdvisedSupport getConfigurationOnlyCopy() {
	AdvisedSupport copy = new AdvisedSupport();
	copy.copyFrom(this);
	copy.targetSource = EmptyTargetSource.forClass(getTargetClass(), getTargetSource().isStatic());
	copy.advisorChainFactory = this.advisorChainFactory;
	copy.interfaces = this.interfaces;
	copy.advisors = this.advisors;
	copy.updateAdvisorArray();
	return copy;
}
 
Example 2
Source Project: java-technology-stack   File: AdvisedSupport.java    License: MIT License 5 votes vote down vote up
/**
 * Build a configuration-only copy of this AdvisedSupport,
 * replacing the TargetSource.
 */
AdvisedSupport getConfigurationOnlyCopy() {
	AdvisedSupport copy = new AdvisedSupport();
	copy.copyFrom(this);
	copy.targetSource = EmptyTargetSource.forClass(getTargetClass(), getTargetSource().isStatic());
	copy.advisorChainFactory = this.advisorChainFactory;
	copy.interfaces = this.interfaces;
	copy.advisors = this.advisors;
	copy.updateAdvisorArray();
	return copy;
}
 
Example 3
/**
 * Build a configuration-only copy of this AdvisedSupport,
 * replacing the TargetSource
 */
AdvisedSupport getConfigurationOnlyCopy() {
	AdvisedSupport copy = new AdvisedSupport();
	copy.copyFrom(this);
	copy.targetSource = EmptyTargetSource.forClass(getTargetClass(), getTargetSource().isStatic());
	copy.advisorChainFactory = this.advisorChainFactory;
	copy.interfaces = this.interfaces;
	copy.advisors = this.advisors;
	copy.updateAdvisorArray();
	return copy;
}
 
Example 4
/**
 * Build a configuration-only copy of this AdvisedSupport,
 * replacing the TargetSource
 */
AdvisedSupport getConfigurationOnlyCopy() {
	AdvisedSupport copy = new AdvisedSupport();
	copy.copyFrom(this);
	copy.targetSource = EmptyTargetSource.forClass(getTargetClass(), getTargetSource().isStatic());
	copy.advisorChainFactory = this.advisorChainFactory;
	copy.interfaces = this.interfaces;
	copy.advisors = this.advisors;
	copy.updateAdvisorArray();
	return copy;
}
 
Example 5
Source Project: spring-analysis-note   File: AdvisedSupport.java    License: MIT License 2 votes vote down vote up
/**
 * Set a target class to be proxied, indicating that the proxy
 * should be castable to the given class.
 * <p>Internally, an {@link org.springframework.aop.target.EmptyTargetSource}
 * for the given target class will be used. The kind of proxy needed
 * will be determined on actual creation of the proxy.
 * <p>This is a replacement for setting a "targetSource" or "target",
 * for the case where we want a proxy based on a target class
 * (which can be an interface or a concrete class) without having
 * a fully capable TargetSource available.
 * @see #setTargetSource
 * @see #setTarget
 */
public void setTargetClass(@Nullable Class<?> targetClass) {
	this.targetSource = EmptyTargetSource.forClass(targetClass);
}
 
Example 6
Source Project: java-technology-stack   File: AdvisedSupport.java    License: MIT License 2 votes vote down vote up
/**
 * Set a target class to be proxied, indicating that the proxy
 * should be castable to the given class.
 * <p>Internally, an {@link org.springframework.aop.target.EmptyTargetSource}
 * for the given target class will be used. The kind of proxy needed
 * will be determined on actual creation of the proxy.
 * <p>This is a replacement for setting a "targetSource" or "target",
 * for the case where we want a proxy based on a target class
 * (which can be an interface or a concrete class) without having
 * a fully capable TargetSource available.
 * @see #setTargetSource
 * @see #setTarget
 */
public void setTargetClass(@Nullable Class<?> targetClass) {
	this.targetSource = EmptyTargetSource.forClass(targetClass);
}
 
Example 7
/**
 * Set a target class to be proxied, indicating that the proxy
 * should be castable to the given class.
 * <p>Internally, an {@link org.springframework.aop.target.EmptyTargetSource}
 * for the given target class will be used. The kind of proxy needed
 * will be determined on actual creation of the proxy.
 * <p>This is a replacement for setting a "targetSource" or "target",
 * for the case where we want a proxy based on a target class
 * (which can be an interface or a concrete class) without having
 * a fully capable TargetSource available.
 * @see #setTargetSource
 * @see #setTarget
 */
public void setTargetClass(Class<?> targetClass) {
	this.targetSource = EmptyTargetSource.forClass(targetClass);
}
 
Example 8
/**
 * Set a target class to be proxied, indicating that the proxy
 * should be castable to the given class.
 * <p>Internally, an {@link org.springframework.aop.target.EmptyTargetSource}
 * for the given target class will be used. The kind of proxy needed
 * will be determined on actual creation of the proxy.
 * <p>This is a replacement for setting a "targetSource" or "target",
 * for the case where we want a proxy based on a target class
 * (which can be an interface or a concrete class) without having
 * a fully capable TargetSource available.
 * @see #setTargetSource
 * @see #setTarget
 */
public void setTargetClass(Class<?> targetClass) {
	this.targetSource = EmptyTargetSource.forClass(targetClass);
}