From 275d0bbf555c8917be82ce4cc21eb4cabb00f4c5 Mon Sep 17 00:00:00 2001 From: Andrew Branson Date: Fri, 3 Oct 2014 17:30:41 +0200 Subject: 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. --- .../java/com/c2kernel/lifecycle/instance/XOrSplit.java | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'src/main/java/com/c2kernel/lifecycle/instance/XOrSplit.java') diff --git a/src/main/java/com/c2kernel/lifecycle/instance/XOrSplit.java b/src/main/java/com/c2kernel/lifecycle/instance/XOrSplit.java index 28896af..e5b91d3 100644 --- a/src/main/java/com/c2kernel/lifecycle/instance/XOrSplit.java +++ b/src/main/java/com/c2kernel/lifecycle/instance/XOrSplit.java @@ -23,11 +23,7 @@ package com.c2kernel.lifecycle.instance; import java.util.ArrayList; import java.util.StringTokenizer; -import com.c2kernel.common.AccessRightsException; -import com.c2kernel.common.InvalidDataException; -import com.c2kernel.common.InvalidTransitionException; -import com.c2kernel.common.ObjectNotFoundException; -import com.c2kernel.common.PersistencyException; +import com.c2kernel.common.InvalidData; import com.c2kernel.graph.model.DirectedEdge; import com.c2kernel.lookup.AgentPath; import com.c2kernel.lookup.ItemPath; @@ -49,7 +45,7 @@ public class XOrSplit extends Split } @Override - public void runNext(AgentPath agent, ItemPath itemPath) throws InvalidDataException, InvalidTransitionException, AccessRightsException, ObjectNotFoundException, PersistencyException + public void runNext(AgentPath agent, ItemPath itemPath) throws InvalidData { ArrayList nextsToFollow = new ArrayList(); String nexts; @@ -59,7 +55,7 @@ public class XOrSplit extends Split nexts = this.evaluateScript(scriptName, scriptVersion, itemPath).toString(); } catch (ScriptingEngineException e) { Logger.error(e); - throw new InvalidDataException("Error running routing script "+scriptName+" v"+scriptVersion, ""); + throw new InvalidData("Error running routing script "+scriptName+" v"+scriptVersion); } StringTokenizer tok = new StringTokenizer(nexts,","); @@ -74,13 +70,13 @@ public class XOrSplit extends Split } // Logger.debug(0, getID()+" following "+nexts); if (nextsToFollow.size() != 1) - throw new InvalidDataException("not good number of active next", null); + throw new InvalidData("not good number of active next"); followNext((Next)nextsToFollow.get(0), agent, itemPath); } - public void followNext(Next activeNext, AgentPath agent, ItemPath itemPath) throws InvalidDataException, InvalidTransitionException, AccessRightsException, ObjectNotFoundException, PersistencyException { + public void followNext(Next activeNext, AgentPath agent, ItemPath itemPath) throws InvalidData { activeNext.getTerminusVertex().run(agent, itemPath); } -- cgit v1.2.3