summaryrefslogtreecommitdiff
path: root/src/main/java/com/c2kernel/persistency/ProxyLoader.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/c2kernel/persistency/ProxyLoader.java')
-rw-r--r--src/main/java/com/c2kernel/persistency/ProxyLoader.java31
1 files changed, 16 insertions, 15 deletions
diff --git a/src/main/java/com/c2kernel/persistency/ProxyLoader.java b/src/main/java/com/c2kernel/persistency/ProxyLoader.java
index 26e43d7..f8704e3 100644
--- a/src/main/java/com/c2kernel/persistency/ProxyLoader.java
+++ b/src/main/java/com/c2kernel/persistency/ProxyLoader.java
@@ -22,7 +22,8 @@ package com.c2kernel.persistency;
import java.util.HashMap;
import java.util.StringTokenizer;
-import com.c2kernel.common.ObjectNotFoundException;
+import com.c2kernel.common.ObjectNotFound;
+import com.c2kernel.common.PersistencyException;
import com.c2kernel.entity.AgentHelper;
import com.c2kernel.entity.C2KLocalObject;
import com.c2kernel.entity.Item;
@@ -43,12 +44,12 @@ public class ProxyLoader extends ClusterStorage {
Lookup lookup;
@Override
- public void open(Authenticator auth) throws ClusterStorageException {
+ public void open(Authenticator auth) throws PersistencyException {
lookup = Gateway.getLookup();
}
@Override
- public void close() throws ClusterStorageException {
+ public void close() throws PersistencyException {
}
// introspection
@Override
@@ -68,7 +69,7 @@ public class ProxyLoader extends ClusterStorage {
// retrieve object by path
@Override
- public C2KLocalObject get(ItemPath thisItem, String path) throws ClusterStorageException {
+ public C2KLocalObject get(ItemPath thisItem, String path) throws PersistencyException {
try {
Item thisEntity = getIOR(thisItem);
String type = getClusterType(path);
@@ -83,33 +84,33 @@ public class ProxyLoader extends ClusterStorage {
else
return (C2KLocalObject)Gateway.getMarshaller().unmarshall(queryData);
}
- } catch (ObjectNotFoundException e) {
+ } catch (ObjectNotFound e) {
return null;
} catch (Exception e) {
Logger.error(e);
- throw new ClusterStorageException(e.getMessage());
+ throw new PersistencyException(e.getMessage());
}
return null;
}
// store object by path
@Override
- public void put(ItemPath thisItem, C2KLocalObject obj) throws ClusterStorageException {
+ public void put(ItemPath thisItem, C2KLocalObject obj) throws PersistencyException {
// not supported
- throw new ClusterStorageException("Cannot write to items through the ProxyLoader");
+ throw new PersistencyException("Cannot write to items through the ProxyLoader");
}
// delete cluster
@Override
- public void delete(ItemPath thisItem, String path) throws ClusterStorageException {
+ public void delete(ItemPath thisItem, String path) throws PersistencyException {
// not supported
- throw new ClusterStorageException("Cannot write to items through the ProxyLoader");
+ throw new PersistencyException("Cannot write to items through the ProxyLoader");
}
/* navigation */
// directory listing
@Override
- public String[] getClusterContents(ItemPath thisItem, String path) throws ClusterStorageException {
+ public String[] getClusterContents(ItemPath thisItem, String path) throws PersistencyException {
try {
Item thisEntity = getIOR(thisItem);
String contents = thisEntity.queryData(path+"/all");
@@ -121,11 +122,11 @@ public class ProxyLoader extends ClusterStorage {
return result;
} catch (Exception e) {
Logger.error(e);
- throw new ClusterStorageException(e.getMessage());
+ throw new PersistencyException(e.getMessage());
}
}
- private Item getIOR(ItemPath thisPath) throws ClusterStorageException {
+ private Item getIOR(ItemPath thisPath) throws PersistencyException {
if (entities.containsKey(thisPath)) {
// check the cache
Logger.msg(7, "ProxyLoader.getIOR() - "+thisPath+" cached.");
@@ -143,7 +144,7 @@ public class ProxyLoader extends ClusterStorage {
try {
thisItem = AgentHelper.narrow(ior);
} catch (org.omg.CORBA.BAD_PARAM ex2) {
- throw new ClusterStorageException ("Could not narrow "+thisItem+" as a known Entity type");
+ throw new PersistencyException ("Could not narrow "+thisItem+" as a known Entity type");
}
}
@@ -151,7 +152,7 @@ public class ProxyLoader extends ClusterStorage {
entities.put(thisPath, thisItem);
return thisItem;
} catch (Exception e) {
- throw new ClusterStorageException("Error narrowing "+thisPath+": "+e.getMessage());
+ throw new PersistencyException("Error narrowing "+thisPath+": "+e.getMessage());
}
}
}