diff options
Diffstat (limited to 'java/src/IceInternal/ServantManager.java')
-rw-r--r-- | java/src/IceInternal/ServantManager.java | 170 |
1 files changed, 85 insertions, 85 deletions
diff --git a/java/src/IceInternal/ServantManager.java b/java/src/IceInternal/ServantManager.java index 200a150f482..caf5f6ba933 100644 --- a/java/src/IceInternal/ServantManager.java +++ b/java/src/IceInternal/ServantManager.java @@ -14,7 +14,7 @@ public final class ServantManager public synchronized void addServant(Ice.Object servant, Ice.Identity ident, String facet) { - assert(_instance != null); // Must not be called after destruction. + assert(_instance != null); // Must not be called after destruction. if(facet == null) { @@ -48,7 +48,7 @@ public final class ServantManager public synchronized Ice.Object removeServant(Ice.Identity ident, String facet) { - assert(_instance != null); // Must not be called after destruction. + assert(_instance != null); // Must not be called after destruction. if(facet == null) { @@ -58,39 +58,39 @@ public final class ServantManager java.util.HashMap m = (java.util.HashMap)_servantMapMap.get(ident); Ice.Object obj = null; if(m == null || (obj = (Ice.Object)m.remove(facet)) == null) - { - Ice.NotRegisteredException ex = new Ice.NotRegisteredException(); - ex.id = _instance.identityToString(ident); - ex.kindOfObject = "servant"; + { + Ice.NotRegisteredException ex = new Ice.NotRegisteredException(); + ex.id = _instance.identityToString(ident); + ex.kindOfObject = "servant"; if(facet.length() > 0) { ex.id += " -f " + IceUtil.StringUtil.escapeString(facet, ""); } - throw ex; - } + throw ex; + } if(m.isEmpty()) { _servantMapMap.remove(ident); } - return obj; + return obj; } public synchronized java.util.Map removeAllFacets(Ice.Identity ident) { - assert(_instance != null); // Must not be called after destruction. + assert(_instance != null); // Must not be called after destruction. java.util.HashMap m = (java.util.HashMap)_servantMapMap.get(ident); if(m == null) - { - Ice.NotRegisteredException ex = new Ice.NotRegisteredException(); - ex.id = _instance.identityToString(ident); - ex.kindOfObject = "servant"; - throw ex; - } + { + Ice.NotRegisteredException ex = new Ice.NotRegisteredException(); + ex.id = _instance.identityToString(ident); + ex.kindOfObject = "servant"; + throw ex; + } - _servantMapMap.remove(ident); + _servantMapMap.remove(ident); return m; } @@ -98,13 +98,13 @@ public final class ServantManager public synchronized Ice.Object findServant(Ice.Identity ident, String facet) { - // - // This assert is not valid if the adapter dispatch incoming - // requests from bidir connections. This method might be called if - // requests are received over the bidir connection after the - // adapter was deactivated. - // - //assert(_instance != null); // Must not be called after destruction. + // + // This assert is not valid if the adapter dispatch incoming + // requests from bidir connections. This method might be called if + // requests are received over the bidir connection after the + // adapter was deactivated. + // + //assert(_instance != null); // Must not be called after destruction. if(facet == null) { @@ -124,7 +124,7 @@ public final class ServantManager public synchronized java.util.Map findAllFacets(Ice.Identity ident) { - assert(_instance != null); // Must not be called after destruction. + assert(_instance != null); // Must not be called after destruction. java.util.HashMap m = (java.util.HashMap)_servantMapMap.get(ident); if(m != null) @@ -138,13 +138,13 @@ public final class ServantManager public synchronized boolean hasServant(Ice.Identity ident) { - // - // This assert is not valid if the adapter dispatch incoming - // requests from bidir connections. This method might be called if - // requests are received over the bidir connection after the - // adapter was deactivated. - // - //assert(_instance != null); // Must not be called after destruction. + // + // This assert is not valid if the adapter dispatch incoming + // requests from bidir connections. This method might be called if + // requests are received over the bidir connection after the + // adapter was deactivated. + // + //assert(_instance != null); // Must not be called after destruction. java.util.HashMap m = (java.util.HashMap)_servantMapMap.get(ident); if(m == null) @@ -161,16 +161,16 @@ public final class ServantManager public synchronized void addServantLocator(Ice.ServantLocator locator, String category) { - assert(_instance != null); // Must not be called after destruction. + assert(_instance != null); // Must not be called after destruction. - Ice.ServantLocator l = (Ice.ServantLocator)_locatorMap.get(category); - if(l != null) - { - Ice.AlreadyRegisteredException ex = new Ice.AlreadyRegisteredException(); - ex.id = IceUtil.StringUtil.escapeString(category, ""); - ex.kindOfObject = "servant locator"; - throw ex; - } + Ice.ServantLocator l = (Ice.ServantLocator)_locatorMap.get(category); + if(l != null) + { + Ice.AlreadyRegisteredException ex = new Ice.AlreadyRegisteredException(); + ex.id = IceUtil.StringUtil.escapeString(category, ""); + ex.kindOfObject = "servant locator"; + throw ex; + } _locatorMap.put(category, locator); } @@ -178,13 +178,13 @@ public final class ServantManager public synchronized Ice.ServantLocator findServantLocator(String category) { - // - // This assert is not valid if the adapter dispatch incoming - // requests from bidir connections. This method might be called if - // requests are received over the bidir connection after the - // adapter was deactivated. - // - //assert(_instance != null); // Must not be called after destruction. + // + // This assert is not valid if the adapter dispatch incoming + // requests from bidir connections. This method might be called if + // requests are received over the bidir connection after the + // adapter was deactivated. + // + //assert(_instance != null); // Must not be called after destruction. return (Ice.ServantLocator)_locatorMap.get(category); } @@ -195,21 +195,21 @@ public final class ServantManager public ServantManager(Instance instance, String adapterName) { - _instance = instance; - _adapterName = adapterName; + _instance = instance; + _adapterName = adapterName; } protected void finalize() throws Throwable { - // - // Don't check whether destroy() has been called. It might have - // not been called if the associated object adapter was not - // properly deactivated. - // - //IceUtil.Assert.FinalizerAssert(_instance == null); - + // + // Don't check whether destroy() has been called. It might have + // not been called if the associated object adapter was not + // properly deactivated. + // + //IceUtil.Assert.FinalizerAssert(_instance == null); + super.finalize(); } @@ -219,34 +219,34 @@ public final class ServantManager public synchronized void destroy() { - assert(_instance != null); // Must not be called after destruction. - - _servantMapMap.clear(); - - java.util.Iterator p = _locatorMap.entrySet().iterator(); - while(p.hasNext()) - { - java.util.Map.Entry e = (java.util.Map.Entry)p.next(); - Ice.ServantLocator locator = (Ice.ServantLocator)e.getValue(); - try - { - locator.deactivate((String)e.getKey()); - } - catch(java.lang.Exception ex) - { - java.io.StringWriter sw = new java.io.StringWriter(); - java.io.PrintWriter pw = new java.io.PrintWriter(sw); - ex.printStackTrace(pw); - pw.flush(); - String s = "exception during locator deactivation:\n" + "object adapter: `" + _adapterName + "'\n" + - "locator category: `" + e.getKey() + "'\n" + sw.toString(); - _instance.initializationData().logger.error(s); - } - } - - _locatorMap.clear(); - - _instance = null; + assert(_instance != null); // Must not be called after destruction. + + _servantMapMap.clear(); + + java.util.Iterator p = _locatorMap.entrySet().iterator(); + while(p.hasNext()) + { + java.util.Map.Entry e = (java.util.Map.Entry)p.next(); + Ice.ServantLocator locator = (Ice.ServantLocator)e.getValue(); + try + { + locator.deactivate((String)e.getKey()); + } + catch(java.lang.Exception ex) + { + java.io.StringWriter sw = new java.io.StringWriter(); + java.io.PrintWriter pw = new java.io.PrintWriter(sw); + ex.printStackTrace(pw); + pw.flush(); + String s = "exception during locator deactivation:\n" + "object adapter: `" + _adapterName + "'\n" + + "locator category: `" + e.getKey() + "'\n" + sw.toString(); + _instance.initializationData().logger.error(s); + } + } + + _locatorMap.clear(); + + _instance = null; } private Instance _instance; |