how to obtain spring context reference in jpbm 4.2 EventListener?
How to obtain spr开发者_运维百科ing context from within EventListener instance which gets notified following this transition of process:
<transition g="-36,11" name="A" to="B">
<event-listener class="com.test.handlers.MyRequestHandler">
</event-listener>
</transition>
I want to be able to do something like the following in my
@Override
public void notify(EventListenerExecution execution) throws Exception {
..
MyOtherSpringBean sender = (MyOtherSpringBean )applicationContext.get("MyOtherSpringBean ");
Thanks in advance,
Denis
You can have your EventListener
be part of the spring context, and hence you can inject other beans into it (using @Autowired private MyOtherSpringBean bean
)
See this thread, and this issue
精彩评论