goog.Disposable | |
goog.structs.Pool | goog.Disposable |
goog.structs.PriorityPool | goog.structs.Pool |
goog.net.XhrIoPool | goog.structs.PriorityPool |
goog.testing.net.XhrIoPool | goog.net.XhrIoPool |
opt_headers
: goog.structs.Map=
Map of default headers to add to every
request.
|
opt_minCount
: number=
Minimum number of objects (Default: 1).
|
opt_maxCount
: number=
Maximum number of objects (Default: 10).
|
Creates an instance of an XhrIo object to use in the pool.
Returns: !goog.net.XhrIo
The created object.
|
code » | |
Determine if an object has become unusable and should not be used.
|
code » |
![]()
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.
Arguments:
|
code » | |||
![]()
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).
|
code » | |||
![]()
No description.
|
code » | |||
![]()
Get a new object from the the pool, if there is one available, otherwise
return undefined.
Arguments:
Returns: VALUE | undefined
The new object from the pool if there is one
available and a callback is not given. Otherwise, undefined.
|
code » | |||
![]()
Handles the request queue. Tries to fires off as many queued requests as
possible.
|
code » | |||
![]()
No description.
|
code » |
![]()
Adds an object to the collection of objects that are free. If the object can
not be added, then it is disposed.
Arguments:
|
code » | ||
![]()
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).
|
code » | ||
Returns true if the given object is in the pool.
Arguments:
Returns: boolean
Whether the pool contains the object.
|
code » | ||
![]()
Should be overridden by sub-classes to return an instance of the object type
that is expected in the pool.
Returns: T
The created object.
|
code » | ||
![]()
Disposes of the pool and all objects currently held in the pool.
|
code » | ||
![]()
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.
Arguments:
|
code » | ||
Returns the number of objects currently in the pool.
Returns: number
Number of objects currently in the pool.
|
code » | ||
Returns the number of objects currently free in the pool.
Returns: number
Number of objects currently free in the pool.
|
code » | ||
Returns the number of objects currently in use in the pool.
Returns: number
Number of objects currently in use in the pool.
|
code » | ||
![]()
No description.
Returns: T | undefined
A new object from the pool if there is one available,
otherwise undefined.
|
code » | ||
Determines if the pool contains no objects.
Returns: boolean
Whether the pool contains no objects.
|
code » | ||
Should be overridden to determine whether an object has become unusable and
should not be returned by getObject(). Calls the object's
canBeReused() method, if available.
Arguments:
Returns: boolean
Whether the object can be reused.
|
code » | ||
Returns an object to the pool of available objects so that it can be reused.
Arguments:
Returns: boolean
Whether the object was found in the Pool's set of in-use
objects (in other words, whether any action was taken).
|
code » | ||
![]()
Removes a free object from the collection of objects that are free so that it
can be used.
NOTE: This method does not mark the returned object as in use.
Returns: T | undefined
The object removed from the free collection, if there
is one available. Otherwise, undefined.
|
code » | ||
![]()
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.
Arguments:
|
code » | ||
![]()
Sets the maximum count of the pool.
If max is less than the max count of the pool, an error is thrown.
Arguments:
|
code » | ||
![]()
Sets the minimum count of the pool.
If min is greater than the max count of the pool, an error is thrown.
Arguments:
|
code » |
![]()
Invokes a callback function when this object is disposed. Callbacks are
invoked in the order in which they were added.
Arguments:
|
code » | |||
![]()
Disposes of the object. If the object hasn't already been disposed of, calls
#disposeInternal . Classes that extend goog.Disposable should
override #disposeInternal in order to delete references to COM
objects, DOM nodes, and other disposable objects. Reentrant.
Returns: void
Nothing.
|
code » | |||
![]()
Deletes or nulls out any references to COM objects, DOM nodes, or other
disposable objects. Classes that extend
goog.Disposable should
override this method.
Not reentrant. To avoid calling it twice, it must only be called from the
subclass' disposeInternal method. Everywhere else the public
dispose method must be used.
For example:
mypackage.MyClass = function() { mypackage.MyClass.base(this, 'constructor'); // Constructor logic specific to MyClass. ... }; goog.inherits(mypackage.MyClass, goog.Disposable); mypackage.MyClass.prototype.disposeInternal = function() { // Dispose logic specific to MyClass. ... // Call superclass's disposeInternal at the end of the subclass's, like // in C++, to avoid hard-to-catch issues. mypackage.MyClass.base(this, 'disposeInternal'); }; |
code » | |||
Use
#isDisposed instead.
No description.
Returns: boolean
Whether the object has been disposed of.
|
code » | |||
No description.
Returns: boolean
Whether the object has been disposed of.
|
code » | |||
![]()
Associates a disposable object with this object so that they will be disposed
together.
Arguments:
|
code » |
![]()
No description.
|
Code » | |
![]()
The minimum delay between objects being made available, in milliseconds. If
this is 0, no minimum delay is enforced.
|
Code » | |
Set used to store objects that are currently in the pool and available
to be used.
|
Code » | |
Set used to store objects that are currently in the pool and in use.
|
Code » | |
![]()
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.
|
Code » | |
![]()
Maximum number of objects allowed
|
Code » | |
![]()
Minimum number of objects allowed
|
Code » |
![]()
No description.
|
Code » |