public boolean isCached(List<Object> oids, BitSet edata) { // If using partitioned cache, we were and still are broke. DataCache cache = _mgr.getSystemDataCache(); if (cache != null && !isLocking(null)) { // BitSet size is not consistent. for(int i = 0; i < oids.size(); i++) { Object oid = oids.get(i); // Only check the cache if we haven't found the current oid. if (edata.get(i) == false && cache.contains(oid)) { edata.set(i); } } if (edata.cardinality() == oids.size()){ return true; } } return super.isCached(oids, edata); }
public boolean isCached(List<Object> oids, BitSet edata) { // If using partitioned cache, we were and still are broke. DataCache cache = _mgr.getSystemDataCache(); if (cache != null && !isLocking(null)) { // BitSet size is not consistent. for(int i = 0; i < oids.size(); i++) { Object oid = oids.get(i); // Only check the cache if we haven't found the current oid. if (edata.get(i) == false && cache.contains(oid)) { edata.set(i); } } if (edata.cardinality() == oids.size()){ return true; } } return super.isCached(oids, edata); }
public boolean isCached(List<Object> oids, BitSet edata) { // If using partitioned cache, we were and still are broke. DataCache cache = _mgr.getSystemDataCache(); if (cache != null && !isLocking(null)) { // BitSet size is not consistent. for(int i = 0; i < oids.size(); i++) { Object oid = oids.get(i); // Only check the cache if we haven't found the current oid. if (edata.get(i) == false && cache.contains(oid)) { edata.set(i); } } if (edata.cardinality() == oids.size()){ return true; } } return super.isCached(oids, edata); }
public boolean isCached(List<Object> oids, BitSet edata) { // If using partitioned cache, we were and still are broke. DataCache cache = _mgr.getSystemDataCache(); if (cache != null && !isLocking(null)) { // BitSet size is not consistent. for(int i = 0; i < oids.size(); i++) { Object oid = oids.get(i); // Only check the cache if we haven't found the current oid. if (edata.get(i) == false && cache.contains(oid)) { edata.set(i); } } if (edata.cardinality() == oids.size()){ return true; } } return super.isCached(oids, edata); }
public StoreCache getStoreCache() { _factory.lock(); try { if (_cache == null) { OpenJPAConfiguration conf = _factory.getConfiguration(); _cache = new StoreCacheImpl(this, conf.getDataCacheManagerInstance().getSystemDataCache()); } return _cache; } finally { _factory.unlock(); } }
public StoreCache getStoreCache() { _factory.lock(); try { if (_cache == null) { OpenJPAConfiguration conf = _factory.getConfiguration(); _cache = new StoreCacheImpl(this, conf.getDataCacheManagerInstance().getSystemDataCache()); } return _cache; } finally { _factory.unlock(); } }
public StoreCache getStoreCache() { _factory.lock(); try { if (_cache == null) { OpenJPAConfiguration conf = _factory.getConfiguration(); _cache = new StoreCacheImpl(this, conf.getDataCacheManagerInstance().getSystemDataCache()); } return _cache; } finally { _factory.unlock(); } }
public StoreCache getStoreCache() { _factory.lock(); try { if (_cache == null) { OpenJPAConfiguration conf = _factory.getConfiguration(); _cache = new StoreCacheImpl(this, conf.getDataCacheManagerInstance().getSystemDataCache()); } return _cache; } finally { _factory.unlock(); } }
public StoreCache getStoreCache() { _factory.lock(); try { if (_cache == null) { OpenJPAConfiguration conf = _factory.getConfiguration(); _cache = new StoreCacheImpl(this, conf.getDataCacheManagerInstance().getSystemDataCache()); } return _cache; } finally { _factory.unlock(); } }
/** * <P> * Create a DelegatingStoreManager for use with a Broker created by this factory. * If a DataCache has been enabled a DataCacheStoreManager will be returned. * </P> * <P> * If no DataCache is in use an ROPStoreManager will be returned. * </P> * * @return A delegating store manager suitable for the current * configuration. */ protected DelegatingStoreManager createDelegatingStoreManager() { // decorate the store manager for data caching and custom // result object providers; always make sure it's a delegating // store manager, because it's easier for users to deal with // that way StoreManager sm = newStoreManager(); DelegatingStoreManager dsm = null; if (_conf.getDataCacheManagerInstance().getSystemDataCache() != null) { dsm = new DataCacheStoreManager(sm); } dsm = new ROPStoreManager((dsm == null) ? sm : dsm); return dsm; }
/** * <P> * Create a DelegatingStoreManager for use with a Broker created by this factory. * If a DataCache has been enabled a DataCacheStoreManager will be returned. * </P> * <P> * If no DataCache is in use an ROPStoreManager will be returned. * </P> * * @return A delegating store manager suitable for the current * configuration. */ protected DelegatingStoreManager createDelegatingStoreManager() { // decorate the store manager for data caching and custom // result object providers; always make sure it's a delegating // store manager, because it's easier for users to deal with // that way StoreManager sm = newStoreManager(); DelegatingStoreManager dsm = null; if (_conf.getDataCacheManagerInstance().getSystemDataCache() != null) { dsm = new DataCacheStoreManager(sm); } dsm = new ROPStoreManager((dsm == null) ? sm : dsm); return dsm; }
/** * <P> * Create a DelegatingStoreManager for use with a Broker created by this factory. * If a DataCache has been enabled a DataCacheStoreManager will be returned. * </P> * <P> * If no DataCache is in use an ROPStoreManager will be returned. * </P> * * @return A delegating store manager suitable for the current * configuration. */ protected DelegatingStoreManager createDelegatingStoreManager() { // decorate the store manager for data caching and custom // result object providers; always make sure it's a delegating // store manager, because it's easier for users to deal with // that way StoreManager sm = newStoreManager(); DelegatingStoreManager dsm = null; if (_conf.getDataCacheManagerInstance().getSystemDataCache() != null) { dsm = new DataCacheStoreManager(sm); } dsm = new ROPStoreManager((dsm == null) ? sm : dsm); return dsm; }
/** * <P> * Create a DelegatingStoreManager for use with a Broker created by this factory. * If a DataCache has been enabled a DataCacheStoreManager will be returned. * </P> * <P> * If no DataCache is in use an ROPStoreManager will be returned. * </P> * * @return A delegating store manager suitable for the current * configuration. */ protected DelegatingStoreManager createDelegatingStoreManager() { // decorate the store manager for data caching and custom // result object providers; always make sure it's a delegating // store manager, because it's easier for users to deal with // that way StoreManager sm = newStoreManager(); DelegatingStoreManager dsm = null; if (_conf.getDataCacheManagerInstance().getSystemDataCache() != null) { dsm = new DataCacheStoreManager(sm); } dsm = new ROPStoreManager((dsm == null) ? sm : dsm); return dsm; }
@Override public void initialize() { Options opts = new Options(); if (getOptions() != null) { opts = Configurations.parseProperties(getOptions()); } String cacheName = opts.getProperty("name",null); OpenJPAConfiguration conf = (OpenJPAConfiguration)getProvider().getConfiguration(); DataCacheManager dcm = conf.getDataCacheManagerInstance(); DataCache dc = null; if (cacheName == null || cacheName.trim().length() == 0) { dc = dcm.getSystemDataCache(); } else { dc = dcm.getDataCache(cacheName); } if (dc == null) { throw new UserException(_loc.get("data-cache-not-found")); } setDataCache(dc); setDataCacheManager(dcm); setConfigId(conf.getId()); setContextRef(Integer.toString(System.identityHashCode(getContext()))); }
@Override public void initialize() { Options opts = new Options(); if (getOptions() != null) { opts = Configurations.parseProperties(getOptions()); } String cacheName = opts.getProperty("name",null); OpenJPAConfiguration conf = (OpenJPAConfiguration)getProvider().getConfiguration(); DataCacheManager dcm = conf.getDataCacheManagerInstance(); DataCache dc = null; if (cacheName == null || cacheName.trim().length() == 0) { dc = dcm.getSystemDataCache(); } else { dc = dcm.getDataCache(cacheName); } if (dc == null) { throw new UserException(_loc.get("data-cache-not-found")); } setDataCache(dc); setDataCacheManager(dcm); setConfigId(conf.getId()); setContextRef(Integer.toString(System.identityHashCode(getContext()))); }
@Override public void initialize() { Options opts = new Options(); if (getOptions() != null) { opts = Configurations.parseProperties(getOptions()); } String cacheName = opts.getProperty("name",null); OpenJPAConfiguration conf = (OpenJPAConfiguration)getProvider().getConfiguration(); DataCacheManager dcm = conf.getDataCacheManagerInstance(); DataCache dc = null; if (cacheName == null || cacheName.trim().length() == 0) { dc = dcm.getSystemDataCache(); } else { dc = dcm.getDataCache(cacheName); } if (dc == null) { throw new UserException(_loc.get("data-cache-not-found")); } setDataCache(dc); setDataCacheManager(dcm); setConfigId(conf.getId()); setContextRef(Integer.toString(System.identityHashCode(getContext()))); }
@Override public void initialize() { Options opts = new Options(); if (getOptions() != null) { opts = Configurations.parseProperties(getOptions()); } String cacheName = opts.getProperty("name",null); OpenJPAConfiguration conf = (OpenJPAConfiguration)getProvider().getConfiguration(); DataCacheManager dcm = conf.getDataCacheManagerInstance(); DataCache dc = null; if (cacheName == null || cacheName.trim().length() == 0) { dc = dcm.getSystemDataCache(); } else { dc = dcm.getDataCache(cacheName); } if (dc == null) { throw new UserException(_loc.get("data-cache-not-found")); } setDataCache(dc); setDataCacheManager(dcm); setConfigId(conf.getId()); setContextRef(Integer.toString(System.identityHashCode(getContext()))); }
void initializeBroker(boolean managed, int connRetainMode, BrokerImpl broker, boolean fromDeserialization) { assertOpen(); makeReadOnly(); // decorate the store manager for data caching and custom // result object providers; always make sure it's a delegating // store manager, because it's easier for users to deal with // that way StoreManager sm = newStoreManager(); DelegatingStoreManager dsm = null; if (_conf.getDataCacheManagerInstance().getSystemDataCache() != null) dsm = new DataCacheStoreManager(sm); dsm = new ROPStoreManager((dsm == null) ? sm : dsm); broker.initialize(this, dsm, managed, connRetainMode, fromDeserialization); if (!fromDeserialization) addListeners(broker); // if we're using remote events, register the event manager so // that it can broadcast commit notifications from the broker RemoteCommitEventManager remote = _conf. getRemoteCommitEventManager(); if (remote.areRemoteEventsEnabled()) broker.addTransactionListener(remote); loadPersistentTypes(broker.getClassLoader()); _brokers.add(broker); _conf.setReadOnly(Configuration.INIT_STATE_FROZEN); }