org.mockejb
Class CMPFindByPrimaryKeyHandler

java.lang.Object
  extended byorg.mockejb.CMPFindByPrimaryKeyHandler
All Implemented Interfaces:
Aspect, Interceptor, java.io.Serializable

public class CMPFindByPrimaryKeyHandler
extends java.lang.Object
implements Aspect, java.io.Serializable

Handles calls to findByPrimaryKey for CMP beans. Checks if the requested PK is in the EntityDatabase, if it is, gets the entity from the EntityDatabase and returns it to the client. Otherwise, proceeds to the next interceptor in the chain.

Author:
Alexander Ananiev
See Also:
Serialized Form

Field Summary
protected  EntityDatabase entityDatabase
           
 
Constructor Summary
CMPFindByPrimaryKeyHandler(EntityDatabase entityDatabase)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
          This class does not have state, so all instances of this class are considered equal
 Pointcut getPointcut()
           
 int hashCode()
           
 void intercept(InvocationContext invocationContext)
          Performs pre and post invocation actions for the target object call.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

entityDatabase

protected EntityDatabase entityDatabase
Constructor Detail

CMPFindByPrimaryKeyHandler

public CMPFindByPrimaryKeyHandler(EntityDatabase entityDatabase)
Method Detail

getPointcut

public Pointcut getPointcut()
Specified by:
getPointcut in interface Aspect

intercept

public void intercept(InvocationContext invocationContext)
               throws java.lang.Exception
Description copied from interface: Interceptor
Performs pre and post invocation actions for the target object call.

Specified by:
intercept in interface Interceptor
Parameters:
invocationContext - provides the info about this call. Also calls interceptors in turn according to their order in the chain. invocationContext provides access to the return value and thrown exceptions of this call.
Throws:
java.lang.Exception

equals

public boolean equals(java.lang.Object obj)
This class does not have state, so all instances of this class are considered equal


hashCode

public int hashCode()