summaryrefslogtreecommitdiff
path: root/js/src/Ice/LocatorManager.js
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2016-08-19 21:25:18 +0200
committerJose <jose@zeroc.com>2016-08-19 21:25:18 +0200
commitc8d32e04873be7938915c606027c84c8ab832f6b (patch)
treef862751cfaddcf5bb7b82a7c04a299d471f948d4 /js/src/Ice/LocatorManager.js
parentFix ICE-7278 (diff)
downloadice-c8d32e04873be7938915c606027c84c8ab832f6b.tar.bz2
ice-c8d32e04873be7938915c606027c84c8ab832f6b.tar.xz
ice-c8d32e04873be7938915c606027c84c8ab832f6b.zip
ES6 mapping updates
Diffstat (limited to 'js/src/Ice/LocatorManager.js')
-rw-r--r--js/src/Ice/LocatorManager.js40
1 files changed, 20 insertions, 20 deletions
diff --git a/js/src/Ice/LocatorManager.js b/js/src/Ice/LocatorManager.js
index ddd356939c4..53ee66670ec 100644
--- a/js/src/Ice/LocatorManager.js
+++ b/js/src/Ice/LocatorManager.js
@@ -7,43 +7,44 @@
//
// **********************************************************************
-var Ice = require("../Ice/ModuleRegistry").Ice;
+const Ice = require("../Ice/ModuleRegistry").Ice;
Ice.__M.require(module,
[
- "../Ice/Class",
"../Ice/HashMap",
"../Ice/LocatorInfo",
"../Ice/LocatorTable",
"../Ice/Locator"
]);
-var HashMap = Ice.HashMap;
-var LocatorInfo = Ice.LocatorInfo;
-var LocatorTable = Ice.LocatorTable;
-var LocatorPrx = Ice.LocatorPrx;
+const HashMap = Ice.HashMap;
+const LocatorInfo = Ice.LocatorInfo;
+const LocatorTable = Ice.LocatorTable;
+const LocatorPrx = Ice.LocatorPrx;
-var LocatorManager = Ice.Class({
- __init__: function(properties)
+class LocatorManager
+{
+ constructor(properties)
{
this._background = properties.getPropertyAsInt("Ice.BackgroundLocatorCacheUpdates") > 0;
-
this._table = new HashMap(HashMap.compareEquals); // Map<Ice.LocatorPrx, LocatorInfo>
this._locatorTables = new HashMap(HashMap.compareEquals); // Map<Ice.Identity, LocatorTable>
- },
- destroy: function()
+ }
+
+ destroy()
{
- for(var e = this._table.entries; e !== null; e = e.next)
+ for(let locator of this._table.values())
{
- e.value.destroy();
+ locator.destroy();
}
this._table.clear();
this._locatorTables.clear();
- },
+ }
+
//
// Returns locator info for a given locator. Automatically creates
// the locator info if it doesn't exist yet.
//
- find: function(loc)
+ find(loc)
{
if(loc === null)
{
@@ -53,13 +54,12 @@ var LocatorManager = Ice.Class({
//
// The locator can't be located.
//
- var locator = LocatorPrx.uncheckedCast(loc.ice_locator(null));
+ const locator = LocatorPrx.uncheckedCast(loc.ice_locator(null));
//
// TODO: reap unused locator info objects?
//
-
- var info = this._table.get(locator);
+ let info = this._table.get(locator);
if(info === undefined)
{
//
@@ -67,7 +67,7 @@ var LocatorManager = Ice.Class({
// have only one table per locator (not one per locator
// proxy).
//
- var table = this._locatorTables.get(locator.ice_getIdentity());
+ let table = this._locatorTables.get(locator.ice_getIdentity());
if(table === undefined)
{
table = new LocatorTable();
@@ -80,7 +80,7 @@ var LocatorManager = Ice.Class({
return info;
}
-});
+}
Ice.LocatorManager = LocatorManager;
module.exports.Ice = Ice;