22.08.2013 Views

ColdFusion Developer's Guide

ColdFusion Developer's Guide

ColdFusion Developer's Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta<br />

Field Description<br />

When a <strong>ColdFusion</strong> application responds to an event gateway message, or sends a message<br />

independently, it does not use a CFEvent structure. However, the <strong>ColdFusion</strong> event gateway<br />

service creates a Java CFEvent instance with the message data before calling the event<br />

gateway’s outgoingMessage method.<br />

Using persistent scopes in listener CFCs<br />

<strong>ColdFusion</strong> listener CFCs can use the Application, Client, and Session persistent scopes.<br />

Because incoming event gateway messages are not associated with HTTP requests,<br />

<strong>ColdFusion</strong> uses different session and client IDs for interactions initiated by these events than<br />

for CFM Page requests, as follows:<br />

.<br />

CFCMethod The listener method that <strong>ColdFusion</strong> invokes to process the event. The<br />

listener CFC does not need to use this field.<br />

CFCTimeout The time-out, in seconds, for the listener CFC to process the event<br />

request. The listener CFC does not need to use this field.<br />

Identifier Structure<br />

Session ID gatewayType_gatewayID_originatorID<br />

cfid originatorID<br />

cftoken gatewayType_gatewayID<br />

The gatewayID value is the event gateway ID that you set in the <strong>ColdFusion</strong> Administrator,<br />

and gatewayType and originatorID are the values that the event gateway sets in the CFEvent<br />

instance for an incoming message.<br />

Application scope<br />

The Application scope lets the CFC share data with any <strong>ColdFusion</strong> page or CFC that uses<br />

the same application name. This way, a listener CFC can use the same Application scope as<br />

CFML pages that might be used to send messages. Also, you can put multiple listener CFCs<br />

in a single directory and have them share an Application.cfc or Application.cfm file and<br />

application name.<br />

As with all <strong>ColdFusion</strong> code, use the Application.cfc This.name variable or the<br />

cfapplication tag to set the application name. The listener CFC can use an Application.cfc<br />

or Application.cfm file if the CFC is in a directory that is in or under one of the following<br />

places:<br />

■ the <strong>ColdFusion</strong> web root<br />

1516 Using Event Gateways

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!