package org.mockejb;
import java.lang.reflect.*;
import javax.ejb.*;
class MDBHome extends BasicEjbHome {
MDBHome( BasicEjbDescriptor descriptor ){
super( descriptor );
}
public Object create( BasicEjbDescriptor descriptor, MockEjbObject ejbObject,
Method createMethod, Object[] paramVals ) throws Exception {
Object bean = createBean( descriptor );
MockEjbContext ejbContext = new MockEjbContext( getHomeProxy() );
if ( bean instanceof MessageDrivenBean ) {
Class paramTypes[]={ MessageDrivenContext.class };
Object args[]={ ejbContext };
invokeBeanMethod(bean, null,
"setMessageDrivenContext", paramTypes, args );
invokeBeanCreateMethod( bean, createMethod, paramVals );
}
Object ejbObjectProxy = ejbObject.createProxy( bean, ejbContext );
return ejbObjectProxy;
}
public Object invokeHomeMethod( BasicEjbDescriptor descriptor,
Method homeMethod, Object[] paramVals ) throws Exception{
throwMethodNotImplemented( homeMethod.toString() );
return null;
}
}