|
IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.btt.base.TraceFile
class TraceFile
This class is implemented to write the trace lines to a disk file. There is a maximum number of lines that can be written into the file, when this number is reached then the file is closed and a new file is opened, until it reaches the maximum number of log files.
Constructor Summary | |
---|---|
TraceFile()
This constructor creates a TraceFile object. |
Method Summary | |
---|---|
protected void |
changeFile()
Changes the name of the log file. |
void |
close()
Closes all the streams opened by the trace file. |
protected void |
createBackup()
Creates a backup, rename the current log filename to a '.bak' extension. |
void |
finalize()
Free all the resources used by the class. |
static java.lang.String |
getEndLine()
Get the O.S. name in order to return the End Of Line for that O.S. |
static int |
getEndLineLength()
Returns the width of the end line trailer depending the O.S. |
java.lang.String |
getFileName()
Returns the name of the current log file. |
protected int |
getLinesWritten()
Returns the number of lines written in the current log file. |
int |
getLineWidth()
Return the width of a line in characters. |
void |
open()
Opens the file of trace. |
void |
reset()
Resets all the settings & resources used by the class. |
void |
setLineWidth(int length)
Sets the width of a line in characters. |
void |
trace(java.lang.String line)
Does all the process necesary to write 'line' into a file. |
void |
trace(java.lang.String line,
java.util.Date date)
Does all the process necesary to write 'line' into a file. |
protected static java.lang.String |
unformatFileName(java.lang.String nameFmt,
java.util.Calendar now,
int order)
Returns the unformatted filename using a date and an order. |
protected static boolean |
usesDate(java.lang.String nameFmt)
Checks if the format uses a date. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TraceFile() throws java.lang.Exception
java.lang.Exception
- - The file can't be createdMethod Detail |
---|
protected void changeFile() throws java.io.IOException
java.io.IOException
- - If it can't change the filenamepublic void close()
protected void createBackup()
public void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
- If can't free the resources.public static java.lang.String getEndLine()
public static int getEndLineLength()
The result is the same as getting the string length result of the getEndLine() method.
public java.lang.String getFileName()
protected int getLinesWritten()
public int getLineWidth()
public void open()
public void reset()
public void setLineWidth(int length)
length
- intpublic void trace(java.lang.String line)
line
- java.lang.Stringpublic void trace(java.lang.String line, java.util.Date date)
line
- java.lang.Stringdate
- java.util.Dateprotected static java.lang.String unformatFileName(java.lang.String nameFmt, java.util.Calendar now, int order)
nameFmt
- java.lang.Stringnow
- java.util.Calendarorder
- int
protected static boolean usesDate(java.lang.String nameFmt)
nameFmt
- java.lang.String
|
IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |