-
Notifications
You must be signed in to change notification settings - Fork 12
JDAL Aop
Jose Luis Martin edited this page May 21, 2015
·
1 revision
The AOP library contains the following Spring AOP Aspects.
To use @DeclareMixin in Spring AOP you only need to declare a bean of type DeclareMixinAutoProxyCreatorConfigurer
in you context.
<bean id="declareMixinConfigurer" class="org.jdal.aop.DeclareMixinAutoProxyCreatorConfigurer" />
or if using JavaConfig:
@Configuration
public class AppConfig {
@Bean
public declareMixinConfigurer() {
return new DeclareMixinAutoProxyCreatorConfigurer();
}
}
To enable serializable proxies use the following bean definitions in context configuration file:
<!-- Enable @SerializableProxy support -->
<bean id="serializableAnnotationBeanPostProcessor" class="org.jdal.aop.config.SerializableAnnotationBeanPostProcessor" />
<bean id="serializableProxyAdvisor" class="org.jdal.aop.SerializableProxyAdvisor" scope="prototype"/>
To replace a bean in the Spring context globally, we can use the <jdal:serializable-proxy>
tag in jdal spring
custom namespace:
<bean id="someBean" class="some.package.SomeBean">
<property name="someProperty" value="someValue" />
<jdal:serializable-proxy /> <!-- Replace this bean with a serializable proxy -->
</bean>
Or we can use @SerializableProxy
annotation on the bean types.
@Component
@SerializableProxy
public class StoreService {
...
}
Finally, we can replace only the reference in the component without touching the Spring context, just using the annotation in the autowired field.
public class MainLayout extends VerticalLayout {
@Autowired
@SerializableProxy
private CustomerDao customerDao;
}
The latest released version is 2.0.0. configure maven as follows to include it.
<repositories>
<repository>
<id>jdal</id>
<name>JDAL Repository</name>
<url>http://www.jdal.org/repo</url>
</repository>
</repositories>
...
<dependency>
<groupId>org.jdal</groupId>
<artifactId>jdal-aop</artifactId>
<version>2.0.0</version>
</dependency>
- Home
- [JDAL Core](JDAL Core)
- [JDAL Swing](JDAL Swing)
- [JDAL Vaadin](JDAL Vaadin)