ca.cbc.sportwire.servlet.data
Class Lineup

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--ca.cbc.sportwire.util.PeriodicData
              |
              +--ca.cbc.sportwire.servlet.data.Lineup
All Implemented Interfaces:
GlobalCacheProperties, LineupBean, java.lang.Runnable, SportPageProperties, Stoppable
Direct Known Subclasses:
ScriptLineup, TemplateLineup

public abstract class Lineup
extends PeriodicData
implements LineupBean, GlobalCacheProperties, SportPageProperties

Lineup: An abstract velocity interface to access the news lineups such that lineups are only refreshed periodically; the period of updates is set in the sportpage.conf as lineup.refresh=seconds

Created: Fri Dec 14 15:40:15 2001
 $Log: Lineup.java,v $
 Revision 1.14  2002/01/29 21:08:00  garym
 beans now loaded after topic context is built

 Revision 1.13  2002/01/26 06:46:29  garym
 authorization bug in lineups

 Revision 1.12  2002/01/24 19:50:20  garym
 Major restructuring of beans and pagehandlers

 Revision 1.11  2002/01/21 20:07:14  garym
 NewsPage did not include $news; fixed error reporting to be a redirect to 404

 Revision 1.10  2002/01/16 00:56:26  garym
 current site on cbc.ca/olympics; checkpoint release

 Revision 1.9  2002/01/14 21:51:46  garym
 bug fixes in topics and config files migration to Extended Properties

 Revision 1.8  2002/01/04 18:37:20  garym
 PeriodicData moved into sportwire.util package

 Revision 1.7  2002/01/03 03:36:25  garym
 Abstracted periodic-refresh data cache objects

 Revision 1.6  2001/12/23 17:55:23  garym
 Allow for multiple SportPage apps on one JVM

 Revision 1.5  2001/12/23 04:54:18  garym
 Added TemplateLineup support and Velocity logfile setting

 Revision 1.4  2001/12/17 17:50:13  garym
 Added date as vcal

 Revision 1.3  2001/12/17 09:36:26  garym
 default page bug fixed. debug msg errors in Lineup and vcal

 Revision 1.2  2001/12/16 22:01:56  garym
 fixes to default page handling

 Revision 1.1  2001/12/14 21:10:33  garym
 Implement error pages and skeletal lineup


 

Version:
$Id: Lineup.java,v 1.14 2002/01/29 21:08:00 garym Exp $
Author:
Gary Lawrence Murphy

Field Summary
(package private) static org.apache.log4j.Category cat
           
private  java.lang.String topic
           
 
Fields inherited from class ca.cbc.sportwire.util.PeriodicData
interval, running
 
Fields inherited from class java.lang.Thread
contextClassLoader, daemon, eetop, group, inheritableThreadLocals, inheritedAccessControlContext, MAX_PRIORITY, MIN_PRIORITY, name, NORM_PRIORITY, priority, single_step, stillborn, stopThreadPermission, target, threadInitNumber, threadLocals, threadQ, userDaemon
 
Fields inherited from interface ca.cbc.sportwire.servlet.data.LineupBean
DEFAULT_CATEGORY, DEFAULT_REFRESH, LINEUP_CATEGORY_VAR, LINEUP_CLASS_PROPERTY, LINEUP_REFRESH_PROPERTY, LINEUP_SCRIPT_PROPERTY, LINEUP_VAR
 
Fields inherited from interface ca.cbc.sportwire.servlet.data.GlobalCacheProperties
CACHE_DEFAULT_PERIOD, CACHE_DEFAULT_TIMEOUT, CACHE_PERIOD, CACHE_TIMEOUT, MRU_PROPERTY, MRU_VAR, TTL_PROPERTY, TTL_VAR
 
Fields inherited from interface ca.cbc.sportwire.servlet.data.SportPageProperties
BEAN_SUFFIX, BEANFACTORY_VAR, CONTEXT_VAR, DATE_VAR, DEFAULT_EXTS, DEFAULT_INDEXES, DEFAULT_PAGE_SUFFIX, DEFAULT_SAX_DRIVER_CLASS, DEFAULT_TIMEZONE, DEFAULT_TOPIC, DOM_VAR, ERROR_TEMPLATE_VAR, EXCEPTION_VAR, EXTENSIONS_VAR, FALSE, GLOBAL_VAR, HOME_PROPERTY, INCLUDE_EXTS_PROPERTY, INCLUDE_VAR, INDEX_INDICATOR_VAR, INDEX_TEMPLATE_VAR, LAYOUT_TEMPLATE_VAR, MACRO_LIB_PROPERTY, MISSING_TEMPLATE_VAR, OUTPUT_VAR, PAGE_EXPIRE, PAGE_TEMPLATE_VAR, PANIC_404_PAGE, PANIC_404_PROPERTY, PANIC_500_PAGE, PANIC_500_PROPERTY, PARAM_PARSER_VAR, PATH_VAR, REQUEST_VAR, RESPONSE_VAR, SAX_CLASS_PROPERTY, SERVLET_DEBUG, SERVLET_LOGCONF_PROPERTY, SQL_SUFFIX, TEMPLATE_PATHS_PROPERTY, TIMEZONE_PROPERTY, TRUE, URI_VAR, VELOCITY_LOGFILE_DEFAULT, VELOCITY_LOGFILE_PROPERTY, XML_EXTS, XML_EXTS_PROPERTY, XML_PATHS_PROPERTY, XML_SUFFIX, XSL_EXTS, XSL_EXTS_PROPERTY, XSL_PATHS_PROPERTY
 
