Announcement Announcement Module
Collapse
No announcement yet.
Injecting to aspect Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    No need help anymore...

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

    Comment

    Working...
    X