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. --- .../agent/CreateAgentFromDescription.java | 28 +++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'src/main/java/com/c2kernel/lifecycle/instance/predefined/agent/CreateAgentFromDescription.java') diff --git a/src/main/java/com/c2kernel/lifecycle/instance/predefined/agent/CreateAgentFromDescription.java b/src/main/java/com/c2kernel/lifecycle/instance/predefined/agent/CreateAgentFromDescription.java index 564c5db..a2dfeae 100644 --- a/src/main/java/com/c2kernel/lifecycle/instance/predefined/agent/CreateAgentFromDescription.java +++ b/src/main/java/com/c2kernel/lifecycle/instance/predefined/agent/CreateAgentFromDescription.java @@ -22,11 +22,11 @@ package com.c2kernel.lifecycle.instance.predefined.agent; import java.util.Arrays; -import com.c2kernel.common.CannotManage; -import com.c2kernel.common.InvalidData; -import com.c2kernel.common.ObjectAlreadyExists; +import com.c2kernel.common.CannotManageException; +import com.c2kernel.common.InvalidDataException; +import com.c2kernel.common.ObjectAlreadyExistsException; import com.c2kernel.common.ObjectCannotBeUpdated; -import com.c2kernel.common.ObjectNotFound; +import com.c2kernel.common.ObjectNotFoundException; import com.c2kernel.common.PersistencyException; import com.c2kernel.entity.CorbaServer; import com.c2kernel.entity.agent.ActiveEntity; @@ -57,21 +57,21 @@ public class CreateAgentFromDescription extends CreateItemFromDescription *
  • Comma-delimited Role names to assign to the agent. Must already exist.
  • *
  • Initial properties to set in the new Agent
  • * - * @throws ObjectNotFound - * @throws InvalidData The input parameters were incorrect - * @throws ObjectAlreadyExists The Agent already exists - * @throws CannotManage The Agent could not be created + * @throws ObjectNotFoundException + * @throws InvalidDataException The input parameters were incorrect + * @throws ObjectAlreadyExistsException The Agent already exists + * @throws CannotManageException The Agent could not be created * @throws ObjectCannotBeUpdated The addition of the new entries into the LookupManager failed * @see com.c2kernel.lifecycle.instance.predefined.item.CreateItemFromDescription#runActivityLogic(com.c2kernel.lookup.AgentPath, int, int, java.lang.String) */ @Override protected String runActivityLogic(AgentPath agent, ItemPath item, - int transitionID, String requestData) throws ObjectNotFound, InvalidData, ObjectAlreadyExists, CannotManage, ObjectCannotBeUpdated { + int transitionID, String requestData) throws ObjectNotFoundException, InvalidDataException, ObjectAlreadyExistsException, CannotManageException, ObjectCannotBeUpdated { String[] params = getDataList(requestData); if (Logger.doLog(3)) Logger.msg(3, "CreateAgentFromDescription: called by "+agent+" on "+item+" with parameters "+Arrays.toString(params)); if (params.length < 3 || params.length > 4) - throw new InvalidData("CreateAgentFromDescription: Invalid parameters "+Arrays.toString(params)); + throw new InvalidDataException("CreateAgentFromDescription: Invalid parameters "+Arrays.toString(params)); String newName = params[0]; String descVer = params[1]; @@ -90,8 +90,8 @@ public class CreateAgentFromDescription extends CreateItemFromDescription // check if the path is already taken try { Gateway.getLookup().getAgentPath(newName); - throw new ObjectAlreadyExists("The agent name " +newName+ " exists already."); - } catch (ObjectNotFound ex) { } + throw new ObjectAlreadyExistsException("The agent name " +newName+ " exists already."); + } catch (ObjectNotFoundException ex) { } // generate new entity key Logger.msg(6, "CreateItemFromDescription - Requesting new agent path"); @@ -103,7 +103,7 @@ public class CreateAgentFromDescription extends CreateItemFromDescription // create the Item object Logger.msg(3, "CreateItemFromDescription - Creating Item"); CorbaServer factory = Gateway.getCorbaServer(); - if (factory == null) throw new CannotManage("This process cannot create new Items"); + if (factory == null) throw new CannotManageException("This process cannot create new Items"); ActiveEntity newAgent = factory.createAgent(newAgentPath); Gateway.getLookupManager().add(newAgentPath); @@ -122,7 +122,7 @@ public class CreateAgentFromDescription extends CreateItemFromDescription // TODO Auto-generated catch block e.printStackTrace(); } catch (Exception e) { - throw new InvalidData("CreateAgentFromDescription: Problem initializing new Agent. See log: "+e.getMessage()); + throw new InvalidDataException("CreateAgentFromDescription: Problem initializing new Agent. See log: "+e.getMessage()); } // add roles if given -- cgit v1.2.3