Constructor Summary
protected Lineup()
          Lineup null constructor does nothing.
  Lineup(org.apache.commons.collections.ExtendedProperties sc, java.lang.String category)
          Lineup category constructor sets the topic and starts the refresh thread.
protected Lineup(java.lang.String category, int period)
          Lineup constructor
 
Method Summary
protected static int defaultPeriod(org.apache.commons.collections.ExtendedProperties sc)
          defaultPeriod:
protected static Lineup getCached(org.apache.velocity.context.Context context, java.lang.Class lineupclass)
          getCached:
protected static Lineup getCached(java.lang.String category, org.apache.velocity.context.Context context, java.lang.Class lineupclass)
           
protected static java.lang.String getCategory(org.apache.velocity.context.Context context)
          getCategory:
static Lineup getInstance(org.apache.velocity.context.Context context)
          getInstance:
abstract  java.lang.Object getLineup()
          getLineup: this is the method used by the Velocity pages as $news.lineup to insert a pre-formatted block of HTML containing the full lineup.
protected  java.lang.String getTopic()
          The Lineup topic is set from the category and is intended for setting the lineup category.
protected  void refresh()
          refresh:
protected abstract  void setLineup()
          setLineup: protected method called by the interval timer to refresh the internal state of the Lineup object.
protected  void setTopic(java.lang.String v)
          Set the value of topic using a protected method; only the server should set the topic, most often with the category.
 
Methods inherited from class ca.cbc.sportwire.util.PeriodicData
bump, isRunning, run, setInterval, setRunning
 
Methods inherited from class java.lang.Thread
, activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, exit, getContextClassLoader, getName, getPriority, getThreadGroup, init, interrupt, interrupt0, interrupted, isAlive, isDaemon, isInterrupted, isInterrupted, join, join, join, nextThreadNum, registerNatives, resume, resume0, setContextClassLoader, setDaemon, setName, setPriority, setPriority0, sleep, sleep, start, stop, stop, stop0, suspend, suspend0, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

cat

static org.apache.log4j.Category cat

topic

private java.lang.String topic
Constructor Detail

Lineup

protected Lineup()
Lineup null constructor does nothing.

Lineup

public Lineup(org.apache.commons.collections.ExtendedProperties sc,
              java.lang.String category)
Lineup category constructor sets the topic and starts the refresh thread.
Parameters:
sc - the global ExtendedProperties value
category - a String news category key

Lineup

protected Lineup(java.lang.String category,
                 int period)
Lineup constructor
Parameters:
category - a String value
period - an int value
Method Detail

refresh

protected void refresh()
refresh:
Overrides:
refresh in class PeriodicData

getLineup

public abstract java.lang.Object getLineup()
getLineup: this is the method used by the Velocity pages as $news.lineup to insert a pre-formatted block of HTML containing the full lineup.
Returns:
a Object with the lineup representation

setLineup

protected abstract void setLineup()
setLineup: protected method called by the interval timer to refresh the internal state of the Lineup object.

getTopic

protected java.lang.String getTopic()
The Lineup topic is set from the category and is intended for setting the lineup category.
Returns:
String value of topic.

setTopic

protected void setTopic(java.lang.String v)
Set the value of topic using a protected method; only the server should set the topic, most often with the category.
Parameters:
v - Value to assign to topic.

defaultPeriod

protected static int defaultPeriod(org.apache.commons.collections.ExtendedProperties sc)
defaultPeriod:
Parameters:
sc - an ExtendedProperties value
Returns:
an int value

getCategory

protected static java.lang.String getCategory(org.apache.velocity.context.Context context)
getCategory:
Parameters:
context - a Context value
Returns:
a String value

getCached

protected static Lineup getCached(org.apache.velocity.context.Context context,
                                  java.lang.Class lineupclass)
getCached:
Parameters:
context - a Context value
lineupclass - a Class value
Returns:
a Lineup value

getCached

protected static Lineup getCached(java.lang.String category,
                                  org.apache.velocity.context.Context context,
                                  java.lang.Class lineupclass)

getInstance

public static Lineup getInstance(org.apache.velocity.context.Context context)
getInstance:
Parameters:
context - a Context value
Returns:
a Lineup value