|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
de.nava.informa.utils.toolkit.WorkerThread
de.nava.informa.utils.poller.PollerWorkerThread
public class PollerWorkerThread
Worker thread is the main processing unit. Worker thread is not dedicated to single channel,
group or whatever else. It represents a single thread, which is capable of doing well-defined
and unified job. WorkersManager submits jobs for free WorkerThread's.
Workers simply do their jobs. This architecture allows to scale to as much threads as necessary.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
Thread.State, Thread.UncaughtExceptionHandler |
| Field Summary | |
|---|---|
static int |
POLICY_SCAN_ALL
Scanning for new items performed fully. |
static int |
POLICY_SKIP_AFTER_EXISTING
Scanning for new items in channel finishes when existing item detected. |
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
PollerWorkerThread(PollerObserverIF observer,
PollerApproverIF approver,
int itemScanningPolicy,
InputSourceProviderIF inputSourceProvider,
InputStreamProviderIF inputStreamProvider)
Creates worker thread for poller with given observer and approver. |
|
| Method Summary | |
|---|---|
(package private) static boolean |
channelHasChanged(ChannelIF o,
ChannelIF n)
Checks if channel has changed. |
(package private) void |
checkItems(ChannelIF newChannel,
ChannelRecord record)
Walks through the items and checks if new items present. |
(package private) static boolean |
differ(Object a,
Object b)
Checks if two objects differ. |
protected void |
processRecord(ChannelRecord record)
Processes record. |
void |
setUserAgent(String userAgent)
Sets specific user-agent to use when using HTTP protocol. |
| Methods inherited from class de.nava.informa.utils.toolkit.WorkerThread |
|---|
getChannelInProcess, run, setQueue, terminate |
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int POLICY_SKIP_AFTER_EXISTING
public static final int POLICY_SCAN_ALL
| Constructor Detail |
|---|
public PollerWorkerThread(PollerObserverIF observer,
PollerApproverIF approver,
int itemScanningPolicy,
InputSourceProviderIF inputSourceProvider,
InputStreamProviderIF inputStreamProvider)
observer - observer object.approver - approver object.itemScanningPolicy - policy for item scanning.inputSourceProvider - provider of InputSource for feeds' streams.inputStreamProvider - provider of InputStream for feeds.| Method Detail |
|---|
public void setUserAgent(String userAgent)
userAgent - user agent or NULL to use default.protected final void processRecord(ChannelRecord record)
processRecord in class WorkerThreadrecord - record to process.
final void checkItems(ChannelIF newChannel,
ChannelRecord record)
newChannel - new channel taken from web.record - record about currently existing channel to match against.
static boolean channelHasChanged(ChannelIF o,
ChannelIF n)
o - old channel.n - new channel.
static boolean differ(Object a,
Object b)
a - object.b - object.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||