com.maintainj.aspect
Class JoinPointMap

java.lang.Object
  extended by com.maintainj.aspect.JoinPointMap

public class JoinPointMap
extends java.lang.Object

Holds multiple JoinPointList instances one for each thread.
Also used as a utility class to write to trace file.

Author:
Choudary Kothapalli

Field Summary
static int jpHashcode
           
static long jpIndex
           
 
Constructor Summary
JoinPointMap()
           
 
Method Summary
static void addToMergedJPList(ISequenceJoinPoint jp)
           
static void clear()
          Clears all lists and sets the jpHashcode to zero.
static JoinPointList get(int threadId, java.lang.String threadName)
          Gets the JoinPointList for the given threadId.
static boolean getAddJoinPoint()
          Returns true if join points should be added to list
static boolean isEmpty()
          Returns true if there is no trace information.
static void main(java.lang.String[] args)
           
static void setAddJoinPoint(boolean addJp)
          Sets if join points should be added to this list
static void splitJPFile(java.lang.String traceFile, int chunkSize)
           
static java.lang.String[][] writeToFile(java.lang.String fileName)
          Writes the join points of the use case to a file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

jpHashcode

public static int jpHashcode

jpIndex

public static long jpIndex
Constructor Detail

JoinPointMap

public JoinPointMap()
Method Detail

addToMergedJPList

public static void addToMergedJPList(ISequenceJoinPoint jp)

clear

public static void clear()
Clears all lists and sets the jpHashcode to zero. Call this method after writing the call lists to trace file.


get

public static JoinPointList get(int threadId,
                                java.lang.String threadName)
Gets the JoinPointList for the given threadId. If so such list is found, it automatically creates an empty list and returns that list.

Parameters:
threadId - id of the thread for which JoinPointList is needed
threadName - name of the thread for which JoinPointList is needed
Returns:
JoinPointList instance of the given thread id and name

getAddJoinPoint

public static boolean getAddJoinPoint()
Returns true if join points should be added to list

Returns:
true if join points should be added to list

isEmpty

public static boolean isEmpty()
Returns true if there is no trace information.

Returns:

main

public static void main(java.lang.String[] args)

setAddJoinPoint

public static void setAddJoinPoint(boolean addJp)
Sets if join points should be added to this list

Parameters:
addJoinPoint - set to true if join points should be added to list. Set to false otherwise.

splitJPFile

public static void splitJPFile(java.lang.String traceFile,
                               int chunkSize)

writeToFile

public static java.lang.String[][] writeToFile(java.lang.String fileName)
Writes the join points of the use case to a file. One trace file for each thread in the use case is generated. One trace file with all the calls in all threads also is generated with name _AllThreads.ser appended to the given file name. Returns an String[][] where String[][0] is the ser file name and String[][1] is the size of the jp list.

Parameters:
fileName - name of the trace file. Do not give any extension. The extension .ser is automatically added to the file name.