Ok, so I have this working:
Code:
<source-adapter channel="events" method="hoover" ref="task-hoover" period="3000"/>
<beans:bean id="task-hoover" class="stockroom.TaskHoover" />
TaskHoover has a method signature and implementation:
Code:
public Event hoover()
{
return new Event("Hello " + count++);
}
With this the hoover() method is called every 3 seconds. This is good, but I need to return a collection of Event objects. (Use case is I am pulling event data from an external data source, then constructing event objects which go to the events channel which is pub-sub).
What I want to do is implement the PollableSource interface in this class and be able to configure it using the source-adapter without passing the method ref.
What I was saying before is that the ChannelAdapterParser creates a MethodInvokingSource which implements PollableSource when parsing a source-adapter. So how do I make use of a custom implementation of PollableSource. Is such an approach desirable?