goog.testing.net.XhrIoPool
Provided By | |
---|---|
Extends | |
All Implemented Interfaces |
A pool containing a single mock XhrIo object.
new XhrIoPool( opt_xhr )
Parameters |
|
---|
Instance Methods
this.addFreeObject( obj ) → void
void
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.
Defined by | |||||
---|---|---|---|---|---|
Overrides | |||||
Parameters |
|
this.addOnDisposeCallback<T>( callback, opt_scope ) → void
void
Invokes a callback function when this object is disposed. Callbacks are invoked in the order in which they were added. If a callback is added to an already disposed Disposable, it will be called immediately.
Defined by | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
this.adjustForMinMax() → void
void
Override adjustForMinMax to not call handleRequests because that causes problems. See b/31041087.
Overrides | |
---|---|
Parameters | None. |
this.contains( obj ) → boolean
boolean
Returns true if the given object is in the pool.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
| ||||
Returns |
|
this.createObject() → goog.net.XhrIo
goog.net.XhrIo
Creates an instance of an XhrIo object to use in the pool.
Overrides | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.dispose() → ?
?
Disposes of the object and its resources.
Overrides | ||
---|---|---|
Specified by | ||
Parameters | None. | |
Returns |
|
this.disposeInternal() → void
void
Disposes of the pool and all objects currently held in the pool.
Defined by | |
---|---|
Overrides | |
Parameters | None. |
this.disposeObject( obj ) → void
void
Should be overridden to dispose of an object. Default implementation is to
remove all its members, which should render it useless. Calls the object's
dispose()
method, if available.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
|
this.getCount() → number
number
Returns the number of objects currently in the pool.
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.getDisposed() → boolean
boolean
warning Deprecated | Use |
---|
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.getFreeCount() → number
number
Returns the number of objects currently free in the pool.
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.getInUseCount() → number
number
Returns the number of objects currently in use in the pool.
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.getObject( opt_callback, opt_priority ) → ?
?
Get a new object from the pool, if there is one available, otherwise return undefined.
Defined by | |||||||||
---|---|---|---|---|---|---|---|---|---|
Overrides | |||||||||
Parameters |
| ||||||||
Returns |
|
this.getXhr() → goog.testing.net.XhrIo
goog.testing.net.XhrIo
Get the mock XhrIo used by this pool.
Parameters | None. | ||
---|---|---|---|
Returns |
|
this.isDisposed() → boolean
boolean
Overrides | |||
---|---|---|---|
Specified by | |||
Parameters | None. | ||
Returns |
|
this.isEmpty() → boolean
boolean
Determines if the pool contains no objects.
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.objectCanBeReused( obj ) → boolean
boolean
this.registerDisposable( disposable ) → void
void
Associates a disposable object with this object so that they will be disposed together.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
|
this.releaseObject( obj ) → boolean
boolean
Returns an object to the pool of available objects so that it can be reused.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
| ||||
Returns |
|
this.setDelay( delay ) → void
void
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.
Defined by | |||||
---|---|---|---|---|---|
Overrides | |||||
Parameters |
|
this.setMaximumCount( max ) → void
void
Sets the maximum count of the pool. If max is less than the min count of the pool, an error is thrown.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
|
this.setMinimumCount( min ) → void
void
Sets the minimum count of the pool. If min is greater than the max count of the pool, an error is thrown.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
|
Instance Properties
this.creationStack → (string|undefined)
(string|undefined)
If monitoring the goog.Disposable instances is enabled, stores the creation stack trace of the Disposable instance.
this.delay → number
number
The minimum delay between objects being made available, in milliseconds. If this is 0, no minimum delay is enforced.
this.lastAccess → (number|null)
(number|null)
The time of the last object being made available, in milliseconds since the epoch (i.e., the result of Date#toTime). If this is null, no access has occurred yet.