1
2
3
4
5
6
7 package org.mule.module.atom.event;
8
9 import org.mule.api.annotations.expressions.Expr;
10 import org.mule.api.annotations.param.Payload;
11
12 import java.util.concurrent.atomic.AtomicInteger;
13
14 import org.apache.abdera.model.Entry;
15 import org.apache.abdera.model.Feed;
16
17 public class EntryReceiver
18 {
19
20 private AtomicInteger receivedEntries = new AtomicInteger(0);
21
22 public void processEntry(@Payload Entry entry, @Expr("#[header:invocation:feed.object]") Feed feed) throws Exception
23 {
24 System.out.println("Received " + receivedEntries.incrementAndGet() + " of " + feed.getEntries().size() + " entries");
25 }
26
27 public int getCount()
28 {
29 return receivedEntries.get();
30 }
31
32 public AtomicInteger getReceivedEntries()
33 {
34 return receivedEntries;
35 }
36 }