The goog.testing.net.XhrIoPool Class

goog.testing.net.XhrIoPool
> goog.net.XhrIoPool
> goog.structs.PriorityPool
> goog.structs.Pool
> goog.Disposable

goog.testing.net.XhrIoPool(opt_xhr)

A pool containing a single mock XhrIo object.

opt_xhr {goog.testing.net.XhrIo=}
The mock XhrIo object.

.addFreeObject(obj)

Inherited from goog.structs.PriorityPool .

Adds an object to the collection of objects that are free. If the object can not be added, then it is disposed. NOTE: This method does not remove the object from the in use collection.

obj {Object}
The object to add to the collection of free objects.

.addOnDisposeCallback(callback, opt_scope)

Inherited from goog.Disposable .

Invokes a callback function when this object is disposed. Callbacks are invoked in the order in which they were added.

callback {!Function}
The callback function.
opt_scope {Object=}
An optional scope to call the callback in.

.adjustForMinMax()

Inherited from goog.structs.PriorityPool .

Adjusts the objects held in the pool to be within the min/max constraints. NOTE: It is possible that the number of objects in the pool will still be greater than the maximum count of objects allowed. This will be the case if no more free objects can be disposed of to get below the minimum count (i.e., all objects are in use).

.contains(obj)

Inherited from goog.structs.Pool .

Returns true if the given object is in the pool.

obj {Object}
The object to check the pool for.
returns {boolean}
Whether the pool contains the object.

.createObject()

Creates an instance of an XhrIo object to use in the pool.

returns {goog.net.XhrIo}
The created object.

.creationStack {string}

Inherited from goog.Disposable .

If monitoring the goog.Disposable instances is enabled, stores the creation stack trace of the Disposable instance.

.dispose()

Inherited from goog.Disposable .

Disposes of the object. If the object hasn't already been disposed of, calls {@link #disposeInternal}. Classes that extend {@code goog.Disposable} should override {@link #disposeInternal} in order to delete references to COM objects, DOM nodes, and other disposable objects. Reentrant.

returns {void}
Nothing.

.disposeObject(obj)

Inherited from goog.structs.Pool .

Should be overriden to dispose of an object. Default implementation is to remove all its members, which should render it useless. Calls the object's {@code dispose()} method, if available.

obj {Object}
The object to dispose.

.getCount()

Inherited from goog.structs.Pool .

Returns the number of objects currently in the pool.

returns {number}
Number of objects currently in the pool.

.getFreeCount()

Inherited from goog.structs.Pool .

Returns the number of objects currently free in the pool.

returns {number}
Number of objects currently free in the pool.

.getInUseCount()

Inherited from goog.structs.Pool .

Returns the number of objects currently in use in the pool.

returns {number}
Number of objects currently in use in the pool.

.getObject(opt_callback, opt_priority)

Inherited from goog.structs.PriorityPool .

Get a new object from the the pool, if there is one available, otherwise return undefined.

opt_callback {Function=}
The function to callback when an object is available. This could be immediately. If this is not present, then an object is immediately returned if available, or undefined if not.
opt_priority {*=}
The priority of the request.
returns {Object|undefined}
The new object from the pool if there is one available and a callback is not given. Otherwise, undefined.

.getXhr()

Get the mock XhrIo used by this pool.

returns {!goog.testing.net.XhrIo}
The mock XhrIo.

.isDisposed()

Inherited from goog.Disposable .

returns {boolean}
Whether the object has been disposed of.

.isEmpty()

Inherited from goog.structs.Pool .

Determines if the pool contains no objects.

returns {boolean}
Whether the pool contains no objects.

.objectCanBeReused(obj)

Inherited from goog.net.XhrIoPool .

Determine if an object has become unusable and should not be used.

obj {Object}
The object to test.
returns {boolean}
Whether the object can be reused, which is true if the object is not disposed and not active.

.registerDisposable(disposable)

Inherited from goog.Disposable .

Associates a disposable object with this object so that they will be disposed together.

disposable {goog.disposable.IDisposable}
that will be disposed when this object is disposed.

.releaseObject(obj)

Inherited from goog.structs.Pool .

Returns an object to the pool of available objects so that it can be reused.

obj {Object}
The object to return to the pool of free objects.
returns {boolean}
Whether the object was found in the Pool's set of in-use objects (in other words, whether any action was taken).

.setDelay(delay)

Inherited from goog.structs.PriorityPool .

Sets the minimum delay between objects being returned by getObject, in milliseconds. This defaults to zero, meaning that no minimum delay is enforced and objects may be used as soon as they're available.

delay {number}
The minimum delay, in milliseconds.

.setMaximumCount(max)

Inherited from goog.structs.Pool .

Sets the maximum count of the pool. If max is less than the max count of the pool, an error is thrown.

max {number}
The maximium count of the pool.

.setMinimumCount(min)

Inherited from goog.structs.Pool .

Sets the minimum count of the pool. If min is greater than the max count of the pool, an error is thrown.

min {number}
The minimum count of the pool.