From 482b98e869d07802310e249d09d784c63f9a86b6 Mon Sep 17 00:00:00 2001 From: Andrew Branson Date: Fri, 19 Sep 2014 15:40:50 +0200 Subject: Introduced static method ItemPath.fromUUIDString and made the UUID constructor protected to better handle ItemPath and AgentPath construction with String UUIDs, throwing the right exceptions. --- src/main/java/com/c2kernel/entity/agent/ActiveLocator.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/main/java/com/c2kernel/entity/agent/ActiveLocator.java') diff --git a/src/main/java/com/c2kernel/entity/agent/ActiveLocator.java b/src/main/java/com/c2kernel/entity/agent/ActiveLocator.java index 966b265..a1561ed 100644 --- a/src/main/java/com/c2kernel/entity/agent/ActiveLocator.java +++ b/src/main/java/com/c2kernel/entity/agent/ActiveLocator.java @@ -14,11 +14,11 @@ package com.c2kernel.entity.agent; import java.nio.ByteBuffer; import java.sql.Timestamp; -import java.util.UUID; import com.c2kernel.common.ObjectNotFoundException; +import com.c2kernel.common.SystemKey; import com.c2kernel.lookup.AgentPath; -import com.c2kernel.lookup.InvalidAgentPathException; +import com.c2kernel.lookup.InvalidItemPathException; import com.c2kernel.process.Gateway; import com.c2kernel.utils.Logger; @@ -55,7 +55,7 @@ public class ActiveLocator extends org.omg.PortableServer.ServantLocatorPOA ByteBuffer bb = ByteBuffer.wrap(oid); long msb = bb.getLong(); long lsb = bb.getLong(); - AgentPath syskey = new AgentPath(new UUID(msb, lsb)); + AgentPath syskey = new AgentPath(new SystemKey(msb, lsb)); Logger.msg(1,"==========================================================="); Logger.msg(1,"Agent called at "+new Timestamp( System.currentTimeMillis()) +": " + operation + @@ -68,8 +68,8 @@ public class ActiveLocator extends org.omg.PortableServer.ServantLocatorPOA { Logger.error("ObjectNotFoundException::ActiveLocator::preinvoke() "+ex.toString()); throw new org.omg.CORBA.OBJECT_NOT_EXIST(); - } catch (InvalidAgentPathException ex) { - Logger.error("InvalidAgentPathException::ActiveLocator::preinvoke() "+ex.toString()); + } catch (InvalidItemPathException ex) { + Logger.error("InvalidItemPathException::ActiveLocator::preinvoke() "+ex.toString()); throw new org.omg.CORBA.INV_OBJREF(); } } -- cgit v1.2.3