thySynchronizer

This class defines a Singleton that will be responsible to accumulate multiples calls to server, execute them and upon receival of server response, respass them to the appropriate thyDataSource component

Events

Summary
This class defines a Singleton that will be responsible to accumulate multiples calls to server, execute them and upon receival of server response, respass them to the appropriate thyDataSource component
Tells the Connector to put its message on the specified Progress Holder
Tells the Connector which messages are to be shown when calling synchronize
Sets the protocol to be used by Synchronizer
Sets up the method that will handle synchronization calls
Sets internal synchronize check interval.
Performs a request to thySynchronizer.
This method is automatically called every pre-defined period of time.
Method that handles responses from server.

setProgressHolder

p.setProgressHolder = function(holder)

Tells the Connector to put its message on the specified Progress Holder

Parameters

holderThe DynLayer (or derivate) that will hold the Messages

setMessages

Tells the Connector which messages are to be shown when calling synchronize

Parameters

messagesArray with messages.  There are 3 possible messages:
  • messages[0] - Contacting Server
  • messages[1] - Server Contacted
  • messages[2] - Loading Server Data

setProtocol

p.setProtocol = function (protocol)

Sets the protocol to be used by Synchronizer

Parameters

protocolThe Protocol Object aready instantiated

setSyncMethod

p.setSyncMethod = function (methodName)

Sets up the method that will handle synchronization calls

Parameter

methodNameThe complete name of the method in a server understandable way.

setInterval

p.setInterval = function (interval)

Sets internal synchronize check interval.  Defaults to 100ms

Parameter

intervalThe number of miliseconds to wait between sync verifications

request

p.request = function (name,
method,
params,
event,
obj)

Performs a request to thySynchronizer.  This should be called from thyDataSource when any user action that demands server interaction is performed.

Parameters

nameThe name of the object plus an unique identifier, so if same object performs 2 calls to server, both will be executed.
methodThe method that this object need to be called.
paramsMethod parameters.
eventThe event name (startup, read or write)
objThe object itself so server response can be populated to it

synchronize

p.synchronize = function ()

This method is automatically called every pre-defined period of time.  It checks for client requests and performs the appropriate action, like a sweepOut() call to each thyDataSource which has reported an action request.  After that, it will communicate with server and wait its response.

Private Methods

_syncHandler

p._syncHandler = function ()

Method that handles responses from server.  It verifies integrity of sync data and pass responses to appropriate thyDataSources

Initialization

Class to automate data exchange between client and server
p.setProgressHolder = function(holder)
Tells the Connector to put its message on the specified Progress Holder
p.setProtocol = function (protocol)
Sets the protocol to be used by Synchronizer
p.setSyncMethod = function (methodName)
Sets up the method that will handle synchronization calls
p.setInterval = function (interval)
Sets internal synchronize check interval.
p.request = function (name,
method,
params,
event,
obj)
Performs a request to thySynchronizer.
This class defines a Singleton that will be responsible to accumulate multiples calls to server, execute them and upon receival of server response, respass them to the appropriate thyDataSource component
p.synchronize = function ()
This method is automatically called every pre-defined period of time.
p._syncHandler = function ()
Method that handles responses from server.