Hi everyone.
In my (web) app will to fire some events. Of course I can open my source code and insert some code :
But I want to dynamically decide if an event will be fired and use Spring..Code:EventManager evtManager = EventManager.getInstance(); Event event = new Event(this.getClass(), "currentMethodName", methodArg1, methodArg2); evtManager.fire(event);
That's not really good (I think) so insted of calling the ConfigDao and copying this code in many classes I will use the AOP capabilities.Code:ConfigDao dao = // Injected EventManager evtManager = // Injected Event event = new Event(this.getClass(), "currentMethodName", methodArg1, methodArg2); if ( dao.willFireEvent(event) ) { evtManager.fire(event); }
I want to write a "ConfiguredPointcut" which use the "ConfigDao" to know if a method will fire an event. But I never have used Spring AOP and really don't know here to start.
I have tried to write a custom "org.springframework.aop.Pointcut" but I d'ont know how to use It..
Can someone help me ?
Thanks


Reply With Quote