Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.0.0)

E17493-01

oracle.javatools.logging
Class Diagnostics

java.lang.Object
  extended by oracle.javatools.logging.Diagnostics

public final class Diagnostics
extends java.lang.Object

Provides utilities for creating diagnostic files. Diagnostics are off by default.

Since:
11.1.1.0.0

Method Summary
static java.lang.String basicConfigurationData()
          Returns a String containing basic configuration data about the execution environment.
static java.io.File getDiagnosticDirectory()
          Returns the diagnostic directory.
static boolean isLockedFile(java.io.File file)
          Returns true if the specified file is a locked diagnostic file that should not be transmitted.
static boolean isOn()
          Returns true if the diagnostics are being saved in the diagnostics directory located in the system directory..
static java.io.File newFile(java.lang.String prefix)
          Creates a new diagnostic File.
static java.io.File newFile(java.lang.String prefix, java.lang.String suffix)
          Creates a new diagnostic File.
static java.io.File newLockedFile(java.lang.String prefix)
          Returns a diagnostic file which will be locked.
static void setDiagnosticDirectory(java.io.File diagnosticDirectory)
          Sets the directory to use for diagnostic files.
static java.lang.String systemProperties()
          Returns a String containing the names and values of all system properties defined in the current configuration.
static void writeBanner(java.io.Writer w, java.lang.String bannerText)
          Writes a banner to the specified writer.
static void writeSystemConfiguration(java.io.Writer w)
          Writes information about the current system configuration to the specified output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getDiagnosticDirectory

public static java.io.File getDiagnosticDirectory()
Returns the diagnostic directory.


setDiagnosticDirectory

public static void setDiagnosticDirectory(java.io.File diagnosticDirectory)
Sets the directory to use for diagnostic files. The directory will be created as a side effect of calling this method.

Parameters:
diagnosticDirectory - the directory to use for diagnostic files.
Throws:
java.lang.IllegalArgumentException - if the diagnosticDirectory exists and is not a directory, or does not exist and could not be created.

isLockedFile

public static boolean isLockedFile(java.io.File file)
Returns true if the specified file is a locked diagnostic file that should not be transmitted.

Parameters:
file -

isOn

public static boolean isOn()
Returns true if the diagnostics are being saved in the diagnostics directory located in the system directory..


newLockedFile

public static java.io.File newLockedFile(java.lang.String prefix)
Returns a diagnostic file which will be locked. A locked file will not be transmitted immediately to the diagnostics server. It will be unlocked when the VM exits, so that the next run of the ide can transmit it. Returns null if the file cannot be created, or if the diagnostics are off.

Parameters:
prefix -

newFile

public static java.io.File newFile(java.lang.String prefix,
                                   java.lang.String suffix)
Creates a new diagnostic File.

Parameters:
prefix - an identifying prefix for the file. May be null.
suffix - a suffix for the file. May be null.
Returns:
the file handle. May return null if the user cannot write to the diagnostic directory, or the diagnostic file already exists and cannot be written to, or if the diagnostics is turned off.

newFile

public static java.io.File newFile(java.lang.String prefix)
Creates a new diagnostic File.

Parameters:
prefix - an identifying prefix for the file.
Returns:
the file handle. May return null if the user cannot write to the diagnostic directory, or the diagnostic file already exists and cannot be written to.

writeBanner

public static void writeBanner(java.io.Writer w,
                               java.lang.String bannerText)
Writes a banner to the specified writer.

Parameters:
w - a writer to write to.
bannerText - the text for the banner.

writeSystemConfiguration

public static void writeSystemConfiguration(java.io.Writer w)
                                     throws java.io.IOException
Writes information about the current system configuration to the specified output stream.

Parameters:
w - a writer to write to.
Throws:
java.io.IOException

basicConfigurationData

public static java.lang.String basicConfigurationData()
Returns a String containing basic configuration data about the execution environment.

Returns:
a String containing configuration information.

systemProperties

public static java.lang.String systemProperties()
Returns a String containing the names and values of all system properties defined in the current configuration.

Returns:
a String containing the names and values of all system properties.

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.0.0)

E17493-01

Copyright © 1997, 2011, Oracle. All rights reserved.