@ Nullable public DBObject tryNext ( ) { if ( cursor == null ) { FindOperation < DBObject > operation = getQueryOperation ( decoder ) ; if ( ! operation . getCursorType ( ) . isTailable ( ) ) { throw new IllegalArgumentException ( "Can only be used with a tailable cursor" ) ; } initializeCursor ( operation ) ; } DBObject next = cursor . tryNext ( ) ; setServerCursorOnFinalizer ( cursor . getServerCursor ( ) ) ; return currentObject ( next ) ; }
Non blocking check for tailable cursors to see if another object is available .