diff options
| author | Andrew Branson <andrew.branson@cern.ch> | 2014-10-03 17:30:41 +0200 |
|---|---|---|
| committer | Andrew Branson <andrew.branson@cern.ch> | 2014-10-03 17:30:41 +0200 |
| commit | 275d0bbf555c8917be82ce4cc21eb4cabb00f4c5 (patch) | |
| tree | ddcc6b14077d90d1b970b67829f07120547dbb62 /src/main/java/com/c2kernel/collection/DependencyDescription.java | |
| parent | a139f95bfeca603333b8c0310ae09c6805e58584 (diff) | |
Huge exception overhaul: Merged ClusterStorageException with
PersistencyException. Replaced MembershipException with
InvalidCollectionModification CORBA Exception. Made all predef steps
throw more accurate exceptions when they go wrong, and let more
exceptions bubble through from underneath.
Diffstat (limited to 'src/main/java/com/c2kernel/collection/DependencyDescription.java')
| -rw-r--r-- | src/main/java/com/c2kernel/collection/DependencyDescription.java | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/main/java/com/c2kernel/collection/DependencyDescription.java b/src/main/java/com/c2kernel/collection/DependencyDescription.java index 0e6bb91..aff2aca 100644 --- a/src/main/java/com/c2kernel/collection/DependencyDescription.java +++ b/src/main/java/com/c2kernel/collection/DependencyDescription.java @@ -20,7 +20,9 @@ */
package com.c2kernel.collection;
-import com.c2kernel.common.ObjectNotFoundException;
+import com.c2kernel.common.InvalidCollectionModification;
+import com.c2kernel.common.ObjectAlreadyExists;
+import com.c2kernel.common.ObjectNotFound;
import com.c2kernel.lookup.ItemPath;
import com.c2kernel.property.PropertyDescriptionList;
import com.c2kernel.property.PropertyUtility;
@@ -39,7 +41,7 @@ public class DependencyDescription extends Dependency implements CollectionDescr }
@Override
- public Collection<DependencyMember> newInstance() throws ObjectNotFoundException{
+ public Collection<DependencyMember> newInstance() throws ObjectNotFound{
String depName = getName().replaceFirst("\'$", ""); // HACK: Knock the special 'prime' off the end for the case of descriptions of descriptions
Dependency newDep = new Dependency(depName);
if (mMembers.list.size() == 1) { // constrain the members based on the property description
@@ -56,21 +58,21 @@ public class DependencyDescription extends Dependency implements CollectionDescr @Override
- public DependencyMember addMember(ItemPath itemPath) throws MembershipException {
+ public DependencyMember addMember(ItemPath itemPath) throws InvalidCollectionModification, ObjectAlreadyExists {
checkMembership();
return super.addMember(itemPath);
}
@Override
public DependencyMember addMember(ItemPath itemPath, CastorHashMap props, String classProps)
- throws MembershipException {
+ throws InvalidCollectionModification, ObjectAlreadyExists {
checkMembership();
return super.addMember(itemPath, props, classProps);
}
- public void checkMembership() throws MembershipException {
+ public void checkMembership() throws InvalidCollectionModification {
if (mMembers.list.size() > 0)
- throw new MembershipException("Dependency descriptions may not have more than one member.");
+ throw new InvalidCollectionModification("Dependency descriptions may not have more than one member.");
}
}
|
