-
30. Re: Seam performance problem + rewarding workaround...
deanhiller2000 Jul 29, 2010 12:28 PM (in response to toby.tobias.hill.gmail.com)oh,coooool, CallChain was already a ThreadLocal!!!
-
31. Re: Seam performance problem + rewarding workaround...
deanhiller2000 Jul 29, 2010 4:23 PM (in response to toby.tobias.hill.gmail.com)coooool, so I didn't really like having to add @MeasureTime to each bean and really just wanted all beans to be included automatically(well, all the ones with interceptors), so I finally figured out how to add interceptors to all beans that have interceptors already...
@Name("ourInit") @Scope(ScopeType.APPLICATION) @BypassInterceptors @Install(value=true) @Startup public class OurInit { private static final Logger log = Logger.getLogger(OurInit.class.getName()); @Create public void start() { process(Contexts.getApplicationContext()); } private static void process(Context ctx) { String[] names = ctx.getNames(); for(String name : names) { Object obj = ctx.get(name); if(!(obj instanceof Component)) continue; Component comp = (Component) obj; log.info("processing="+name+" class="+comp.getBeanClass()); List<Interceptor> interceptors = comp.getInterceptors(InterceptorType.SERVER); if(interceptors.size() > 0) { log.info("add interceptor to begin of size="+interceptors.size()); interceptors.add(0, new Interceptor(new TimingInterceptor(), comp)); } else { log.info("has no interceptors.......skipping"); } } } }
-
32. Re: Seam performance problem + rewarding workaround...
juergenb Dec 10, 2010 5:54 AM (in response to toby.tobias.hill.gmail.com)Wow! Cool! Thank you very much Tobias and everybody for this enlightment.
I used a datatable which caused me much headache until I used @BypassInterceptors.
-
33. Re: Seam performance problem + rewarding workaround...
bgroeneveld Jan 4, 2011 5:58 PM (in response to toby.tobias.hill.gmail.com)This is proving really useful. In trying to implement Dean's idea of watching all bean automatically I'm confronted with the following exception when the times are collected (below). What am I missing here? Thanks!
Caused by: java.lang.IllegalArgumentException: Could not invoke method by reflection: TimingInterceptor.timeCall(org.jboss.seam.intercept.InvocationContext) with parameters: (org.jboss.seam.intercept.EE5SeamInvocationContext) on: org.jboss.seam.core.MethodContextInterceptor
-
34. Re: Seam performance problem + rewarding workaround...
antibrumm.mfrey0.bluewin.ch Jan 20, 2011 7:10 AM (in response to toby.tobias.hill.gmail.com)I was using the TimingInterceptor since i found this thread and the only thing that annoyed me was that we have to declare the interceptor everywhere.
Thanks alot Dean!!!
-
35. Re: Seam performance problem + rewarding workaround...
omontano Feb 5, 2011 7:08 PM (in response to toby.tobias.hill.gmail.com)I tried doing a-level interceptor method but not working. I wonder if it can be done
-
36. Re: Seam performance problem + rewarding workaround...
gaboo.gael.livre-rare-book.com Feb 14, 2011 3:51 AM (in response to toby.tobias.hill.gmail.com)I'm having this issue too. Does someone has any idea about how to fix it ?
Thanks! -
37. Re: Seam performance problem + rewarding workaround...
gaboo.gael.livre-rare-book.com Feb 14, 2011 3:52 AM (in response to toby.tobias.hill.gmail.com)
Ben Groeneveld wrote on Jan 04, 2011 17:58:
This is proving really useful. In trying to implement Dean's idea of watching all bean automatically I'm confronted with the following exception when the times are collected (below). What am I missing here? Thanks!
Caused by: java.lang.IllegalArgumentException: Could not invoke method by reflection: TimingInterceptor.timeCall(org.jboss.seam.intercept.InvocationContext) with parameters: (org.jboss.seam.intercept.EE5SeamInvocationContext) on: org.jboss.seam.core.MethodContextInterceptorThis issue, easier to understand the reply with the quote :)
-
38. Re: Seam performance problem + rewarding workaround...
jakec Oct 25, 2011 6:54 PM (in response to toby.tobias.hill.gmail.com)I know this is an old post, but there has never been a response to the IllegalArgumentException, which I am also getting.
I don't really understand what is going on here. It has an instance of MethodContextInterceptor, but the Method it is trying to call is the TimingInterceptor.timeCall method, but TimingInterceptor is NOT an instance of MethodContextInterceptor. How is it that Interceptor.aroundInvoke() is being called by SeamInvocationContext.proceed() with a userInteceptor that is of a different class than the one the aroundInvokeMethod came from?
This is in Seam 2.0.1.GA.