All Packages This Package Previous Next
Class sqlj.runtime.profile.util.AuditorInstaller
java.lang.Object
|
+----sqlj.runtime.profile.util.AuditorInstaller
- public class AuditorInstaller
- extends Object
- implements ProfileCustomizer
The auditor installer class is used as a command line utility to install
(or uninstall) debugging class-auditors into an existing set of binary
profiles. Once installed, all RTStatement and RTResultSet calls made
during application runtime will be logged to a file (or standard
output), which can then be inspected to verify expected behavior and
trace errors. Note that only those calls made to the underlying
RTStatement and RTResultSet call interface at runtime are audited. An
AuditedProfile instance is invoked at application runtime to pass calls
made by the runtime to the auditor instance. A PrintWriterAuditor is
used as the auditor instance.
The auditor installer utility is invoked as follows:
% java sqlj.runtime.profile.util.AuditorInstaller [options] profile.ser...
Auditor installer options are as follows:
- -Cuninstall
- Removes the debugging class-auditors that were installed during the
last invocation of the auditor installer utility. If this option is not
specified, class-auditors are installed rather than removed. If the
uninstall option is used, all other options are ignored.
- -Clog=logFileName
- Specifies the name of the log file into which call audits will be
appended at runtime. If this option is not specified, audits will be
written to standard out at runtime. Note that audits are appended to
the log file rather than creating a new log file for each program run.
Appending allows multiple program runs to be logged in the same file,
and also allows two debugging auditors to write the same log during the
same program run.
- -Cprefix=auditorLogPrefixString
- Specifies the prefix which will precede each audit line created by
this auditor installation. If this option is not specified, no prefix
is used. The prefix option is useful when multiple debugging auditors are
installed that write to the same log file.
- -Cdepth=debugLayeringDepth
- Specifies an integer number that identifies the profile layer
number to audit at runtime. Often a particular program will use a
number of different customized profile layers, each of which provides
some level of additional functionality to the runtime. Some calls made
to one layer will not be passed on to lower layers. By specifying a
depth option, it is possible to determine exactly what calls are being
made at a particular layer. If this option is not specified or the
number specified exceeds the layers available at runtime, the maximum
depth possible is used. A depth of -1 indicates to use maximum depth
possible. Use depth 0 to audit the sequence of calls issued directly
from the SQLJ runtime engine and code generation.
Note that the AuditorInstaller utility is a Customizer that uses the
CustomizerHarness to map itself over a series of profiles. Accordingly,
it also inherits all of the options made available by the
CustomizerHarness.
Usage notes:
- Each time this utility is invoked (without the -uninstall option),
it installs another debugging auditor; previously installed auditors are
not removed. When a program is run for which mutliple debugging
auditors are installed, all of the auditors installed will be used.
This feature can be used to debug different aspects of the program at
the same time. A useful application of this feature is to install a
different debug auditor for each runtime layer (see the depth option
above).
- Debugging auditors can only be removed by invoking this utility
with the -uninstall option. Note that the -uninstall option only
removes the last auditor installed. To remove all debugging auditors
installed in a profile, reissue the command using the -unistall option
until an "unchanged" message is reported for the profile in question.
- See Also:
- Auditor, AuditedProfile, PrintWriterAuditor, CustomizerHarness
-
AuditorInstaller()
-
-
acceptsConnection(Connection)
-
-
customize(Profile, Connection, ErrorLog)
- Customizes the passed profile.
-
getDepth()
-
-
getLog()
-
-
getPrefix()
-
-
getUninstall()
-
-
main(String[])
-
The main command-line entry point for this method.
-
newCustomization(Customization)
- Returns a new audited customization object which will wrap the passed
customization.
-
setDepth(int)
-
-
setLog(String)
-
-
setPrefix(String)
-
-
setUninstall(boolean)
-
AuditorInstaller
public AuditorInstaller()
acceptsConnection
public boolean acceptsConnection(Connection conn)
getUninstall
public boolean getUninstall()
setUninstall
public void setUninstall(boolean uninstall)
getLog
public String getLog()
setLog
public void setLog(String logFileName)
getPrefix
public String getPrefix()
setPrefix
public void setPrefix(String auditPrefix)
getDepth
public int getDepth()
setDepth
public void setDepth(int debugDepth)
customize
public boolean customize(Profile p,
Connection conn,
ErrorLog log)
- Customizes the passed profile. If installing, a new audited
customization wraps and replaces each customization currently
registered in the profile, and a catch-all audited customization is
added to the end of the list for the default case. If de-installing,
each audited customization instance registered in the profile is
replaced with the customization it wraps.
- Returns:
- s true if profile was customized, false otherwise.
newCustomization
protected AuditorInstaller. AuditedCustomization newCustomization(Customization wrappedCustomization)
- Returns a new audited customization object which will wrap the passed
customization. The audited customization returned will be installed into
the profile in place of the passed customization argument. Subclasses
should override this method if a different audited customization instance
is desired.
main
public static void main(String args[])
- The main command-line entry point for this method. See the class
overview for a description of the command-line options and
functionality.
All Packages This Package Previous Next