org.springframework.config.java.annotation.aop
Annotation Type ScopedProxy


@Target(value=METHOD)
@Retention(value=RUNTIME)
public @interface ScopedProxy

Marker annotation identical in functionality with <aop:scoped-proxy/> tag. Provides a smart proxy backed by a scoped bean, which can be injected into object instances (usually singletons) allowing the same reference to be held while delegating method invocations to the backing, scoped beans.

Used with scoped beans (non-singleton and non-prototype).

 @Configuration
 public class ScopedConfig {
 
        @Bean(scope = "myScope")
        @ScopedProxy
        public SomeBean someBean() {
                return new SomeBean();
        }
 
        @Bean
        public SomeOtherBean() {
                return new AnotherBean(someBean());
        }
 }
 
See Spring reference documentation for more details.

Author:
Costin Leau

Optional Element Summary
 boolean proxyTargetClass
          Use CGLib-based class proxies (true) or JDK interface-based (false).
 

proxyTargetClass

public abstract boolean proxyTargetClass
Use CGLib-based class proxies (true) or JDK interface-based (false). Default is CGLib (true).

Returns:
Default:
true


Copyright � 2005-2008 Spring Framework. All Rights Reserved.