1 | public class CollectionRegionImpl extends TransactionalDataRegionAdapter implements CollectionRegion {↵ | | 1 | public class EntityRegionImpl extends TransactionalDataRegionAdapter implements EntityRegion {↵
|
|
2 | public static final String TYPE = "COLL";↵ | | 2 | public static final String TYPE = "ENTITY";↵
|
| | | 3 | ↵
|
3 | private boolean optimistic;↵ | | 4 | private boolean optimistic;↵
|
|
4 | public CollectionRegionImpl(Cache jbcCache, String regionName, String regionPrefix, CacheDataDescription metadata) {↵ | | 5 | public EntityRegionImpl(Cache jbcCache, String regionName, String regionPrefix, CacheDataDescription metadata) {↵
|
5 | super(jbcCache, regionName, regionPrefix, metadata);↵ | | 6 | super(jbcCache, regionName, regionPrefix, metadata);↵
|
6 | optimistic = (jbcCache.getConfiguration().getNodeLockingScheme() == NodeLockingScheme.OPTIMISTIC);↵ | | 7 | optimistic = (jbcCache.getConfiguration().getNodeLockingScheme() == NodeLockingScheme.OPTIMISTIC);↵
|
7 | }↵ | | 8 | }↵
|
|
8 | public Collection↵ | | 9 | /**↵
|
| | | 10 | * {@inheritDoc}↵
|
| | | 11 | */↵
|
9 | RegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException {↵ | | 12 | public EntityRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException {↵
|
10 | if (AccessType.READ_ONLY.equals(accessType)) {↵ | | 13 | if (AccessType.READ_ONLY.equals(accessType)) {↵
|
11 | return optimistic ? new OptimisticReadOnlyAccess(this) : new ReadOnlyAccess(this);↵ | | 14 | return optimistic ? new OptimisticReadOnlyAccess(this) : new ReadOnlyAccess(this);↵
|
12 | }↵ | | 15 | }↵
|
13 | if (AccessType.TRANSACTIONAL.equals(accessType)) {↵ | | 16 | if (AccessType.TRANSACTIONAL.equals(accessType)) {↵
|
14 | return optimistic ? new OptimisticTransactionalAccess(this) : new TransactionalAccess(this);↵ | | 17 | return optimistic ? new OptimisticTransactionalAccess(this) : new TransactionalAccess(this);↵
|
15 | }↵ | | 18 | }↵
|
|
16 | // todo : add support for READ_WRITE ( + NONSTRICT_READ_WRITE ??? )↵ | | 19 | // todo : add support for READ_WRITE ( + NONSTRICT_READ_WRITE ??? )↵
|
|
17 | throw new CacheException("unsupported access type [" + accessType.getName() + "]");↵ | | 20 | throw new CacheException("unsupported access type [" + accessType.getName() + "]");↵
|
18 | }↵ | | 21 | }↵
|
|
19 | @Override↵ | | 22 | @Override↵
|
20 | protected Fqn<String> createRegionFqn(String regionName, String regionPrefix) {↵ | | 23 | protected Fqn<String> createRegionFqn(String regionName, String regionPrefix) {↵
|
21 | return getTypeLastRegionFqn(regionName, regionPrefix, TYPE) | | 24 | return getTypeLastRegionFqn(regionName, regionPrefix, TYPE)
|