goog.testing.net.XhrIoPool
Classgoog.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
=}
.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
}
.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
}
opt_scope
{Object
=}
.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
}
boolean
}
.createObject()
Creates an instance of an XhrIo object to use in the pool.
goog.net.XhrIo
}
.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.
void
}
.disposeInternal()
[protected]Inherited from goog.structs.PriorityPool
.
Disposes of the pool and all objects currently held in the pool.
.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
}
.getCount()
Inherited from goog.structs.Pool
.
Returns the number of objects currently in the pool.
number
}
.getDisposed
[deprecated]Deprecated. Use {@link #isDisposed} instead.
Inherited from goog.Disposable
.
boolean
}
.getFreeCount()
Inherited from goog.structs.Pool
.
Returns the number of objects currently free in the pool.
number
}
.getInUseCount()
Inherited from goog.structs.Pool
.
Returns the number of objects currently in use in the pool.
number
}
.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
=}
opt_priority
{*=}
Object
|undefined
}
.getXhr()
Get the mock XhrIo used by this pool.
goog.testing.net.XhrIo
}
.isDisposed()
Inherited from goog.Disposable
.
boolean
}
.isEmpty()
Inherited from goog.structs.Pool
.
Determines if the pool contains no objects.
boolean
}
.objectCanBeReused(obj)
Inherited from goog.net.XhrIoPool
.
Determine if an object has become unusable and should not be used.
obj
{Object
}
boolean
}
.registerDisposable(disposable)
Inherited from goog.Disposable
.
Associates a disposable object with this object so that they will be disposed together.
disposable
{goog.disposable.IDisposable
}
.releaseObject(obj)
Inherited from goog.structs.Pool
.
Returns an object to the pool of available objects so that it can be reused.
obj
{Object
}
boolean
}
.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
}
.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
}
.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
}