Results 1 to 2 of 2

Thread: Injecting to aspect

  1. #1
    Join Date
    Feb 2013
    Posts
    2

    Default Injecting to aspect

    Hello,

    I am reading the Spring in Action book and trying to make examples to work.

    I made an aspectJ project + spring in STS.

    In spring config file:

    Code:
    <bean class="com.aspectj.JudgeAspect" factory-method="aspectOf">
    	<property name="test" value="true"/>
    </bean>
    and the aspect:

    Code:
    public aspect JudgeAspect {
    	public JudgeAspect() {}
    	
    	pointcut performance() : execution(* perform(..));
    	
    	after() returning() : performance() {
    		System.out.println("");
    	}
    	
    	private Boolean test;
    
    	public Boolean isTest() {
    		return test;
    	}
    
    	public void setTest(Boolean test) {
    		this.test = test;
    	}
    }
    Got no error on missing aspectOf method but the breakpoint at setTest never hit and the test is null (when pointcut run). What do I miss?

    Thanks in advance.

  2. #2
    Join Date
    Feb 2013
    Posts
    2

    Default

    No need help anymore...

    The class that invoked perform() was not a spring bean container part

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •