patterntesting.runtime.log
Class SequenceGrapher

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

public class SequenceGrapher
extends AbstractLogger

This class supports the creation of simple sequence diagrams as desribed in the user manual of UML Graph.

Since:
1.3.1 (06.09.2013)
Author:
oliver

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
SequenceGrapher()
          Instantiates a new SequenceGrapher.
SequenceGrapher(File logFile)
          Instantiates a new SequenceGrapher.
SequenceGrapher(File logFile, String resource)
          Instantiates a new sequence grapher.
SequenceGrapher(OutputStream ostream)
          Instantiates a new object logger to the given stream.
SequenceGrapher(OutputStream ostream, String resource)
          /** Instantiates a new sequence grapher.
 
Method Summary
 void close()
          Closes the stream with the logged objects.
 void createMessage(JoinPoint call, Object result)
          Logs the creation of an object in the created sequence diagram.
 void createMessage(Object creator, Object createdObject)
          Logs the creation of an object in the created sequence diagram.
 void execute(JoinPoint execution)
          Trys to log the call of the given excecution joinpoint.
 void message(JoinPoint call)
          Logs the call of a method to the generated sequence diagram.
 void message(Object caller, JoinPoint call)
          Logs the call of a method to the generated sequence diagram.
 void message(Object sender, Object target, String methodName, Object[] args)
          Logs the call of a method to the generated sequence diagram.
 void returnMessage(JoinPoint call)
          Logs the return arrow from the last call to the generated sequence diagram.
 void returnMessage(JoinPoint call, Object returnValue)
          Logs the return arrow from the last call to the generated sequence diagram.
 void returnMessage(Object returnee, Object returnValue)
          Return message.
 void run()
          This method is called at shutdown to close the open writer.
 void setExcludeFilter(String[] pattern)
          Sets the exclude filter.
 
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

SequenceGrapher

public SequenceGrapher()
Instantiates a new SequenceGrapher. The generated sequence diagram is stored in a temporary file.


SequenceGrapher

public SequenceGrapher(File logFile)
Instantiates a new SequenceGrapher. The generated sequence diagram is stored in the given log file.

Parameters:
logFile - the log file

SequenceGrapher

public SequenceGrapher(File logFile,
                       String resource)
Instantiates a new sequence grapher. The header for the generated diagram is read from the given resource:

Parameters:
logFile - the log file
resource - the resource ("seq-head.template" or "seq-head-small")

SequenceGrapher

public SequenceGrapher(OutputStream ostream)
Instantiates a new object logger to the given stream.

Parameters:
ostream - the ostream

SequenceGrapher

public SequenceGrapher(OutputStream ostream,
                       String resource)
/** Instantiates a new sequence grapher. The header for the generated diagram is read from the given resource:

Parameters:
ostream - the ostream
resource - the resource ("seq-head.template" or "seq-head-small")
Method Detail

setExcludeFilter

public void setExcludeFilter(String[] pattern)
Sets the exclude filter. Classes which matches the filter will not appear in the generated sequence diagram.

Parameters:
pattern - the new exclude filter
Since:
1.4.1

run

public void run()
This method is called at shutdown to close the open writer.

Specified by:
run in interface Runnable
Overrides:
run in class AbstractLogger
See Also:
Thread.run()

close

public void close()
Closes the stream with the logged objects.

Overrides:
close in class AbstractLogger

createMessage

public void createMessage(JoinPoint call,
                          Object result)
Logs the creation of an object in the created sequence diagram.

Parameters:
call - the call
result - the created object

createMessage

public void createMessage(Object creator,
                          Object createdObject)
Logs the creation of an object in the created sequence diagram.

Parameters:
creator - the creator
createdObject - the created object

execute

public void execute(JoinPoint execution)
Trys to log the call of the given excecution joinpoint. For this reason we must find the caller which is a little bit tricky. We use the classname of the mapped variable names to guess which could be the caller.

Parameters:
execution - the execution joinpoint

message

public void message(JoinPoint call)
Logs the call of a method to the generated sequence diagram.

Parameters:
call - the call

message

public void message(Object caller,
                    JoinPoint call)
Logs the call of a method to the generated sequence diagram.

Parameters:
caller - the caller
call - the call

message

public void message(Object sender,
                    Object target,
                    String methodName,
                    Object[] args)
Logs the call of a method to the generated sequence diagram.

Parameters:
sender - the sender
target - the target
methodName - the method name
args - the args

returnMessage

public void returnMessage(JoinPoint call)
Logs the return arrow from the last call to the generated sequence diagram.

Parameters:
call - the call

returnMessage

public void returnMessage(JoinPoint call,
                          Object returnValue)
Logs the return arrow from the last call to the generated sequence diagram.

Parameters:
call - the call
returnValue - the return value

returnMessage

public void returnMessage(Object returnee,
                          Object returnValue)
Return message.

Parameters:
returnee - the returnee
returnValue - the return value


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