org.mockejb
Class BMPFinderHandler

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

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

Intercepts the calls to the BMP find methods, checks if the returned PK (or elements of the pk collection) is in the EntityDatabase, if not, creates a new entity and calls "ejbLoad", and adds it to the EntityDatabase. Returns the entity or entity collection to the client

Author:
Alexander Ananiev
See Also:
Serialized Form

Field Summary
protected  EntityDatabase entityDatabase
           
 
Constructor Summary
BMPFinderHandler(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
protected  java.lang.Object findInCacheOrCreate(EntityBeanDescriptor descriptor, MockEjbContext ejbContext, java.lang.Object pk)
           
 Pointcut getPointcut()
           
 int hashCode()
           
 void intercept(InvocationContext invocationContext)
          Intercepts and handles finders.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

entityDatabase

protected EntityDatabase entityDatabase
Constructor Detail

BMPFinderHandler

public BMPFinderHandler(EntityDatabase entityDatabase)
Method Detail

getPointcut

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

intercept

public void intercept(InvocationContext invocationContext)
               throws java.lang.Exception
Intercepts and handles finders.

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

findInCacheOrCreate

protected java.lang.Object findInCacheOrCreate(EntityBeanDescriptor descriptor,
                                               MockEjbContext ejbContext,
                                               java.lang.Object pk)
                                        throws java.lang.Exception
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()