Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Application use cases often require sending recurring or timed notifications. This can be done by creating a timer component that has a producer connected to a channel:

Code Block
java
java

public class SomeTime implements Runnable {

     @Producer
     protected Channel channel;

       public void run() {
          Event event = ...
          channel.publish(event);
   }  }
}

and configuring it in a composite:

Code Block
xml
xml

<composite ....>

  &nbsp;&nbsp; <component name="Timer">
 &nbsp;&nbsp; &nbsp; &nbsp;     <f3:implementation.timer class="..." repeatInterval="10000"/>
 &nbsp;&nbsp; &nbsp; &nbsp;     <producer name="channel" target="SomeChannel"/>
   </composite>

...

Further, to limit timed events to a single source in a clustered zone, mark the implementation with @Scope("DOMAIN").