package org.mockejb;
import java.io.Serializable;
import javax.ejb.*;
public class MockEjbMetaData implements EJBMetaData, Serializable {
private BasicEjbDescriptor descriptor;
private Object homeProxy;
MockEjbMetaData( final BasicEjbDescriptor descriptor ) {
this.descriptor = descriptor;
}
void setHomeProxy( final Object homeProxy ) {
this.homeProxy = homeProxy;
}
public EJBHome getEJBHome() {
return (EJBHome) homeProxy;
}
public Class getHomeInterfaceClass() {
return descriptor.getHomeClass();
}
public Class getRemoteInterfaceClass() {
return descriptor.getIfaceClass();
}
public Class getPrimaryKeyClass() {
return null;
}
public boolean isSession() {
return (descriptor instanceof SessionBeanDescriptor);
}
public boolean isStatelessSession() {
return ( descriptor instanceof SessionBeanDescriptor && !((SessionBeanDescriptor) descriptor).isStateful() );
}
}