Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

burst.io.IframeURIRequest Class Reference

Inheritance diagram for burst.io.IframeURIRequest:

burst.io.AbstractURIRequest List of all members.

Detailed Description

Subclass of AbstractURIRequest based on a hidden iframe.

This is not needed in environments supporting XMLHttpRequest; in that case use XmlHttpURIRequest .

Implementation Issues

This implementation relies on the primitive (and stateless) utility functions for iframes in burst.xml.HtmlUtil .

There are several considerations:

Antecedents

The basic principle is straightforward and has been done many times before. However, the tricky implementation issues above are often not all dealt with, or are not dealt with well.

Furthermore, rampant confusion abounds which conflates iframe element objects, iframe window objects, and iframe document objects.

Some implementations that bear examination are listed below. I note here only some salient distinguishing characteristics, without detailing any criticisms.

Our Approach

Our approach is:

iframe element, window, and document

This is a cross-platform morass.

For getting an iframe window from the id or name attribute value of the iframe element:

To get the element given the id or name attribute value:

For going from iframe element to iframe window, see burst.xml.HtmlUtil.iframeContentWindow(iframe_el).

For going from iframe element to iframe document, see burst.xml.HtmlUtil.iframeContentDocument(iframe_el).


Public Member Functions

 IframeURIRequest (Node iframe_el)
 Construct a wrapper object around an iframe Node channel.


Static Public Member Functions

IframeURIRequest getInstance ()
 Class method to get an instance.


Protected Member Functions

void destroy ()
 remove the iframe Element from its parent Node, and eliminate any pointers we have.


Static Protected Member Functions

void register (BU_IframeURIRequest instance)
 Registers the just-created BU_IframeURIRequest instance in the global registry.

BU_IframeURIRequest acquire ()
 Reconstitute an instance from the pool.

void release (BU_IframeURIRequest instance)
 Class method called when load callbacks are done.


Constructor & Destructor Documentation

burst.io.IframeURIRequest.IframeURIRequest Node  iframe_el  ) 
 

Construct a wrapper object around an iframe Node channel.

You generally want to call the class method getInstance() instead of the constructor directly, so that you can take advantage of instance pooling.

If you happen to already have an iframe element on the page that is intended to be used for communication, that may be provided.

The actual iframe element is created only on demand; it may already have one if this instance came from the pool.

Any constructed object is automatically added to the pool whenever it is done being used.

All instances have a state variable which is one of:

  • 'uninitialized' (after constructor call)
  • 'loading' (just after entry to load())
  • 'complete' (when load() callback first comes back)
  • 'deleted' (when all load() callbacks have finished, and it is put back into the pool)

(This mimics microsoft readyState: http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/readystate_1.asp except for the addition of 'deleted').

Parameters:
iframe_el Optional. An iframe element for use. It must have a (unique) name attribute.


Member Function Documentation

BU_IframeURIRequest burst.io.IframeURIRequest.acquire  )  [static, protected]
 

Reconstitute an instance from the pool.

If none are available returns a false value. Sets state from 'deleted' to 'uninitialized'.

void burst.io.IframeURIRequest.destroy  )  [protected]
 

remove the iframe Element from its parent Node, and eliminate any pointers we have.

used if we are doing pooling.

IframeURIRequest burst.io.IframeURIRequest.getInstance  )  [static]
 

Class method to get an instance.

This is preferable to calling the constructor directly.

void burst.io.IframeURIRequest.release BU_IframeURIRequest  instance  )  [static, protected]
 

Class method called when load callbacks are done.

Sets state to 'deleted'.


The documentation for this class was generated from the following file:
Generated on Tue Nov 30 04:03:08 2004 for BurstProject by doxygen 1.3.4