org.ektorp.impl.changes
Class ContinuousChangesFeed

java.lang.Object
  extended by org.ektorp.impl.changes.ContinuousChangesFeed
All Implemented Interfaces:
java.lang.Runnable, ChangesFeed

public final class ContinuousChangesFeed
extends java.lang.Object
implements ChangesFeed, java.lang.Runnable

Author:
henrik lundgren

Constructor Summary
ContinuousChangesFeed(java.lang.String dbName, java.io.InputStream changesStream)
           
 
Method Summary
 void cancel()
          Will close this feed and interrupt any threads waiting on next()
 boolean isAlive()
           
 DocumentChange next()
          Retrieves and removes the head of this changes feed, waiting if necessary until an element becomes available.
 DocumentChange next(long timeout, java.util.concurrent.TimeUnit unit)
          Retrieves and removes the head of this changes feed, waiting up to the specified wait time if necessary for an element to become available.
 int queueSize()
           
 void run()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContinuousChangesFeed

public ContinuousChangesFeed(java.lang.String dbName,
                             java.io.InputStream changesStream)
Method Detail

next

public DocumentChange next()
                    throws java.lang.InterruptedException
Description copied from interface: ChangesFeed
Retrieves and removes the head of this changes feed, waiting if necessary until an element becomes available.

Specified by:
next in interface ChangesFeed
Returns:
Throws:
java.lang.InterruptedException - when this changes feed is closed or otherwise is interrupted

next

public DocumentChange next(long timeout,
                           java.util.concurrent.TimeUnit unit)
                    throws java.lang.InterruptedException
Description copied from interface: ChangesFeed
Retrieves and removes the head of this changes feed, waiting up to the specified wait time if necessary for an element to become available.

Specified by:
next in interface ChangesFeed
Returns:
Throws:
java.lang.InterruptedException - when this changes feed is closed or otherwise is interrupted

cancel

public void cancel()
Description copied from interface: ChangesFeed
Will close this feed and interrupt any threads waiting on next()

Specified by:
cancel in interface ChangesFeed

isAlive

public boolean isAlive()
Specified by:
isAlive in interface ChangesFeed
Returns:
true if this feed is active.

queueSize

public int queueSize()
Specified by:
queueSize in interface ChangesFeed
Returns:
the size of this feed's unhandled internal queue.

run

public void run()
Specified by:
run in interface java.lang.Runnable


Copyright © 2011. All Rights Reserved.