/** * {@inheritDoc} * <p/> * Should be a no-op since this cache is read-only */ @Override public void unlockItem(final Object key, final SoftLock lock) throws CacheException { /* * To err on the safe side though, follow ReadOnlyEhcacheEntityRegionAccessStrategy which nevertheless evicts * the key. */ evict(key); }
/** * @throws UnsupportedOperationException */ @Override public SoftLock lockRegion() throws CacheException { throw new UnsupportedOperationException("Attempting to lock a read-only cache region: " + getHazelcastRegion().getName()); }
public EntityRegionAccessStrategy buildAccessStrategy(final AccessType accessType) throws CacheException { if (AccessType.READ_ONLY.equals(accessType)) { return new EntityRegionAccessStrategyAdapter( new ReadOnlyAccessDelegate<HazelcastEntityRegion>(this, props)); } if (AccessType.NONSTRICT_READ_WRITE.equals(accessType)) { return new EntityRegionAccessStrategyAdapter( new NonStrictReadWriteAccessDelegate<HazelcastEntityRegion>(this, props)); } if (AccessType.READ_WRITE.equals(accessType)) { return new EntityRegionAccessStrategyAdapter( new ReadWriteAccessDelegate<HazelcastEntityRegion>(this, props)); } throw new CacheException("AccessType \"" + accessType + "\" is not currently supported by Hazelcast."); }
@Override public EntityRegionAccessStrategy buildAccessStrategy(final AccessType accessType) throws CacheException { if (AccessType.READ_ONLY.equals(accessType)) { return new EntityRegionAccessStrategyAdapter( new ReadOnlyAccessDelegate<HazelcastEntityRegion>(this, props)); } if (AccessType.NONSTRICT_READ_WRITE.equals(accessType)) { return new EntityRegionAccessStrategyAdapter( new NonStrictReadWriteAccessDelegate<HazelcastEntityRegion>(this, props)); } if (AccessType.READ_WRITE.equals(accessType)) { return new EntityRegionAccessStrategyAdapter( new ReadWriteAccessDelegate<HazelcastEntityRegion>(this, props)); } throw new CacheException("AccessType \"" + accessType + "\" is not currently supported by Hazelcast."); }
/** * @throws UnsupportedOperationException */ @Override public boolean afterUpdate(final Object key, final Object value, final Object currentVersion, final Object previousVersion, final SoftLock lock) throws CacheException { throw new UnsupportedOperationException("Cannot update an item in a read-only cache: " + getHazelcastRegion().getName()); }
public NaturalIdRegionAccessStrategy buildAccessStrategy(final AccessType accessType) throws CacheException { if (AccessType.READ_ONLY.equals(accessType)) { return new NaturalIdRegionAccessStrategyAdapter( new ReadOnlyAccessDelegate<HazelcastNaturalIdRegion>(this, props)); } if (AccessType.NONSTRICT_READ_WRITE.equals(accessType)) { return new NaturalIdRegionAccessStrategyAdapter( new NonStrictReadWriteAccessDelegate<HazelcastNaturalIdRegion>(this, props)); } if (AccessType.READ_WRITE.equals(accessType)) { return new NaturalIdRegionAccessStrategyAdapter( new ReadWriteAccessDelegate<HazelcastNaturalIdRegion>(this, props)); } throw new CacheException("AccessType \"" + accessType + "\" is not currently supported by Hazelcast."); } }
/** * {@inheritDoc} * <p/> * Should be a no-op since this cache is read-only */ @Override public void unlockItem(final Object key, final SoftLock lock) throws CacheException { /* * To err on the safe side though, follow ReadOnlyEhcacheEntityRegionAccessStrategy which nevertheless evicts * the key. */ evict(key); }
/** * @throws UnsupportedOperationException */ @Override public boolean afterUpdate(final Object key, final Object value, final Object currentVersion, final Object previousVersion, final SoftLock lock) throws CacheException { throw new UnsupportedOperationException("Cannot update an item in a read-only cache: " + getHazelcastRegion().getName()); }
@Override public EntityRegionAccessStrategy buildAccessStrategy(final AccessType accessType) throws CacheException { if (AccessType.READ_ONLY.equals(accessType)) { return new EntityRegionAccessStrategyAdapter( new ReadOnlyAccessDelegate<HazelcastEntityRegion>(this, props)); } if (AccessType.NONSTRICT_READ_WRITE.equals(accessType)) { return new EntityRegionAccessStrategyAdapter( new NonStrictReadWriteAccessDelegate<HazelcastEntityRegion>(this, props)); } if (AccessType.READ_WRITE.equals(accessType)) { return new EntityRegionAccessStrategyAdapter( new ReadWriteAccessDelegate<HazelcastEntityRegion>(this, props)); } throw new CacheException("AccessType \"" + accessType + "\" is not currently supported by Hazelcast."); }
/** * {@inheritDoc} * <p/> * Should be a no-op since this cache is read-only */ @Override public void unlockItem(final Object key, final SoftLock lock) throws CacheException { /* * To err on the safe side though, follow ReadOnlyEhcacheEntityRegionAccessStrategy which nevertheless evicts * the key. */ evict(key); }
/** * @throws UnsupportedOperationException */ @Override public SoftLock lockRegion() throws CacheException { throw new UnsupportedOperationException("Attempting to lock a read-only cache region: " + getHazelcastRegion().getName()); }
@Override public CollectionRegionAccessStrategy buildAccessStrategy(final AccessType accessType) throws CacheException { if (AccessType.READ_ONLY.equals(accessType)) { return new CollectionRegionAccessStrategyAdapter( new ReadOnlyAccessDelegate<HazelcastCollectionRegion>(this, props)); } if (AccessType.NONSTRICT_READ_WRITE.equals(accessType)) { return new CollectionRegionAccessStrategyAdapter( new NonStrictReadWriteAccessDelegate<HazelcastCollectionRegion>(this, props)); } if (AccessType.READ_WRITE.equals(accessType)) { return new CollectionRegionAccessStrategyAdapter( new ReadWriteAccessDelegate<HazelcastCollectionRegion>(this, props)); } throw new CacheException("AccessType \"" + accessType + "\" is not currently supported by Hazelcast."); } }
/** * {@inheritDoc} * <p> * Should be a no-op since this cache is read-only * </p> */ @Override public void unlockItem(final Object key, final SoftLock lock) throws CacheException { /* * To err on the safe side though, follow ReadOnlyEhcacheEntityRegionAccessStrategy which nevertheless evicts * the key. */ evict(key); }
/** * @throws UnsupportedOperationException Thrown always because a read-only cache region cannot be locked */ @Override public SoftLock lockRegion() throws CacheException { throw new UnsupportedOperationException("Attempting to lock a read-only cache region: " + getHazelcastRegion().getName()); }
public CollectionRegionAccessStrategy buildAccessStrategy(final AccessType accessType) throws CacheException { if (AccessType.READ_ONLY.equals(accessType)) { return new CollectionRegionAccessStrategyAdapter( new ReadOnlyAccessDelegate<HazelcastCollectionRegion>(this, props)); } if (AccessType.NONSTRICT_READ_WRITE.equals(accessType)) { return new CollectionRegionAccessStrategyAdapter( new NonStrictReadWriteAccessDelegate<HazelcastCollectionRegion>(this, props)); } if (AccessType.READ_WRITE.equals(accessType)) { return new CollectionRegionAccessStrategyAdapter( new ReadWriteAccessDelegate<HazelcastCollectionRegion>(this, props)); } throw new CacheException("AccessType \"" + accessType + "\" is not currently supported by Hazelcast."); } }
/** * @throws UnsupportedOperationException */ @Override public boolean update(final Object key, final Object value, final Object currentVersion, final Object previousVersion) throws CacheException { throw new UnsupportedOperationException("Attempting to update an item in a read-only cache: " + getHazelcastRegion().getName()); } }
@Override public NaturalIdRegionAccessStrategy buildAccessStrategy(final AccessType accessType) throws CacheException { if (AccessType.READ_ONLY.equals(accessType)) { return new NaturalIdRegionAccessStrategyAdapter( new ReadOnlyAccessDelegate<HazelcastNaturalIdRegion>(this, props)); } if (AccessType.NONSTRICT_READ_WRITE.equals(accessType)) { return new NaturalIdRegionAccessStrategyAdapter( new NonStrictReadWriteAccessDelegate<HazelcastNaturalIdRegion>(this, props)); } if (AccessType.READ_WRITE.equals(accessType)) { return new NaturalIdRegionAccessStrategyAdapter( new ReadWriteAccessDelegate<HazelcastNaturalIdRegion>(this, props)); } throw new CacheException("AccessType \"" + accessType + "\" is not currently supported by Hazelcast."); } }
/** * @throws UnsupportedOperationException */ @Override public boolean afterUpdate(final Object key, final Object value, final Object currentVersion, final Object previousVersion, final SoftLock lock) throws CacheException { throw new UnsupportedOperationException("Cannot update an item in a read-only cache: " + getHazelcastRegion().getName()); }
@Override public EntityRegionAccessStrategy buildAccessStrategy(final AccessType accessType) throws CacheException { if (AccessType.READ_ONLY.equals(accessType)) { return new EntityRegionAccessStrategyAdapter( new ReadOnlyAccessDelegate<HazelcastEntityRegion>(this, props)); } if (AccessType.NONSTRICT_READ_WRITE.equals(accessType)) { return new EntityRegionAccessStrategyAdapter( new NonStrictReadWriteAccessDelegate<HazelcastEntityRegion>(this, props)); } if (AccessType.READ_WRITE.equals(accessType)) { return new EntityRegionAccessStrategyAdapter( new ReadWriteAccessDelegate<HazelcastEntityRegion>(this, props)); } throw new CacheException("AccessType \"" + accessType + "\" is not currently supported by Hazelcast."); }
/** * @throws UnsupportedOperationException */ @Override public boolean update(final Object key, final Object value, final Object currentVersion, final Object previousVersion) throws CacheException { throw new UnsupportedOperationException("Attempting to update an item in a read-only cache: " + getHazelcastRegion().getName()); } }