summaryrefslogtreecommitdiff
path: root/src/main/java/com/c2kernel/utils/StateMachineCache.java
diff options
context:
space:
mode:
authorAndrew Branson <andrew.branson@cern.ch>2014-10-03 17:30:41 +0200
committerAndrew Branson <andrew.branson@cern.ch>2014-10-03 17:30:41 +0200
commit275d0bbf555c8917be82ce4cc21eb4cabb00f4c5 (patch)
treeddcc6b14077d90d1b970b67829f07120547dbb62 /src/main/java/com/c2kernel/utils/StateMachineCache.java
parenta139f95bfeca603333b8c0310ae09c6805e58584 (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/utils/StateMachineCache.java')
-rw-r--r--src/main/java/com/c2kernel/utils/StateMachineCache.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/main/java/com/c2kernel/utils/StateMachineCache.java b/src/main/java/com/c2kernel/utils/StateMachineCache.java
index b11ac8b..9b9e464 100644
--- a/src/main/java/com/c2kernel/utils/StateMachineCache.java
+++ b/src/main/java/com/c2kernel/utils/StateMachineCache.java
@@ -23,12 +23,12 @@
*/
package com.c2kernel.utils;
-import com.c2kernel.common.InvalidDataException;
-import com.c2kernel.common.ObjectNotFoundException;
+import com.c2kernel.common.InvalidData;
+import com.c2kernel.common.ObjectNotFound;
+import com.c2kernel.common.PersistencyException;
import com.c2kernel.entity.proxy.ItemProxy;
import com.c2kernel.lifecycle.instance.stateMachine.StateMachine;
import com.c2kernel.persistency.ClusterStorage;
-import com.c2kernel.persistency.ClusterStorageException;
import com.c2kernel.persistency.outcome.Viewpoint;
import com.c2kernel.process.Gateway;
@@ -41,22 +41,22 @@ public class StateMachineCache extends DescriptionObjectCache<StateMachine> {
}
@Override
- public StateMachine loadObject(String name, int version, ItemProxy proxy) throws ObjectNotFoundException, InvalidDataException {
+ public StateMachine loadObject(String name, int version, ItemProxy proxy) throws ObjectNotFound, InvalidData {
StateMachine thisStateMachine;
Viewpoint smView = (Viewpoint)proxy.getObject(ClusterStorage.VIEWPOINT + "/StateMachine/" + version);
String marshalledSM;
try {
marshalledSM = smView.getOutcome().getData();
- } catch (ClusterStorageException ex) {
+ } catch (PersistencyException ex) {
Logger.error(ex);
- throw new ObjectNotFoundException("Problem loading State Machine "+name+" v"+version+": "+ex.getMessage(), "");
+ throw new ObjectNotFound("Problem loading State Machine "+name+" v"+version+": "+ex.getMessage());
}
try {
thisStateMachine = (StateMachine)Gateway.getMarshaller().unmarshall(marshalledSM);
thisStateMachine.validate();
} catch (Exception ex) {
Logger.error(ex);
- throw new InvalidDataException("Could not unmarshall State Machine '"+name+"' v"+version+": "+ex.getMessage(), "");
+ throw new InvalidData("Could not unmarshall State Machine '"+name+"' v"+version+": "+ex.getMessage());
}
thisStateMachine.setName(name);
thisStateMachine.setVersion(version);