From 40ef76037aeac4ee2b9d857a092e5ea026c0bb5c Mon Sep 17 00:00:00 2001 From: Andrew Branson Date: Wed, 14 May 2014 13:23:26 +0200 Subject: Refactored Proxy update notification server into its own class and thread, so executions return before proxy messages are sent. Another deadlock suspect. --- src/main/java/com/c2kernel/process/Gateway.java | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'src/main/java/com/c2kernel/process') diff --git a/src/main/java/com/c2kernel/process/Gateway.java b/src/main/java/com/c2kernel/process/Gateway.java index 6c7b68d..01cc202 100644 --- a/src/main/java/com/c2kernel/process/Gateway.java +++ b/src/main/java/com/c2kernel/process/Gateway.java @@ -14,6 +14,7 @@ import com.c2kernel.common.ObjectNotFoundException; import com.c2kernel.entity.CorbaServer; import com.c2kernel.entity.proxy.AgentProxy; import com.c2kernel.entity.proxy.ProxyManager; +import com.c2kernel.entity.proxy.ProxyServer; import com.c2kernel.lookup.AgentPath; import com.c2kernel.lookup.LDAPLookup; import com.c2kernel.lookup.LDAPProperties; @@ -57,7 +58,8 @@ public class Gateway static private boolean orbDestroyed = false; static private LDAPLookup mLDAPLookup; static private TransactionManager mStorage; - static private ProxyManager mProxyManager; + static private ProxyManager mProxyManager; + static private ProxyServer mProxyServer; static private CorbaServer mCorbaServer; static private CastorXMLUtility mMarshaller; static private AgentProxy mCurrentUser = null; @@ -151,13 +153,13 @@ public class Gateway mLDAPLookup.install(); // start entity proxy server - ProxyManager.initServer(); + mProxyServer = new ProxyServer(mC2KProps.getProperty("ItemServer.name")); // Init ORB - set various config - String serverName = getProperty("ItemServer.name"); + String serverName = mC2KProps.getProperty("ItemServer.name"); if (serverName != null) mC2KProps.put("com.sun.CORBA.ORBServerHost", serverName); - String serverPort = getProperty("ItemServer.iiop", "1500"); + String serverPort = mC2KProps.getProperty("ItemServer.iiop", "1500"); mC2KProps.put("com.sun.CORBA.ORBServerPort", serverPort); //TODO: externalize this (or replace corba completely) mC2KProps.put("com.sun.CORBA.POA.ORBServerId", "1"); @@ -356,11 +358,13 @@ public class Gateway mLDAPLookup.disconnect(); mLDAPLookup = null; - // shut down proxy manager + // shut down proxy manager & server + if (mProxyServer != null) + mProxyServer.shutdownServer(); if (mProxyManager != null) mProxyManager.shutdown(); mProxyManager = null; - ProxyManager.shutdownServer(); + // close log consoles Logger.closeConsole(); @@ -410,6 +414,11 @@ public class Gateway return mProxyManager; } + + public static ProxyServer getProxyServer() { + return mProxyServer; + } + static public String getCentreId() { return getProperty("LocalCentre"); } -- cgit v1.2.3