org.sourceforge.jemm.weaver
Class ShadowDummy

java.lang.Object
  extended by org.sourceforge.jemm.weaver.ShadowDummy
All Implemented Interfaces:
org.sourceforge.jemm.lifecycle.ShadowObject, org.sourceforge.jemm.lifecycle.ShadowUserObject

public class ShadowDummy
extends java.lang.Object
implements org.sourceforge.jemm.lifecycle.ShadowUserObject

A Dummy ShadowObject interface implementation which counts how many method invocations and keeps an order. Used in some of the Compiler tests to confirm that methods are called and are called in the right order.

Author:
Paul Keeble

Nested Class Summary
static class ShadowDummy.Memento
          Momento class holds a snapshot of the state of the ShadowDummy class.
 
Field Summary
protected  int getUserObject
           
 
Constructor Summary
ShadowDummy()
          Creates an ShadowDummy
ShadowDummy(org.sourceforge.jemm.types.ID id)
          Create an ShadowDummy with the given id result.
 
Method Summary
 void beginLock()
           
 void beginLock(java.lang.Object obj)
           
 void constructionComplete(org.sourceforge.jemm.util.JEMMObject proxyClass, org.sourceforge.jemm.util.JEMMObjectImpl proxyImpl)
           
 void endLock()
           
 void endLock(java.lang.Object obj)
           
 void entityEntered()
           
 void entityEntered(java.lang.String methodSignature)
           
 void entityExited()
           
 void entityExited(java.lang.String methodSignature)
           
 int getBeginLock()
          Get the call order of the last time the beginLock() method was called.
 int getBeginMethod()
          Get the call order of the last time beginMethod() was called.
 int getCount()
          Return the count of method calls processed.
 org.sourceforge.jemm.lifecycle.ShadowData getData()
           
 int getEndLock()
          Get the call order of the last time the endLock() method was called.
 int getEndMethod()
          Get the call order of the last time the endMethod() method was called.
 int getGetUserObject()
          Get the call order of the last time the getObject() method was called.
 org.sourceforge.jemm.types.ID getID()
           
 org.sourceforge.jemm.util.JEMMObjectImpl getImpl()
           
 ShadowDummy.Memento getMemento()
          Create a Momento - a snapshot of all of the current call order values for comparison.
 org.sourceforge.jemm.util.JEMMObject getUserObject()
           
 boolean hasUserObject()
           
 void initialiseUserObject(org.sourceforge.jemm.util.JEMMObject userObject)
           
 void reset()
          Reset all of the call order counters to 0.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

getUserObject

protected int getUserObject
Constructor Detail

ShadowDummy

public ShadowDummy()
Creates an ShadowDummy


ShadowDummy

public ShadowDummy(org.sourceforge.jemm.types.ID id)
Create an ShadowDummy with the given id result.

Parameters:
id - The id to return getId()
Method Detail

beginLock

public void beginLock()
Specified by:
beginLock in interface org.sourceforge.jemm.lifecycle.ShadowUserObject

entityEntered

public void entityEntered()

endLock

public void endLock()
Specified by:
endLock in interface org.sourceforge.jemm.lifecycle.ShadowUserObject

beginLock

public void beginLock(java.lang.Object obj)
Specified by:
beginLock in interface org.sourceforge.jemm.lifecycle.ShadowUserObject

endLock

public void endLock(java.lang.Object obj)
Specified by:
endLock in interface org.sourceforge.jemm.lifecycle.ShadowUserObject

entityExited

public void entityExited()

hasUserObject

public boolean hasUserObject()

constructionComplete

public void constructionComplete(org.sourceforge.jemm.util.JEMMObject proxyClass,
                                 org.sourceforge.jemm.util.JEMMObjectImpl proxyImpl)

getImpl

public org.sourceforge.jemm.util.JEMMObjectImpl getImpl()

entityEntered

public void entityEntered(java.lang.String methodSignature)
Specified by:
entityEntered in interface org.sourceforge.jemm.lifecycle.ShadowUserObject

entityExited

public void entityExited(java.lang.String methodSignature)
Specified by:
entityExited in interface org.sourceforge.jemm.lifecycle.ShadowUserObject

getUserObject

public org.sourceforge.jemm.util.JEMMObject getUserObject()
Specified by:
getUserObject in interface org.sourceforge.jemm.lifecycle.ShadowObject

getID

public org.sourceforge.jemm.types.ID getID()
Specified by:
getID in interface org.sourceforge.jemm.lifecycle.ShadowObject

initialiseUserObject

public void initialiseUserObject(org.sourceforge.jemm.util.JEMMObject userObject)

getCount

public int getCount()
Return the count of method calls processed.

Returns:
The number of method calls processed.

getBeginMethod

public int getBeginMethod()
Get the call order of the last time beginMethod() was called.

Returns:
The call order of the last beginMethod() call.

getEndMethod

public int getEndMethod()
Get the call order of the last time the endMethod() method was called.

Returns:
The call order of the last endMethod() call.

getBeginLock

public int getBeginLock()
Get the call order of the last time the beginLock() method was called.

Returns:
The call order of the last beginLock() call.

getEndLock

public int getEndLock()
Get the call order of the last time the endLock() method was called.

Returns:
The call order of the last endLock() call.

getGetUserObject

public int getGetUserObject()
Get the call order of the last time the getObject() method was called.

Returns:
The call order of the last getObject() call.

getMemento

public ShadowDummy.Memento getMemento()
Create a Momento - a snapshot of all of the current call order values for comparison.

Returns:
A momento object containing all of the current call order values..

reset

public void reset()
Reset all of the call order counters to 0.


getData

public org.sourceforge.jemm.lifecycle.ShadowData getData()
Specified by:
getData in interface org.sourceforge.jemm.lifecycle.ShadowUserObject


Copyright © 2009. All Rights Reserved.