|
![]() |
|||||||||
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.componentmanager.XMLCache
public class XMLCache
An XMLCache to cut down the cost of XML parsing. This class tries to ensure we only parse a String of XML into an XML packet once.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
Thread.State, Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
private HashMap |
_hashA
Our primary HashMap |
private HashMap |
_hashB
Our secondary HashMap |
private static XMLCache |
_instance
Reference to our instance - we're a singleton. |
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. |
private boolean |
_running
We can set this to false to stop the Thread |
private XMLPacketMaker |
_xmlPacketMaker
A reference to an XMLPacketMaker which we can use to generate XMLPackets from XML Strings |
int |
DEFAULT_CLEANUP_PERIOD
The default period for cleaning out old XMLPackets |
static String |
REVISION
The current CVS revision of this class |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
private |
XMLCache()
A private constructor to start this class up |
Method Summary | |
---|---|
static XMLCache |
getInstance()
Return a reference to our singleton. |
XMLPacket |
getXMLPacket(String xml)
Generates an XMLPacket from a given String of XML, checking to see if it already has the XMLPacket cached. |
void |
run()
Main loop for the thread to clean out old XMLPackets. |
String |
toString()
Overrides the Object.toString()
method to provide clean logging (every class should have this). |
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_CLEANUP_PERIOD
private static XMLCache _instance
private HashMap _hashA
private HashMap _hashB
private XMLPacketMaker _xmlPacketMaker
private boolean _running
private String _name
private Logger _logger
Constructor Detail |
---|
private XMLCache()
Method Detail |
---|
public static XMLCache getInstance()
public void run()
run
in interface Runnable
run
in class Thread
public 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
public XMLPacket getXMLPacket(String xml) throws InvalidXMLException
xml
- A String of XML data
InvalidXMLException
- if the XML does not parse
|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |