From b68ea0f2b12c4c5189c5fc7c182a1b242dc63579 Mon Sep 17 00:00:00 2001 From: Andrew Branson Date: Fri, 3 Oct 2014 23:18:47 +0200 Subject: Rolled back the renaming of existing exceptions. --- .../com/c2kernel/entity/agent/ActiveEntity.java | 26 +++++++------- .../com/c2kernel/entity/agent/ActiveLocator.java | 4 +-- .../c2kernel/entity/agent/AgentImplementation.java | 12 +++---- src/main/java/com/c2kernel/entity/agent/Job.java | 40 +++++++++++----------- 4 files changed, 41 insertions(+), 41 deletions(-) (limited to 'src/main/java/com/c2kernel/entity/agent') diff --git a/src/main/java/com/c2kernel/entity/agent/ActiveEntity.java b/src/main/java/com/c2kernel/entity/agent/ActiveEntity.java index 4f3f622..feb8880 100644 --- a/src/main/java/com/c2kernel/entity/agent/ActiveEntity.java +++ b/src/main/java/com/c2kernel/entity/agent/ActiveEntity.java @@ -21,12 +21,12 @@ package com.c2kernel.entity.agent; import com.c2kernel.common.AccessRightsException; -import com.c2kernel.common.CannotManage; +import com.c2kernel.common.CannotManageException; import com.c2kernel.common.InvalidCollectionModification; -import com.c2kernel.common.InvalidData; -import com.c2kernel.common.InvalidTransition; -import com.c2kernel.common.ObjectAlreadyExists; -import com.c2kernel.common.ObjectNotFound; +import com.c2kernel.common.InvalidDataException; +import com.c2kernel.common.InvalidTransitionException; +import com.c2kernel.common.ObjectAlreadyExistsException; +import com.c2kernel.common.ObjectNotFoundException; import com.c2kernel.common.PersistencyException; import com.c2kernel.common.SystemKey; import com.c2kernel.entity.AgentPOA; @@ -86,7 +86,7 @@ public class ActiveEntity extends AgentPOA @Override public String queryData(String path) throws AccessRightsException, - ObjectNotFound, + ObjectNotFoundException, PersistencyException { synchronized (this) { @@ -108,14 +108,14 @@ public class ActiveEntity extends AgentPOA } @Override - public void addRole(String roleName) throws CannotManage, ObjectNotFound { + public void addRole(String roleName) throws CannotManageException, ObjectNotFoundException { synchronized (this) { mAgentImpl.addRole(roleName); } } @Override - public void removeRole(String roleName) throws CannotManage, ObjectNotFound { + public void removeRole(String roleName) throws CannotManageException, ObjectNotFoundException { synchronized (this) { mAgentImpl.removeRole(roleName); } @@ -124,7 +124,7 @@ public class ActiveEntity extends AgentPOA @Override public void initialise(SystemKey agentId, String propString, String initWfString, String initCollsString) throws AccessRightsException, - InvalidData, PersistencyException, ObjectNotFound { + InvalidDataException, PersistencyException, ObjectNotFoundException { synchronized (this) { mAgentImpl.initialise(agentId, propString, initWfString, initCollsString); } @@ -134,9 +134,9 @@ public class ActiveEntity extends AgentPOA @Override public String requestAction(SystemKey agentID, String stepPath, int transitionID, String requestData) throws AccessRightsException, - InvalidTransition, ObjectNotFound, - InvalidData, PersistencyException, - ObjectAlreadyExists, InvalidCollectionModification { + InvalidTransitionException, ObjectNotFoundException, + InvalidDataException, PersistencyException, + ObjectAlreadyExistsException, InvalidCollectionModification { synchronized (this) { return mAgentImpl.requestAction(agentID, stepPath, transitionID, requestData); @@ -146,7 +146,7 @@ public class ActiveEntity extends AgentPOA @Override public String queryLifeCycle(SystemKey agentId, boolean filter) - throws AccessRightsException, ObjectNotFound, + throws AccessRightsException, ObjectNotFoundException, PersistencyException { synchronized (this) { return mAgentImpl.queryLifeCycle(agentId, filter); diff --git a/src/main/java/com/c2kernel/entity/agent/ActiveLocator.java b/src/main/java/com/c2kernel/entity/agent/ActiveLocator.java index 4b389ec..ecc9d42 100644 --- a/src/main/java/com/c2kernel/entity/agent/ActiveLocator.java +++ b/src/main/java/com/c2kernel/entity/agent/ActiveLocator.java @@ -24,7 +24,7 @@ package com.c2kernel.entity.agent; import java.nio.ByteBuffer; import java.sql.Timestamp; -import com.c2kernel.common.ObjectNotFound; +import com.c2kernel.common.ObjectNotFoundException; import com.c2kernel.common.SystemKey; import com.c2kernel.lookup.AgentPath; import com.c2kernel.lookup.InvalidItemPathException; @@ -73,7 +73,7 @@ public class ActiveLocator extends org.omg.PortableServer.ServantLocatorPOA return Gateway.getCorbaServer().getAgent(syskey); } - catch (ObjectNotFound ex) + catch (ObjectNotFoundException ex) { Logger.error("ObjectNotFoundException::ActiveLocator::preinvoke() "+ex.toString()); throw new org.omg.CORBA.OBJECT_NOT_EXIST(); diff --git a/src/main/java/com/c2kernel/entity/agent/AgentImplementation.java b/src/main/java/com/c2kernel/entity/agent/AgentImplementation.java index 97f5ae4..c9eee73 100644 --- a/src/main/java/com/c2kernel/entity/agent/AgentImplementation.java +++ b/src/main/java/com/c2kernel/entity/agent/AgentImplementation.java @@ -20,9 +20,9 @@ */ package com.c2kernel.entity.agent; -import com.c2kernel.common.CannotManage; +import com.c2kernel.common.CannotManageException; import com.c2kernel.common.ObjectCannotBeUpdated; -import com.c2kernel.common.ObjectNotFound; +import com.c2kernel.common.ObjectNotFoundException; import com.c2kernel.common.SystemKey; import com.c2kernel.entity.AgentOperations; import com.c2kernel.entity.ItemImplementation; @@ -77,22 +77,22 @@ public class AgentImplementation extends ItemImplementation implements } @Override - public void addRole(String roleName) throws CannotManage, ObjectNotFound { + public void addRole(String roleName) throws CannotManageException, ObjectNotFoundException { RolePath newRole = Gateway.getLookup().getRolePath(roleName); try { Gateway.getLookupManager().addRole(mAgentPath, newRole); } catch (ObjectCannotBeUpdated ex) { - throw new CannotManage("Could not update role"); + throw new CannotManageException("Could not update role"); } } @Override - public void removeRole(String roleName) throws CannotManage, ObjectNotFound { + public void removeRole(String roleName) throws CannotManageException, ObjectNotFoundException { RolePath rolePath = Gateway.getLookup().getRolePath(roleName); try { Gateway.getLookupManager().removeRole(mAgentPath, rolePath); } catch (ObjectCannotBeUpdated ex) { - throw new CannotManage("Could not update role"); + throw new CannotManageException("Could not update role"); } } diff --git a/src/main/java/com/c2kernel/entity/agent/Job.java b/src/main/java/com/c2kernel/entity/agent/Job.java index 7172bbb..72c46eb 100644 --- a/src/main/java/com/c2kernel/entity/agent/Job.java +++ b/src/main/java/com/c2kernel/entity/agent/Job.java @@ -22,8 +22,8 @@ package com.c2kernel.entity.agent; import java.util.HashMap; -import com.c2kernel.common.InvalidData; -import com.c2kernel.common.ObjectNotFound; +import com.c2kernel.common.InvalidDataException; +import com.c2kernel.common.ObjectNotFoundException; import com.c2kernel.common.PersistencyException; import com.c2kernel.entity.C2KLocalObject; import com.c2kernel.entity.proxy.ItemProxy; @@ -100,7 +100,7 @@ public class Job implements C2KLocalObject { } - public Job(Activity act, ItemPath itemPath, Transition transition, AgentPath agent, String role) throws InvalidData, ObjectNotFound, InvalidAgentPathException { + public Job(Activity act, ItemPath itemPath, Transition transition, AgentPath agent, String role) throws InvalidDataException, ObjectNotFoundException, InvalidAgentPathException { setItemPath(itemPath); setStepPath(act.getPath()); @@ -192,7 +192,7 @@ public class Job implements C2KLocalObject this.transition = transition; } - public AgentPath getAgentPath() throws ObjectNotFound { + public AgentPath getAgentPath() throws ObjectNotFoundException { if (agentPath == null && getAgentName() != null) { agentPath = Gateway.getLookup().getAgentPath(getAgentName()); } @@ -218,7 +218,7 @@ public class Job implements C2KLocalObject try { if (getAgentPath() != null) return getAgentPath().getUUID().toString(); - } catch (ObjectNotFound e) { } + } catch (ObjectNotFoundException e) { } return null; } @@ -229,7 +229,7 @@ public class Job implements C2KLocalObject return agentName; } - public void setAgentName(String agentName) throws ObjectNotFound + public void setAgentName(String agentName) throws ObjectNotFoundException { this.agentName = agentName; agentPath = Gateway.getLookup().getAgentPath(agentName); @@ -243,7 +243,7 @@ public class Job implements C2KLocalObject agentRole = role; } - public String getSchemaName() throws InvalidData, ObjectNotFound { + public String getSchemaName() throws InvalidDataException, ObjectNotFoundException { if (transition.hasOutcome(actProps)) { Schema schema = transition.getSchema(actProps); return schema.docType; @@ -251,7 +251,7 @@ public class Job implements C2KLocalObject return null; } - public int getSchemaVersion() throws InvalidData, ObjectNotFound { + public int getSchemaVersion() throws InvalidDataException, ObjectNotFoundException { if (transition.hasOutcome(actProps)) { Schema schema = transition.getSchema(actProps); return schema.docVersion; @@ -271,7 +271,7 @@ public class Job implements C2KLocalObject return null; } - public int getScriptVersion() throws InvalidData { + public int getScriptVersion() throws InvalidDataException { if (transition.hasScript(actProps)) { return transition.getScriptVersion(actProps); } @@ -303,7 +303,7 @@ public class Job implements C2KLocalObject } } - public ItemProxy getItemProxy() throws ObjectNotFound, InvalidItemPathException { + public ItemProxy getItemProxy() throws ObjectNotFoundException, InvalidItemPathException { if (item == null) item = Gateway.getProxyManager().getProxy(itemPath); return item; @@ -333,26 +333,26 @@ public class Job implements C2KLocalObject } } - public String getLastView() throws InvalidData { + public String getLastView() throws InvalidDataException { String viewName = (String) getActProp("Viewpoint"); if (viewName.length() > 0) { // find schema String schemaName; try { schemaName = getSchemaName(); - } catch (ObjectNotFound e1) { - throw new InvalidData("Schema "+getActProp("SchemaType")+" v"+getActProp("SchemaVersion")+" not found"); + } catch (ObjectNotFoundException e1) { + throw new InvalidDataException("Schema "+getActProp("SchemaType")+" v"+getActProp("SchemaVersion")+" not found"); } try { Viewpoint view = (Viewpoint) Gateway.getStorage().get(itemPath, ClusterStorage.VIEWPOINT + "/" + schemaName + "/" + viewName, null); return view.getOutcome().getData(); - } catch (ObjectNotFound ex) { // viewpoint doesn't exist yet + } catch (ObjectNotFoundException ex) { // viewpoint doesn't exist yet return null; } catch (PersistencyException e) { Logger.error(e); - throw new InvalidData("ViewpointOutcomeInitiator: PersistencyException loading viewpoint " + throw new InvalidDataException("ViewpointOutcomeInitiator: PersistencyException loading viewpoint " + ClusterStorage.VIEWPOINT + "/" + schemaName + "/" + viewName+" in item "+itemPath.getUUID()); } } @@ -360,7 +360,7 @@ public class Job implements C2KLocalObject return null; } - public OutcomeInitiator getOutcomeInitiator() throws InvalidData { + public OutcomeInitiator getOutcomeInitiator() throws InvalidDataException { String ocInitName = (String) getActProp("OutcomeInit"); OutcomeInitiator ocInit; if (ocInitName.length() > 0) { @@ -370,13 +370,13 @@ public class Job implements C2KLocalObject if (ocInit == null) { Object ocInitObj; if (!Gateway.getProperties().containsKey(ocPropName)) { - throw new InvalidData("Outcome instantiator "+ocPropName+" isn't defined"); + throw new InvalidDataException("Outcome instantiator "+ocPropName+" isn't defined"); } try { ocInitObj = Gateway.getProperties().getInstance(ocPropName); } catch (Exception e) { Logger.error(e); - throw new InvalidData("Outcome instantiator "+ocPropName+" couldn't be instantiated"); + throw new InvalidDataException("Outcome instantiator "+ocPropName+" couldn't be instantiated"); } ocInit = (OutcomeInitiator)ocInitObj; // throw runtime class cast if it isn't one ocInitCache.put(ocPropName, ocInit); @@ -388,7 +388,7 @@ public class Job implements C2KLocalObject return null; } - public String getOutcomeString() throws InvalidData + public String getOutcomeString() throws InvalidDataException { if (outcomeData == null && transition.hasOutcome(actProps)) { outcomeData = getLastView(); @@ -402,7 +402,7 @@ public class Job implements C2KLocalObject return outcomeData; } - public Outcome getOutcome() throws InvalidData, ObjectNotFound + public Outcome getOutcome() throws InvalidDataException, ObjectNotFoundException { return new Outcome(-1, getOutcomeString(), getSchemaName(), getSchemaVersion()); } -- cgit v1.2.3