|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
uk.org.iscream.cms.server.client.WebFeeder
public class WebFeeder
Provides a feed to the webpage system.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
Thread.State, Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
private static WebFeeder |
_instance
A reference to the single instance of this class |
private Logger |
_logger
This holds a reference to the system logger that is being used. |
private String |
_name
This is the friendly identifier of the component this class is running in. |
int |
DEFAULT_AGE
Delete alerts older than this in seconds, default. |
int |
DEFAULT_CHECK_PERIOD
Default check period in seconds (30 minutes) |
static String |
REVISION
The current CVS revision of this class |
private String |
sep
The default path seperator, here for convienience |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
private |
WebFeeder()
Construct a new WebFeeder. |
Method Summary | |
---|---|
private boolean |
deleteContents(File dir)
Iterates through dir (a directory) and deletes all files and subdirectories. |
static WebFeeder |
getInstance()
Return a reference to the single class. |
void |
receiveAlert(Alert alert)
Handles an Alert. |
void |
receiveXMLPacket(XMLPacket packet)
Handles an XMLPacket. |
void |
run()
Thread loop, will check at intervals for any files that need to be "cleaned up". |
String |
toString()
Overrides the Object.toString()
method to provide clean logging (every class should have this). |
private void |
writeData(File outDir,
File outFile,
String data)
Attempts to write "data" to "outFile" in "outDir". |
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, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String REVISION
public final int DEFAULT_CHECK_PERIOD
public final int DEFAULT_AGE
private final String sep
private String _name
private Logger _logger
private static WebFeeder _instance
Constructor Detail |
---|
private WebFeeder()
Method Detail |
---|
public static WebFeeder getInstance()
public void run()
run
in interface Runnable
run
in class Thread
public void receiveXMLPacket(XMLPacket packet)
packet
- the XMLPacket to writepublic void receiveAlert(Alert alert)
alert
- the Alert object to writepublic String toString()
Object.toString()
method to provide clean logging (every class should have this).
This uses the uk.org.iscream.cms.util.FormatName class
to format the toString()
toString
in class Thread
private void writeData(File outDir, File outFile, String data)
outDir
- the directory to put the file inoutFile
- the filename to put the data indata
- the String of data to writeprivate boolean deleteContents(File dir)
dir
- the directory to clear
|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |