|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK 11g Release 2 (11.1.2.2.0) E17493-03 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.jdeveloper.audit.analyzer.Analyzer
public abstract class Analyzer
A visitor over the Audit object models which verifies rules and/or computes metrics. An analyzer subclass implements visitor methods which are invoked by the Audit framework as it traverses the Audit object models. The visitor methods report violations and measurements using the reporting methods of a context object passed to them. Besides implementing the visitor methods, an analyzer subclass exposes its rules and metrics for the framework to configure. Analyzers are registered with the AuditManager at startup by IDE extensions.
Analyzer Configuration
The getRules
and getMetrics
methods supply the framework with the rules and metrics of the Analyzer. The framework configures the instances returned to reflect the profile selected by the user for the current traversal. An analyzer should hold references to the instances returned both to use when reporting violations and measurements and to get the current values of properties which affect the operation of the analyzer. Note that each analyzer instance should create unique rule and metric instances.
Visitor Methods
The visitor methods are the enter
and exit
methods. The Audit framework traverses the constructs of the object models corresponding to the nodes being audited and at each construct invokes the applicable enter
and exit
methods of each registered analyzer. As the traversal enters a construct, it invokes the enter
method from each analyzer with the most specific type matching the construct. As the traversal exits a construct, it likewise invokes all exit
methods with the most specific type matching the construct. The enter and exit methods actually accept two parameters: a context parameter of type AuditContext
, and a construct parameter of any type. A method matches a construct if the type of the construct is assignable to the type of the construct parameter and if no construct type of an alternative method is assignable to the type of the construct parameter.
The traversal is depth-first, which means that contained models are visited after invoking the containing construct's enter
methods (if any) but before invoking the containing construct's exit
methods (if any). A typical analyzer will collect information as the traversal proceeds down, in enter
methods; and produce violations or measurements as the traversal proceeds back up, in exit
methods. This collected information can be shared between visitor methods through instance fields declared in the analyzer subclass, or through the attribute methods of the context object passed to the visitor method. See AuditContext
.
Constructor Summary | |
---|---|
Analyzer() |
Method Summary | |
---|---|
void |
cancel() Notifies this analyzer that the audit that created it has been cancelled. |
Metric[] |
getMetrics() Deprecated. Use <audit-hook> in extension.xml. |
Rule[] |
getRules() Deprecated. Use <audit-hook> in extension.xml. |
boolean |
isApplicationContentSupported() Gets whether this analyzer supports analyzing application content files. |
boolean |
isCancelled() Gets whether cancel() has been invoked. |
boolean |
isEnabled() Gets whether this analyzer is enabled. |
void |
setEnabled(boolean enabled) Sets whether this analyzer is enabled. |
boolean |
startTask(AuditTaskContext context) Executes a post-traversal background task. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Analyzer()
Method Detail |
---|
public boolean startTask(AuditTaskContext context)
cancel()
to allow the background task to be cancelled. The task should report issues using the AuditTaskContext
report methods, and should report completion using the AuditTaskContext.taskCompleted()
method.public void cancel()
Analyzer
implementation ensures that isCancelled() returns true after it is invoked. Analyzers that override startTask(oracle.jdeveloper.audit.analyzer.AuditTaskContext)
should also override cancel()
to cancel the background task.AuditContext.isCancelled()
public boolean isCancelled()
cancel()
has been invoked.public boolean isApplicationContentSupported()
Analyzer
implementation returns false.public Rule[] getRules()
Analyzer
implementation returns null.
Properties of the rule instances returned will be set to the values configured by the user for the current invocation.
public Metric[] getMetrics()
Analyzer
implementation returns null.
Properties of the metric instances returned will be set to the values configured by the user for the current invocation.
public boolean isEnabled()
setEnabled(boolean)
public void setEnabled(boolean enabled)
Note that calling setEnabled(false) from an exit method is pointless (it will be reenabled as soon as the exit method returns), and calling setEnabled(true) from an enter or an exit method is also pointless (if the analyzer is not enabled, the enter or exit method will not be invoked in the first place).
isEnabled()
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK 11g Release 2 (11.1.2.2.0) E17493-03 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |