|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ca.cbc.sportwire.WireFeeder
Copyright (C) 2001 Canadian Broadcasting Corporation (cbc.ca) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Field Summary | |
protected static java.util.Date |
boottime
boottime : variable |
(package private) static org.apache.log4j.Category |
cat
Set up a reporting category in Log4J |
private org.apache.commons.collections.ExtendedProperties |
config
|
private DocHandler |
docHandler
|
private SportwireFeed |
feed
|
private java.util.List |
ignorePatterns
|
private static int |
MIN_LINES
|
private DocQueue |
queue
|
protected java.util.Date |
starttime
|
protected java.util.Date |
timestamp
|
Constructor Summary | |
protected |
WireFeeder()
Creates a new WireFeeder instance. |
protected |
WireFeeder(java.lang.String conf)
WireFeeder constructor accepts a config filename. |
Method Summary | |
protected org.apache.commons.collections.ExtendedProperties |
getConfig()
getConfig : Access the properties list. |
protected DocHandler |
getDocHandler()
Get the current docHandler. |
protected SportwireFeed |
getFeed()
Access the current feed object. |
protected DocQueue |
getQueue()
getQueue : access the document queue. |
protected void |
loadIgnoreList(java.lang.String ignoreFile)
loadIgnoreList : Loads in and pre-compiles a list
of perl expressions that specify document tags to ignore. |
private void |
loadProperties(java.lang.String conf)
|
private void |
loadRegexMap(org.apache.commons.collections.ExtendedProperties conf)
|
static void |
main(java.lang.String[] argv)
Command line main function; use a property to determine the specific input feed or doc processing module (should someday add a command line override) |
private boolean |
onIgnoreList(java.lang.String doctag)
|
protected void |
readFeed()
readFeed rips through the continuous stream of
input until the read function starts returning consecutive
nulls, which probably means we are out of input; when input
runs out, we flag the workers to exit and return to await job
completion. |
protected void |
setConfig(org.apache.commons.collections.ExtendedProperties v)
Set the properties list |
protected void |
setDocHandler()
Set the value of docHandler from the class name found in the property DOCHANDLER_PROPERTY . |
protected void |
setDocHandler(java.lang.String dh)
setDocHandler : set the handler to a class from the
class name. |
protected void |
setFeed()
Set the feed from a classname specified by the FEEDCLASS_PROPERTY |
protected void |
setFeed(java.lang.String f)
setFeed : set the feed by name, invoking the
getInstance (the class is assumed to be a Singleton pattern) |
private static void |
setLogging(boolean debug)
setLogging loads filters and appenders from the
property file specified by wirefeeder.log4j.conf. |
private void |
startWatchdog()
|
java.util.Map |
status()
status : XMLRPC method to report on the system
status; called as sportwire.status from
localhost:8484/ , this returns a few uptime
diagnostics useful for ensuring the system is still alive. |
static void |
usage()
usage : print the command line options to stderr |
Methods inherited from class java.lang.Object |
|
Field Detail |
static org.apache.log4j.Category cat
private static int MIN_LINES
private DocHandler docHandler
private SportwireFeed feed
private DocQueue queue
private org.apache.commons.collections.ExtendedProperties config
private java.util.List ignorePatterns
protected java.util.Date timestamp
protected java.util.Date starttime
protected static java.util.Date boottime
boottime
: variableConstructor Detail |
protected WireFeeder() throws java.io.IOException, java.lang.ClassNotFoundException
WireFeeder
instance. This should
have the effect of a total warm restart. The constructor will
instance the feed and default document handler.java.io.IOException
- if an input error occursjava.lang.ClassNotFoundException
- if the feeder fails to loadprotected WireFeeder(java.lang.String conf) throws java.io.IOException, java.lang.ClassNotFoundException, java.io.FileNotFoundException
WireFeeder
constructor accepts a config filename.conf
- a String
valuejava.io.IOException
- if an error occursjava.lang.ClassNotFoundException
- if an error occursjava.io.FileNotFoundException
- if an error occursMethod Detail |
protected DocHandler getDocHandler()
protected void setDocHandler() throws java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException
DOCHANDLER_PROPERTY
.java.lang.ClassNotFoundException
- if missingjava.lang.IllegalAccessException
- if security errorjava.lang.InstantiationException
- if constructor failsjava.lang.NoSuchMethodException
- if no getInstancejava.lang.reflect.InvocationTargetException
- if other errorprotected void setDocHandler(java.lang.String dh) throws java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException
setDocHandler
: set the handler to a class from the
class name.dh
- a classname String
valuejava.lang.ClassNotFoundException
- if missingjava.lang.IllegalAccessException
- if security errorjava.lang.InstantiationException
- if constructor failsjava.lang.NoSuchMethodException
- if no getInstancejava.lang.reflect.InvocationTargetException
- if other errorprotected SportwireFeed getFeed()
protected void setFeed() throws java.lang.ClassNotFoundException, java.lang.NoSuchMethodException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
FEEDCLASS_PROPERTY
java.lang.ClassNotFoundException
- if missingjava.lang.NoSuchMethodException
- if no getInstancejava.lang.IllegalAccessException
- if security errorjava.lang.reflect.InvocationTargetException
- if other error occursprotected void setFeed(java.lang.String f) throws java.lang.ClassNotFoundException, java.lang.NoSuchMethodException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
setFeed
: set the feed by name, invoking the
getInstance (the class is assumed to be a Singleton pattern)f
- a String
valuejava.lang.ClassNotFoundException
- if missingjava.lang.NoSuchMethodException
- if no getInstancejava.lang.IllegalAccessException
- if security errorjava.lang.reflect.InvocationTargetException
- if other error occursprotected DocQueue getQueue()
getQueue
: access the document queue.DocQueue
valueprotected org.apache.commons.collections.ExtendedProperties getConfig()
getConfig
: Access the properties list.protected void setConfig(org.apache.commons.collections.ExtendedProperties v)
v
- Value to assign to config.private void loadProperties(java.lang.String conf) throws java.io.IOException, java.io.FileNotFoundException
protected void loadIgnoreList(java.lang.String ignoreFile)
loadIgnoreList
: Loads in and pre-compiles a list
of perl expressions that specify document tags to ignore. For
most feeds, the tag is the systemID of the DocType; for ESPN,
the tag is the keyword slug.ignoreFile
- a String
filename valueprivate boolean onIgnoreList(java.lang.String doctag)
private void loadRegexMap(org.apache.commons.collections.ExtendedProperties conf)
protected void readFeed() throws java.io.IOException
readFeed
rips through the continuous stream of
input until the read function starts returning consecutive
nulls, which probably means we are out of input; when input
runs out, we flag the workers to exit and return to await job
completion.java.io.IOException
- if an error occursprivate static void setLogging(boolean debug)
setLogging
loads filters and appenders from the
property file specified by wirefeeder.log4j.conf.
If debug
is false, messages below WARN
priority will be suppressed. This can be undone in a
production releasey through the
log4j.disableOverride
property.public static void usage()
usage
: print the command line options to stderrpublic java.util.Map status()
status
: XMLRPC method to report on the system
status; called as sportwire.status
from
localhost:8484/
, this returns a few uptime
diagnostics useful for ensuring the system is still alive.Map
valueprivate void startWatchdog()
public static void main(java.lang.String[] argv)
argv
- a String[]
of ignored command line parms
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Javadocs generated Tue Apr 23 01:08:36 EDT 2002 by garym@maya.dyndns.org
Copyright © 2002 Canadian Broadcasting Corp