views:

458

answers:

2

I was reading through spring framework documentation and found a section on raising events in Spring using ApplicationContext. After reading few paragraphs I found that spring events are raised synchronously. Is there any way to raise asynchronous events? your help is much appreciated. I am looking something similar which would help me to complete my module.

+1  A: 

Spring itself (AFAIK) work synchronously, but what you can do is to create your own ApplicationListener proxy - a class that implements this interface but instead of handling the event it just delegates it by sending to another (or new) thread, sending JMS message, etc.

David Rabinowitz
+1  A: 

Alternative notification strategies can be achieved by implementing ApplicationEventMulticaster (see Javadoc) and its underlying (helper) class hierarchy. Typically you use either a JMS based notification mechanism (as David already suggested) or attach to Spring's TaskExecuter abstraction (see Javadoc).

Oliver Gierke