| org.dspace.checker.BitstreamDispatcher
All known Subclasses: org.dspace.checker.SimpleDispatcher, org.dspace.checker.LimitedCountDispatcher, org.dspace.checker.LimitedDurationDispatcher, org.dspace.checker.ListDispatcher, org.dspace.checker.HandleDispatcher,
BitstreamDispatcher | public interface BitstreamDispatcher (Code) | |
BitstreamDispatchers are strategy objects that hand bitstream ids out to
workers. Implementations must be threadsafe.
The rationale behind the use of the Sentinel pattern (rather than the more
traditional iterator pattern or a cursor c.f. java.sql.ResultSet): -
- To make it easy to make implementations thread safe - multithreaded
invocation of the dispatchers is seen as a next step use case. In simple
terms, this requires that a single method does all the work.
- Shouldn't an exception as the sentinel, as reaching the end of a loop is
not an exceptional condition.
author: Jim Downing author: Grace Carpenter author: Nathan Sarr |
Field Summary | |
public static int | SENTINEL This value should be returned by next() to indicate that
there are no more values. |
Method Summary | |
public int | next() Returns the next id for checking, or a sentinel value if there are no
more to check. |
SENTINEL | public static int SENTINEL(Code) | | This value should be returned by next() to indicate that
there are no more values.
|
next | public int next()(Code) | | Returns the next id for checking, or a sentinel value if there are no
more to check.
the next bitstream id, or BitstreamDispatcher.SENTINEL if thereisn't another value |
|
|