MACROMEDIA COLFUSION MX 7-CFML Reference page 979

Cfml reference
Hide thumbs Also See for COLFUSION MX 7-CFML:
Table of Contents

Advertisement

addEvent
Description
Sends a CFEvent instance to ColdFusion for dispatching to a listener CFC.
Category
Event Gateway Development
Syntax
boolean addEvent(CFEvent msg)
See also
getMaxQueueSize
"Creating Custom Event Gateways" in ColdFusion MX Developer's Guide
Parameters
Parameter
msg
Returns
True if the event was added to the gateway services queue for delivery, false, otherwise. Therefore,
a true response does not indicate that the message was delivered.
Usage
The event gateway must use this method to send incoming messages to the application for
processing.
Example
The following example from the ColdFusion MX SocketGateway code sends an event to all
listener CFCs:
for (int i = 0; i < listeners.length; i++) {
String path = listeners[i];
CFEvent event = new CFEvent(gatewayID);
Hashtable mydata = new Hashtable();
mydata.put("MESSAGE", theInput);
event.setData(mydata);
event.setGatewayType("SocketGateway");
event.setOriginatorID(theKey);
event.setCfcMethod(cfcEntryPoint);
event.setCfcTimeOut(10);
if (path != null)
event.setCfcPath(path);
boolean sent = gatewayService.addEvent(event);
if (!sent)
log.error("SocketGateway(" + gatewayID + ") Unable to put message on
event queue. Message not sent from " + gatewayID + ", thread " +
theKey + ".
}
,
, "Responding to incoming messages" in Chapter 45,
getMaxQueueSize
Description
The CFEvent object containing the message to be queued for delivery to the
listener CFC.
Message was " + theInput);
GatewayServices class
979

Advertisement

Table of Contents
loading

This manual is also suitable for:

Colfusion mx 7 - installing and using coldfusion mx

Table of Contents