protected void setKey(Object id, EnterpriseContext ctx) { ((EntityEnterpriseContext)ctx).setCacheKey(id); ctx.setId(id); }
public EnterpriseContext get(Object id) throws RemoteException, NoSuchObjectException { if(id == null) throw new IllegalArgumentException("Can't get an object with a null key"); Map cache = getLocalCache(); EntityEnterpriseContext instance = (EntityEnterpriseContext) cache.get(id); if(instance == null) { try { // acquire instance = (EntityEnterpriseContext) container.getInstancePool().get(); // set key instance.setId(id); instance.setCacheKey(id); // activate container.getPersistenceManager().activateEntity(instance); // insert cache.put(id, instance); } catch(Throwable x) { throw new NoSuchObjectException(x.getMessage()); } } return instance; }
ctx.setCacheKey(cacheKey);
ctx.setCacheKey(cacheKey);
ctx.setCacheKey(cacheKey);
ctx.setCacheKey(cacheKey);
throw new RemoteException("Unable to get an intance from the pool", e); ctx.setCacheKey(key); ctx.setId(key); EntityPersistenceManager pm = ec.getPersistenceManager();