Whatever message this page gives is out now! Go check it out!

setCFCPath

Last update:
May 18, 2026

Description

Specifies the listener CFC that processes this event.

Category

Event Gateway Development

Syntax

void setCFCPath(String path)

See also

getCFCPath setCFCMethod setCFCTimeout CFEvent class  in the Developing ColdFusion Applications

Parameters

ParameterDescription
path
An absolute path to the application listener CFC that processes the event. If you do not call this method in your gateway, ColdFusion uses the first path configured for the event gateway instance on the Event Gateways page in the ColdFusion Administrator.

Usage

By default, ColdFusion delivers messages to the CFC in the first path configured for the event gateway instance on the Event Gateways page in the ColdFusion Administrator.If your application supports multiple listener CFCs, use this method to set each listener CFC and then call the gatewayService.addEvent method to send the event to the CFC.

Example

The following example code is based on the Socket gateway processInput method that takes input from the socket and sends it to the CFC listener methods. The listeners variable contains an array of listener CFCS and is set by the gateway's  setCFCListeners method, which ColdFusion calls when it starts the gateway.
for (int i = 0; i < listeners.length; i++) { String path = listeners[i]; CFEvent event = new CFEvent(gatewayID); Hashtable mydata = new Hashtable(); mydata.put("MESSAGE", theInput); event.setData(mydata); event.setGatewayType("SocketGateway"); event.setOriginatorID(theKey); event.setCFCMethod(cfcEntryPoint); event.setCFCTimeout(10); if (path != null) event.setCFCPath(path); boolean sent = gatewayService.addEvent(event); }

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page