PostCenter

Kind of class:class
Inherits from:none
Author:Arthur Clemens, Martijn de Visser (added support for 'window' parameter)
Classpath:org.asapframework.util.postcenter.PostCenter
File last modified:Thursday, 13 July 2006, 13:48:48
Windows IE cannot handle getURL messages that are send quickly in succession; PostCenter functions as intermediary and queues messages to send them in a batch. If you need to sent getURLs from multiple places in your application it becomes a difficult task to manage the timings of these messages. It is safer to let PostCenter deal with this.
Usage:
  • PostCenter uses the static method send, so you don't need to create a class instance. The method can be called from multiple places in your application by using PostCenter.send(message):
    var message:String;
    message = "javascript:alert('message one');";
    PostCenter.send(message);
    message = "javascript:alert('message two');";
    PostCenter.send(message);
To do:
  • PostCenter currently ignores the getURL parameter 'method' ("GET" or "POST").

Summary


Class properties
Class methods
  • send (inMessage:String, inWindow:String) : Void
    • Adds a message to the send queue.
  • doSendMessages : Void
    • Performs the actual posting.

Class properties

SEND_DELAY

static private SEND_DELAY:Number = 200
(read)

sMessages

static private sMessages:Array = []
(read)

sPostInterval

static private sPostInterval:Number = 0
(read)

Class methods

doSendMessages

static private function doSendMessages (
) : Void

Performs the actual posting.

send

static function send (
inMessage:String, inWindow:String) : Void

Adds a message to the send queue.
Parameters:
message:
Message string to be sent.
window :
Window to send message to. Will be used as second 'window' parameter in getURL action when message is sent.