User Guide

Table Of Contents
1040 Chapter 42: Using Event Gateways
type="#CFEvent.Data.type#"
thread="yes"
date="yes"
time="yes"
application="yes">
</cffunction>
</cfcomponent>
The following minimal CFML page tests the event gateway:
Sending an event to the CFML event gateway that is registered in the
ColdFusion MX Administrator as Asynch Logger.<br>
<cfscript>
status = false;
props = structNew();
props.Message = "Replace me with a variable with data to log";
status = SendGatewayMessage("Asynch Logger", props);
if (status IS True) WriteOutput(’Event Message "#props.Message#" has been
sent.’);
</cfscript>
Using the example event gateways and gateway applications
ColdFusion MX provides several example event gateways and applications in the cf_root\WEB-
INF\cfusion\gateway directory on J2EE configurations or the cf_root\gateway directory on server
configurations. These gateways provide example code that you can examine or use in developing
your gateways. They are intended as examples only, and are not complete, product-quality,
implementations.
Example event gateways
The gateway\src\examples directory and its subdirectories include the sources for the example
event gateways. Compiled versions are located in the gateway\lib\examples.jar file. The following
sections briefly describe the event gateways and their functions. For more detailed information,
see the code and comments in the files.
EmptyGateway
The EmptyGateway.java file contains an event gateway template that you can use as a skeleton for
creating your own event gateway. For more information on this class, and on creating new event
gateways, see Chapter 45, “Creating Custom Event Gateways,” on page 1085.
SocketGateway
The SocketGateway event gateway listens on a TCP/IP port. Therefore, you can use this gateway
for applications that send and respond to messages using TCP/IP-based protocols such as Telnet,
or for applications that send messages between sockets. For example, a simple gateway application
that might respond to messages from a Telnet terminal client without supporting the full Telnet
protocol.
Note: The ColdFusion MX Administrator uses Socket as the gateway type name for the
SocketGateway class.