Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 1275

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Using External Resources
CFML event gateway data structure
The structure that you use in the CFML
• The structure can include any number of fields with arbitrary contents for use in by the CFC.
• Several optional fields can configure how the gateway delivers the information to the CFC.
The CFML gateway looks for the following optional fields, and, if they exist, uses them to determine how it delivers
the message. Do not use these field names for data that you send to your CFC method.
Field
Use
cfcpath
Overrides the CFC path specified in the ColdFusion Administrator. This field lets you use a single gateway
configuration in the ColdFusion Administrator multiple CFCs.
method
Sets the name of the method to invoke in the CFC. The default method is
you use a single gateway configuration in the ColdFusion Administrator for a CFC that has several methods.
originatorID
Sets the originatorID field of the CFEvent object that ColdFusion delivers to the CFC. The default value is
CFMLGateway.
timeout
Sets the time-out, in seconds, during which the listener CFC must process the event request and return before
ColdFusion gateway services terminates the request. The default value is the Timeout Request value set on the
Server Settings page in the ColdFusion Administrator. Set this value if a request could validly take longer to
process than the default timeout; for example, if the request involves a long processing time.
Using the CFML gateway
The following procedure describes how to use an asynchronous CFC that has a single,
Use an asynchronous CFC
Create a CFC with an
1
onIncomingMessage
application. For example, you can place it in the cf_root\WEB-INF\cfusion\gateway\cfc directory on J2EE
configurations, in the cf_root\gateway\cfc directory on server configurations, or in a subdirectory of these
directories. ColdFusion is installed with mappings to these cfc gateway directories.
The
onIncomingMessage
and processes the contents of the Data field as needed.
2
Use the Gateway Instances page in the ColdFusion Administrator to add an instance of the CFML event gateway
type. Specify the following:
• A unique Gateway ID.
• The path to the CFC that you created in step 1.
• The startup mode. Select Automatic startup mode to start the event gateway when ColdFusion starts up.
• Do not specify a configuration file.
Start the event gateway instance.
3
Write CFML code that uses
4
instance ID that you specified in step 2. The
queues the message in the ColdFusion Gateway Service; false, otherwise. It does not ensure that the CFC receives
or processes the message.
5
Run your CFML application.
SendGatewayMessage
method. Place the CFC in an appropriate directory for your
method must take a CFEvent structure that contains input information in its Data field,
functions to send messages in structures to the event gateway
SendGatewayMessage
SendGatewayMessage
Last updated 1/20/2012
function can include two types of fields:
onIncomingMessage
onIncomingMessage
function returns true if the gateway successfully
1270
. This field lets
method.

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents