public void activateEntity(EntityEnterpriseContext instance) throws RemoteException { pm.activateEntity(instance); }
public Object createBeanClassInstance() throws Exception { return pm.createBeanClassInstance(); }
public void createEntity(Method m, Object[] args, EntityEnterpriseContext instance) throws Exception { pm.createEntity(m, args, instance); }
/** * For CMP actually stores the instance */ public void storeEntity(EntityEnterpriseContext ctx) throws Exception { if (ctx.getId() != null) { final EntityPersistenceManager pm = getPersistenceManager(); if(pm.isStoreRequired(ctx)) { pm.storeEntity(ctx); } } }
public void passivateEntity(EntityEnterpriseContext instance) throws RemoteException { pm.passivateEntity(instance); }
protected boolean changed (org.jboss.invocation.Invocation mi, org.jboss.ejb.EntityEnterpriseContext ctx) throws Exception { if (ctx.getId() == null) return true; if(!container.isReadOnly()) { java.lang.reflect.Method method = mi.getMethod(); if(method == null || !container.getBeanMetaData().isMethodReadOnly(method.getName())) { return invalidateRelated ? container.getPersistenceManager().isModified(ctx) : container.getPersistenceManager().isStoreRequired(ctx); } } return false; }
public Collection findEntities(Method finderMethod, Object[] args, EntityEnterpriseContext instance, GenericEntityObjectFactory factory) throws Exception { return pm.findEntities(finderMethod, args, instance, factory); }
/** * Invokes ejbStore method on the instance * @param ctx the instance to invoke ejbStore on * @throws Exception */ public void invokeEjbStore(EntityEnterpriseContext ctx) throws Exception { if (ctx.getId() != null) { final EntityPersistenceManager pm = getPersistenceManager(); pm.invokeEjbStore(ctx); } }
public Object findEntity(Method finderMethod, Object[] args, EntityEnterpriseContext instance, GenericEntityObjectFactory factory) throws Exception { return pm.findEntity(finderMethod, args, instance, factory); }
public void loadEntity(EntityEnterpriseContext instance) throws RemoteException { pm.loadEntity(instance); }
public boolean isStoreRequired(EntityEnterpriseContext instance) throws Exception { return pm.isStoreRequired(instance); }
public boolean isModified(EntityEnterpriseContext ctx) throws Exception { return pm.isModified(ctx); }
protected void passivate(EnterpriseContext ctx) throws RemoteException { removeTimerServiceIfAllCancelledOrExpired(ctx); m_container.getPersistenceManager().passivateEntity((EntityEnterpriseContext)ctx); }
Collection c = getPersistenceManager().findEntities(method, args, instance, localProxyFactory);
public void invokeEjbStore(EntityEnterpriseContext ctx) throws RemoteException { Object key = ctx.getInstance(); try { ccm.pushMetaAwareObject(key, unsharableResources); try { pm.invokeEjbStore(ctx); } finally { ccm.popMetaAwareObject(unsharableResources); } } catch (ResourceException e) { throw new RemoteException("Could not store!: ", e); } }
private Object findSingleObject(Transaction tx, Method method, Object[] args, EntityEnterpriseContext instance, GenericEntityObjectFactory factory) throws Exception { if(method.getName().equals("findByPrimaryKey")) { if(args[0] == null) throw new IllegalArgumentException("findByPrimaryKey called with null argument."); if(metaData.getContainerConfiguration().getCommitOption() != ConfigurationMetaData.B_COMMIT_OPTION) { Object key = instance.getCacheKey(); if(key == null) { key = ((EntityCache)instanceCache).createCacheKey(args[0]); } if(instanceCache.isActive(key)) { return factory.getEntityEJBObject(key); } } } else if(!metaData.getContainerConfiguration().getSyncOnCommitOnly()) { EntityContainer.synchronizeEntitiesWithinTransaction(tx); } return getPersistenceManager().findEntity(method, args, instance, factory); }
container.getPersistenceManager().loadEntity(ctx); ctx.setValid(true);
public void synchronize(Thread thread, Transaction tx, EntityEnterpriseContext instance) throws Exception { EntityContainer container = (EntityContainer)instance.getContainer(); if(container.getPersistenceManager().isStoreRequired(instance)) { throw new EJBException("The instance of " + container.getBeanMetaData().getEjbName() + " with pk=" + instance.getId() + " was not stored to prevent potential inconsistency of data in the database:" + " the instance was evicted from the cache during the transaction" + " and the database was possibly updated by another process."); } }
container.getPersistenceManager().passivateEntity(ctx);
protected void activate(EnterpriseContext ctx) throws RemoteException { m_container.getPersistenceManager().activateEntity((EntityEnterpriseContext)ctx); }