patterntesting.runtime.log
Class LazyObjectRecorder

Package class diagram package LazyObjectRecorder
java.lang.Object
  extended by java.lang.Thread
      extended by patterntesting.runtime.log.AbstractLogger
          extended by patterntesting.runtime.log.ObjectRecorder
              extended by patterntesting.runtime.log.LazyObjectRecorder
All Implemented Interfaces:
Runnable

public class LazyObjectRecorder
extends ObjectRecorder

In contradiction to ObjectRecorder 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)

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
LazyObjectRecorder()
          Instantiates a new lazy object recorder.
LazyObjectRecorder(File logFile)
          Instantiates a new lazy object recorder.
LazyObjectRecorder(OutputStream ostream)
          Instantiates a new lazy object recorder.
 
Method Summary
 void log(JoinPoint joinPoint, 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, run, save
 
Methods inherited from class patterntesting.runtime.log.AbstractLogger
createTempLogFile, getLogStream, getStreamFor, toString
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, yield
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LazyObjectRecorder

public LazyObjectRecorder()
Instantiates a new lazy object recorder.


LazyObjectRecorder

public LazyObjectRecorder(File logFile)
Instantiates a new lazy object recorder.

Parameters:
logFile - the log file

LazyObjectRecorder

public LazyObjectRecorder(OutputStream ostream)
Instantiates a new lazy object recorder.

Parameters:
ostream - the ostream
Method Detail

log

@NullArgsAllowed
public void log(JoinPoint joinPoint,
                                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 class ObjectRecorder
Parameters:
joinPoint - the joinpoint
returnValue - the return value ObjectPlayer 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.



Copyright © 2002–2014 PatternTesting Team. All rights reserved.