diff options
Diffstat (limited to 'src/main/java/com/c2kernel/persistency/RemoteMap.java')
| -rw-r--r-- | src/main/java/com/c2kernel/persistency/RemoteMap.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/main/java/com/c2kernel/persistency/RemoteMap.java b/src/main/java/com/c2kernel/persistency/RemoteMap.java index 9f1d8a3..48ed220 100644 --- a/src/main/java/com/c2kernel/persistency/RemoteMap.java +++ b/src/main/java/com/c2kernel/persistency/RemoteMap.java @@ -30,7 +30,7 @@ public class RemoteMap<V extends C2KLocalObject> extends TreeMap<String, V> impl private int mID=-1;
private String mName;
- protected int mSysKey;
+ protected ItemPath mItemPath;
private String mPath = "";
Object keyLock = null;
TransactionManager storage;
@@ -39,7 +39,7 @@ public class RemoteMap<V extends C2KLocalObject> extends TreeMap<String, V> impl ItemProxy source;
Object mLocker; // if this remote map will participate in a transaction
- public RemoteMap(int sysKey, String path, Object locker) {
+ public RemoteMap(ItemPath itemPath, String path, Object locker) {
super(new Comparator<String>() {
@Override
@@ -54,7 +54,7 @@ public class RemoteMap<V extends C2KLocalObject> extends TreeMap<String, V> impl }
});
- mSysKey = sysKey;
+ mItemPath = itemPath;
mLocker = locker;
// split the path into path/name
@@ -88,7 +88,7 @@ public class RemoteMap<V extends C2KLocalObject> extends TreeMap<String, V> impl };
try {
- source = Gateway.getProxyManager().getProxy(new ItemPath(sysKey));
+ source = Gateway.getProxyManager().getProxy(mItemPath);
source.subscribe(new MemberSubscription<V>(listener, path, false));
} catch (Exception ex) {
Logger.error("Error subscribing to remote map. Changes will not be received");
@@ -103,7 +103,7 @@ public class RemoteMap<V extends C2KLocalObject> extends TreeMap<String, V> impl synchronized(this) {
String[] keys;
try {
- keys = storage.getClusterContents(mSysKey, mPath+mName);
+ keys = storage.getClusterContents(mItemPath, mPath+mName);
for (String key : keys) super.put(key, null);
} catch (ClusterStorageException e) {
Logger.error(e);
@@ -198,7 +198,7 @@ public class RemoteMap<V extends C2KLocalObject> extends TreeMap<String, V> impl try {
V value = super.get(key);
if (value == null) {
- value = (V)storage.get(mSysKey, mPath+mName+"/"+key, mLocker);
+ value = (V)storage.get(mItemPath, mPath+mName+"/"+key, mLocker);
super.put(key, value);
}
return value;
@@ -238,7 +238,7 @@ public class RemoteMap<V extends C2KLocalObject> extends TreeMap<String, V> impl public synchronized V put(String key, V value) {
try {
synchronized(this) {
- storage.put(mSysKey, value, mLocker);
+ storage.put(mItemPath, value, mLocker);
return putLocal(key, value);
}
} catch (ClusterStorageException e) {
@@ -259,7 +259,7 @@ public class RemoteMap<V extends C2KLocalObject> extends TreeMap<String, V> impl loadKeys();
if (containsKey(key)) try {
synchronized(keyLock) {
- storage.remove(mSysKey, mPath+mName+"/"+key, mLocker);
+ storage.remove(mItemPath, mPath+mName+"/"+key, mLocker);
return super.remove(key);
}
} catch (ClusterStorageException e) {
|
