|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.clapper.curn.MetaPlugIn
public class MetaPlugIn
A MetaPlugIn object is basically a plug-in that contains all the
loaded plug-ins. It's a singleton that makes it easier for curn
to invoke the various loaded plugins. It is not used outside of
curn. The MetaPlugIn singleton object is loaded by an
instance of the PlugInManager class.
PlugIn,
PlugInManager,
CacheLoadedPlugIn,
FeedConfigItemPlugIn,
MainConfigItemPlugIn,
OutputHandlerConfigItemPlugIn,
PostConfigPlugIn,
PostFeedDownloadPlugIn,
PostFeedOutputPlugIn,
PostFeedParsePlugIn,
PostOutputHandlerFlushPlugIn,
PreCacheSavePlugIn,
PreFeedDownloadPlugIn,
PreFeedOutputPlugIn,
ShutdownPlugIn,
StartupPlugIn,
UnknownSectionConfigItemPlugIn,
Curn| Method Summary | |
|---|---|
void |
addPlugIn(PlugIn plugIn)
Add a plug-in to the list of plug-ins wrapped in this object. |
static MetaPlugIn |
getMetaPlugIn()
Get the MetaPlugIn singleton. |
java.lang.String |
getPlugInName()
Get a displayable name for the plug-in. |
java.lang.String |
getPlugInSortKey()
Get the sort key for this plug-in. |
void |
initPlugIn()
Initialize the plug-in. |
void |
registerPersistentDataClientPlugIns(DataPersister dataPersister)
Find all plug-ins that implement the PersistentDataClient
interface and register them with the specified DataPersister. |
void |
runCacheLoadedPlugIn(FeedCache cache)
Called after the curn cache has been read (and after any expired entries have been purged), but before any feeds are processed. |
boolean |
runFeedConfigItemPlugIn(java.lang.String sectionName,
java.lang.String paramName,
CurnConfig config,
FeedInfo feedInfo)
Called immediately after curn has read and processed a configuration item in a "feed" configuration section. |
void |
runMainConfigItemPlugIn(java.lang.String sectionName,
java.lang.String paramName,
CurnConfig config)
Called immediately after curn has read and processed a configuration item in the main [curn] configuration section. |
boolean |
runOutputHandlerConfigItemPlugIn(java.lang.String sectionName,
java.lang.String paramName,
CurnConfig config,
ConfiguredOutputHandler handler)
Called immediately after curn has read and processed a configuration item in an output handler configuration section. |
void |
runPostConfigPlugIn(CurnConfig config)
Called after the entire configuration has been read and parsed, but before any feeds are processed. |
boolean |
runPostFeedDownloadPlugIn(FeedInfo feedInfo,
java.io.File feedDataFile,
java.lang.String encoding)
Called immediately after a feed is downloaded. |
void |
runPostFeedOutputPlugIn(FeedInfo feedInfo,
OutputHandler outputHandler)
Called immediately after a parsed feed is passed to an output handler. |
boolean |
runPostFeedParsePlugIn(FeedInfo feedInfo,
RSSChannel channel)
Called immediately after a feed is parsed, but before it is otherwise processed. |
boolean |
runPostOutputHandlerFlushPlugIn(OutputHandler outputHandler)
Called immediately after an output handler is flushed (i.e., after it has been called to process all feeds and its output has been written to a temporary file), but before that output is displayed, emailed, etc. |
void |
runPostOutputPlugIn(java.util.Collection<OutputHandler> outputHandlers)
Called after curn has flushed all output handlers. |
void |
runPreCacheSavePlugIn(FeedCache cache)
Called right before the curn cache is to be saved. |
boolean |
runPreFeedDownloadPlugIn(FeedInfo feedInfo,
java.net.URLConnection urlConn)
Called just before a feed is downloaded. |
void |
runPreFeedOutputPlugIn(FeedInfo feedInfo,
RSSChannel channel,
OutputHandler outputHandler)
Called immediately before a parsed feed is passed to an output handler. |
void |
runShutdownPlugIn()
Called just before curn gets ready to exit. |
void |
runStartupPlugIn()
Called immediately after curn has started, but before it has loaded its configuration file or its cache. |
void |
runUnknownSectionConfigItemPlugIn(java.lang.String sectionName,
java.lang.String paramName,
CurnConfig config)
Called immediately after curn has read and processed a configuration item in an unknown configuration section. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static MetaPlugIn getMetaPlugIn()
CurnException - on errorpublic void addPlugIn(PlugIn plugIn)
PlugInManager.
plugIn - the PlugIn to addpublic void registerPersistentDataClientPlugIns(DataPersister dataPersister)
PersistentDataClient
interface and register them with the specified DataPersister.
dataPersister - the DataPersisterpublic java.lang.String getPlugInName()
PlugIn
getPlugInName in interface PlugInpublic java.lang.String getPlugInSortKey()
PlugIn
getPlugInSortKey in interface PlugIn
public void initPlugIn()
throws CurnException
PlugIn
initPlugIn in interface PlugInCurnException - on error
public void runStartupPlugIn()
throws CurnException
StartupPlugIn
runStartupPlugIn in interface StartupPlugInCurnException - on error
public void runMainConfigItemPlugIn(java.lang.String sectionName,
java.lang.String paramName,
CurnConfig config)
throws CurnException
MainConfigItemPlugIn
runMainConfigItemPlugIn in interface MainConfigItemPlugInsectionName - the name of the configuration section where
the item was foundparamName - the name of the parameterconfig - the CurnConfig object
CurnException - on errorCurnConfig
public boolean runFeedConfigItemPlugIn(java.lang.String sectionName,
java.lang.String paramName,
CurnConfig config,
FeedInfo feedInfo)
throws CurnException
FeedConfigItemPlugIn
runFeedConfigItemPlugIn in interface FeedConfigItemPlugInsectionName - the name of the configuration section where
the item was foundparamName - the name of the parameterconfig - the CurnConfig objectfeedInfo - partially complete FeedInfo object
for the feed. The URL is guaranteed to be
present, but no other fields are.
CurnException - on errorCurnConfig,
FeedInfo,
FeedInfo.getURL()
public boolean runOutputHandlerConfigItemPlugIn(java.lang.String sectionName,
java.lang.String paramName,
CurnConfig config,
ConfiguredOutputHandler handler)
throws CurnException
OutputHandlerConfigItemPlugIn
runOutputHandlerConfigItemPlugIn in interface OutputHandlerConfigItemPlugInsectionName - the name of the configuration section where
the item was foundparamName - the name of the parameterconfig - the CurnConfig objecthandler - partially complete ConfiguredOutputHandler
object. The class name is guaranteed to be set,
but the other fields may not be.
CurnException - on errorCurnConfig,
ConfiguredOutputHandler
public void runUnknownSectionConfigItemPlugIn(java.lang.String sectionName,
java.lang.String paramName,
CurnConfig config)
throws CurnException
UnknownSectionConfigItemPlugIn
runUnknownSectionConfigItemPlugIn in interface UnknownSectionConfigItemPlugInsectionName - the name of the configuration section where
the item was foundparamName - the name of the parameterconfig - the CurnConfig object
CurnException - on errorCurnConfig,
FeedInfo,
FeedInfo.getURL()
public void runPostConfigPlugIn(CurnConfig config)
throws CurnException
PostConfigPlugIn
runPostConfigPlugIn in interface PostConfigPlugInconfig - the parsed CurnConfig object
CurnException - on errorCurnConfig
public void runCacheLoadedPlugIn(FeedCache cache)
throws CurnException
CacheLoadedPlugIn
runCacheLoadedPlugIn in interface CacheLoadedPlugIncache - the loaded FeedCache object
CurnException - on error
public boolean runPreFeedDownloadPlugIn(FeedInfo feedInfo,
java.net.URLConnection urlConn)
throws CurnException
PreFeedDownloadPlugInCalled just before a feed is downloaded. This method can return false to signal curn that the feed should be skipped. The plug-in method can also set values on the URLConnection used to download the plug-in, via URL.setRequestProperty(). (Note that all URLs, even file: URLs, are passed into this method. Setting a request property on the URLConnection object for a file: URL will have no effect--though it isn't specifically harmful.)
Possible uses for a pre-feed download plug-in include:
runPreFeedDownloadPlugIn in interface PreFeedDownloadPlugInfeedInfo - the FeedInfo object for the feed to be
downloadedurlConn - the java.net.URLConnection object that will
be used to download the feed's XML.
CurnException - on errorFeedInfo
public boolean runPostFeedDownloadPlugIn(FeedInfo feedInfo,
java.io.File feedDataFile,
java.lang.String encoding)
throws CurnException
PostFeedDownloadPlugIn
runPostFeedDownloadPlugIn in interface PostFeedDownloadPlugInfeedInfo - the FeedInfo object for the feed that
has been downloadedfeedDataFile - the file containing the downloaded, unparsed feed
XML. curn may delete this file after all
plug-ins are notified!encoding - the encoding used to store the data in the file,
or null for the default
CurnException - on errorFeedInfo
public boolean runPostFeedParsePlugIn(FeedInfo feedInfo,
RSSChannel channel)
throws CurnException
PostFeedParsePlugInRSSChannel object. This
method can return false to signal curn that the feed
should be skipped. For instance, a plug-in that filters on the
parsed feed data could use this method to weed out non-matching
feeds before they are downloaded. Similarly, a plug-in that edits
the parsed data (removing or editing individual items, for instance)
could use method to do so.
runPostFeedParsePlugIn in interface PostFeedParsePlugInfeedInfo - the FeedInfo object for the feed that
has been downloaded and parsed.channel - the parsed channel data
CurnException - on errorRSSChannel,
FeedInfo
public void runPreFeedOutputPlugIn(FeedInfo feedInfo,
RSSChannel channel,
OutputHandler outputHandler)
throws CurnException
PreFeedOutputPlugIn
runPreFeedOutputPlugIn in interface PreFeedOutputPlugInfeedInfo - the FeedInfo object for the feed that
has been downloaded and parsed.channel - the parsed channel data. The plug-in is free
to edit this data; it's receiving a copy
that's specific to the output handler.outputHandler - the OutputHandler that is about to be
called. This object is read-only.
CurnException - on errorRSSChannel,
FeedInfo
public void runPostFeedOutputPlugIn(FeedInfo feedInfo,
OutputHandler outputHandler)
throws CurnException
PostFeedOutputPlugIn
runPostFeedOutputPlugIn in interface PostFeedOutputPlugInfeedInfo - the FeedInfo object for the feed that
has been downloaded and parsed.outputHandler - the OutputHandler that is about to be
called. This object is read-only.
CurnException - on errorFeedInfo,
OutputHandler
public boolean runPostOutputHandlerFlushPlugIn(OutputHandler outputHandler)
throws CurnException
PostOutputHandlerFlushPlugIn
runPostOutputHandlerFlushPlugIn in interface PostOutputHandlerFlushPlugInoutputHandler - the OutputHandler that is about to be
called. This object is read-only.
CurnException - on errorOutputHandler
public void runPostOutputPlugIn(java.util.Collection<OutputHandler> outputHandlers)
throws CurnException
PostOutputPlugIn
runPostOutputPlugIn in interface PostOutputPlugInoutputHandlers - a Collection of the
OutputHandler objects (useful for
obtaining the output files, for instance).
CurnException - on errorOutputHandler
public void runPreCacheSavePlugIn(FeedCache cache)
throws CurnException
PreCacheSavePlugIn
runPreCacheSavePlugIn in interface PreCacheSavePlugIncache - the FeedCache object
CurnException - on error
public void runShutdownPlugIn()
throws CurnException
ShutdownPlugIn
runShutdownPlugIn in interface ShutdownPlugInCurnException - on error
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||