Package patterntesting.runtime.log
Class LazyObjectRecorder
- java.lang.Object
-
- java.lang.Thread
-
- patterntesting.runtime.log.AbstractLogger
-
- patterntesting.runtime.log.ObjectRecorder
-
- patterntesting.runtime.log.LazyObjectRecorder
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,java.lang.Runnable
public class LazyObjectRecorder extends ObjectRecorder
In contradiction toObjectRecorder
this class only records joinpoints and return values if they are different from the last record. I.e. If a return value is always the same for the same joinpoint this pair is only recorded once.- Since:
- 1.3.1 (01.09.2013)
- Author:
- oliver (boehm@javatux.de)
-
-
Constructor Summary
Constructors Constructor Description LazyObjectRecorder()
Instantiates a new lazy object recorder.LazyObjectRecorder(java.io.File logFile)
Instantiates a new lazy object recorder.LazyObjectRecorder(java.io.OutputStream ostream)
Instantiates a new lazy object recorder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
log(org.aspectj.lang.JoinPoint joinPoint, java.lang.Object returnValue)
Both things are logged with this method: the call of a method (joinPoint) and the return value of this method.-
Methods inherited from class patterntesting.runtime.log.ObjectRecorder
close, save
-
Methods inherited from class patterntesting.runtime.log.AbstractLogger
createTempLogFile, getLogStream, run, toString
-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, yield
-
-
-
-
Constructor Detail
-
LazyObjectRecorder
public LazyObjectRecorder()
Instantiates a new lazy object recorder.
-
LazyObjectRecorder
public LazyObjectRecorder(java.io.File logFile)
Instantiates a new lazy object recorder.- Parameters:
logFile
- the log file
-
LazyObjectRecorder
public LazyObjectRecorder(java.io.OutputStream ostream)
Instantiates a new lazy object recorder.- Parameters:
ostream
- the ostream
-
-
Method Detail
-
log
@NullArgsAllowed public void log(org.aspectj.lang.JoinPoint joinPoint, java.lang.Object returnValue)
Both things are logged with this method: the call of a method (joinPoint) and the return value of this method. Constructors or method of type 'void' are not recorded because the have no return value.Because the given joinPoint cannot be used as key for a map in
- Overrides:
log
in classObjectRecorder
- Parameters:
joinPoint
- the joinpointreturnValue
- the return valueObjectPlayer
it is saved as string. As a side effect this will speedup the serialization stuff and shorten the generated record file.The given return value will be only stored if it is not the same as the last time.
-
-