What happens when a custom EventListener handles a custom EventObject?
Once the Handler is done:
EventListener is only Interface (actually very low level) and it only defines what should be implemented. How it is implemented is defined in the class which implements this interface. So, question should be how some particular class handles it. It could be started in separate thread or new thread could be created or current one could be used. Different classes handle it differently. I believe that majority of them just call listener's method in current own thread. That's the reason why it is not advised to do anything long (actually anything at all except few commands to notify about event) inside listener itself. That's where flexibility comes - you decide what and when to do. Start new thread and finish it when job done or use existing thread or do your job quickly and hope that current thread doesn't stuck and, for example, GUI window is not frozen.
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