User Guide

Table Of Contents
Event gateway elements 1087
Gateway interface
The ColdFusion event gateway must implement the coldfusion.eventservice.Gateway interface.
The following table lists the interface method signatures:
Note: For detailed information on implementing each method, see “Building an event gateway”
on page 1092. For reference pages for these methods, see “Gateway interface” in CFML Reference.
Signature Description
void setGatewayID(String id)
Sets the gateway ID that uniquely identifies the gateway
instance. ColdFusion calls this method before it starts the
event gateway, even if the gateway class constructor also
sets the ID.
void setCFCListeners(String[]
listeners)
Identifies the CFCs that listen for incoming messages
from the event gateway. The array contains one or more
paths to the listener CFCs. ColdFusion calls this method
before it starts the event gateway, and if the configuration
for a running event gateway changes.
GatewayHelper getHelper()
Returns a coldfusion.eventgateway.GatewayHelper class
instance, or null. The GatewayHelper class provides event
gateway-specific utility methods to CFML applications.
ColdFusion calls this method when a ColdFusion
application calls the
GetGatewayHelper function.
String getGatewayID()
Returns the gateway ID.
int getStatus()
Gets the event gateway status. The interface defines the
following status constants:
STARTING, RUNNING, STOPPING,
STOPPED, FAILED.
void start()
Starts the event gateway. Starts at least one thread for
processing incoming messages. ColdFusion calls this
method when it starts an event gateway.
void stop()
Stops the event gateway. Stops the threads and destroys
any resources. ColdFusion calls this method when it stops
an event gateway.
void restart()
Restarts a running event gateway. ColdFusion calls this
method when the ColdFusion MX Administrator restarts a
running event gateway.
String outgoingMessage (coldfusion.
eventgateway.CFEvent
cfmessage)
Handles a message sent by ColdFusion and processes it
as needed by the gateway type to send a message.
ColdFusion calls this method when a listener CFC’s
listener method returns a CFEvent or when a ColdFusion
application calls the
SendGatewayMessage function. The
CFML
SendGatewayMessage function gets the returned
String as its return value.