It would be nice to be able to define my own method interceptors (advice) and weave them in to my client-side GWT methods, and have GWT automagicallly compile them down into JavaScript with the rest of my app.
I checked out gwt-ent
, but it doesn't look like there's been solid development on it since 2009 and there were quite a number of issues. I've also heard of gwt-tiny-aop
but heard it was very limited.
Do I have any other options here? I know AOP requires dynamic bytecode generation, which in turn requires heavy reflection, and that GWT doesn't contain a lot of support (and seems to discourage) the practice of reflection, but I was wondering if there are any stable, well-known AOP libs out there for GWT. At least something that I could use for writing AOP Alliance-like interceptors:
public class MyInterceptor implements MethodInterceptor {
@Override
public void onIntercept(MethodInvocation mi) {
// Do some stuff...
// Let the method execute
Object results = mi.proceed();
// Analyze results...
// Returns results
return results;
}
You could use GWT generators:
https://developers.google.com/web-toolkit/doc/latest/DevGuideCodingBasicsDeferred#generators
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With