SpringSource/spring-data-mongodb — pull request #9 by amolnayak311 (2012-08-07 18:58:50+00:00)
Title: DATAMONGO-501: Initial push for Tailable Cursor Support (Review Only)

This PR is meant for review purpose only and to demonstrate the prototype developed, and collection opinions and views about the new feature that is planned to be added to MongoTemplate to tail a capped collection.

Some information about tailable cursors can be found here

http://www.mongodb.org/display/DOCS/Tailable+Cursors

The feature included in mongo template looks like this

``` java
TailingCursorHandle handle = template.tailCollection("SomeTestCappedCollection", "id",
new TailingCursorDocumentListener() {
public void processDocument(DBObject doc) {
//process the doc here
}
});
```
The first two parameters are the name of the capped collection to be tailed and the increasing key which forms the basis for tailing the collection.
The third parameter is an implementation of TailingCursorDocumentListener which is the callback interface whose processDocument is invoked when a new document is found at the tail of the collection.