You have to look at two things to solve your problem. First you need an Application-Scoped bean which run as a type of singleton process. Next you need to look at the Observer pattern, which is implemented as a Observer annotation on the method you want to call. This methods get called when you raise an event in your application, which can be done with the Events component.
These things are very good explained in the Seam documentation. If that isn' clear enough don't hesitate to ask
Thanks, events was the first thing that came to my mind, but as far as I know, whenever an event is thrown the observer is fired, isn't it? What I want to do is to wait for a signal, then do my processing, then wait again. If multiple events are risen, my observer will be fired several times in parallel won't it? Maybe there's a way to define an event in such a way, that when this event is already risen and being handled, rising it again does nothing?
You can use timeevent, meaning after firing the event it will start a timer process. What you can do is use two different methods on one bean each with a specific event signatuse.