// Assert a valid emf was provided, it is open, and the entity is PC
if (emf == null || !emf.isOpen() || !ImplHelper.isManageable(entity)) {
return false;
}
// Assert the context is a broker
PersistenceCapable pc = (PersistenceCapable)entity;
if (!(pc.pcGetGenericContext() instanceof Broker)) {
return false;
}
// Assert the broker is available and open
Broker broker = (Broker)pc.pcGetGenericContext();
if (broker == null || broker.isClosed()) {
return false;
}
// Assert the emf associated with the PC is the same as the provided emf
OpenJPAEntityManagerFactory eemf = JPAFacadeHelper.toEntityManagerFactory(broker.getBrokerFactory());