|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--TwilightMinds.Log.Log
An instance of the Log abstract class provides the functionality to represent a
single log. It stores LogEntry objects that are passed to it and runs as a
thread to record and ease these objects. Information that cannot be recorded
is written to System.err as a last resort.
Working Log classes are derived from the Log class by overwriting the private
recordLogEntry(LogEntry logentry) method.
Author: Reason
Last Modified: 11/23/00
------------------------------------------------
Copyright (C) 2000 Twilight Minds. All rights reserved.
This Java package is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this package; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston,
MA 02111-1307 USA
Alternatively, a copy can be obtained from the Twilight Minds web
site:
http://www.twilightminds.com/GNU-LGPL.html
Twilight Minds Design Group
http://www.twilightminds.com/
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
Log(java.lang.String inputname)
The standard constructor for a Log object. |
|
Log(java.lang.String inputname,
long inputcycledelay)
Constructor allowing for specification of the cycle delay between periods of recording LogEntry objects. |
Method Summary | |
boolean |
addLogEntry(LogEntry logentry)
Add a LogEntry object to the queue waiting to be written. |
long |
getCycleDelay()
Return the delay in milliseconds between each cycle during which the Log writes out pending LogEntry objects to the log file. |
java.lang.String |
getLogName()
Return the identifying name of this log. |
boolean |
isLogging()
Return the state of the log. |
protected abstract void |
recordLogEntry(LogEntry logentry)
This abstract method must be overwritten in child classes to provide an implementation for writing the LogEntry information to a store, be that file, database, etc, etc. |
void |
run()
The run() method for this class runs through the LogEntry objects waiting to be recorded and deletes these objects as this happens. |
void |
setCycleDelay(long inputcycledelay)
Set the delay in milliseconds between each cycle during which the Log writes out pending LogEntry objects to the log file. |
void |
startLogging()
Set this Log object to accept new LogEntry objects and begin running as a thread while writing to the log file. |
void |
stopLogging()
Set this Log object to reject new LogEntry objects. |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Log(java.lang.String inputname)
public Log(java.lang.String inputname, long inputcycledelay)
Method Detail |
public java.lang.String getLogName()
public boolean isLogging()
public void startLogging()
public void stopLogging()
public long getCycleDelay()
public void setCycleDelay(long inputcycledelay)
public boolean addLogEntry(LogEntry logentry)
public void run()
run
in class java.lang.Thread
protected abstract void recordLogEntry(LogEntry logentry) throws java.lang.Exception
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |