public class SourcePoller extends Object
An isAvailable() method is included in this class so that the caller, nominally the CatalogFramework, can retrieve the cached availability of a specific source, or have it polled on demand if there is no availability status cached.
Constructor and Description |
---|
SourcePoller(SourcePollerRunner incomingRunner)
Constructor to schedule the SourcePollerRunner to execute immediately and at a fixed interval,
currently set at every 1 minute.
|
Modifier and Type | Method and Description |
---|---|
void |
cancel(CatalogFramework framework,
Map properties)
Cancels the
SourcePollerRunner thread that had been previously scheduled to run at
specific intervals. |
CachedSource |
getCachedSource(Source source)
Retrieves a
CachedSource which contains cached values from the specified Source . |
int |
getInterval() |
void |
setInterval(int interval) |
void |
start(CatalogFramework framework,
Map properties)
Start method for this poller, invoked by the CatalogFramework's blueprint when the framework is
registered/installed.
|
public SourcePoller(SourcePollerRunner incomingRunner)
incomingRunner
- the SourcePollerRunner to use for pollingpublic CachedSource getCachedSource(Source source)
CachedSource
which contains cached values from the specified Source
. Returns a Source
with values from the last polling interval. If the Source
is not known, null is returned.source
- the source to get the CachedSource
forCachedSource
which contains cached valuespublic void cancel(CatalogFramework framework, Map properties)
SourcePollerRunner
thread that had been previously scheduled to run at
specific intervals. Invoked by the CatalogFramework's blueprint when the framework is
unregistered/uninstalled.framework
- unused, but required by blueprintproperties
- unused, but required by blueprintpublic void start(CatalogFramework framework, Map properties)
framework
- the catalog framework being startedproperties
- unused, but required by blueprintpublic int getInterval()
public void setInterval(int interval)
This work is licensed under a Creative Commons Attribution 4.0 International License.