Class LazyObjectRecorder

  • All Implemented Interfaces:
    java.lang.AutoCloseable, java.lang.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

        java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
    • Field Summary

      • Fields inherited from class java.lang.Thread

        MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
    • 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 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
      • 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​(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 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.