tags:

views:

10

answers:

1

How to obtain spring 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

+1  A: 

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

Bozho