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

The following examples show how to use org.springframework.aop.target.EmptyTargetSource#forClass() . 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 File: AdvisedSupport.java    From spring-analysis-note with 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 File: AdvisedSupport.java    From java-technology-stack with 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
Source File: AdvisedSupport.java    From lams with GNU General Public License v2.0 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 4
Source File: AdvisedSupport.java    From spring4-understanding with Apache License 2.0 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 5
Source File: AdvisedSupport.java    From spring-analysis-note with 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 File: AdvisedSupport.java    From java-technology-stack with 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
Source File: AdvisedSupport.java    From lams with GNU General Public License v2.0 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(Class<?> targetClass) {
	this.targetSource = EmptyTargetSource.forClass(targetClass);
}
 
Example 8
Source File: AdvisedSupport.java    From spring4-understanding with Apache License 2.0 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(Class<?> targetClass) {
	this.targetSource = EmptyTargetSource.forClass(targetClass);
}