View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.module.rss;
8   
9   import org.mule.api.annotations.param.Payload;
10  
11  import com.sun.syndication.feed.synd.SyndFeed;
12  
13  import java.util.concurrent.atomic.AtomicInteger;
14  
15  public class FeedReceiver
16  {
17      private AtomicInteger count = new AtomicInteger(0);
18  
19      public void readFeed(@Payload SyndFeed feed) throws Exception
20      {
21          count.set(feed.getEntries().size());            
22      }
23  
24      public int getCount()
25      {
26          return count.get();
27      }
28  }