Name

LzInstantiatorClass — Handles application instantiation.

Synopsis

JavaScript: LzInstantiatorClass
Type: Class
Access: public
Topic: LZX.Runtime
Declared in: WEB-INF/lps/lfc/services/LzInstantiator.lzs

Description

The instantiator is responsible for timing the creation and initialization of Laszlo applications. Because of Laszlo's declarative style, applications must be instantiated in two passes -- one where all of the objects are created and another where all of the references are resolved. This ensures that order rarely matters in an lzx file, and allows objects to refer to one another without making the programmer worry about initialization order or messy callbacks.

If an OpenLaszlo application is slow to instantiate, LzNodes supply the initstage attribute. The instantiator also has a few exposed methods and attributes that can be used to control the instantiation behavior of a Laszlo app.

Superclass Chain

LzInstantiatorClass

Known Subclasses

Details

Properties (13)

checkQDel
public var checkQDel = null;
halted
public var halted = false;
isdatareplicating
public var isdatareplicating = false;
isimmediate
public var isimmediate = false;
istrickling
public var istrickling = false;
isUpdating
public var isUpdating = false;
makeQ
public var makeQ;
safe
public var safe = true;
syncNew
public var syncNew = true;
timeout
public var timeout : Number = 500;
The length of time in miliseconds to spend synchronously creating nodes before allowing an idle event to pass. By default this is 500.
trickleQ
public var trickleQ;
trickletime
public var trickletime : Number = 10;
The length of time to spend creating initstage= "late" nodes before allowing an idle event to pass. By default this is 10 miliseconds.
tricklingQ
public var tricklingQ;

Methods (16)

checkQ()
private function checkQ();
checkUpdate()
private function checkUpdate();
clearDataReplicationQueue()
private function clearDataReplicationQueue();
completeTrickle()
private function completeTrickle(v);
createImmediate()
private function createImmediate(v, children);
drainQ()
private function drainQ(limit);
Used by Krank to instantiate all views before kranking
enableDataReplicationQueuing()
private function enableDataReplicationQueuing();
halt()
public function halt();
Stops the instantiatior until resume is called.
initialize()
public function initialize();
makeSomeViews()
private function makeSomeViews(cq, otime);
newReverseArray()
private function newReverseArray(arr);
requestInstantiation()
private function requestInstantiation(v : LzView, children);
Instantiate the child array for a view. This will be instantiated immediately, normally, or on the trickly depending on the state of the service
resume()
public function resume();
Restarts the instantiatior after it is stopped with halt
setSafeInstantiation()
private function setSafeInstantiation(isSafe);
traceQ()
private function traceQ();
trickleInstantiate()
private function trickleInstantiate(v, children);

JavaScript Synopsis

public LzInstantiatorClass {
  public var checkQDel  = null;
  public var halted  = false;
  public var isdatareplicating  = false;
  public var isimmediate  = false;
  public var istrickling  = false;
  public var isUpdating  = false;
  public var makeQ ;
  public var safe  = true;
  public var syncNew  = true;
  public var timeout  : Number = 500;
  public var trickleQ ;
  public var trickletime  : Number = 10;
  public var tricklingQ ;
  prototype private function checkQ ();
  prototype private function checkUpdate ();
  prototype private function clearDataReplicationQueue ();
  prototype private function completeTrickle (v);
  prototype private function createImmediate (v, children);
  prototype private function drainQ (limit);
  prototype private function enableDataReplicationQueuing ();
  prototype public function halt ();
  prototype public function initialize ();
  prototype private function makeSomeViews (cq, otime);
  prototype private function newReverseArray (arr);
  prototype private function requestInstantiation (v : LzView, children);
  prototype public function resume ();
  prototype private function setSafeInstantiation (isSafe);
  prototype private function traceQ ();
  prototype private function trickleInstantiate (v, children);
}