diff options
| author | Andrew Branson <andrew.branson@cern.ch> | 2014-05-14 13:23:26 +0200 |
|---|---|---|
| committer | Andrew Branson <andrew.branson@cern.ch> | 2014-05-14 13:23:26 +0200 |
| commit | 40ef76037aeac4ee2b9d857a092e5ea026c0bb5c (patch) | |
| tree | 9b3a11ee847e4efe4099143098ca95b66bfb9ba2 /src/main/java/com/c2kernel/process | |
| parent | b8f1b6c330ba5117a608ae8113bad6a07d471881 (diff) | |
Refactored Proxy update notification server into its own class and
thread, so executions return before proxy messages are sent. Another
deadlock suspect.
Diffstat (limited to 'src/main/java/com/c2kernel/process')
| -rw-r--r-- | src/main/java/com/c2kernel/process/Gateway.java | 21 |
1 files changed, 15 insertions, 6 deletions
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");
}
|
