User Guide

Table Of Contents
Structure of an event gateway application 1027
The Gateways page lets you add, remove, configure, start, and stop individual event gateway
instances. You configure an event gateway instance by specifying a unique ID, the gateway type,
one or more listener CFC paths, a configuration file (not required for all gateway types), and a
startup mode (manual, automatic, or disabled).
Structure of an event gateway application
To develop an event gateway application, you create and use some or all of the following
elements:
One or more listener CFCs that handle any incoming messages and send any necessary
responses.
In some applications, ColdFusion pages that generate outgoing messages directly.
An event gateway instance configuration in the ColdFusion MX Administrator. This
configuration might require a separate event gateway configuration file.
In some applications, a GatewayHelper object to provide access to additional features of the
protocol or technology; for example, to manage instant messaging buddy lists.
The role of the listener CFC
All incoming event messages must be handled by one or more listener CFCs. You specify the
listener CFCs when you configure an event gateway in the ColdFusion MX Administrator. You
must specify at least one CFC in the administrator. Some gateway types can use more than one
CFC. By default, the ColdFusion event gateway service delivers events by calling the CFC’s
onIncomingMessage method.
The event gateway developer must inform the event gateway application developer of methods
that the listener CFC must implement (may be only the
onIncomingMessage method) and of the
structure and contents of the event message data, contained in the CFEvent instance, that the
listener CFC must handle. Outgoing messages have the same event message data structure as
incoming messages.
Many gateways let the listener CFCs send a response by calling the
cfreturn function, but
ColdFusion MX does not require a return value. Listener CFCs can also use the
SendGatewayMessage function, which provides more flexibility than the cfreturn tag.
The role of ColdFusion pages
ColdFusion MX CFM pages cannot receive event messages. However, they can send messages
using an event gateway. Therefore, an event gateway application that initiates outgoing messages
might use one or more
SendGatewayMessage functions to send the messages. An application that
sends an SMS message to notify users when a package ships, for example, could use the
SendGatewayMessage function to send the notification.