com.maintainj.aspect
Class StackJoinPoint

java.lang.Object
  extended by com.maintainj.aspect.StackJoinPoint
All Implemented Interfaces:
ISequenceJoinPoint, java.io.Serializable

public class StackJoinPoint
extends java.lang.Object
implements ISequenceJoinPoint

Implementation for ISequenceJoinPoint.

Author:
Choudary Kothapalli
See Also:
Serialized Form

Constructor Summary
StackJoinPoint(long jpIndex, boolean isReturnCall, CallSignature signature, java.lang.String thisClass, java.lang.String targetClass, java.lang.String kind, int hashCode, int stackHashcode, java.lang.String threadId, int lineNumber, java.lang.String withinType)
          StackJoinPoint constructor
 
Method Summary
 boolean equals(java.lang.Object obj)
          Returns true if the given join point object is equal to this join point.
 CallSignature getCallSignature()
          Returns CallSignature for this join point
 long getEndTime()
          End time of this method call as returned by System.currentTimeMillis()
 int getLineNumber()
           
 ISequenceJoinPoint getMatchingJoinPoint()
          Returns the matching join point.
 long getResponseTime()
          Returns the response time of this method in milliseconds.
 java.lang.String getSourceLocation()
          The source file name and the line number where this call originates.
 long getStartTime()
          Start time of this method call as returned by System.currentTimeMillis()
 java.lang.String getTargetClass()
          Target class name
 java.lang.String getThisClass()
          Source class name
 java.lang.String getWithinType()
          The name of the class where this method is defined.
 int hashCode()
          This number is same for both normal and return calls and is unique in join point list.
 boolean isReturnCall()
          Returns true if this is a return call
 boolean isSelfCall()
          Returns true if this join point is for a self call.
 void setEndTime(long endTime)
           
 void setMatchingJoinPoint(ISequenceJoinPoint match)
           
 void setReturnCall(boolean isReturnCall)
           
 void setStartTime(long startTime)
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StackJoinPoint

public StackJoinPoint(long jpIndex,
                      boolean isReturnCall,
                      CallSignature signature,
                      java.lang.String thisClass,
                      java.lang.String targetClass,
                      java.lang.String kind,
                      int hashCode,
                      int stackHashcode,
                      java.lang.String threadId,
                      int lineNumber,
                      java.lang.String withinType)
StackJoinPoint constructor

Parameters:
jpIndex - Not used. Pass zero
isReturnCall - true if this is a return call, false for the normal call
signature - CallSignature for this join point
thisClass - source class name with package
targetClass - target class name with package
kind - Not used. pass empty String
hashCode - hashCode for this join point. This should be same for both forward and return calls. This should be unique in the join point list.
stackHashcode - Not Used. Pass zero.
threadId - Not used. Pass empty string.
lineNumber - Line number in the source file where this method is defined.
withinType - The name of the class where this method is defined. When a method defined in super class is called by a sub-class instance, this field should have the super class name.
Method Detail

equals

public final boolean equals(java.lang.Object obj)
Returns true if the given join point object is equal to this join point.

Overrides:
equals in class java.lang.Object
Returns:
true if the given object is of type SequenceJoinPoint and its hashCode() matches with this objects hashCode()

getCallSignature

public final CallSignature getCallSignature()
Returns CallSignature for this join point

Specified by:
getCallSignature in interface ISequenceJoinPoint
Returns:
CallSignature for this join point

getEndTime

public long getEndTime()
Description copied from interface: ISequenceJoinPoint
End time of this method call as returned by System.currentTimeMillis()

Specified by:
getEndTime in interface ISequenceJoinPoint
Returns:
End time of this method call as returned by System.currentTimeMillis()

getLineNumber

public int getLineNumber()

getMatchingJoinPoint

public ISequenceJoinPoint getMatchingJoinPoint()
Description copied from interface: ISequenceJoinPoint
Returns the matching join point. When called on the forward call, return the return call and vice versa.

Specified by:
getMatchingJoinPoint in interface ISequenceJoinPoint
Returns:
Returns the matching join point. When called on the forward call, return the return call and vice versa.

getResponseTime

public long getResponseTime()
Description copied from interface: ISequenceJoinPoint
Returns the response time of this method in milliseconds.

Specified by:
getResponseTime in interface ISequenceJoinPoint
Returns:
Returns the response time of this method in milliseconds.

getSourceLocation

public java.lang.String getSourceLocation()
The source file name and the line number where this call originates. The source location string must be in the format SourceFileName.java:lineNumber
Ex: CelsiusConverter.java:75

Specified by:
getSourceLocation in interface ISequenceJoinPoint
Returns:
returns the source file name and the line number where this call originates.

getStartTime

public long getStartTime()
Description copied from interface: ISequenceJoinPoint
Start time of this method call as returned by System.currentTimeMillis()

Specified by:
getStartTime in interface ISequenceJoinPoint
Returns:
Start time of this method call as returned by System.currentTimeMillis()

getTargetClass

public final java.lang.String getTargetClass()
Target class name

Specified by:
getTargetClass in interface ISequenceJoinPoint
Returns:
the target class name.

getThisClass

public final java.lang.String getThisClass()
Source class name

Specified by:
getThisClass in interface ISequenceJoinPoint
Returns:
the source class name

getWithinType

public final java.lang.String getWithinType()
The name of the class where this method is defined. When a method defined in super class is called by a sub-class instance, this returns the super class name.

Specified by:
getWithinType in interface ISequenceJoinPoint
Returns:
same value as returned by thisJoinPoint.getSourceLocation().getWithinType()

hashCode

public final int hashCode()
This number is same for both normal and return calls and is unique in join point list.

Specified by:
hashCode in interface ISequenceJoinPoint
Overrides:
hashCode in class java.lang.Object
Returns:
hash code

isReturnCall

public final boolean isReturnCall()
Description copied from interface: ISequenceJoinPoint
Returns true if this is a return call

Specified by:
isReturnCall in interface ISequenceJoinPoint
Returns:

isSelfCall

public final boolean isSelfCall()
Returns true if this join point is for a self call.

Specified by:
isSelfCall in interface ISequenceJoinPoint
Returns:
true if this join point is for a self call.

setEndTime

public void setEndTime(long endTime)

setMatchingJoinPoint

public void setMatchingJoinPoint(ISequenceJoinPoint match)

setReturnCall

public final void setReturnCall(boolean isReturnCall)

setStartTime

public void setStartTime(long startTime)