public String getCacheName() { if (_dc != null) return _dc.getName(); return null; }
public String getCacheName() { if (_dc != null) return _dc.getName(); return null; }
public String getCacheName() { if (_dc != null) return _dc.getName(); return null; }
public String getCacheName() { if (_dc != null) return _dc.getName(); return null; }
public DataCache getDataCache(String name, boolean create) { if (name == null || (_cache != null && name.equals(_cache.getName()))) return _cache; return null; }
public String getName() { if (_cache == null) return null; try { return _cache.getName(); } catch (RuntimeException re) { throw translate(re); } }
public String getName() { if (_cache == null) return null; try { return _cache.getName(); } catch (RuntimeException re) { throw translate(re); } }
/** * Returns the named cache. * If the given name is name or the name of the cache plugin then returns the main cache. * Otherwise, {@linkplain DataCache#getPartition(String, boolean) delegates} to the main cache * to obtain a partition. */ public DataCache getDataCache(String name, boolean create) { if (name == null || (_cache != null && name.equals(_cache.getName()))) return _cache; if (_cache != null) return _cache.getPartition(name, create); return null; }
public String getName() { if (_cache == null) return null; try { return _cache.getName(); } catch (RuntimeException re) { throw translate(re); } }
public String getName() { if (_cache == null) return null; try { return _cache.getName(); } catch (RuntimeException re) { throw translate(re); } }
public String getName() { if (_cache == null) return null; try { return _cache.getName(); } catch (RuntimeException re) { throw translate(re); } }
/** * Returns the named cache. * If the given name is name or the name of the cache plugin then returns the main cache. * Otherwise, {@linkplain DataCache#getPartition(String, boolean) delegates} to the main cache * to obtain a partition. */ public DataCache getDataCache(String name, boolean create) { if (name == null || (_cache != null && name.equals(_cache.getName()))) return _cache; if (_cache != null) return _cache.getPartition(name, create); return null; }
/** * Returns the named cache. * If the given name is name or the name of the cache plugin then returns the main cache. * Otherwise, {@linkplain DataCache#getPartition(String, boolean) delegates} to the main cache * to obtain a partition. */ public DataCache getDataCache(String name, boolean create) { if (name == null || (_cache != null && name.equals(_cache.getName()))) return _cache; if (_cache != null) return _cache.getPartition(name, create); return null; }
/** * Returns the named cache. * If the given name is name or the name of the cache plugin then returns the main cache. * Otherwise, {@linkplain DataCache#getPartition(String, boolean) delegates} to the main cache * to obtain a partition. */ public DataCache getDataCache(String name, boolean create) { if (name == null || (_cache != null && name.equals(_cache.getName()))) return _cache; if (_cache != null) return _cache.getPartition(name, create); return null; }
/** * Set partitions from a String configuration. * * @param parts a String of the form <code>(p1, p2, p3)</code> where p1, p2 etc. itself are plug-in strings * for individual Data Cache configuration. */ public void setPartitions(String parts) { _partProperties.clear(); parsePartitionProperties(parts); PluginListValue partitions = new PluginListValue("partitions"); String[] types = (String[])Array.newInstance(String.class, _partProperties.size()); Arrays.fill(types, _type.getName()); partitions.setClassNames(types); partitions.setProperties(_partProperties.toArray(new String[_partProperties.size()])); DataCache[] array = (DataCache[])partitions.instantiate(_type, conf); for (DataCache part : array) { if (part.getName() == null) throw new UserException(_loc.get("partition-cache-null-partition", parts)); if (_partitions.containsKey(part.getName())) throw new UserException(_loc.get("partition-cache-duplicate-partition", part.getName(), parts)); if (part.getName().equals(DataCache.NAME_DEFAULT)) throw new UserException(_loc.get("partition-cache-default-partition", part.getName(), parts)); _partitions.put(part.getName(), part); } }
/** * Set partitions from a String configuration. * * @param parts a String of the form <code>(p1, p2, p3)</code> where p1, p2 etc. itself are plug-in strings * for individual Data Cache configuration. */ public void setPartitions(String parts) { _partProperties.clear(); parsePartitionProperties(parts); PluginListValue partitions = new PluginListValue("partitions"); String[] types = (String[])Array.newInstance(String.class, _partProperties.size()); Arrays.fill(types, _type.getName()); partitions.setClassNames(types); partitions.setProperties(_partProperties.toArray(new String[_partProperties.size()])); DataCache[] array = (DataCache[])partitions.instantiate(_type, conf); for (DataCache part : array) { if (part.getName() == null) throw new UserException(_loc.get("partition-cache-null-partition", parts)); if (_partitions.containsKey(part.getName())) throw new UserException(_loc.get("partition-cache-duplicate-partition", part.getName(), parts)); if (part.getName().equals(DataCache.NAME_DEFAULT)) throw new UserException(_loc.get("partition-cache-default-partition", part.getName(), parts)); _partitions.put(part.getName(), part); } }
/** * Create a new cacheable instance for the given state manager. */ private DataCachePCData newPCData(OpenJPAStateManager sm, DataCache cache) { ClassMetaData meta = sm.getMetaData(); if (_gen != null) return (DataCachePCData) _gen.generatePCData(sm.getObjectId(), meta); return new DataCachePCDataImpl(sm.fetchObjectId(), meta, cache.getName()); }
/** * Create a new cacheable instance for the given state manager. */ private DataCachePCData newPCData(OpenJPAStateManager sm, DataCache cache) { ClassMetaData meta = sm.getMetaData(); if (_gen != null) return (DataCachePCData) _gen.generatePCData(sm.getObjectId(), meta); return new DataCachePCDataImpl(sm.fetchObjectId(), meta, cache.getName()); }
/** * Create a new cacheable instance for the given state manager. */ private DataCachePCData newPCData(OpenJPAStateManager sm, DataCache cache) { ClassMetaData meta = sm.getMetaData(); if (_gen != null) return (DataCachePCData) _gen.generatePCData(sm.getObjectId(), meta); return new DataCachePCDataImpl(sm.fetchObjectId(), meta, cache.getName()); }
/** * Create a new cacheable instance for the given state manager. */ private DataCachePCData newPCData(OpenJPAStateManager sm, DataCache cache) { ClassMetaData meta = sm.getMetaData(); if (_gen != null) return (DataCachePCData) _gen.generatePCData(sm.getObjectId(), meta); return new DataCachePCDataImpl(sm.fetchObjectId(), meta, cache.getName()); }