com.ptc.windchill.upgrade.util
Class AdvisoryLog

java.lang.Object
  extended bycom.ptc.windchill.upgrade.util.AdvisoryLog

public class AdvisoryLog
extends Object


Field Summary
private static String ADVISORY_LOG_NAME
           
private static Object lock
           
private  File logFile_
           
private static SoftReference singleton
           
private  BufferedWriter writer_
           
 
Constructor Summary
private AdvisoryLog()
           
 
Method Summary
 void close()
           
protected  void finalize()
           
 File getFile()
          Reports the underlying log file incase a client wishes to report this file to users.
static AdvisoryLog getLog()
          Obtains a hard reference to the log creating it if needed.
 void logIssue(Object caller_or_calling_class, String message)
          Log the issue.
 void logIssue(Object caller_or_calling_class, String[] multi_line_message)
          Log the issue.
static void main(String[] args)
           
private  void openIfNeeded()
           
private  void writeIssueHeader(Object caller_or_calling_class)
           
private  void writeLine(String line)
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ADVISORY_LOG_NAME

private static final String ADVISORY_LOG_NAME
See Also:
Constant Field Values

lock

private static Object lock

singleton

private static SoftReference singleton

logFile_

private File logFile_

writer_

private BufferedWriter writer_
Constructor Detail

AdvisoryLog

private AdvisoryLog()
             throws IOException,
                    FileNotFoundException
Method Detail

openIfNeeded

private void openIfNeeded()
                   throws IOException
Throws:
IOException

getLog

public static AdvisoryLog getLog()
                          throws IOException,
                                 FileNotFoundException
Obtains a hard reference to the log creating it if needed. Clients should cache their reference to the log if they will be using it frequently repeatedly

Throws:
IOException
FileNotFoundException

getFile

public File getFile()
Reports the underlying log file incase a client wishes to report this file to users. Clients should not manipulate this file directly.


writeLine

private void writeLine(String line)
                throws IOException
Throws:
IOException

writeIssueHeader

private void writeIssueHeader(Object caller_or_calling_class)
                       throws IOException
Throws:
IOException

logIssue

public void logIssue(Object caller_or_calling_class,
                     String[] multi_line_message)
              throws IOException
Log the issue. Will (re)open the log as necessary.

Parameters:
caller_or_calling_class - the caller (if an instance), the caller's class (if in a static method), or can be null if traceability back to caller is unnecessary
Throws:
IOException

logIssue

public void logIssue(Object caller_or_calling_class,
                     String message)
              throws IOException
Log the issue. Will (re)open the log as necessary.

Parameters:
caller_or_calling_class - the caller (if an instance), the caller's class (if in a static method), or can be null if traceability back to caller is unnecessary
Throws:
IOException

finalize

protected void finalize()
                 throws Throwable
Throws:
Throwable

close

public void close()

main

public static void main(String[] args)