1 | public class OptimisticReadOnlyAccess extends OptimisticTransactionalAccess {↵ | | 1 | public class ReadOnlyAccess extends TransactionalAccess {↵
|
2 |
↵ | | |
|
3 | private static final Logger log = LoggerFactory.getLogger(OptimisticReadOnlyAccess.class);↵ | | 2 | private static final Logger log = LoggerFactory.getLogger(ReadOnlyAccess.class);↵
|
|
4 | /**↵ | | |
|
5 | * Create a new OptimisticR↵ | | |
|
|
| | | 3 | /**↵
|
6 | eadOnlyAccess.↵ | | 4 | * Create a provider of read-only access↵
|
7 | * ↵ | | |
|
8 | ↵ | | 5 | to the specific region.↵
|
| | | 6 | *↵
|
9 | * @param region The region to which this is providing access↵ | | 7 | * @param region The region to which this provides access↵
|
10 | */↵ | | |
|
11 | public Optimistic↵ | | 8 | .↵
|
| | | 9 | */↵
|
12 | ReadOnlyAccess(CollectionRegionImpl region) {
↵ | | 10 | public ReadOnlyAccess(CollectionRegionImpl region) {↵
|
13 | super(region);
↵ | | 11 | super(region);↵
|
14 | }↵ | | 12 | }↵
|
15 |
↵ | | |
|
|
16 | ↵ | | 13 | /**↵
|
| | | 14 | * {@inheritDoc}↵
|
| | | 15 | */↵
|
17 | @Override
↵ | | 16 | @Override↵
|
18 | public SoftLock lockItem(Object key, Object version) throws CacheException {
↵ | | 17 | public SoftLock lockItem(Object key, Object version) throws CacheException {↵
|
19 | throw new UnsupportedOperationException("Illegal attempt to edit read only item");
↵ | | 18 | throw new UnsupportedOperationException("Illegal attempt to edit read only item");↵
|
20 | }↵ | | 19 | }↵
|
21 |
↵ | | |
|
|
22 | ↵ | | 20 | /**↵
|
| | | 21 | * {@inheritDoc}↵
|
| | | 22 | */↵
|
23 | @Override
↵ | | 23 | @Override↵
|
24 | public SoftLock lockRegion() throws CacheException {
↵ | | 24 | public SoftLock lockRegion() throws CacheException {↵
|
25 | throw new UnsupportedOperationException("Illegal attempt to edit read only region");
↵ | | 25 | throw new UnsupportedOperationException("Illegal attempt to edit read only region");↵
|
26 | }↵ | | 26 | }↵
|
27 |
↵ | | |
|
|
28 | ↵ | | 27 | /**↵
|
| | | 28 | * {@inheritDoc}↵
|
| | | 29 | */↵
|
29 | @Override
↵ | | 30 | @Override↵
|
30 | public void unlockItem(Object key, SoftLock lock) throws CacheException {
↵ | | 31 | public void unlockItem(Object key, SoftLock lock) throws CacheException {↵
|
31 | log.error("Illegal attempt to edit read only item");
↵ | | 32 | log.error("Illegal attempt to edit read only item");↵
|
32 | }↵ | | 33 | }↵
|
33 |
↵ | | |
|
|
34 | ↵ | | 34 | /**↵
|
| | | 35 | * {@inheritDoc}↵
|
| | | 36 | */↵
|
35 | @Override
↵ | | 37 | @Override↵
|
36 | public void unlockRegion(SoftLock lock) throws CacheException {
↵ | | 38 | public void unlockRegion(SoftLock lock) throws CacheException {↵
|
37 | log.error("Illegal attempt to edit read only region");
↵ | | 39 | log.error("Illegal attempt to edit read only region");↵
|
38 | | | 40 |
|