|
Jcontract API | |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jcontract.RuntimeHandler | +--jcontract.LogRuntimeHandler
A non-intrusive RuntimeHandler.
Logs all the contract violations into a "./jcontract.log" file.
The logging information also includes the instrumented classes loaded,
environment information and statistics collected while running the program.
Constructor Summary | |
LogRuntimeHandler()
|
Method Summary | |
void |
contractViolation(java.lang.RuntimeException exception)
Logs the contract violated |
protected java.io.PrintStream |
getLogStream()
Returns the current log stream |
protected void |
instrumentedClassLoaded(java.lang.String class_name)
Logs the name of the class |
protected void |
log()
logs an empty line |
protected void |
log(java.lang.String line)
Logs a line to the log stream |
protected boolean |
logActive()
Returns true if the log stream is not null |
protected void |
logViolation(java.lang.RuntimeException exception)
Logs the contract violation described by the exception |
java.io.PrintStream |
makeLogStream()
Returns the default log PrintStream (the file "jcontract.log"). Override this method if you want the log PrintStream to go to a different stream. |
protected void |
shutdownAction()
Prints the RuntimeStatistics for this Runtime Handler |
protected void |
startAction()
Prints the JContract's Copyright message |
Methods inherited from class jcontract.RuntimeHandler |
documentedExceptionThrown, getRuntimeStatistics |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LogRuntimeHandler()
Method Detail |
public void contractViolation(java.lang.RuntimeException exception)
contractViolation
in class RuntimeHandler
jcontract.RuntimeHandler
exception
- the exception that describes the contract violatedprotected final java.io.PrintStream getLogStream()
protected final void instrumentedClassLoaded(java.lang.String class_name)
instrumentedClassLoaded
in class RuntimeHandler
jcontract.RuntimeHandler
class_name
- name of the class being loadedprotected final void log()
protected final void log(java.lang.String line)
line
- line to be loggedprotected final boolean logActive()
true
if the log stream is not nullprotected final void logViolation(java.lang.RuntimeException exception)
public java.io.PrintStream makeLogStream() throws java.io.IOException
protected void shutdownAction()
shutdownAction
in class RuntimeHandler
protected void startAction()
startAction
in class RuntimeHandler
|
Jcontract API | |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |