Aspect Filter : AOP « Spring « Java

Aspect Filter

File: context.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns=""

    <context:component-scan base-package="bean">
        <context:include-filter type="annotation" expression="bean.Magic"/>
        <context:include-filter type="assignable" expression="bean.ComponentMarker"/>
        <context:include-filter type="aspectj" expression="* void bean.*Service*(..)"/>



import org.springframework.context.ApplicationContext;

public class Main {
  public static void main(String[] args) throws Exception {
    ApplicationContext ac = new ClassPathXmlApplicationContext(
    String[] beanNames = ac.getBeanDefinitionNames();
    for (String beanName : beanNames) {
      System.out.println(beanName + ": " + ac.getBean(beanName));

 4,453 k)

Related examples in the same category

1.Spring Tracing Aspect
2.Method Lookup
3.Method Before Advice
4.Matcher For Getter And Setter
5.Spring AOP Examples
6.Jdk Regexp Method Pointcut
7.Customizable TraceInterceptor
8.Concurrency Throttle Interceptor
9.ComposablePointcut Union
10.ComposablePointcut Intersection
11.AspectJ Expression Pointcut
12.AspectJ AutoProxy
13.Aspect Annotation Pointcut AroundAfter
14.Aspect Annotation
15.AOP Annotation
16.Annotation Scope
17.Annotation Component
18.Annotated Autowiring