qianjava / ehcache-spring-annotations

Automatically exported from code.google.com/p/ehcache-spring-annotations
0 stars 0 forks source link

@TriggersRemove does not work when calling from another that marked as @TriggersRemove as well #36

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago

What steps will reproduce the problem?
1. Define two functions and mark both of them with @TriggersRemove,
2. Call the second function from the first.
3. Calls the first function.

What is the expected output? What do you see instead?
Both @TriggersRemove should be executed, however, only the first 
@TriggersRemove gets executed.

What version of the product are you using? On what operating system?
1.1.0, MAC and Linux

Please provide any additional information below.
I hope I am making sense... since Issue #34 hasn't been implemented yet. Here 
is my work around. I am trying to remove two cached object with different 
keys...

@TriggersRemove(cacheName="triggersRemoveCountingCache", 
            keyGeneratorName = "keyGenerator1"
    )
function methodOne()[
   // other codes...
 methodTwo(); //calling methodTwo, expect to see the @TriggersRemove on methodTwo gets executed...
}

@TriggersRemove(cacheName="triggersRemoveCountingCache", 
              keyGeneratorName = "keyGenerator2")
function methodTwo(){
   //whatever it is...
}

I have the test case attached.

Original issue reported on code.google.com by timobj@gmail.com on 29 Jun 2010 at 7:53

Attachments:

GoogleCodeExporter commented 8 years ago
The library doesn't support load-time weaving from AspectJ. Since the code 
functions by adding a wrapper proxy around a spring bean calls between methods 
in the bean will not be affected by the annotations. This is true for any 
Spring aspect that is not implemented using load-time weaving.

The solution is to call a helper or registry style bean API that then calls 
each of your annotated methods in turn on your annotated bean.

Original comment by eric.dalquist on 29 Jun 2010 at 8:02

GoogleCodeExporter commented 8 years ago
Ok. Thanks. Well, I'll be when Issue #34 is implemented.

Thanks!

Jiang

Original comment by timobj@gmail.com on 29 Jun 2010 at 8:06

GoogleCodeExporter commented 8 years ago
I'm actually working on #34 right now. We might even get a 1.1.1 release by the 
end of the week.

Original comment by eric.dalquist on 29 Jun 2010 at 8:09

GoogleCodeExporter commented 8 years ago
Wow! That will be great! Thanks a lot!

Original comment by timobj@gmail.com on 29 Jun 2010 at 8:20