diff options
Diffstat (limited to 'js/src')
-rw-r--r-- | js/src/Ice/BasicStream.js | 22 | ||||
-rw-r--r-- | js/src/Ice/Communicator.js | 10 | ||||
-rw-r--r-- | js/src/Ice/ConnectionI.js | 27 | ||||
-rw-r--r-- | js/src/Ice/Instance.js | 6 | ||||
-rw-r--r-- | js/src/Ice/PropertyNames.js | 2 | ||||
-rw-r--r-- | js/src/Ice/ValueFactoryManager.js (renamed from js/src/Ice/ObjectFactoryManager.js) | 41 | ||||
-rw-r--r-- | js/src/Ice/sources.json | 2 | ||||
-rw-r--r-- | js/src/IceGrid/IceGrid.js | 3 | ||||
-rw-r--r-- | js/src/IceGrid/sources.json | 3 |
9 files changed, 68 insertions, 48 deletions
diff --git a/js/src/Ice/BasicStream.js b/js/src/Ice/BasicStream.js index 8bfbcaa4778..6647a41139c 100644 --- a/js/src/Ice/BasicStream.js +++ b/js/src/Ice/BasicStream.js @@ -116,7 +116,7 @@ var EncapsDecoder = Class({ if(userFactory !== undefined) { - v = userFactory.create(typeId); + v = userFactory(typeId); } // @@ -128,7 +128,7 @@ var EncapsDecoder = Class({ userFactory = this._servantFactoryManager.find(""); if(userFactory !== undefined) { - v = userFactory.create(typeId); + v = userFactory(typeId); } } @@ -490,7 +490,7 @@ var EncapsDecoder10 = Class(EncapsDecoder, { // if(this._typeId == IceObject.ice_staticId()) { - throw new Ice.NoObjectFactoryException("", mostDerivedId); + throw new Ice.NoValueFactoryException("", mostDerivedId); } v = this.newInstance(this._typeId); @@ -508,7 +508,7 @@ var EncapsDecoder10 = Class(EncapsDecoder, { // if(!this._sliceObjects) { - throw new Ice.NoObjectFactoryException("no object factory found and object slicing is disabled", + throw new Ice.NoValueFactoryException("no value factory found and object slicing is disabled", this._typeId); } @@ -793,7 +793,7 @@ var EncapsDecoder11 = Class(EncapsDecoder, { { if(this._current.sliceType === SliceType.ObjectSlice) { - throw new Ice.NoObjectFactoryException("no object factory found and compact format prevents slicing " + + throw new Ice.NoValueFactoryException("no value factory found and compact format prevents slicing " + "(the sender should use the sliced format instead)", this._current.typeId); } @@ -936,7 +936,7 @@ var EncapsDecoder11 = Class(EncapsDecoder, { // if(!this._sliceObjects) { - throw new Ice.NoObjectFactoryException("no object factory found and object slicing is disabled", + throw new Ice.NoValueFactoryException("no value factory found and object slicing is disabled", this._current.typeId); } @@ -2761,7 +2761,7 @@ var BasicStream = Class({ } catch(ex) { - throw new Ice.NoObjectFactoryException("no object factory", id, ex); + throw new Ice.NoValueFactoryException("no value factory", id, ex); } return obj; @@ -2898,7 +2898,7 @@ var defineBuiltinHelper = function(write, read, sz, format, min, max) writeOpt: function(os, tag, v) { os.writeOptValue(tag, format, write, v); }, readOpt: function(is, tag) { return is.readOptValue(tag, format, read); }, }; - + if(min !== undefined && max !== undefined) { helper.validate = function(v) { @@ -2932,13 +2932,13 @@ var MAX_INT32_VALUE = 0x7FFFFFFF; var MIN_FLOAT32_VALUE = -3.4028234664e+38; var MAX_FLOAT32_VALUE = 3.4028234664e+38; -Ice.ByteHelper = defineBuiltinHelper(stream.writeByte, stream.readByte, 1, Ice.OptionalFormat.F1, +Ice.ByteHelper = defineBuiltinHelper(stream.writeByte, stream.readByte, 1, Ice.OptionalFormat.F1, MIN_UINT8_VALUE, MAX_UINT8_VALUE); Ice.ShortHelper = defineBuiltinHelper(stream.writeShort, stream.readShort, 2, Ice.OptionalFormat.F2, MIN_INT16_VALUE, MAX_INT16_VALUE); -Ice.IntHelper = defineBuiltinHelper(stream.writeInt, stream.readInt, 4, Ice.OptionalFormat.F4, +Ice.IntHelper = defineBuiltinHelper(stream.writeInt, stream.readInt, 4, Ice.OptionalFormat.F4, MIN_INT32_VALUE, MAX_INT32_VALUE); Ice.FloatHelper = defineBuiltinHelper(stream.writeFloat, stream.readFloat, 4, Ice.OptionalFormat.F4, @@ -2964,7 +2964,7 @@ Ice.LongHelper.validate = function(v) // // For a long to be valid both words must be within the range of UINT32 // - return v.low >= MIN_UINT32_VALUE && v.low <= MAX_UINT32_VALUE && + return v.low >= MIN_UINT32_VALUE && v.low <= MAX_UINT32_VALUE && v.high >= MIN_UINT32_VALUE && v.high <= MAX_UINT32_VALUE; }; diff --git a/js/src/Ice/Communicator.js b/js/src/Ice/Communicator.js index a4f172d9a64..819627bb5b3 100644 --- a/js/src/Ice/Communicator.js +++ b/js/src/Ice/Communicator.js @@ -117,10 +117,18 @@ var Communicator = Ice.Class({ }, addObjectFactory: function(factory, id) { - this._instance.servantFactoryManager().add(factory, id); + this._instance.servantFactoryManager().addObjectFactory(factory, id); }, findObjectFactory: function(id) { + return this._instance.servantFactoryManager().findObjectFactory(id); + }, + addValueFactory: function(factory, id) + { + this._instance.servantFactoryManager().add(factory, id); + }, + findValueFactory: function(id) + { return this._instance.servantFactoryManager().find(id); }, getImplicitContext: function() diff --git a/js/src/Ice/ConnectionI.js b/js/src/Ice/ConnectionI.js index bf5d75adb81..c368ca3a07f 100644 --- a/js/src/Ice/ConnectionI.js +++ b/js/src/Ice/ConnectionI.js @@ -140,7 +140,8 @@ var ConnectionI = Class({ { this._servantManager = null; } - this._callback = null; + this._closeCallback = null; + this._heartbeatCallback = null; }, start: function() { @@ -465,7 +466,7 @@ var ConnectionI = Class({ result.__invoke(); return result; }, - setCallback: function(callback) + setCloseCallback: function(callback) { if(this._state >= StateClosed) { @@ -475,7 +476,7 @@ var ConnectionI = Class({ Timer.setImmediate(function() { try { - callback.closed(this); + callback(this); } catch(ex) { @@ -486,9 +487,13 @@ var ConnectionI = Class({ } else { - this._callback = callback; + this._closeCallback = callback; } }, + setHeartbeatCallback: function(callback) + { + this._heartbeatCallback = callback; + }, setACM: function(timeout, close, heartbeat) { if(this._monitor === null || this._state >= StateClosed) @@ -920,7 +925,7 @@ var ConnectionI = Class({ { try { - info.heartbeatCallback.heartbeat(this); + info.heartbeatCallback(this); } catch(ex) { @@ -1063,19 +1068,21 @@ var ConnectionI = Class({ this._writeStream.clear(); this._writeStream.buffer.clear(); - if(this._callback !== null) + if(this._closeCallback !== null) { try { - this._callback.closed(this); + this._closeCallback(this); } catch(ex) { this._logger.error("connection callback exception:\n" + ex + '\n' + this._desc); } - this._callback = null; + this._closeCallback = null; } + this._heartbeatCallback = null; + // // This must be done last as this will cause waitUntilFinished() to return (and communicator // objects such as the timer might be destroyed too). @@ -1843,9 +1850,9 @@ var ConnectionI = Class({ case Protocol.validateConnectionMsg: { TraceUtil.traceRecv(info.stream, this._logger, this._traceLevels); - if(this._callback !== null) + if(this._heartbeatCallback !== null) { - info.heartbeatCallback = this._callback; + info.heartbeatCallback = this._heartbeatCallback; ++this._dispatchCount; } break; diff --git a/js/src/Ice/Instance.js b/js/src/Ice/Instance.js index b26a7b52f77..d856904c412 100644 --- a/js/src/Ice/Instance.js +++ b/js/src/Ice/Instance.js @@ -21,7 +21,7 @@ Ice.__M.require(module, "../Ice/LocatorManager", "../Ice/Logger", "../Ice/ObjectAdapterFactory", - "../Ice/ObjectFactoryManager", + "../Ice/ValueFactoryManager", "../Ice/OutgoingConnectionFactory", "../Ice/Promise", "../Ice/Properties", @@ -52,7 +52,7 @@ var ImplicitContextI = Ice.ImplicitContextI; var LocatorManager = Ice.LocatorManager; var Logger = Ice.Logger; var ObjectAdapterFactory = Ice.ObjectAdapterFactory; -var ObjectFactoryManager = Ice.ObjectFactoryManager; +var ValueFactoryManager = Ice.ValueFactoryManager; var OutgoingConnectionFactory = Ice.OutgoingConnectionFactory; var Promise = Ice.Promise; var Properties = Ice.Properties; @@ -381,7 +381,7 @@ var Instance = Ice.Class({ this._endpointFactoryManager.add(wssEndpointFactory); this._outgoingConnectionFactory = new OutgoingConnectionFactory(communicator, this); - this._servantFactoryManager = new ObjectFactoryManager(); + this._servantFactoryManager = new ValueFactoryManager(); this._objectAdapterFactory = new ObjectAdapterFactory(this, communicator); diff --git a/js/src/Ice/PropertyNames.js b/js/src/Ice/PropertyNames.js index 551757d6d0e..c31d0eb71f0 100644 --- a/js/src/Ice/PropertyNames.js +++ b/js/src/Ice/PropertyNames.js @@ -6,7 +6,7 @@ // ICE_LICENSE file included in this distribution. // // ********************************************************************** -// Generated by makeprops.py from file ./config/PropertyNames.xml, Tue Apr 28 22:03:41 2015 +// Generated by makeprops.py from file ../config/PropertyNames.xml, Tue Nov 24 08:50:30 2015 // IMPORTANT: Do not edit this file -- any edits made here will be lost! diff --git a/js/src/Ice/ObjectFactoryManager.js b/js/src/Ice/ValueFactoryManager.js index e23ba18e4b0..957a5f28ecd 100644 --- a/js/src/Ice/ObjectFactoryManager.js +++ b/js/src/Ice/ValueFactoryManager.js @@ -9,7 +9,7 @@ var Ice = require("../Ice/ModuleRegistry").Ice; Ice.__M.require(module, ["../Ice/Class", "../Ice/HashMap", "../Ice/LocalException"]); - + var HashMap = Ice.HashMap; var AlreadyRegisteredException = Ice.AlreadyRegisteredException; var NotRegisteredException = Ice.NotRegisteredException; @@ -17,10 +17,11 @@ var NotRegisteredException = Ice.NotRegisteredException; // // Only for use by Instance // -var ObjectFactoryManager = Ice.Class({ +var ValueFactoryManager = Ice.Class({ __init__: function() { - this._factoryMap = new HashMap(); // Map<String, ObjectFactory> + this._factoryMap = new HashMap(); // Map<String, ValueFactory> + this._objectFactoryMap = new HashMap(); // Map<String, ObjectFactory> }, add: function(factory, id) { @@ -30,34 +31,44 @@ var ObjectFactoryManager = Ice.Class({ { ex = new AlreadyRegisteredException(); ex.id = id; - ex.kindOfObject = "object factory"; + ex.kindOfObject = "value factory"; throw ex; } this._factoryMap.set(id, factory); }, - remove: function(id) + addObjectFactory: function(factory, id) { - var factory, ex; - factory = this._factoryMap.get(id); - if(factory === undefined) + var o, ex; + o = this._factoryMap.get(id); + if(o !== undefined) { - ex = new NotRegisteredException(); + ex = new AlreadyRegisteredException(); ex.id = id; - ex.kindOfObject = "object factory"; + ex.kindOfObject = "value factory"; throw ex; } - this._factoryMap.delete(id); - factory.destroy(); + this._factoryMap.set(id, + function(s) + { + return factory.create(s); + } + ); + this._objectFactoryMap.set(id, factory); }, find: function(id) { return this._factoryMap.get(id); }, + findObjectFactory: function(id) + { + return this._objectFactoryMap.get(id); + }, destroy: function() { - var oldMap = this._factoryMap, + var oldMap = this._objectFactoryMap, e = oldMap.entries; - this._factoryMap = new HashMap(); // Map<String, ObjectFactory> + this._factoryMap = new HashMap(); // Map<String, ValueFactory> + this._objectFactoryMap = new HashMap(); // Map<String, ObjectFactory> while(e !== null) { @@ -67,5 +78,5 @@ var ObjectFactoryManager = Ice.Class({ } }); -Ice.ObjectFactoryManager = ObjectFactoryManager; +Ice.ValueFactoryManager = ValueFactoryManager; module.exports.Ice = Ice; diff --git a/js/src/Ice/sources.json b/js/src/Ice/sources.json index 99cf32a9021..e97f75ae638 100644 --- a/js/src/Ice/sources.json +++ b/js/src/Ice/sources.json @@ -65,7 +65,6 @@ "ObjectAdapterFactory.js", "ObjectAdapterI.js", "ObjectFactory.js", - "ObjectFactoryManager.js", "ObjectPrx.js", "OpaqueEndpointI.js", "Operation.js", @@ -99,6 +98,7 @@ "TraceUtil.js", "UnknownSlicedObject.js", "UUID.js", + "ValueFactoryManager.js", "WSEndpoint.js", "WSEndpointFactory.js"], diff --git a/js/src/IceGrid/IceGrid.js b/js/src/IceGrid/IceGrid.js index 50ce24bb180..fd05439b1ec 100644 --- a/js/src/IceGrid/IceGrid.js +++ b/js/src/IceGrid/IceGrid.js @@ -15,9 +15,6 @@ module.exports.IceGrid = __M.require(module, "../IceGrid/Descriptor", "../IceGrid/Exception", "../IceGrid/FileParser", - "../IceGrid/Locator", - "../IceGrid/Observer", - "../IceGrid/Query", "../IceGrid/Registry", "../IceGrid/Session", "../IceGrid/UserAccountMapper" diff --git a/js/src/IceGrid/sources.json b/js/src/IceGrid/sources.json index 3ccaca61e66..a6b8622dea2 100644 --- a/js/src/IceGrid/sources.json +++ b/js/src/IceGrid/sources.json @@ -7,9 +7,6 @@ "IceGrid/Descriptor.ice", "IceGrid/Exception.ice", "IceGrid/FileParser.ice", - "IceGrid/Locator.ice", - "IceGrid/Observer.ice", - "IceGrid/Query.ice", "IceGrid/Registry.ice", "IceGrid/Session.ice", "IceGrid/UserAccountMapper.ice"], |