User Guide

Table Of Contents
1042 Chapter 42: Using Event Gateways
An example configuration file is located in the gateway\config\directory-watcher.cfg file.
CFC methods
When the directory contents change, the event gateway calls one of the following CFC listener
methods, unless you change the names in the configuration file:
onAdd
onChange
onDelete
The CFEvent.Data field sent to the listener methods includes the following fields:
The event gateway supports multiple listener CFCs and sends the event messages to all listeners.
The event gateway is one-way; it watches for events and dispatches event information to a CFC,
but it does not accept return values from the CFC or input from
SendGatewayMessage
functions.
The directory watcher logs errors to the watcher.log file in the ColdFusion logs directory.
extensions Optional Comma-delimited list of extensions to watch. The event gateway logs
only changed files with these extensions. An asterisk (*) indicates all
files. The default is all files.
interval Optional Number of milliseconds between the times that the event gateway
checks the directory. The default value is 60 seconds.
addFunction Optional Name of the function to call when a file is added. The default value is
onAdd.
changeFunction Optional Name of the function to call when a file is changed. The default value
is
onChange.
deleteFunction Optional Name of the function to call when a file is deleted. The default value is
onDelete.
Field Description
TYPE Event type, one of ADD, CHANGE, DELETE.
FILENAME Name of the file that was added, deleted, or changed.
LASTMODIFIED The date and time that the file was created or modified. This field is not included
if the file was deleted.
Property Req/Opt Description